diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc7d35c9c7..cfbe3ac722 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ env: RISC0_VM_VERSION: v1.0.1 # This is the top commit hash in the branch lukasz/juvix-integration-tracking # of the anoma repository. - ANOMA_VERSION: 1213cd83b6b0912c98a12e88a40f93ce9b6da094 + ANOMA_VERSION: 81601ab7ee8e7ceade7e7cb00bdcc5b65aef77c9 JUST_ARGS: runtimeCcArg=$CC runtimeLibtoolArg=$LIBTOOL STACK_BUILD_ARGS: --pedantic -j4 --ghc-options=-j diff --git a/app/App.hs b/app/App.hs index 50b5f73f8b..ab97f16eb8 100644 --- a/app/App.hs +++ b/app/App.hs @@ -188,6 +188,9 @@ getEntryPointStdin' RunAppIOArgs {..} = do | otherwise -> return Nothing set entryPointStdin estdin <$> entryPointFromGlobalOptionsNoFile root opts +askPackageDotJuvixPath :: (Members '[App] r) => Sem r (Path Abs File) +askPackageDotJuvixPath = mkPackagePath . (^. rootRootDir) <$> askRoot + fromRightGenericError :: (Members '[App] r, ToGenericError err, Typeable err) => Either err a -> Sem r a fromRightGenericError = fromRightJuvixError . mapLeft JuvixError diff --git a/app/Commands/Dev/Nockma/Format.hs b/app/Commands/Dev/Nockma/Format.hs index 9878a814f7..9cc3355a1e 100644 --- a/app/Commands/Dev/Nockma/Format.hs +++ b/app/Commands/Dev/Nockma/Format.hs @@ -10,7 +10,7 @@ runCommand opts = do afile <- fromAppPathFile file parsedTerm <- runAppError @JuvixError - . Nockma.ignoreHighlightBuilder + . Nockma.evalHighlightBuilder $ Nockma.parseTermFile afile putStrLn (ppPrint parsedTerm) where diff --git a/app/Commands/Dev/Nockma/Ide/Check.hs b/app/Commands/Dev/Nockma/Ide/Check.hs index 85f0cb771a..b6d41f716b 100644 --- a/app/Commands/Dev/Nockma/Ide/Check.hs +++ b/app/Commands/Dev/Nockma/Ide/Check.hs @@ -10,6 +10,6 @@ runCommand opts = do afile <- fromAppPathFile (opts ^. nockmaCheckFile) void . runAppError @JuvixError - . ignoreHighlightBuilder + . evalHighlightBuilder $ Nockma.parseTermFile afile renderStdOutLn ("Ok" :: Text) diff --git a/app/Commands/Format.hs b/app/Commands/Format.hs index 55d7bab957..7242695c62 100644 --- a/app/Commands/Format.hs +++ b/app/Commands/Format.hs @@ -49,15 +49,22 @@ targetFromOptions opts = do -- | Formats the project on the root formatProject :: forall r. - (Members '[App, EmbedIO, TaggedLock, Logger, Files, Output FormattedFileInfo] r) => + (Members '[App, EmbedIO, TaggedLock, Logger, ScopeEff, Files, Output FormattedFileInfo] r) => Sem r FormatResult formatProject = silenceProgressLog . runPipelineOptions . runPipelineSetup $ do res :: [(ImportNode, PipelineResult ModuleInfo)] <- processProject - res' :: [(ImportNode, SourceCode)] <- forM res $ \(node, nfo) -> do - pkgId :: PackageId <- (^. entryPointPackageId) <$> ask - src <- runReader pkgId (formatModuleInfo node nfo) + pkgId :: PackageId <- (^. entryPointPackageId) <$> ask + res' :: [(ImportNode, SourceCode)] <- runReader pkgId $ forM res $ \(node, nfo) -> do + src <- formatModuleInfo node nfo return (node, src) - formatProjectSourceCode res' + formatRes <- formatProjectSourceCode res' + formatPkgRes <- formatPackageDotJuvix + return (formatRes <> formatPkgRes) + +formatPackageDotJuvix :: forall r. (Members '[App, Files, Logger, Output FormattedFileInfo, ScopeEff] r) => Sem r FormatResult +formatPackageDotJuvix = do + pkgDotJuvix <- askPackageDotJuvixPath + ifM (fileExists' pkgDotJuvix) (format pkgDotJuvix) (return mempty) runCommand :: forall r. (Members AppEffects r) => FormatOptions -> Sem r () runCommand opts = do diff --git a/examples/demo/Package.juvix b/examples/demo/Package.juvix index 39e428effd..c2c5c16d72 100644 --- a/examples/demo/Package.juvix +++ b/examples/demo/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "Demo"; - version := mkVersion 0 1 0 + version := mkVersion 0 1 0; }; diff --git a/examples/midsquare/Package.juvix b/examples/midsquare/Package.juvix index 191f097606..c42c892687 100644 --- a/examples/midsquare/Package.juvix +++ b/examples/midsquare/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "midsquare"; - version := mkVersion 0 1 0 + version := mkVersion 0 1 0; }; diff --git a/examples/milestone/Bank/Package.juvix b/examples/milestone/Bank/Package.juvix index 83819477c1..59d4367449 100644 --- a/examples/milestone/Bank/Package.juvix +++ b/examples/milestone/Bank/Package.juvix @@ -4,5 +4,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ - name := "bank" + name := "bank"; }; diff --git a/examples/milestone/Collatz/Package.juvix b/examples/milestone/Collatz/Package.juvix index 10d24fc716..412c73ee52 100644 --- a/examples/milestone/Collatz/Package.juvix +++ b/examples/milestone/Collatz/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "Collatz"; version := mkVersion 0 1 0; - main := just "Collatz.juvix" + main := just "Collatz.juvix"; }; diff --git a/examples/milestone/Fibonacci/Package.juvix b/examples/milestone/Fibonacci/Package.juvix index 7624e50fb5..9f6702d860 100644 --- a/examples/milestone/Fibonacci/Package.juvix +++ b/examples/milestone/Fibonacci/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "Fibonacci"; version := mkVersion 0 1 0; - main := just "Fibonacci.juvix" + main := just "Fibonacci.juvix"; }; diff --git a/examples/milestone/Hanoi/Package.juvix b/examples/milestone/Hanoi/Package.juvix index 9bb7f6f53e..f59eac7ef5 100644 --- a/examples/milestone/Hanoi/Package.juvix +++ b/examples/milestone/Hanoi/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "Hanoi"; version := mkVersion 0 1 0; - main := just "Hanoi.juvix" + main := just "Hanoi.juvix"; }; diff --git a/examples/milestone/HelloWorld/Package.juvix b/examples/milestone/HelloWorld/Package.juvix index ec3f84f5c8..22bff8557e 100644 --- a/examples/milestone/HelloWorld/Package.juvix +++ b/examples/milestone/HelloWorld/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "HelloWorld"; version := mkVersion 0 1 0; - main := just "HelloWorld.juvix" + main := just "HelloWorld.juvix"; }; diff --git a/examples/milestone/PascalsTriangle/Package.juvix b/examples/milestone/PascalsTriangle/Package.juvix index c6370e1474..ea7baddbf7 100644 --- a/examples/milestone/PascalsTriangle/Package.juvix +++ b/examples/milestone/PascalsTriangle/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "PascalsTriangle"; version := mkVersion 0 1 0; - main := just "PascalsTriangle.juvix" + main := just "PascalsTriangle.juvix"; }; diff --git a/examples/milestone/TicTacToe/Package.juvix b/examples/milestone/TicTacToe/Package.juvix index edbcb64f7f..70a86b22bb 100644 --- a/examples/milestone/TicTacToe/Package.juvix +++ b/examples/milestone/TicTacToe/Package.juvix @@ -6,5 +6,5 @@ package : Package := defaultPackage@{ name := "TicTacToe"; version := mkVersion 0 1 0; - main := just "CLI/TicTacToe.juvix" + main := just "CLI/TicTacToe.juvix"; }; diff --git a/examples/milestone/Tutorial/Package.juvix b/examples/milestone/Tutorial/Package.juvix index e670c512c8..04e141d84c 100644 --- a/examples/milestone/Tutorial/Package.juvix +++ b/examples/milestone/Tutorial/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "Tutorial"; - version := mkVersion 0 1 0 + version := mkVersion 0 1 0; }; diff --git a/include/anoma/start.exs b/include/anoma/start.exs index fba6dfb6f3..2edadf2364 100644 --- a/include/anoma/start.exs +++ b/include/anoma/start.exs @@ -2,4 +2,5 @@ Logger.configure(level: :none) eclient = Anoma.Client.Examples.EClient.create_example_client IO.puts("#{eclient.client.grpc_port} #{eclient.node.node_id}") + Anoma.Node.Utility.Consensus.start_link(node_id: eclient.node.node_id, interval: 10000) ) diff --git a/runtime/nockma/anomalib.nockma b/runtime/nockma/anomalib.nockma index 2ad0b5b6c7..a831781332 100644 --- a/runtime/nockma/anomalib.nockma +++ b/runtime/nockma/anomalib.nockma @@ -1 +1 @@ -[[[7 [8 [1 0 0 0 0] [1 8 [1 30160793233665617219451904865] 0 0] 0 1] 11 [1953718630 1 30160793233665617219451904865 [0 7] 0] 0 1] [[1 0] [[8 [1 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 751 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 751 0 1] 0 2] 9 2 10 [6 0 58] 0 2] 0 27] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [1 0] 0 0] [1 8 [[6 [6 [3 0 12] [1 1] 1 0] [0 12] 0 0] 8 [7 [0 7] 9 1534 0 1] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 1] 8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 [[8 [9 1492 0 7] 9 2 10 [6 0 14] 0 2] 8 [9 10 0 15] 9 2 10 [6 0 238] 0 2] 1 0] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 478793196187462788804451] [1 8 [6 [5 [0 6] 1 478793196187462788804451] [1 478793196187462788804451] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 6243918] 7 [0 3] 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] 8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 1 478793196187462788804451] 0 1] [[7 [8 [1 0 0] [1 8 [1 1851907519744077227364] 0 0] 0 1] 11 [1953718630 1 1851907519744077227364 [0 7] 0] 0 1] [[7 [8 [1 0] [1 8 [1 460217181910180775551341] 0 0] 0 1] 11 [1953718630 1 460217181910180775551341 [0 7] 0] 0 1] [[8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 [0 12] 0 26] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [6 [5 [1 478793196187462788804451] 0 6] [8 [7 [0 7] 9 174 0 1] 9 2 10 [6 0 14] 0 2] 8 [7 [0 7] 9 762 0 1] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 351 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 374 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [6 [6 [3 0 54] [1 1] 1 0] [0 54] 0 0] 0 55] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 351 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 374 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 2986 0 1] 0 2] 9 2 10 [6 0 118] 0 2] 0 55] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [0 [1 0] 0 0] 0] [1 8 [[8 [7 [0 7] 9 170 0 1] 9 2 10 [6 0 28] 0 2] 6 [6 [3 0 13] [1 1] 1 0] [0 13] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [[6 [6 [3 0 12] [1 1] 1 0] [0 12] 0 0] [8 [7 [0 7] 9 1534 0 1] 9 2 10 [6 0 58] 0 2] [6 [5 [1 0] 0 54] [1 0] 6 [5 [1 1] 0 54] [1 1] 0 0] [6 [6 [3 0 110] [1 1] 1 0] [0 110] 0 0] [[6 [6 [3 0 444] [1 1] 1 0] [0 444] 0 0] 6 [6 [3 0 445] [1 1] 1 0] [0 445] 0 0] [6 [6 [3 0 446] [1 1] 1 0] [0 446] 0 0] [6 [6 [3 0 894] [1 1] 1 0] [0 894] 0 0] 6 [5 [0 895] 1 1701536102] [1 1701536102] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 6245699] 7 [0 3] 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [[[1 [8 [1 0] [1 8 [9 751 0 15] 9 2 10 [6 7 [0 3] 8 [9 94 0 255] 9 2 10 [6 7 [0 3] 8 [8 [9 10 0 511] 9 767 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 2] 0 2] 0 1] 8 [1 0] [1 8 [9 751 0 15] 9 2 10 [6 7 [0 3] 8 [9 94 0 255] 9 2 10 [6 7 [0 3] 8 [8 [9 10 0 511] 9 767 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 2] 0 2] 0 1] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [[8 [7 [0 7] 9 751 0 1] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 9 2987 0 1] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 9 84 0 1] 9 2 10 [6 0 59] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 7 [8 [1 0 0] [1 8 [1 1816244077244883690852] 0 0] 0 1] 11 [1953718630 1 1816244077244883690852 [0 7] 0] 0 1] [8 [1 0 0 0 418565088612] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 86 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 747 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [8 [7 [0 7] 9 766 0 1] 9 2 10 [6 0 118] 0 2] 6 [5 [0 55] 1 418565088612] [1 418565088612] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 8 [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 750 0 1] 0 2] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [1 0] 0 0] [1 8 [7 [1 0] 8 [1 0] [1 1 0] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 1 418565088612] 0 1] [[7 [8 [1 0 0] [1 8 [[8 [9 756 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 756 0 7] 9 2 10 [6 0 29] 0 2] 6 [0 8] [6 [0 10] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 6 [8 [9 22 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 27] 0 25] 0 2] 0 2] 6 [0 10] [6 [8 [9 22 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 27] 0 25] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 0 1] 11 [1953718630 1 7173491 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 0 1] 11 [1953718630 1 7239027 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [8 [9 756 0 7] 9 2 10 [6 0 28] 0 2] 6 [0 4] [8 [9 46 0 2047] 9 2 10 [6 [0 13] 0 61] 0 2] 8 [9 47 0 2047] 9 2 10 [6 [0 61] 0 13] 0 2] 0 1] 11 [1953718630 1 7107940 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 5 [1 0] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 7 [0 3] 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7303792 [0 7] 0] 0 1] [[7 [8 [1 0] [1 5 [1 0] 8 [7 [7 [0 7] 9 4 0 3] 9 1375 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 1] 11 [1953718630 1 7240051 [0 7] 0] 0 1] [[7 [8 [1 0] [1 [8 [9 188 0 7] 9 2 10 [6 0 14] 0 2] 8 [9 1515 0 7] 9 2 10 [6 0 14] 0 2] 0 1] 11 [1953718630 1 6581359 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 759 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 46 0 7] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 190 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7169394 [0 7] 0] 0 1] 7 [8 [1 0] [1 8 [7 [7 [0 7] 9 4 0 3] 9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 7] 9 4 0 3] 9 1375 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 3] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 2] 0 1] 11 [1953718630 1 7561825 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 6 [0 12] [8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 0 29] 0 2] 6 [5 [1 0] 0 13] [1 0] 4 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 342 0 1023] 9 2 10 [6 0 29] 0 2] 0 2] 0 1] 11 [1953718630 1 7824750 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [9 4 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [1 1] 1 0] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6711652 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 5 [1 0] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 7 [0 3] 8 [9 170 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6386278 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [5 [0 12] 0 13] [1 0] 6 [8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] [6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [6 [8 [9 43 0 1023] 9 2 10 [6 [0 28] 0 29] 0 2] [1 2] 1 1] 1 2] 6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [1 1] 6 [8 [9 43 0 1023] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 2] 0 1] 11 [1953718630 1 7368035 [0 7] 0] 0 1] [[[1 [7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [1 0] 6 [5 [1 0] 0 61] [1 0] 1 1] [0 13] 9 2 10 [30 [8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] 8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 4095] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 341 0 31] 9 2 10 [6 [7 [0 3] [1 0] 0 12] 7 [0 3] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] [1 0] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] [1 0] 1 1] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7563620 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [6 [5 [1 0] 0 61] [1 0] 1 1] 1 1] [0 13] 9 2 10 [30 [8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] 8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 4095] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 341 0 31] 9 2 10 [6 [7 [0 3] [1 0] 0 12] 7 [0 3] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] [6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] [1 0] 1 1] 1 1] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7237475 [0 7] 0] 0 1] [[8 [1 0] [1 8 [6 [3 0 6] [[8 [7 [0 7] 9 342 0 1] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 9 1374 0 1] 9 2 10 [6 0 29] 0 2] 8 [7 [0 7] 9 342 0 1] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 0] [8 [9 1375 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 9 2 10 [13 8 [9 87 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 1] 0 1] 11 [1953718630 1 7367026 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 90 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6845292 [0 7] 0] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 0] [1 8 [8 [9 10 0 127] 9 190 10 [6 0 28] 0 2] 9 2 10 [6 0 29] 0 2] 0 1] [8 [1 0] [1 8 [7 [0 7] 1 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 367 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6581861 [0 7] 0] 0 1] [7 [8 [1 0 [1 1] 0] [1 8 [8 [9 10 0 127] 9 367 10 [6 0 28] 0 2] 9 2 10 [6 [0 117] 7 [0 3] 8 [8 [9 10 0 127] 9 767 10 [6 0 28] 0 2] 9 2 10 [6 [0 116] 0 59] 0 2] 0 2] 0 1] 11 [1953718630 1 7632227 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 767 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6845298 [0 7] 0] 0 1] [8 [1 0] [1 [8 [1 0 0] [1 8 [9 44 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 4095] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [9 4 0 127] 9 2 10 [6 7 [0 3] 8 [9 4 0 127] 9 2 10 [6 0 14] 0 2] 0 2] [[8 [1 0] [1 8 [9 1375 0 31] 9 2 10 [6 [0 62] 0 14] 0 2] 0 1] 8 [1 0] [1 8 [9 47 0 4095] 9 2 10 [6 [7 [0 3] 8 [9 342 0 4095] 9 2 10 [6 7 [0 3] 9 10 0 7] 0 2] 7 [0 3] 8 [9 44 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [8 [1 0 0 0] [1 8 [8 [9 44 0 7] 9 2 10 [6 0 59] 0 2] 8 [8 [9 4 0 1023] 9 2 10 [6 7 [0 3] 8 [9 47 0 8191] 9 2 10 [6 [0 126] 0 60] 0 2] 0 2] 8 [8 [9 46 0 16383] 9 2 10 [6 [0 250] 0 6] 0 2] 8 [9 44 0 63] 9 2 10 [6 7 [0 3] 8 [9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [9 87 0 255] 9 2 10 [6 [7 [0 3] [0 124] 0 2] 0 30] 0 2] 7 [0 3] 8 [9 341 0 255] 9 2 10 [6 [7 [0 3] [0 124] 8 [9 47 0 32767] 9 2 10 [6 [0 14] 0 6] 0 2] 0 30] 0 2] 0 2] 0 2] 0 1] 8 [1 0] [1 7 [10 [6 8 [9 44 0 7] 9 2 10 [6 0 14] 0 2] 0 1] 6 [8 [9 84 0 4095] 9 2 10 [6 [0 62] 7 [0 3] 1 3] 0 2] [0 6] 8 [8 [9 342 0 4095] 9 2 10 [6 0 62] 0 2] 8 [9 20 0 63] 9 2 10 [6 [7 [0 3] 8 [9 341 0 63] 9 2 10 [6 [0 6] 7 [0 3] 9 2 10 [30 0 2] 10 [6 8 [9 86 0 63] 9 2 10 [6 [0 6] [7 [0 3] 1 0 1] 0 30] 0 2] 0 3] 0 2] 7 [0 3] 9 2 10 [30 0 2] 10 [6 8 [9 86 0 63] 9 2 10 [6 [0 6] [7 [0 3] 1 1 1] 0 30] 0 2] 0 3] 0 2] 0 1] 0 1] [7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 0] 8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1375 0 7] 9 2 10 [6 [7 [0 3] [0 12] 0 52] 0 117] 0 2] 7 [0 3] 8 [9 341 0 7] 9 2 10 [6 [7 [0 3] [0 12] 0 52] 7 [0 3] 9 2 10 [13 0 27] 0 1] 0 2] 0 2] 0 1] 11 [1953718630 1 7233891 [0 7] 0] 0 1] [7 [8 [1 0 0 [0 15] 0 0 0] [1 8 [9 95 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 22 0 511] 9 2 10 [6 [7 [0 3] 8 [9 340 0 7] 9 2 10 [6 [0 28] 0 58] 0 2] 0 59] 0 2] 0 2] 0 1] 11 [1953718630 1 7239026 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [1 0] 8 [1 6 [5 [1 0] 0 125] [1 0] 8 [9 20 0 8191] 9 2 10 [6 [7 [0 3] 9 2 10 [125 0 251] 10 [6 4 0 6] 0 1] 7 [0 3] 8 [9 341 0 63] 9 2 10 [6 [7 [0 3] [0 28] 8 [9 4 0 8191] 9 2 10 [6 [0 61] 0 14] 0 2] 7 [0 3] 8 [9 1375 0 63] 9 2 10 [6 [7 [0 3] [0 28] 0 29] 0 506] 0 2] 0 2] 0 2] 9 2 0 1] 0 1] 11 [1953718630 1 7366002 [0 7] 0] 0 1] 0 1] [7 [8 [1 0 0] [1 8 [9 22 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 22 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 1935763571 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [7 [7 [0 1] 9 4 0 7] 9 46 0 3] 9 2 10 [6 7 [0 3] [8 [7 [7 [0 1] 9 4 0 7] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 6] 0 2] 0 1] 11 [1953718630 1 2019649651 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 7 [10 [13 8 [7 [7 [0 1] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 3] [7 [0 3] [1 0] 0 12] 0 29] 0 2] 0 1] 8 [[7 [7 [7 [0 1] 9 4 0 7] 9 22 0 1] 10 [6 1 5] 0 1] 8 [1 0 0] [1 8 [7 [7 [0 7] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 5] [7 [0 3] [0 12] 1 1] 0 29] 0 2] 0 1] 8 [[9 4 0 4] [9 46 0 4] [9 47 0 4] 9 45 0 4] 8 [8 [7 [7 [0 7] 9 4 0 7] 9 341 0 1] 9 2 10 [6 [7 [0 3] 1 0 3] 0 124] 0 2] 8 [8 [7 [7 [0 15] 9 4 0 7] 9 46 0 1] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] [[0 2] 0 125] [1 8 128] [[8 [7 [7 [0 15] 9 4 0 7] 9 46 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [7 [0 3] 1 960] 7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 46 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 20 0 255] 9 2 10 [6 [7 [0 3] 1 8] 0 6] 0 2] 7 [0 3] 1 512] 0 2] 0 2] 7 [0 3] 1 512] 0 2] 1 0] [[1 64] 8 [8 [7 [7 [0 15] 9 4 0 7] 9 22 0 1] 9 47 10 [6 7 [0 3] 1 6] 0 2] 9 2 10 [6 0 6] 0 2] 1 0] 0 2] 8 [8 [7 [7 [0 31] 9 4 0 7] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 9] 0 6] 0 2] 8 [1 25051139735836467913601071899189108501681633092613316132753366958947502841281110980347811086624969305314199562795868290539880502533646505489797110349007385020507326982043050618112420254613810441709594605123090411975756494285771699200369901479195251226368983824020564277645963860728452821576845901498668417244438721537663670541944820957180957595559282976806173113161068298822071065329290006052849814285001949914564097058408480133985233335799884203712730341384999677089997083749077591931498939520449886954646413138343858395935213418018409268340744776361518554939863400075967197509182087778881547827184266701615699472280] 8 [1 41557658498906279274860226408925318911382702236748615442085426012007055353447] 8 [1 0] 8 [1 6 [5 [0 6] 0 62] [8 [7 [7 [0 1023] 9 4 0 7] 9 94 0 1] 9 2 10 [6 [7 [0 3] 1 5] [0 30] 0 8182] 0 2] 8 [8 [8 [7 [7 [0 1023] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 9] [7 [0 3] [0 6] 1 1] 0 254] 0 2] 8 [8 [7 [7 [0 2047] 9 4 0 7] 9 94 0 1] 9 2 10 [6 [7 [0 3] 1 5] [0 6] 0 16374] 0 2] 8 [1 16] 8 [1 6 [5 [1 64] 0 6] [0 14] 8 [[8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 15] 0 2] 0 30] 0 2] [8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 2] 0 2] 0 30] 0 2] [8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 16] 0 2] 0 30] 0 2] 8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 7] 0 2] 0 30] 0 2] 8 [8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 65530] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 7] 0 12] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 65530] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 18] 0 12] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0 3] 0 12] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 65535] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 131066] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 17] 0 58] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 131066] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 19] 0 58] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 65535] 9 4 0 7] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0 10] 0 58] 0 2] 0 2] 0 2] 8 [8 [0 131068] 8 [0 2] 9 2 10 [6 [0 502] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 30] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 503] 0 14] 0 2] 0 2] 0 2] 9 2 10 [14 8 [7 [7 [0 262143] 9 4 0 7] 9 20 0 1] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 341 0 1] 9 2 10 [6 [7 [0 3] [1 5] 0 126] 0 6] 0 2] 0 510] 0 2] 10 [6 4 0 126] 0 31] 9 2 0 1] 8 [1 0] 8 [[8 [0 8189] 9 2 10 [6 [7 [0 3] 1 0] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 1] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 2] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 3] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 4] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 5] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 6] 0 126] 0 2] 8 [0 8189] 9 2 10 [6 [7 [0 3] 1 7] 0 126] 0 2] 8 [1 6 [5 [1 64] 0 14] [9 2 10 [14 8 [7 [7 [0 16383] 9 4 0 7] 9 95 0 1] 9 2 10 [6 [7 [0 3] 1 5] 7 [0 3] [8 [0 16380] 9 2 10 [6 [0 28] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 0] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 58] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 1] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 118] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 2] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 238] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 3] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 478] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 4] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 958] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 5] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 1918] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 6] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 1919] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 7] 0 510] 0 2] 0 2] 1 0] 0 2] 10 [6 4 0 126] 0 31] 8 [8 [7 [7 [0 16383] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 2] 0 28] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 13] 0 28] 0 2] 7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 22] 0 28] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 60] 0 122] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 60] 0 246] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 122] 0 246] 0 2] 0 2] 0 2] 8 [8 [0 65532] 9 2 10 [6 [0 14] 0 6] 0 2] 8 [8 [7 [7 [0 131071] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 6] 0 4062] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 11] 0 4062] 0 2] 7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 25] 0 4062] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 15] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 8158] 0 16318] 0 2] 7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [7 [0 3] 8 [0 1048567] 9 2 10 [6 0 8158] 0 2] 0 32638] 0 2] 0 2] 8 [8 [0 524284] 8 [0 2] 9 2 10 [6 [0 130943] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 30] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 14] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 1048573] 9 2 10 [6 [0 1022] 0 32766] 0 2] 7 [0 3] 7 [0 3] 8 [0 1048573] 9 2 10 [6 [0 1022] 0 2046] 0 2] 0 2] 0 2] 0 2] 0 2] 9 2 10 [14 4 0 1022] 10 [6 [8 [0 1048572] 9 2 10 [6 [0 6] 0 62] 0 2] [0 1020] [0 2042] [0 4086] [8 [0 1048572] 9 2 10 [6 [0 16366] 0 6] 0 2] [0 16350] [0 32702] 0 65406] 0 127] 9 2 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 2036426867 [0 7] 0] 0 1] 7 [8 [1 0] [1 [8 [1 0] [1 8 [8 [9 23 0 7] 9 2 10 [6 0 14] 0 2] [0 2] 10 [6 8 [9 10 0 63] 9 2 10 [6 [7 [0 3] 1 1932355439] 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [0 126] 0 6] 0 2] 0 2] 0 15] 0 1] [[8 [1 0] [1 11 [1851876717 [1 [1 1717658988] 7 [0 1] 8 [1 1 114 97 100 45 122 101 114 111 0] 9 2 0 1] 0 1] 6 [5 [1 0] 0 6] [0 0] 8 [8 [9 23 0 7] 9 2 10 [6 7 [0 3] 8 [7 [7 [0 1] 9 4 0 31] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 2] 6 [8 [7 [7 [0 3] 9 4 0 31] 9 343 0 255] 9 2 10 [6 [0 6] 0 30] 0 2] [0 2] 9 2 10 [30 4 0 62] 0 3] 0 1] [10 [6 8 [9 10 0 7] 9 2 10 [6 [7 [0 3] 1 30449275492921459] 0 14] 0 2] 0 1] 10 [6 8 [9 10 0 7] 9 2 10 [6 [7 [0 3] 1 32138125353185395] 0 14] 0 2] 0 1] [8 [1 0] [1 8 [8 [9 20 0 7] 9 2 10 [6 0 14] 0 2] [0 2] 10 [6 8 [9 10 0 63] 9 2 10 [6 [7 [0 3] 1 1932355439] 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [0 126] 0 6] 0 2] 0 2] 0 15] 0 1] 7 [8 [1 0] [1 8 [7 [7 [0 1] 9 4 0 31] 9 46 0 1] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [8 [7 [7 [0 1] 9 4 0 31] 9 10 0 3] 9 2 10 [6 [7 [0 3] 1 1630365551] 7 [0 3] 8 [7 [7 [0 1] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 14] 0 62] 0 2] 0 2] 8 [1 6 [5 [1 0] 0 30] [1 0] 8 [8 [7 [7 [0 7] 9 4 0 31] 9 10 0 3] 9 2 10 [6 [7 [0 3] 1 1647142767] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 62] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 254] 0 14] 0 2] 0 2] 0 2] 6 [8 [7 [7 [0 15] 9 4 0 31] 9 343 0 255] 9 2 10 [6 [0 126] 7 [0 3] 1 256] 0 2] [[[0 62] 8 [7 [7 [0 15] 9 4 0 31] 9 1375 0 1] 9 2 10 [6 [7 [0 3] [1 0] 0 62] 0 6] 0 2] 1 0] [[1 256] 0 2] 9 2 10 [30 8 [7 [7 [0 15] 9 4 0 31] 9 47 0 255] 9 2 10 [6 [0 126] 7 [0 3] 1 256] 0 2] 10 [6 0 2] 0 3] 9 2 0 1] 0 2] 0 1] 11 [1953718630 1 7823730 [0 7] 0] 0 1] 0 1] 11 [1953718630 1 26479 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 133480762729846] 0 0] 0 1] 11 [1953718630 1 133480762729846 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [1 1852270963] 0 0] 0 1] 11 [1953718630 1 1852270963 [0 7] 0] 0 1] [7 [8 [1 0 0 0] [1 8 [1 133449338811408550175386169016308622710] 0 0] 0 1] 11 [1953718630 1 133449338811408550175386169016308622710 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [1 2036275311453377535635164748015987] 0 0] 0 1] 11 [1953718630 1 2036275311453377535635164748015987 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [6 [5 [1 0] 0 61] [1 0] 1 1] 1 1] [0 13] 9 2 10 [30 [8 [8 [9 10 0 63] 9 767 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 124] 0 2] 8 [8 [9 10 0 63] 9 767 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 511] 9 2 10 [6 [0 29] 7 [0 3] 8 [8 [9 10 0 63] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [0 28] 7 [0 3] 5 [8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 124] 0 2] 8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 125] 0 2] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7891309 [0 7] 0] 0 1] [[8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[0 50] 0 54] [1 8 [[8 [0 60] 9 2 10 [6 0 28] 0 2] 8 [0 61] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [9 46 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] 7 [8 [1 0] [1 6 [5 [1 0] 0 6] [1 1 1] 8 [8 [8 [9 10 0 15] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 14] 0 2] 8 [8 [8 [9 10 0 31] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 6] 0 2] [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 8 [9 20 0 511] 9 2 10 [6 [0 6] 0 6] 0 2] 0 14] 0 2] 8 [8 [9 10 0 63] 9 4 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 4 0 63] 9 2 10 [6 0 6] 0 2] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [7 [0 3] 8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 6] 0 2] 0 14] 0 2] 7 [0 3] 8 [8 [9 10 0 63] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 6] 0 2] 0 62] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7627117 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [1 0] 7 [8 [1 6 [6 [3 0 30] [1 1] 1 0] [8 [8 [9 43 0 31] 9 2 10 [6 0 62] 0 2] [8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 1 1] 0 12] 0 2] 8 [8 [9 10 0 127] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 13] 0 2] 7 [10 [6 8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 0 1] 8 [9 2 10 [30 0 60] 0 1] 8 [9 2 10 [30 0 125] 10 [6 8 [9 20 0 1023] 9 2 10 [6 [0 30] 0 12] 0 2] 0 3] [8 [9 20 0 2047] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 28] 0 12] 0 2] 0 2] 8 [9 4 0 127] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [8 [9 10 0 255] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [0 29] 0 13] 0 2] 0 2] 0 2] 9 2 0 1] 0 3] 0 1] 11 [1953718630 1 7168362 [0 7] 0] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 46 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 8 [9 46 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 59] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [7 [8 [1 0] [1 8 [1 0] 7 [8 [1 6 [5 [1 0] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [0 6] 1 1] 0 62] 0 2] [8 [8 [9 95 0 31] 9 2 10 [6 [7 [0 3] 4 0 6] 0 62] 0 2] [4 0 4] 0 5] 8 [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 6 [5 [1 0] 8 [8 [9 10 0 127] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [4 0 14] 1 1] 0 126] 0 2] [8 [9 2 10 [6 0 2] 0 3] 8 [9 2 10 [6 8 [9 20 0 2047] 9 2 10 [6 [0 12] 0 14] 0 2] 0 7] 8 [[0 13] 0 5] [8 [9 20 0 8191] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 20 0 8191] 9 2 10 [6 [0 60] 0 28] 0 2] 0 2] 0 2] 0 0] 9 2 0 1] 0 3] 0 1] 11 [1953718630 1 6649187 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [8 [[1 0] 8 [8 [9 10 0 15] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 29] 0 2] 8 [1 6 [8 [9 43 0 511] 9 2 10 [6 [0 28] 0 29] 0 2] [0 0] 6 [5 [1 0] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [8 [9 20 0 511] 9 2 10 [6 [0 124] 0 28] 0 2] 1 1] 0 125] 0 2] [9 2 10 [12 4 0 12] 0 1] 0 12] 9 2 0 1] 6 [5 [1 0] 0 2] [1 1 0] 8 [8 [9 20 0 255] 9 2 10 [6 [0 60] 7 [0 3] 4 0 2] 0 2] 8 [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 8 [9 4 0 63] 9 2 10 [6 7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 14] 0 2] 0 2] 7 [0 3] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [0 2] 8 [9 342 0 511] 9 2 10 [6 0 14] 0 2] 0 125] 0 2] 0 2] [8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 20 0 1023] 9 2 10 [6 [0 30] 0 30] 0 2] 0 6] 0 2] 8 [8 [9 10 0 127] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [8 [9 20 0 1023] 9 2 10 [6 [0 14] 7 [0 3] 8 [9 342 0 1023] 9 2 10 [6 0 30] 0 2] 0 2] 0 2] 0 253] 0 2] 0 1] 11 [1953718630 1 6452594 [0 7] 0] 0 1] [[8 [1 0] [1 6 [5 [1 0] 0 6] [1 1] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 9 2 10 [6 8 [9 342 0 63] 9 2 10 [6 0 14] 0 2] 0 1] 0 2] 0 1] [8 [1 0] [1 [8 [1 0 0] [1 8 [9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [9 90 0 7] 9 2 10 [6 [7 [0 3] 8 [9 190 0 7] 9 2 10 [6 0 28] 0 2] 0 29] 0 2] 0 28] 0 2] 0 1] [8 [1 0] [1 8 [9 367 0 7] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 0 1] [[8 [1 0 0] [1 8 [1 0] 7 [10 [29 8 [9 10 0 15] 9 2 10 [6 0 61] 0 2] 0 1] 8 [0 29] 8 [1 6 [5 [0 14] 0 124] [8 [9 767 0 63] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 9 2 10 [14 4 0 14] 10 [6 8 [9 20 0 2047] 9 2 10 [6 [0 253] 7 [0 3] 8 [9 90 0 63] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] [8 [1 0 0] [1 8 [9 4 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] [8 [9 4 0 7] 9 2 10 [6 0 14] 0 2] [8 [1 0] [1 8 [9 47 0 255] 9 2 10 [6 [7 [0 3] 8 [9 342 0 255] 9 2 10 [6 7 [0 3] 9 382 0 7] 0 2] 7 [0 3] 8 [9 10 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] 8 [1 0 0] [1 8 [9 46 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] [8 [1 0 0] [1 8 [9 10 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 255] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [1 [0 0] 0] [1 8 [9 367 0 7] 9 2 10 [6 [0 57] 7 [0 3] 8 [9 767 0 7] 9 2 10 [6 [0 56] 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 8 [1 0] 8 [1 6 [5 [1 0] 0 30] [0 6] 9 2 10 [30 8 [9 767 0 31] 9 2 10 [6 [7 [0 3] 1 1] 0 62] 0 2] 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] [8 [9 4 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 7] 9 2 10 [6 0 14] 0 2] 0 2] [8 [1 0] [1 8 [9 46 0 7] 9 2 10 [6 [7 [0 3] 8 [9 366 0 7] 9 2 10 [6 0 14] 0 2] 7 [0 3] 1 1] 0 2] 0 1] 8 [1 0 0] [1 8 [9 170 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] 0 1] 8 [1 0] [1 8 [8 [9 10 0 7] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 14] 0 2] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 1] 8 [9 4 0 31] 9 2 10 [6 [0 28] 7 [0 3] 9 2 10 [13 8 [9 342 0 31] 9 2 10 [6 0 29] 0 2] 0 1] 0 2] 0 1] 11 [1953718630 1 7827312 [0 7] 0] 0 1] 8 [1 0] [1 [8 [1 1 1] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 127] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [[8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 127] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 8 [9 46 0 127] 9 2 10 [6 [0 14] 0 62] 0 2] 0 1] [8 [1 1 1] [1 8 [9 4 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 174 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 0 0] 0 1] 8 [1 0] [1 8 [9 47 0 127] 9 2 10 [6 [0 62] 7 [0 3] 8 [9 42 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [8 [1 0 0] [1 5 [8 [9 42 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 42 0 7] 9 2 10 [6 0 29] 0 2] 0 1] [8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] 8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 47 0 127] 9 2 10 [6 [7 [0 3] 8 [9 20 0 127] 9 2 10 [6 [0 62] 0 28] 0 2] 7 [0 3] 8 [9 42 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 0 1] [[8 [1 [[0 15] [0 0] [0 0] 0] 0] [1 8 [0 101] [1 8 [0 60] 9 2 10 [6 [0 125] 0 14] 0 2] 0 1] 0 1] [[8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [7 [0 7] [1 7 [0 14] 9 2 0 1] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[6 [5 [1 0] 0 12] [1 0] 0 0] 8 [0 30] 9 2 10 [6 0 29] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[0 26] 7 [8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 0 6] [1 8 [[8 [0 30] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [1 0] [1 8 [7 [1 0 0] 8 [0 2] [1 0 15] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[1 0] 0 54] [1 8 [6 [5 [1 1] 0 12] [[6 [5 [0 12] 1 1] [1 1] 0 0] 8 [0 60] 9 2 10 [6 0 29] 0 2] [6 [5 [0 12] 1 0] [1 0] 0 0] 8 [0 61] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 702 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 8 [9 702 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 59] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [1 0] [1 6 [5 [1 0] 0 6] [1 0] 4 9 2 10 [6 0 13] 0 1] 0 1] 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [0 15] 0 0 0] [1 8 [1 6 [5 [1 0] 0 28] [1 0] [8 [0 29] 9 2 10 [6 0 120] 0 2] 9 2 10 [28 0 57] 0 1] 9 2 0 1] 0 1] [8 [1 0 [0 13] [0 0] 0] [1 8 [1 6 [5 [1 0] 0 28] [0 237] 8 [0 29] 9 2 10 [6 [0 120] 7 [0 3] 9 2 10 [28 0 57] 0 1] 0 2] 9 2 0 1] 0 1] 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 29] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [[7 [8 [1 1 1] [1 8 [1 0] 8 [1 6 [5 [1 0] 0 60] [0 6] 9 2 10 [60 8 [9 342 0 31] 9 2 10 [6 0 124] 0 2] 10 [6 8 [9 20 0 31] 9 2 10 [6 [0 125] 0 14] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7107949 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 12] [0 13] 9 2 10 [6 [8 [9 342 0 7] 9 2 10 [6 0 28] 0 2] 4 0 13] 0 1] 0 1] 11 [1953718630 1 6579297 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 6 [5 [0 12] 0 13] [1 0] 6 [8 [9 343 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 0] 1 1] 0 1] 11 [1953718630 1 6648940 [0 7] 0] 0 1] [7 [8 [1 1 1] [1 6 [5 [1 0] 0 13] [0 0] 8 [1 0] 8 [1 6 [8 [9 343 0 31] 9 2 10 [6 [0 124] 0 125] 0 2] [0 6] 9 2 10 [60 8 [9 47 0 31] 9 2 10 [6 [0 124] 0 125] 0 2] 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7760228 [0 7] 0] 0 1] [7 [8 [1 0] [1 6 [5 [1 0] 0 6] [0 0] 8 [1 0] 8 [1 6 [5 [0 30] 4 0 6] [0 6] 9 2 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 6514020 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [6 [5 [0 12] 0 13] [1 1] 1 0] [6 [8 [1 6 [5 [1 0] 0 28] [1 0] 6 [6 [6 [5 [1 0] 0 29] [1 1] 1 0] [6 [9 2 10 [14 [8 [9 342 0 15] 9 2 10 [6 0 60] 0 2] 8 [9 342 0 15] 9 2 10 [6 0 61] 0 2] 0 1] [1 0] 1 1] 1 1] [1 0] 1 1] 9 2 0 1] [1 0] 1 1] 1 1] 0 1] 11 [1953718630 1 6845548 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [8 [9 84 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 0] 0 1] 11 [1953718630 1 6845543 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 6 [8 [9 343 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 0] 0 1] 11 [1953718630 1 6648935 [0 7] 0] 0 1] [7 [8 [1 1 1] [1 6 [5 [1 0] 0 13] [0 0] 8 [9 47 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 4 0 7] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 170 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6582125 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [0 12] 9 2 10 [6 [8 [9 342 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 342 0 7] 9 2 10 [6 0 29] 0 2] 0 1] 0 1] 11 [1953718630 1 6452595 [0 7] 0] 0 1] [0 3] 909] +[[[7 [8 [1 0 0 0 0] [1 8 [1 30160793233665617219451904865] 0 0] 0 1] 11 [1953718630 1 30160793233665617219451904865 [0 7] 0] 0 1] [[1 0] [[8 [1 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 751 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 751 0 1] 0 2] 9 2 10 [6 0 58] 0 2] 0 27] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [1 0] 0 0] [1 8 [[6 [6 [3 0 12] [1 1] 1 0] [0 12] 0 0] 8 [7 [0 7] 9 1534 0 1] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 1] 8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 [[8 [9 1492 0 7] 9 2 10 [6 0 14] 0 2] 8 [9 10 0 15] 9 2 10 [6 0 238] 0 2] 1 0] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 478793196187462788804451] [1 8 [6 [5 [0 6] 1 478793196187462788804451] [1 478793196187462788804451] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 6243918] 7 [0 3] 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] 8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 1 478793196187462788804451] 0 1] [[7 [8 [1 0 0] [1 8 [1 1851907519744077227364] 0 0] 0 1] 11 [1953718630 1 1851907519744077227364 [0 7] 0] 0 1] [[8 [1 0] [1 5 [1 6243918] 8 [8 [9 10 0 255] 9 367 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 1] [[8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 [0 12] 0 26] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [6 [5 [1 478793196187462788804451] 0 6] [8 [7 [0 7] 9 174 0 1] 9 2 10 [6 0 14] 0 2] 8 [7 [0 7] 9 762 0 1] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 351 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 374 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [6 [6 [3 0 54] [1 1] 1 0] [0 54] 0 0] 0 55] 8 [5 [0 14] 0 2] 0 6] 0 1] [7 [8 [1 0] [1 8 [1 460217181910180775551341] 0 0] 0 1] 11 [1953718630 1 460217181910180775551341 [0 7] 0] 0 1] 8 [1 0 0 0 0] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 351 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 374 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 2986 0 1] 0 2] 9 2 10 [6 0 118] 0 2] 0 55] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [0 [1 0] 0 0] 0] [1 8 [[8 [7 [0 7] 9 170 0 1] 9 2 10 [6 0 28] 0 2] 6 [6 [3 0 13] [1 1] 1 0] [0 13] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [[6 [6 [3 0 12] [1 1] 1 0] [0 12] 0 0] [8 [7 [0 7] 9 1534 0 1] 9 2 10 [6 0 58] 0 2] [6 [5 [1 0] 0 54] [1 0] 6 [5 [1 1] 0 54] [1 1] 0 0] [6 [6 [3 0 110] [1 1] 1 0] [0 110] 0 0] [[6 [6 [3 0 444] [1 1] 1 0] [0 444] 0 0] 6 [6 [3 0 445] [1 1] 1 0] [0 445] 0 0] [6 [6 [3 0 446] [1 1] 1 0] [0 446] 0 0] [6 [6 [3 0 894] [1 1] 1 0] [0 894] 0 0] 6 [5 [0 895] 1 1701536102] [1 1701536102] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [1 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 6245699] 7 [0 3] 8 [9 22 0 127] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [[[1 [8 [1 0] [1 8 [9 751 0 15] 9 2 10 [6 7 [0 3] 8 [9 94 0 255] 9 2 10 [6 7 [0 3] 8 [8 [9 10 0 511] 9 767 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 2] 0 2] 0 1] 8 [1 0] [1 8 [9 751 0 15] 9 2 10 [6 7 [0 3] 8 [9 94 0 255] 9 2 10 [6 7 [0 3] 8 [8 [9 10 0 511] 9 767 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 2] 0 2] 0 1] 0 1] [8 [1 [0 [[1 0] 0 0] 1 1 [0 0] 0 0 1701536102] [0 0 0 0] 0 0 0] [1 8 [[8 [7 [0 7] 9 751 0 1] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 9 2987 0 1] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 9 84 0 1] 9 2 10 [6 0 59] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 5 [1 6245699] 8 [8 [9 10 0 255] 9 367 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 1] 7 [8 [1 0 0] [1 8 [1 1816244077244883690852] 0 0] 0 1] 11 [1953718630 1 1816244077244883690852 [0 7] 0] 0 1] [8 [1 0 0 0 418565088612] [1 8 [[8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 86 0 1] 0 2] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 1495 0 1] 0 2] 9 2 10 [6 0 58] 0 2] [8 [7 [0 7] 9 766 0 1] 9 2 10 [6 0 118] 0 2] 6 [5 [0 55] 1 418565088612] [1 418565088612] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0] [1 8 [8 [7 [0 7] 8 [9 47 0 255] 9 2 10 [6 7 [0 3] 9 750 0 1] 0 2] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 [1 0] 0 0] [1 8 [7 [1 0] 8 [1 0] [1 1 0] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 1 418565088612] 0 1] [[7 [8 [1 0 0] [1 8 [[8 [9 756 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 756 0 7] 9 2 10 [6 0 29] 0 2] 6 [0 8] [6 [0 10] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 6 [8 [9 22 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 27] 0 25] 0 2] 0 2] 6 [0 10] [6 [8 [9 22 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] [8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [9 47 0 2047] 9 2 10 [6 [0 27] 0 25] 0 2] 0 2] 8 [9 758 0 15] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 25] 0 27] 0 2] 0 2] 0 1] 11 [1953718630 1 7173491 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 0 1] 11 [1953718630 1 7239027 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [8 [9 756 0 7] 9 2 10 [6 0 28] 0 2] 6 [0 4] [8 [9 46 0 2047] 9 2 10 [6 [0 13] 0 61] 0 2] 8 [9 47 0 2047] 9 2 10 [6 [0 61] 0 13] 0 2] 0 1] 11 [1953718630 1 7107940 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 5 [1 0] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 7 [0 3] 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7303792 [0 7] 0] 0 1] [[7 [8 [1 0] [1 5 [1 0] 8 [7 [7 [0 7] 9 4 0 3] 9 1375 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 1] 11 [1953718630 1 7240051 [0 7] 0] 0 1] [[7 [8 [1 0] [1 [8 [9 188 0 7] 9 2 10 [6 0 14] 0 2] 8 [9 1515 0 7] 9 2 10 [6 0 14] 0 2] 0 1] 11 [1953718630 1 6581359 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 759 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 46 0 7] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 190 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7169394 [0 7] 0] 0 1] 7 [8 [1 0] [1 8 [7 [7 [0 7] 9 4 0 3] 9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 7] 9 4 0 3] 9 1375 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 3] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 2] 0 1] 11 [1953718630 1 7561825 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 6 [0 12] [8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 0 29] 0 2] 6 [5 [1 0] 0 13] [1 0] 4 8 [9 4 0 1023] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 342 0 1023] 9 2 10 [6 0 29] 0 2] 0 2] 0 1] 11 [1953718630 1 7824750 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [9 4 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [1 1] 1 0] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6711652 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [9 758 0 7] 9 2 10 [6 [7 [0 3] 5 [1 0] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 7 [0 3] 8 [9 170 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 28] 0 2] 7 [0 3] 8 [9 1515 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6386278 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [5 [0 12] 0 13] [1 0] 6 [8 [9 188 0 7] 9 2 10 [6 0 28] 0 2] [6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [6 [8 [9 43 0 1023] 9 2 10 [6 [0 28] 0 29] 0 2] [1 2] 1 1] 1 2] 6 [8 [9 188 0 7] 9 2 10 [6 0 29] 0 2] [1 1] 6 [8 [9 43 0 1023] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 2] 0 1] 11 [1953718630 1 7368035 [0 7] 0] 0 1] [[[1 [7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [1 0] 6 [5 [1 0] 0 61] [1 0] 1 1] [0 13] 9 2 10 [30 [8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] 8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 4095] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 341 0 31] 9 2 10 [6 [7 [0 3] [1 0] 0 12] 7 [0 3] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] [1 0] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] [1 0] 1 1] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7563620 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [6 [5 [1 0] 0 61] [1 0] 1 1] 1 1] [0 13] 9 2 10 [30 [8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] 8 [9 87 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 4095] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 341 0 31] 9 2 10 [6 [7 [0 3] [1 0] 0 12] 7 [0 3] 6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 124] 0 2] [6 [5 [1 0] 8 [9 1375 0 31] 9 2 10 [6 [7 [0 3] 1 0] 0 125] 0 2] [1 0] 1 1] 1 1] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7237475 [0 7] 0] 0 1] [[8 [1 0] [1 8 [6 [3 0 6] [[8 [7 [0 7] 9 342 0 1] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 9 1374 0 1] 9 2 10 [6 0 29] 0 2] 8 [7 [0 7] 9 342 0 1] 9 2 10 [6 0 14] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 0] [8 [9 1375 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 9 2 10 [13 8 [9 87 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 1] 0 1] 11 [1953718630 1 7367026 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 90 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6845292 [0 7] 0] 0 1] [8 [1 0] [1 8 [6 [6 [3 0 6] [1 1] 1 0] [0 6] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 0] [1 8 [8 [9 10 0 127] 9 190 10 [6 0 28] 0 2] 9 2 10 [6 0 29] 0 2] 0 1] [8 [1 0] [1 8 [7 [0 7] 1 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 367 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6581861 [0 7] 0] 0 1] [7 [8 [1 0 [1 1] 0] [1 8 [8 [9 10 0 127] 9 367 10 [6 0 28] 0 2] 9 2 10 [6 [0 117] 7 [0 3] 8 [8 [9 10 0 127] 9 767 10 [6 0 28] 0 2] 9 2 10 [6 [0 116] 0 59] 0 2] 0 2] 0 1] 11 [1953718630 1 7632227 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [8 [9 10 0 255] 9 767 10 [6 0 12] 0 2] 9 2 10 [6 [0 13] 0 61] 0 2] 0 1] 11 [1953718630 1 6845298 [0 7] 0] 0 1] [8 [1 0] [1 [8 [1 0 0] [1 8 [9 44 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 4095] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [9 4 0 127] 9 2 10 [6 7 [0 3] 8 [9 4 0 127] 9 2 10 [6 0 14] 0 2] 0 2] [[8 [1 0] [1 8 [9 1375 0 31] 9 2 10 [6 [0 62] 0 14] 0 2] 0 1] 8 [1 0] [1 8 [9 47 0 4095] 9 2 10 [6 [7 [0 3] 8 [9 342 0 4095] 9 2 10 [6 7 [0 3] 9 10 0 7] 0 2] 7 [0 3] 8 [9 44 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [8 [1 0 0 0] [1 8 [8 [9 44 0 7] 9 2 10 [6 0 59] 0 2] 8 [8 [9 4 0 1023] 9 2 10 [6 7 [0 3] 8 [9 47 0 8191] 9 2 10 [6 [0 126] 0 60] 0 2] 0 2] 8 [8 [9 46 0 16383] 9 2 10 [6 [0 250] 0 6] 0 2] 8 [9 44 0 63] 9 2 10 [6 7 [0 3] 8 [9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [9 87 0 255] 9 2 10 [6 [7 [0 3] [0 124] 0 2] 0 30] 0 2] 7 [0 3] 8 [9 341 0 255] 9 2 10 [6 [7 [0 3] [0 124] 8 [9 47 0 32767] 9 2 10 [6 [0 14] 0 6] 0 2] 0 30] 0 2] 0 2] 0 2] 0 1] 8 [1 0] [1 7 [10 [6 8 [9 44 0 7] 9 2 10 [6 0 14] 0 2] 0 1] 6 [8 [9 84 0 4095] 9 2 10 [6 [0 62] 7 [0 3] 1 3] 0 2] [0 6] 8 [8 [9 342 0 4095] 9 2 10 [6 0 62] 0 2] 8 [9 20 0 63] 9 2 10 [6 [7 [0 3] 8 [9 341 0 63] 9 2 10 [6 [0 6] 7 [0 3] 9 2 10 [30 0 2] 10 [6 8 [9 86 0 63] 9 2 10 [6 [0 6] [7 [0 3] 1 0 1] 0 30] 0 2] 0 3] 0 2] 7 [0 3] 9 2 10 [30 0 2] 10 [6 8 [9 86 0 63] 9 2 10 [6 [0 6] [7 [0 3] 1 1 1] 0 30] 0 2] 0 3] 0 2] 0 1] 0 1] [7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 0] 8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 1375 0 7] 9 2 10 [6 [7 [0 3] [0 12] 0 52] 0 117] 0 2] 7 [0 3] 8 [9 341 0 7] 9 2 10 [6 [7 [0 3] [0 12] 0 52] 7 [0 3] 9 2 10 [13 0 27] 0 1] 0 2] 0 2] 0 1] 11 [1953718630 1 7233891 [0 7] 0] 0 1] [7 [8 [1 0 0 [0 15] 0 0 0] [1 8 [9 95 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 22 0 511] 9 2 10 [6 [7 [0 3] 8 [9 340 0 7] 9 2 10 [6 [0 28] 0 58] 0 2] 0 59] 0 2] 0 2] 0 1] 11 [1953718630 1 7239026 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [6 [6 [3 0 12] [1 1] 1 0] [[0 12] 1 1] 0 12] 8 [1 0] 8 [1 6 [5 [1 0] 0 125] [1 0] 8 [9 20 0 8191] 9 2 10 [6 [7 [0 3] 9 2 10 [125 0 251] 10 [6 4 0 6] 0 1] 7 [0 3] 8 [9 341 0 63] 9 2 10 [6 [7 [0 3] [0 28] 8 [9 4 0 8191] 9 2 10 [6 [0 61] 0 14] 0 2] 7 [0 3] 8 [9 1375 0 63] 9 2 10 [6 [7 [0 3] [0 28] 0 29] 0 506] 0 2] 0 2] 0 2] 9 2 0 1] 0 1] 11 [1953718630 1 7366002 [0 7] 0] 0 1] 0 1] [7 [8 [1 0 0] [1 8 [9 22 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 22 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 1935763571 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [7 [7 [0 1] 9 4 0 7] 9 46 0 3] 9 2 10 [6 7 [0 3] [8 [7 [7 [0 1] 9 4 0 7] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 3] 0 14] 0 2] 0 6] 0 2] 0 1] 11 [1953718630 1 2019649651 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 7 [10 [13 8 [7 [7 [0 1] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 3] [7 [0 3] [1 0] 0 12] 0 29] 0 2] 0 1] 8 [[7 [7 [7 [0 1] 9 4 0 7] 9 22 0 1] 10 [6 1 5] 0 1] 8 [1 0 0] [1 8 [7 [7 [0 7] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 5] [7 [0 3] [0 12] 1 1] 0 29] 0 2] 0 1] 8 [[9 4 0 4] [9 46 0 4] [9 47 0 4] 9 45 0 4] 8 [8 [7 [7 [0 7] 9 4 0 7] 9 341 0 1] 9 2 10 [6 [7 [0 3] 1 0 3] 0 124] 0 2] 8 [8 [7 [7 [0 15] 9 4 0 7] 9 46 0 1] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] [[0 2] 0 125] [1 8 128] [[8 [7 [7 [0 15] 9 4 0 7] 9 46 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [7 [0 3] 1 960] 7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 46 0 255] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 15] 9 4 0 7] 9 20 0 255] 9 2 10 [6 [7 [0 3] 1 8] 0 6] 0 2] 7 [0 3] 1 512] 0 2] 0 2] 7 [0 3] 1 512] 0 2] 1 0] [[1 64] 8 [8 [7 [7 [0 15] 9 4 0 7] 9 22 0 1] 9 47 10 [6 7 [0 3] 1 6] 0 2] 9 2 10 [6 0 6] 0 2] 1 0] 0 2] 8 [8 [7 [7 [0 31] 9 4 0 7] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 9] 0 6] 0 2] 8 [1 25051139735836467913601071899189108501681633092613316132753366958947502841281110980347811086624969305314199562795868290539880502533646505489797110349007385020507326982043050618112420254613810441709594605123090411975756494285771699200369901479195251226368983824020564277645963860728452821576845901498668417244438721537663670541944820957180957595559282976806173113161068298822071065329290006052849814285001949914564097058408480133985233335799884203712730341384999677089997083749077591931498939520449886954646413138343858395935213418018409268340744776361518554939863400075967197509182087778881547827184266701615699472280] 8 [1 41557658498906279274860226408925318911382702236748615442085426012007055353447] 8 [1 0] 8 [1 6 [5 [0 6] 0 62] [8 [7 [7 [0 1023] 9 4 0 7] 9 94 0 1] 9 2 10 [6 [7 [0 3] 1 5] [0 30] 0 8182] 0 2] 8 [8 [8 [7 [7 [0 1023] 9 4 0 7] 9 86 0 1] 9 2 10 [6 [7 [0 3] 1 9] [7 [0 3] [0 6] 1 1] 0 254] 0 2] 8 [8 [7 [7 [0 2047] 9 4 0 7] 9 94 0 1] 9 2 10 [6 [7 [0 3] 1 5] [0 6] 0 16374] 0 2] 8 [1 16] 8 [1 6 [5 [1 64] 0 6] [0 14] 8 [[8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 15] 0 2] 0 30] 0 2] [8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 2] 0 2] 0 30] 0 2] [8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 16] 0 2] 0 30] 0 2] 8 [0 32765] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 16383] 9 4 0 7] 9 47 0 255] 9 2 10 [6 [0 14] 7 [0 3] 1 7] 0 2] 0 30] 0 2] 8 [8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 65530] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 7] 0 12] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 65530] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 18] 0 12] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0 3] 0 12] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 65535] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 131066] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 17] 0 58] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 131066] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 19] 0 58] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 65535] 9 4 0 7] 9 87 0 1] 9 2 10 [6 [7 [0 3] 1 0 10] 0 58] 0 2] 0 2] 0 2] 8 [8 [0 131068] 8 [0 2] 9 2 10 [6 [0 502] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 30] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 503] 0 14] 0 2] 0 2] 0 2] 9 2 10 [14 8 [7 [7 [0 262143] 9 4 0 7] 9 20 0 1] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 341 0 1] 9 2 10 [6 [7 [0 3] [1 5] 0 126] 0 6] 0 2] 0 510] 0 2] 10 [6 4 0 126] 0 31] 9 2 0 1] 8 [1 0] 8 [[8 [0 8189] 9 2 10 [6 [7 [0 3] 1 0] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 1] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 2] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 3] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 4] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 5] 0 126] 0 2] [8 [0 8189] 9 2 10 [6 [7 [0 3] 1 6] 0 126] 0 2] 8 [0 8189] 9 2 10 [6 [7 [0 3] 1 7] 0 126] 0 2] 8 [1 6 [5 [1 64] 0 14] [9 2 10 [14 8 [7 [7 [0 16383] 9 4 0 7] 9 95 0 1] 9 2 10 [6 [7 [0 3] 1 5] 7 [0 3] [8 [0 16380] 9 2 10 [6 [0 28] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 0] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 58] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 1] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 118] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 2] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 238] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 3] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 478] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 4] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 958] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 5] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 1918] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 6] 0 510] 0 2] 0 2] [8 [0 16380] 9 2 10 [6 [0 1919] 7 [0 3] 8 [0 32765] 9 2 10 [6 [7 [0 3] 1 7] 0 510] 0 2] 0 2] 1 0] 0 2] 10 [6 4 0 126] 0 31] 8 [8 [7 [7 [0 16383] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 2] 0 28] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 13] 0 28] 0 2] 7 [0 3] 7 [0 3] 8 [0 32762] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 22] 0 28] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 60] 0 122] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 60] 0 246] 0 2] 7 [0 3] 7 [0 3] 8 [7 [7 [0 32767] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 122] 0 246] 0 2] 0 2] 0 2] 8 [8 [0 65532] 9 2 10 [6 [0 14] 0 6] 0 2] 8 [8 [7 [7 [0 131071] 9 4 0 7] 9 4 0 15] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 6] 0 4062] 0 2] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 11] 0 4062] 0 2] 7 [0 3] 7 [0 3] 8 [0 262138] 9 2 10 [6 [7 [0 3] 1 0] [7 [0 3] 1 25] 0 4062] 0 2] 0 2] 0 2] 8 [8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 15] 9 2 10 [6 [7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [0 8158] 0 16318] 0 2] 7 [0 3] 8 [7 [7 [0 262143] 9 4 0 7] 9 4 0 1] 9 2 10 [6 [7 [0 3] 8 [0 1048567] 9 2 10 [6 0 8158] 0 2] 0 32638] 0 2] 0 2] 8 [8 [0 524284] 8 [0 2] 9 2 10 [6 [0 130943] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 30] 7 [0 3] 8 [0 2] 9 2 10 [6 [0 14] 7 [0 3] 8 [0 2] 9 2 10 [6 [7 [0 3] 7 [0 3] 8 [0 1048573] 9 2 10 [6 [0 1022] 0 32766] 0 2] 7 [0 3] 7 [0 3] 8 [0 1048573] 9 2 10 [6 [0 1022] 0 2046] 0 2] 0 2] 0 2] 0 2] 0 2] 9 2 10 [14 4 0 1022] 10 [6 [8 [0 1048572] 9 2 10 [6 [0 6] 0 62] 0 2] [0 1020] [0 2042] [0 4086] [8 [0 1048572] 9 2 10 [6 [0 16366] 0 6] 0 2] [0 16350] [0 32702] 0 65406] 0 127] 9 2 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 2036426867 [0 7] 0] 0 1] 7 [8 [1 0] [1 [8 [1 0] [1 8 [8 [9 23 0 7] 9 2 10 [6 0 14] 0 2] [0 2] 10 [6 8 [9 10 0 63] 9 2 10 [6 [7 [0 3] 1 1932355439] 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [0 126] 0 6] 0 2] 0 2] 0 15] 0 1] [[8 [1 0] [1 11 [1851876717 [1 [1 1717658988] 7 [0 1] 8 [1 1 114 97 100 45 122 101 114 111 0] 9 2 0 1] 0 1] 6 [5 [1 0] 0 6] [0 0] 8 [8 [9 23 0 7] 9 2 10 [6 7 [0 3] 8 [7 [7 [0 1] 9 4 0 31] 9 686 0 1] 9 2 10 [6 [7 [0 3] 1 0] 0 14] 0 2] 0 2] 6 [8 [7 [7 [0 3] 9 4 0 31] 9 343 0 255] 9 2 10 [6 [0 6] 0 30] 0 2] [0 2] 9 2 10 [30 4 0 62] 0 3] 0 1] [10 [6 8 [9 10 0 7] 9 2 10 [6 [7 [0 3] 1 30449275492921459] 0 14] 0 2] 0 1] 10 [6 8 [9 10 0 7] 9 2 10 [6 [7 [0 3] 1 32138125353185395] 0 14] 0 2] 0 1] [8 [1 0] [1 8 [8 [9 20 0 7] 9 2 10 [6 0 14] 0 2] [0 2] 10 [6 8 [9 10 0 63] 9 2 10 [6 [7 [0 3] 1 1932355439] 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [0 126] 0 6] 0 2] 0 2] 0 15] 0 1] 7 [8 [1 0] [1 8 [7 [7 [0 1] 9 4 0 31] 9 46 0 1] 9 2 10 [6 [7 [0 3] 1 0] 7 [0 3] 8 [8 [7 [7 [0 1] 9 4 0 31] 9 10 0 3] 9 2 10 [6 [7 [0 3] 1 1630365551] 7 [0 3] 8 [7 [7 [0 1] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 14] 0 62] 0 2] 0 2] 8 [1 6 [5 [1 0] 0 30] [1 0] 8 [8 [7 [7 [0 7] 9 4 0 31] 9 10 0 3] 9 2 10 [6 [7 [0 3] 1 1647142767] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 62] 7 [0 3] 8 [7 [7 [0 7] 9 4 0 31] 9 4 0 15] 9 2 10 [6 [0 254] 0 14] 0 2] 0 2] 0 2] 6 [8 [7 [7 [0 15] 9 4 0 31] 9 343 0 255] 9 2 10 [6 [0 126] 7 [0 3] 1 256] 0 2] [[[0 62] 8 [7 [7 [0 15] 9 4 0 31] 9 1375 0 1] 9 2 10 [6 [7 [0 3] [1 0] 0 62] 0 6] 0 2] 1 0] [[1 256] 0 2] 9 2 10 [30 8 [7 [7 [0 15] 9 4 0 31] 9 47 0 255] 9 2 10 [6 [0 126] 7 [0 3] 1 256] 0 2] 10 [6 0 2] 0 3] 9 2 0 1] 0 2] 0 1] 11 [1953718630 1 7823730 [0 7] 0] 0 1] 0 1] 11 [1953718630 1 26479 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 133480762729846] 0 0] 0 1] 11 [1953718630 1 133480762729846 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 8 [1 1852270963] 0 0] 0 1] 11 [1953718630 1 1852270963 [0 7] 0] 0 1] [7 [8 [1 0 0 0] [1 8 [1 133449338811408550175386169016308622710] 0 0] 0 1] 11 [1953718630 1 133449338811408550175386169016308622710 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [1 2036275311453377535635164748015987] 0 0] 0 1] 11 [1953718630 1 2036275311453377535635164748015987 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 8 [1 0 0] 8 [1 6 [6 [5 [1 0] 0 60] [6 [5 [1 0] 0 61] [1 0] 1 1] 1 1] [0 13] 9 2 10 [30 [8 [8 [9 10 0 63] 9 767 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 124] 0 2] 8 [8 [9 10 0 63] 9 767 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 125] 0 2] 10 [6 [4 0 12] 8 [9 20 0 511] 9 2 10 [6 [0 29] 7 [0 3] 8 [8 [9 10 0 63] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [0 28] 7 [0 3] 5 [8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 124] 0 2] 8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 125] 0 2] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7891309 [0 7] 0] 0 1] [[8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[0 50] 0 54] [1 8 [[8 [0 60] 9 2 10 [6 0 28] 0 2] 8 [0 61] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [9 46 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] 7 [8 [1 0] [1 6 [5 [1 0] 0 6] [1 1 1] 8 [8 [8 [9 10 0 15] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 14] 0 2] 8 [8 [8 [9 10 0 31] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 6] 0 2] [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 8 [9 20 0 511] 9 2 10 [6 [0 6] 0 6] 0 2] 0 14] 0 2] 8 [8 [9 10 0 63] 9 4 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 4 0 63] 9 2 10 [6 0 6] 0 2] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [7 [0 3] 8 [8 [9 10 0 63] 9 367 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 6] 0 2] 0 14] 0 2] 7 [0 3] 8 [8 [9 10 0 63] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 6] 0 2] 0 62] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 7627117 [0 7] 0] 0 1] [7 [8 [1 0] [1 8 [1 0] 7 [8 [1 6 [6 [3 0 30] [1 1] 1 0] [8 [8 [9 43 0 31] 9 2 10 [6 0 62] 0 2] [8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 1 1] 0 12] 0 2] 8 [8 [9 10 0 127] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 13] 0 2] 7 [10 [6 8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 0 1] 8 [9 2 10 [30 0 60] 0 1] 8 [9 2 10 [30 0 125] 10 [6 8 [9 20 0 1023] 9 2 10 [6 [0 30] 0 12] 0 2] 0 3] [8 [9 20 0 2047] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 20 0 2047] 9 2 10 [6 [0 28] 0 12] 0 2] 0 2] 8 [9 4 0 127] 9 2 10 [6 [7 [0 3] 1 1] 7 [0 3] 8 [8 [9 10 0 255] 9 90 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [8 [9 10 0 255] 9 4 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [0 29] 0 13] 0 2] 0 2] 0 2] 9 2 0 1] 0 3] 0 1] 11 [1953718630 1 7168362 [0 7] 0] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 46 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 8 [9 46 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 59] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [7 [8 [1 0] [1 8 [1 0] 7 [8 [1 6 [5 [1 0] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [0 6] 1 1] 0 62] 0 2] [8 [8 [9 95 0 31] 9 2 10 [6 [7 [0 3] 4 0 6] 0 62] 0 2] [4 0 4] 0 5] 8 [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 1 2] 0 14] 0 2] 6 [5 [1 0] 8 [8 [9 10 0 127] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [4 0 14] 1 1] 0 126] 0 2] [8 [9 2 10 [6 0 2] 0 3] 8 [9 2 10 [6 8 [9 20 0 2047] 9 2 10 [6 [0 12] 0 14] 0 2] 0 7] 8 [[0 13] 0 5] [8 [9 20 0 8191] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 8 [9 20 0 8191] 9 2 10 [6 [0 60] 0 28] 0 2] 0 2] 0 2] 0 0] 9 2 0 1] 0 3] 0 1] 11 [1953718630 1 6649187 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 8 [8 [[1 0] 8 [8 [9 10 0 15] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 29] 0 2] 8 [1 6 [8 [9 43 0 511] 9 2 10 [6 [0 28] 0 29] 0 2] [0 0] 6 [5 [1 0] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [8 [9 20 0 511] 9 2 10 [6 [0 124] 0 28] 0 2] 1 1] 0 125] 0 2] [9 2 10 [12 4 0 12] 0 1] 0 12] 9 2 0 1] 6 [5 [1 0] 0 2] [1 1 0] 8 [8 [9 20 0 255] 9 2 10 [6 [0 60] 7 [0 3] 4 0 2] 0 2] 8 [8 [9 20 0 511] 9 2 10 [6 [7 [0 3] 8 [9 4 0 63] 9 2 10 [6 7 [0 3] 8 [9 342 0 511] 9 2 10 [6 0 14] 0 2] 0 2] 7 [0 3] 8 [8 [9 10 0 63] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [0 2] 8 [9 342 0 511] 9 2 10 [6 0 14] 0 2] 0 125] 0 2] 0 2] [8 [9 20 0 1023] 9 2 10 [6 [7 [0 3] 8 [9 20 0 1023] 9 2 10 [6 [0 30] 0 30] 0 2] 0 6] 0 2] 8 [8 [9 10 0 127] 9 94 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 [7 [0 3] [8 [9 20 0 1023] 9 2 10 [6 [0 14] 7 [0 3] 8 [9 342 0 1023] 9 2 10 [6 0 30] 0 2] 0 2] 0 2] 0 253] 0 2] 0 1] 11 [1953718630 1 6452594 [0 7] 0] 0 1] [[8 [1 0] [1 6 [5 [1 0] 0 6] [1 1] 8 [9 4 0 63] 9 2 10 [6 [7 [0 3] 1 2] 7 [0 3] 9 2 10 [6 8 [9 342 0 63] 9 2 10 [6 0 14] 0 2] 0 1] 0 2] 0 1] [8 [1 0] [1 [8 [1 0 0] [1 8 [9 20 0 255] 9 2 10 [6 [7 [0 3] 8 [9 90 0 7] 9 2 10 [6 [7 [0 3] 8 [9 190 0 7] 9 2 10 [6 0 28] 0 2] 0 29] 0 2] 0 28] 0 2] 0 1] [8 [1 0] [1 8 [9 367 0 7] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 0 1] [[8 [1 0 0] [1 8 [1 0] 7 [10 [29 8 [9 10 0 15] 9 2 10 [6 0 61] 0 2] 0 1] 8 [0 29] 8 [1 6 [5 [0 14] 0 124] [8 [9 767 0 63] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 9 2 10 [14 4 0 14] 10 [6 8 [9 20 0 2047] 9 2 10 [6 [0 253] 7 [0 3] 8 [9 90 0 63] 9 2 10 [6 [7 [0 3] 1 1] 0 14] 0 2] 0 2] 0 1] 9 2 0 1] 0 1] [8 [1 0 0] [1 8 [9 4 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] [8 [9 4 0 7] 9 2 10 [6 0 14] 0 2] [8 [1 0] [1 8 [9 47 0 255] 9 2 10 [6 [7 [0 3] 8 [9 342 0 255] 9 2 10 [6 7 [0 3] 9 382 0 7] 0 2] 7 [0 3] 8 [9 10 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] 8 [1 0 0] [1 8 [9 46 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] [8 [1 0 0] [1 8 [9 10 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 255] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [1 [0 0] 0] [1 8 [9 367 0 7] 9 2 10 [6 [0 57] 7 [0 3] 8 [9 767 0 7] 9 2 10 [6 [0 56] 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 8 [1 0] 8 [1 6 [5 [1 0] 0 30] [0 6] 9 2 10 [30 8 [9 767 0 31] 9 2 10 [6 [7 [0 3] 1 1] 0 62] 0 2] 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] [8 [9 4 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 7] 9 2 10 [6 0 14] 0 2] 0 2] [8 [1 0] [1 8 [9 46 0 7] 9 2 10 [6 [7 [0 3] 8 [9 366 0 7] 9 2 10 [6 0 14] 0 2] 7 [0 3] 1 1] 0 2] 0 1] 8 [1 0 0] [1 8 [9 170 0 255] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 7 [0 3] 8 [9 4 0 255] 9 2 10 [6 [7 [0 3] 9 182 0 7] 0 28] 0 2] 0 2] 0 2] 0 1] 0 1] 8 [1 0] [1 8 [8 [9 10 0 7] 9 190 10 [6 7 [0 3] 1 0] 0 2] 9 2 10 [6 0 14] 0 2] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [1 1] 8 [9 4 0 31] 9 2 10 [6 [0 28] 7 [0 3] 9 2 10 [13 8 [9 342 0 31] 9 2 10 [6 0 29] 0 2] 0 1] 0 2] 0 1] 11 [1953718630 1 7827312 [0 7] 0] 0 1] 8 [1 0] [1 [8 [1 1 1] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 127] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [[8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 20 0 127] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 8 [9 46 0 127] 9 2 10 [6 [0 14] 0 62] 0 2] 0 1] [8 [1 1 1] [1 8 [9 4 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 174 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 1] [8 [1 0] [1 0 0] 0 1] 8 [1 0] [1 8 [9 47 0 127] 9 2 10 [6 [0 62] 7 [0 3] 8 [9 42 0 7] 9 2 10 [6 0 14] 0 2] 0 2] 0 1] [8 [1 0 0] [1 5 [8 [9 42 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 42 0 7] 9 2 10 [6 0 29] 0 2] 0 1] [8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 4 0 31] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 1] 8 [1 0 0] [1 8 [9 42 0 7] 9 2 10 [6 7 [0 3] 8 [9 47 0 127] 9 2 10 [6 [7 [0 3] 8 [9 20 0 127] 9 2 10 [6 [0 62] 0 28] 0 2] 7 [0 3] 8 [9 42 0 7] 9 2 10 [6 0 29] 0 2] 0 2] 0 2] 0 1] 0 1] [[8 [1 [[0 15] [0 0] [0 0] 0] 0] [1 8 [0 101] [1 8 [0 60] 9 2 10 [6 [0 125] 0 14] 0 2] 0 1] 0 1] [[8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [7 [0 7] [1 7 [0 14] 9 2 0 1] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[6 [5 [1 0] 0 12] [1 0] 0 0] 8 [0 30] 9 2 10 [6 0 29] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[0 26] 7 [8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 0 6] [1 8 [[8 [0 30] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [1 0] [1 8 [7 [1 0 0] 8 [0 2] [1 0 15] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [[8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [[1 0] 0 54] [1 8 [6 [5 [1 1] 0 12] [[6 [5 [0 12] 1 1] [1 1] 0 0] 8 [0 60] 9 2 10 [6 0 29] 0 2] [6 [5 [0 12] 1 0] [1 0] 0 0] 8 [0 61] 9 2 10 [6 0 29] 0 2] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] [8 [7 [0 7] 8 [9 702 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 58] 0 2] 8 [7 [0 7] 8 [9 702 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 59] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [8 [1 0] [1 6 [5 [1 0] 0 6] [1 0] 4 9 2 10 [6 0 13] 0 1] 0 1] 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] 8 [5 [0 14] 0 2] 0 6] 0 1] [8 [1 0 [0 15] 0 0 0] [1 8 [1 6 [5 [1 0] 0 28] [1 0] [8 [0 29] 9 2 10 [6 0 120] 0 2] 9 2 10 [28 0 57] 0 1] 9 2 0 1] 0 1] [8 [1 0 [0 13] [0 0] 0] [1 8 [1 6 [5 [1 0] 0 28] [0 237] 8 [0 29] 9 2 10 [6 [0 120] 7 [0 3] 9 2 10 [28 0 57] 0 1] 0 2] 9 2 0 1] 0 1] 8 [8 [1 0] [1 8 [0 6] 8 [5 [0 14] 0 2] 0 6] 0 1] [1 8 [1 0] [1 8 [6 [3 0 6] [[8 [0 30] 9 2 10 [6 0 28] 0 2] 8 [7 [0 7] 8 [9 47 0 7] 9 2 10 [6 0 14] 0 2] 9 2 10 [6 0 29] 0 2] 6 [5 [1 0] 0 6] [1 0] 0 0] 8 [5 [0 14] 0 2] 0 6] 0 1] 0 1] [[7 [8 [1 1 1] [1 8 [1 0] 8 [1 6 [5 [1 0] 0 60] [0 6] 9 2 10 [60 8 [9 342 0 31] 9 2 10 [6 0 124] 0 2] 10 [6 8 [9 20 0 31] 9 2 10 [6 [0 125] 0 14] 0 2] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7107949 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 6 [5 [1 0] 0 12] [0 13] 9 2 10 [6 [8 [9 342 0 7] 9 2 10 [6 0 28] 0 2] 4 0 13] 0 1] 0 1] 11 [1953718630 1 6579297 [0 7] 0] 0 1] [[7 [8 [1 0 0] [1 6 [5 [0 12] 0 13] [1 0] 6 [8 [9 343 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 0] 1 1] 0 1] 11 [1953718630 1 6648940 [0 7] 0] 0 1] [7 [8 [1 1 1] [1 6 [5 [1 0] 0 13] [0 0] 8 [1 0] 8 [1 6 [8 [9 343 0 31] 9 2 10 [6 [0 124] 0 125] 0 2] [0 6] 9 2 10 [60 8 [9 47 0 31] 9 2 10 [6 [0 124] 0 125] 0 2] 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 7760228 [0 7] 0] 0 1] [7 [8 [1 0] [1 6 [5 [1 0] 0 6] [0 0] 8 [1 0] 8 [1 6 [5 [0 30] 4 0 6] [0 6] 9 2 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1] 11 [1953718630 1 6514020 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [6 [5 [0 12] 0 13] [1 1] 1 0] [6 [8 [1 6 [5 [1 0] 0 28] [1 0] 6 [6 [6 [5 [1 0] 0 29] [1 1] 1 0] [6 [9 2 10 [14 [8 [9 342 0 15] 9 2 10 [6 0 60] 0 2] 8 [9 342 0 15] 9 2 10 [6 0 61] 0 2] 0 1] [1 0] 1 1] 1 1] [1 0] 1 1] 9 2 0 1] [1 0] 1 1] 1 1] 0 1] 11 [1953718630 1 6845548 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [8 [9 84 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 0] 0 1] 11 [1953718630 1 6845543 [0 7] 0] 0 1] [7 [8 [1 0 0] [1 6 [8 [9 343 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] [1 1] 1 0] 0 1] 11 [1953718630 1 6648935 [0 7] 0] 0 1] [7 [8 [1 1 1] [1 6 [5 [1 0] 0 13] [0 0] 8 [9 47 0 7] 9 2 10 [6 [0 28] 7 [0 3] 8 [9 4 0 7] 9 2 10 [6 [0 29] 7 [0 3] 8 [9 170 0 7] 9 2 10 [6 [0 28] 0 29] 0 2] 0 2] 0 2] 0 1] 11 [1953718630 1 6582125 [0 7] 0] 0 1] 7 [8 [1 0 0] [1 6 [5 [1 0] 0 13] [0 12] 9 2 10 [6 [8 [9 342 0 7] 9 2 10 [6 0 28] 0 2] 8 [9 342 0 7] 9 2 10 [6 0 29] 0 2] 0 1] 0 1] 11 [1953718630 1 6452595 [0 7] 0] 0 1] [0 3] 909] diff --git a/src/Juvix/Compiler/Casm/Extra/Base.hs b/src/Juvix/Compiler/Casm/Extra/Base.hs index bc55de032b..b1904288ff 100644 --- a/src/Juvix/Compiler/Casm/Extra/Base.hs +++ b/src/Juvix/Compiler/Casm/Extra/Base.hs @@ -14,35 +14,43 @@ adjustAp idx mr@MemRef {..} = case _memRefReg of Ap -> MemRef Ap (_memRefOff - idx) Fp -> mr -mkAssign :: MemRef -> RValue -> Instruction -mkAssign mr rv = +mkAssign' :: Maybe Text -> MemRef -> RValue -> Instruction +mkAssign' comment mr rv = Assign InstrAssign { _instrAssignResult = mr, _instrAssignValue = rv, - _instrAssignIncAp = False + _instrAssignIncAp = False, + _instrAssignComment = comment } -mkAssignAp :: RValue -> Instruction -mkAssignAp v = +mkAssign :: MemRef -> RValue -> Instruction +mkAssign = mkAssign' Nothing + +mkAssignAp' :: Maybe Text -> RValue -> Instruction +mkAssignAp' comment v = Assign InstrAssign { _instrAssignResult = MemRef Ap 0, _instrAssignValue = v, - _instrAssignIncAp = True + _instrAssignIncAp = True, + _instrAssignComment = comment } +mkAssignAp :: RValue -> Instruction +mkAssignAp = mkAssignAp' Nothing + mkCallRel :: Value -> Instruction -mkCallRel tgt = Call (InstrCall tgt True) +mkCallRel tgt = Call (InstrCall tgt True Nothing) mkCallAbs :: Value -> Instruction -mkCallAbs tgt = Call (InstrCall tgt False) +mkCallAbs tgt = Call (InstrCall tgt False Nothing) mkJumpAbs :: RValue -> Instruction -mkJumpAbs tgt = Jump (InstrJump tgt False False) +mkJumpAbs tgt = Jump (InstrJump tgt False False Nothing) mkJumpIf :: Value -> MemRef -> Instruction -mkJumpIf tgt v = JumpIf (InstrJumpIf tgt v False) +mkJumpIf tgt v = JumpIf (InstrJumpIf tgt v False Nothing) mkJumpRel :: RValue -> Instruction -mkJumpRel tgt = Jump (InstrJump tgt True False) +mkJumpRel tgt = Jump (InstrJump tgt True False Nothing) diff --git a/src/Juvix/Compiler/Casm/Language.hs b/src/Juvix/Compiler/Casm/Language.hs index 6528927cc7..ad30552d27 100644 --- a/src/Juvix/Compiler/Casm/Language.hs +++ b/src/Juvix/Compiler/Casm/Language.hs @@ -99,7 +99,8 @@ data Instruction data InstrAssign = InstrAssign { _instrAssignValue :: RValue, _instrAssignResult :: MemRef, - _instrAssignIncAp :: Bool + _instrAssignIncAp :: Bool, + _instrAssignComment :: Maybe Text } data InstrExtraBinop = InstrExtraBinop @@ -107,13 +108,15 @@ data InstrExtraBinop = InstrExtraBinop _instrExtraBinopArg2 :: Value, _instrExtraBinopResult :: MemRef, _instrExtraBinopOpcode :: ExtraOpcode, - _instrExtraBinopIncAp :: Bool + _instrExtraBinopIncAp :: Bool, + _instrExtraBinopComment :: Maybe Text } data InstrJump = InstrJump { _instrJumpTarget :: RValue, _instrJumpRel :: Bool, - _instrJumpIncAp :: Bool + _instrJumpIncAp :: Bool, + _instrJumpComment :: Maybe Text } -- | Jump if value is nonzero. Boolean true is translated to zero, false to @@ -121,12 +124,14 @@ data InstrJump = InstrJump data InstrJumpIf = InstrJumpIf { _instrJumpIfTarget :: Value, _instrJumpIfValue :: MemRef, - _instrJumpIfIncAp :: Bool + _instrJumpIfIncAp :: Bool, + _instrJumpIfComment :: Maybe Text } data InstrCall = InstrCall { _instrCallTarget :: Value, - _instrCallRel :: Bool + _instrCallRel :: Bool, + _instrCallComment :: Maybe Text } newtype InstrAlloc = InstrAlloc diff --git a/src/Juvix/Compiler/Casm/Pretty/Base.hs b/src/Juvix/Compiler/Casm/Pretty/Base.hs index 1645b7c95d..80096974ec 100644 --- a/src/Juvix/Compiler/Casm/Pretty/Base.hs +++ b/src/Juvix/Compiler/Casm/Pretty/Base.hs @@ -23,6 +23,11 @@ ppIncAp = \case True -> return $ Str.semicolon <+> Str.apPlusPlus False -> mempty +ppComment :: Maybe Text -> Sem r (Doc Ann) +ppComment = \case + Just c -> return $ Str.commentLineStart <+> pretty c <> hardline + Nothing -> return mempty + instance PrettyCode Reg where ppCode = \case Ap -> return Str.ap @@ -121,19 +126,21 @@ instance PrettyCode Hint where instance PrettyCode InstrAssign where ppCode InstrAssign {..} = do + comment <- ppComment _instrAssignComment v <- ppCode _instrAssignValue r <- ppCode _instrAssignResult incAp <- ppIncAp _instrAssignIncAp - return $ r <+> Str.equal <+> v <> incAp + return $ comment <> r <+> Str.equal <+> v <> incAp instance PrettyCode InstrExtraBinop where ppCode InstrExtraBinop {..} = do + comment <- ppComment _instrExtraBinopComment v1 <- ppCode _instrExtraBinopArg1 v2 <- ppCode _instrExtraBinopArg2 op <- ppCode _instrExtraBinopOpcode r <- ppCode _instrExtraBinopResult incAp <- ppIncAp _instrExtraBinopIncAp - return $ r <+> Str.equal <+> v1 <+> op <+> v2 <> incAp + return $ comment <> r <+> Str.equal <+> v1 <+> op <+> v2 <> incAp ppRel :: Bool -> RValue -> Sem r (Doc Ann) ppRel isRel tgt @@ -148,23 +155,26 @@ ppRel isRel tgt instance PrettyCode InstrJump where ppCode InstrJump {..} = do + comment <- ppComment _instrJumpComment tgt <- ppCode _instrJumpTarget incAp <- ppIncAp _instrJumpIncAp rel <- ppRel _instrJumpRel _instrJumpTarget - return $ Str.jmp <+> rel <> tgt <> incAp + return $ comment <> Str.jmp <+> rel <> tgt <> incAp instance PrettyCode InstrJumpIf where ppCode InstrJumpIf {..} = do + comment <- ppComment _instrJumpIfComment tgt <- ppCode _instrJumpIfTarget v <- ppCode _instrJumpIfValue incAp <- ppIncAp _instrJumpIfIncAp - return $ Str.jmp <+> tgt <+> Str.if_ <+> v <+> Str.notequal <+> annotate AnnLiteralInteger "0" <> incAp + return $ comment <> Str.jmp <+> tgt <+> Str.if_ <+> v <+> Str.notequal <+> annotate AnnLiteralInteger "0" <> incAp instance PrettyCode InstrCall where ppCode InstrCall {..} = do + comment <- ppComment _instrCallComment tgt <- ppCode _instrCallTarget rel <- ppRel _instrCallRel (Val _instrCallTarget) - return $ Str.call <+> rel <> tgt + return $ comment <> Str.call <+> rel <> tgt instance PrettyCode InstrAlloc where ppCode InstrAlloc {..} = do diff --git a/src/Juvix/Compiler/Casm/Transformation/Optimize/Peephole.hs b/src/Juvix/Compiler/Casm/Transformation/Optimize/Peephole.hs index d934de5710..db5953d6e1 100644 --- a/src/Juvix/Compiler/Casm/Transformation/Optimize/Peephole.hs +++ b/src/Juvix/Compiler/Casm/Transformation/Optimize/Peephole.hs @@ -41,7 +41,8 @@ peephole = mapT go let call = InstrCall { _instrCallTarget = tgt, - _instrCallRel = _instrJumpRel + _instrCallRel = _instrJumpRel, + _instrCallComment } in Call call : Return : is is -> is diff --git a/src/Juvix/Compiler/Casm/Translation/FromCairo.hs b/src/Juvix/Compiler/Casm/Translation/FromCairo.hs index 6b9fccee10..5dba9f0a4b 100644 --- a/src/Juvix/Compiler/Casm/Translation/FromCairo.hs +++ b/src/Juvix/Compiler/Casm/Translation/FromCairo.hs @@ -75,7 +75,8 @@ fromCairo elems0 = Call InstrCall { _instrCallRel = _instrPcUpdate == Cairo.PcUpdateJumpRel, - _instrCallTarget = val + _instrCallTarget = val, + _instrCallComment = Nothing } (rval, delta) = decodeRes i elems val = case rval of @@ -110,7 +111,8 @@ fromCairo elems0 = InstrAssign { _instrAssignResult = dst, _instrAssignValue = rval, - _instrAssignIncAp = _instrApUpdate == Cairo.ApUpdateInc + _instrAssignIncAp = _instrApUpdate == Cairo.ApUpdateInc, + _instrAssignComment = Nothing } goNop :: Cairo.Instruction -> [Cairo.Element] -> (Instruction, Int) @@ -136,7 +138,8 @@ fromCairo elems0 = InstrJump { _instrJumpTarget = res, _instrJumpRel = isRel, - _instrJumpIncAp = _instrApUpdate == Cairo.ApUpdateInc + _instrJumpIncAp = _instrApUpdate == Cairo.ApUpdateInc, + _instrJumpComment = Nothing } goJumpIf :: Cairo.Instruction -> [Cairo.Element] -> (Instruction, Int) @@ -159,7 +162,8 @@ fromCairo elems0 = InstrJumpIf { _instrJumpIfTarget = tgt, _instrJumpIfValue = dst, - _instrJumpIfIncAp = _instrApUpdate == Cairo.ApUpdateInc + _instrJumpIfIncAp = _instrApUpdate == Cairo.ApUpdateInc, + _instrJumpIfComment = Nothing } goAlloc :: Cairo.Instruction -> [Cairo.Element] -> (Instruction, Int) diff --git a/src/Juvix/Compiler/Casm/Translation/FromReg.hs b/src/Juvix/Compiler/Casm/Translation/FromReg.hs index 6cd31cb04d..4ad691280f 100644 --- a/src/Juvix/Compiler/Casm/Translation/FromReg.hs +++ b/src/Juvix/Compiler/Casm/Translation/FromReg.hs @@ -14,6 +14,7 @@ import Juvix.Compiler.Casm.Translation.FromReg.CasmBuilder import Juvix.Compiler.Reg.Data.Blocks.InfoTable qualified as Reg import Juvix.Compiler.Reg.Extra.Blocks.Info qualified as Reg import Juvix.Compiler.Reg.Language.Blocks qualified as Reg +import Juvix.Compiler.Reg.Pretty qualified as Reg import Juvix.Compiler.Tree.Evaluator.Builtins qualified as Reg import Juvix.Compiler.Tree.Extra.Rep qualified as Reg import Juvix.Data.Field @@ -141,6 +142,9 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI argsOffset :: Int argsOffset = 3 + ppVarComment :: Reg.VarRef -> Int -> Text + ppVarComment var off = Reg.ppPrint tab var <> " is [fp + " <> show off <> "]" + goFun :: forall r. (Member LabelInfoBuilder r) => StdlibBuiltins -> LabelRef -> (Address, [[Instruction]]) -> Reg.FunctionInfo -> Sem r (Address, [[Instruction]]) goFun blts failLab (addr0, acc) funInfo = do let sym = funInfo ^. Reg.functionSymbol @@ -190,7 +194,9 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI Nothing -> do massert (isJust mout) massert (HashSet.member (fromJust mout) liveVars0) - goCallBlock False Nothing liveVars0 + goAssignApBuiltins + whenJust mout saveLiveVar + goCallBlock mout liveVars0 where output'' :: Instruction -> Sem r () output'' i = do @@ -202,23 +208,25 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI output'' i incAP apOff - goCallBlock :: Bool -> Maybe Reg.VarRef -> HashSet Reg.VarRef -> Sem r () - goCallBlock updatedBuiltins outVar liveVars = do - let liveVars' = toList (maybe liveVars (`HashSet.delete` liveVars) outVar) + saveLiveVar :: Reg.VarRef -> Sem r () + saveLiveVar var = do + ref <- mkMemRef var + let comment = Reg.ppPrint tab var + goAssignAp' (Just comment) (Val (Ref ref)) + + -- The `goCallBlock` function is used to switch to a new basic block. + -- Assumes that the builtins pointer and outVar (if present) were + -- already saved (in this order). + goCallBlock :: Maybe Reg.VarRef -> HashSet Reg.VarRef -> Sem r () + goCallBlock outVar liveVars = do + let liveVars' = sort $ toList (maybe liveVars (`HashSet.delete` liveVars) outVar) n = length liveVars' - bltOff = - if - | updatedBuiltins -> - -argsOffset - n - fromEnum (isJust outVar) - | otherwise -> - -argsOffset - n + bltOff = -argsOffset - n - fromEnum (isJust outVar) vars = HashMap.fromList $ - maybe [] (\var -> [(var, -argsOffset - n - if updatedBuiltins then 0 else 1)]) outVar + maybe [] (\var -> [(var, -argsOffset - n)]) outVar ++ zipWithExact (\var k -> (var, -argsOffset - k)) liveVars' [0 .. n - 1] - unless updatedBuiltins $ - goAssignApBuiltins - mapM_ (mkMemRef >=> goAssignAp . Val . Ref) (reverse liveVars') + mapM_ saveLiveVar (reverse liveVars') output'' (mkCallRel $ Imm 3) output'' Return -- we need the Nop instruction to ensure that the relative call offset @@ -295,11 +303,15 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI goAssignVar vr val = do off <- getAP insertVar vr off - goAssignAp val + let comment = ppVarComment vr off + goAssignAp' (Just comment) val + + goAssignAp' :: Maybe Text -> RValue -> Sem r () + goAssignAp' comment val = do + output' 1 (mkAssignAp' comment val) goAssignAp :: RValue -> Sem r () - goAssignAp val = do - output' 1 (mkAssignAp val) + goAssignAp = goAssignAp' Nothing goAssignValue :: Reg.VarRef -> Reg.Value -> Sem r () goAssignValue vr v = mkRValue v >>= goAssignVar vr @@ -308,7 +320,7 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI goAssignApValue v = mkRValue v >>= goAssignAp goAssignApBuiltins :: Sem r () - goAssignApBuiltins = mkBuiltinRef >>= goAssignAp . Val . Ref + goAssignApBuiltins = mkBuiltinRef >>= goAssignAp' (Just "builtins pointer") . Val . Ref -- Warning: the result may depend on Ap. Use adjustAp when changing Ap -- afterwards. @@ -334,7 +346,8 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI _instrExtraBinopResult = MemRef Ap 0, _instrExtraBinopArg1 = arg1, _instrExtraBinopArg2 = arg2, - _instrExtraBinopIncAp = True + _instrExtraBinopIncAp = True, + _instrExtraBinopComment = Just (ppVarComment res off) } goNativeBinop :: Opcode -> Reg.VarRef -> MemRef -> Value -> Sem r () @@ -370,7 +383,8 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI _binopValueArg2 = Imm 1, _binopValueOpcode = FieldAdd }, - _instrAssignIncAp = True + _instrAssignIncAp = True, + _instrAssignComment = Nothing } Lab {} -> impossible @@ -557,7 +571,11 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI val <- mkMemRef _instrExtendClosureValue goAssignAp (Val $ Ref val) output'' $ mkCallRel $ Lab $ LabelRef (blts ^. stdlibExtendClosure) (Just (blts ^. stdlibExtendClosureName)) - goCallBlock False (Just _instrExtendClosureResult) liveVars + -- the `juvix_extend_closure` runtime function does not accept or + -- return the builtins pointer + goAssignApBuiltins + goAssignAp (Val $ Ref $ MemRef Ap (-2)) + goCallBlock (Just _instrExtendClosureResult) liveVars goCall' :: Reg.CallType -> [Reg.Value] -> Sem r () goCall' ct args = case ct of @@ -577,7 +595,7 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI goCall :: HashSet Reg.VarRef -> Reg.InstrCall -> Sem r () goCall liveVars Reg.InstrCall {..} = do goCall' _instrCallType _instrCallArgs - goCallBlock True (Just _instrCallResult) liveVars + goCallBlock (Just _instrCallResult) liveVars -- There is no way to make "proper" tail calls in Cairo, because -- the only way to set the `fp` register is via the `call` instruction. diff --git a/src/Juvix/Compiler/Casm/Translation/FromSource.hs b/src/Juvix/Compiler/Casm/Translation/FromSource.hs index 9568237d99..ae3b35a0e6 100644 --- a/src/Juvix/Compiler/Casm/Translation/FromSource.hs +++ b/src/Juvix/Compiler/Casm/Translation/FromSource.hs @@ -222,7 +222,8 @@ parseJump = do InstrJumpIf { _instrJumpIfTarget = tgt, _instrJumpIfValue = v, - _instrJumpIfIncAp = incAp + _instrJumpIfIncAp = incAp, + _instrJumpIfComment = Nothing } jmp :: ParsecS r Instruction @@ -235,7 +236,8 @@ parseJump = do InstrJump { _instrJumpTarget = tgt, _instrJumpRel = isRel, - _instrJumpIncAp = incAp + _instrJumpIncAp = incAp, + _instrJumpComment = Nothing } parseCall :: (Member LabelInfoBuilder r) => ParsecS r Instruction @@ -243,7 +245,13 @@ parseCall = do kw kwCall isRel <- parseRel v <- parseValue - return $ Call $ InstrCall {_instrCallTarget = v, _instrCallRel = isRel} + return $ + Call $ + InstrCall + { _instrCallTarget = v, + _instrCallRel = isRel, + _instrCallComment = Nothing + } parseReturn :: ParsecS r Instruction parseReturn = do @@ -277,7 +285,8 @@ parseAssign = do InstrAssign { _instrAssignValue = v, _instrAssignResult = res, - _instrAssignIncAp = incAp + _instrAssignIncAp = incAp, + _instrAssignComment = Nothing } extraBinop :: MemRef -> ParsecS r Instruction @@ -293,7 +302,8 @@ parseAssign = do _instrExtraBinopArg2 = arg2, _instrExtraBinopOpcode = op, _instrExtraBinopResult = res, - _instrExtraBinopIncAp = incAp + _instrExtraBinopIncAp = incAp, + _instrExtraBinopComment = Nothing } parseExtraValue :: ExtraOpcode -> ParsecS r Value diff --git a/src/Juvix/Compiler/Concrete/Data/Highlight.hs b/src/Juvix/Compiler/Concrete/Data/Highlight.hs index da8385b993..4efe6443d0 100644 --- a/src/Juvix/Compiler/Concrete/Data/Highlight.hs +++ b/src/Juvix/Compiler/Concrete/Data/Highlight.hs @@ -44,12 +44,23 @@ buildProperties HighlightInput {..} = <> mapMaybe goFaceName _highlightNames <> map goFaceError _highlightErrors, _propertiesGoto = map goGotoProperty _highlightNames, + _propertiesTopDef = nubHashable (mapMaybe goDefProperty _highlightNames), _propertiesInfo = mapMaybe (goDocProperty _highlightDocTable _highlightTypes) _highlightNames } goFaceError :: Interval -> WithLoc PropertyFace goFaceError i = WithLoc i (PropertyFace FaceError) +goDefProperty :: AName -> Maybe (WithLoc PropertyTopDef) +goDefProperty n = do + guard (n ^. anameIsTop) + guard ((n ^. anameLoc) == (n ^. anameDefinedLoc)) + return + WithLoc + { _withLocInt = n ^. anameLoc, + _withLocParam = PropertyTopDef (n ^. anameVerbatim) + } + goFaceSemanticItem :: SemanticItem -> Maybe (WithLoc PropertyFace) goFaceSemanticItem i = WithLoc (getLoc i) . PropertyFace <$> f where diff --git a/src/Juvix/Compiler/Concrete/Data/Highlight/Builder.hs b/src/Juvix/Compiler/Concrete/Data/Highlight/Builder.hs index 97fb216d4f..e857f7e764 100644 --- a/src/Juvix/Compiler/Concrete/Data/Highlight/Builder.hs +++ b/src/Juvix/Compiler/Concrete/Data/Highlight/Builder.hs @@ -34,8 +34,8 @@ runHighlightBuilder = reinterpret (runStateShared emptyHighlightInput) $ \case HighlightMergeDocTable tbl -> modifyShared (over highlightDocTable (HashMap.union tbl)) GetDocTable uid -> filterByTopModule uid <$> getsShared (^. highlightDocTable) -ignoreHighlightBuilder :: Sem (HighlightBuilder ': r) a -> Sem r a -ignoreHighlightBuilder = fmap snd . runHighlightBuilder +evalHighlightBuilder :: Sem (HighlightBuilder ': r) a -> Sem r a +evalHighlightBuilder = fmap snd . runHighlightBuilder runJuvixError :: (Members '[HighlightBuilder] r) => Sem (Error JuvixError ': r) a -> Sem r (Either JuvixError a) runJuvixError m = do diff --git a/src/Juvix/Compiler/Concrete/Data/InfoTableBuilder.hs b/src/Juvix/Compiler/Concrete/Data/InfoTableBuilder.hs index 147a971e25..fbb4d44358 100644 --- a/src/Juvix/Compiler/Concrete/Data/InfoTableBuilder.hs +++ b/src/Juvix/Compiler/Concrete/Data/InfoTableBuilder.hs @@ -15,8 +15,8 @@ data InfoTableBuilder :: Effect where RegisterConstructor :: ConstructorDef 'Scoped -> InfoTableBuilder m () RegisterInductive :: InductiveDef 'Scoped -> InfoTableBuilder m () RegisterFunctionDef :: FunctionDef 'Scoped -> InfoTableBuilder m () - RegisterName :: (HasLoc c) => S.Name' c -> InfoTableBuilder m () - RegisterScopedIden :: ScopedIden -> InfoTableBuilder m () + RegisterName :: (HasLoc c) => Bool -> S.Name' c -> InfoTableBuilder m () + RegisterScopedIden :: Bool -> ScopedIden -> InfoTableBuilder m () RegisterModuleDoc :: S.NameId -> Maybe (Judoc 'Scoped) -> InfoTableBuilder m () RegisterFixity :: FixityDef -> InfoTableBuilder m () RegisterPrecedence :: S.NameId -> S.NameId -> InfoTableBuilder m () @@ -65,8 +65,8 @@ runInfoTableBuilder ini = reinterpret (runState ini) $ \case fid = f ^. functionDefName . functionDefNameScoped . nameId modify' (over infoFunctions (HashMap.insert fid f)) highlightDoc fid j - RegisterName n -> highlightName (S.anameFromName n) - RegisterScopedIden n -> highlightName (anameFromScopedIden n) + RegisterName isTop n -> highlightName (S.anameFromName isTop n) + RegisterScopedIden isTop n -> highlightName (anameFromScopedIden isTop n) RegisterModuleDoc uid doc -> highlightDoc uid doc RegisterFixity f -> do let sid = f ^. fixityDefSymbol . S.nameId @@ -138,15 +138,16 @@ registerBuiltinHelper b n = do } runInfoTableBuilderRepl :: (Members '[Error ScoperError] r) => InfoTable -> Sem (InfoTableBuilder ': r) a -> Sem r (InfoTable, a) -runInfoTableBuilderRepl tab = ignoreHighlightBuilder . runInfoTableBuilder tab . raiseUnder +runInfoTableBuilderRepl tab = evalHighlightBuilder . runInfoTableBuilder tab . raiseUnder ignoreInfoTableBuilder :: (Members '[Error ScoperError, HighlightBuilder] r) => Sem (InfoTableBuilder ': r) a -> Sem r a ignoreInfoTableBuilder = fmap snd . runInfoTableBuilder mempty -anameFromScopedIden :: ScopedIden -> AName -anameFromScopedIden s = +anameFromScopedIden :: Bool -> ScopedIden -> AName +anameFromScopedIden isTop s = AName { _anameLoc = getLoc s, + _anameIsTop = isTop, _anameKindPretty = getNameKindPretty s, _anameDocId = s ^. scopedIdenFinal . nameId, _anameDefinedLoc = s ^. scopedIdenSrcName . nameDefined, diff --git a/src/Juvix/Compiler/Concrete/Data/ScopedName.hs b/src/Juvix/Compiler/Concrete/Data/ScopedName.hs index 62378d0282..c19d0f7b4e 100644 --- a/src/Juvix/Compiler/Concrete/Data/ScopedName.hs +++ b/src/Juvix/Compiler/Concrete/Data/ScopedName.hs @@ -106,6 +106,7 @@ data AName = AName { _anameLoc :: Interval, _anameDefinedLoc :: Interval, _anameKindPretty :: NameKind, + _anameIsTop :: Bool, _anameDocId :: NameId, _anameVerbatim :: Text } @@ -118,13 +119,14 @@ instance NFData AName makeLenses ''Name' makeLenses ''AName -anameFromName :: (HasLoc c) => Name' c -> AName -anameFromName n = +anameFromName :: (HasLoc c) => Bool -> Name' c -> AName +anameFromName isTop n = AName { _anameLoc = getLoc n, _anameDefinedLoc = n ^. nameDefined, _anameKindPretty = getNameKindPretty n, _anameDocId = n ^. nameId, + _anameIsTop = isTop, _anameVerbatim = n ^. nameVerbatim } diff --git a/src/Juvix/Compiler/Concrete/Translation/FromParsed.hs b/src/Juvix/Compiler/Concrete/Translation/FromParsed.hs index beae4e8189..0c73734a88 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromParsed.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromParsed.hs @@ -10,7 +10,6 @@ import Juvix.Compiler.Concrete.Language import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Data.Context import Juvix.Compiler.Concrete.Translation.FromSource.Data.Context qualified as Parsed -import Juvix.Compiler.Pipeline.EntryPoint import Juvix.Compiler.Store.Extra import Juvix.Compiler.Store.Language import Juvix.Prelude diff --git a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs index 006144e12a..e1d2747508 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs @@ -24,7 +24,6 @@ import Juvix.Compiler.Concrete.Pretty (ppTrace) import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Data.Context import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Error import Juvix.Compiler.Concrete.Translation.FromSource.Data.Context qualified as Parser -import Juvix.Compiler.Pipeline.EntryPoint import Juvix.Compiler.Store.Scoped.Language as Store import Juvix.Data.FixityInfo qualified as FI import Juvix.Prelude @@ -106,7 +105,7 @@ scopeCheckRepl :: Sem r b scopeCheckRepl check importTab tab a = mapError (JuvixError @ScoperError) - . ignoreHighlightBuilder + . evalHighlightBuilder . evalInfoTableBuilder tab . runReader iniScopeParameters . runReader tab' @@ -284,7 +283,10 @@ reserveSymbolOfNameSpace ns kind kindPretty nameSig builtin s = do whenJust nameSig (modify' . set (scoperNameSignatures . at (s' ^. S.nameId)) . Just) whenJust nameSig (registerParsedNameSig (s' ^. S.nameId)) modify (set (scopeNameSpaceLocal sns . at s) (Just s')) - registerName s' + let isTop = case strat of + BindingLocal -> False + BindingTop -> True + registerName isTop s' let u = S.unqualifiedSymbol s' entry :: NameSpaceEntryType ns entry = @@ -644,8 +646,8 @@ checkImportNoPublic import_@Import {..} = do qual' = do asName <- _importAsName return (set S.nameConcrete asName sname') - registerName importName - whenJust synonymName registerName + registerName False importName + whenJust synonymName (registerName False) registerScoperModules scopedModule importOpen' <- mapM (checkOpenModuleShort scopedModule) _importOpen usingHiding' <- mapM (checkUsingHiding importName exportInfoOriginal) _importUsingHiding @@ -852,7 +854,7 @@ entryToScopedIden name e = do { _scopedIdenAlias = Just scopedName', _scopedIdenFinal = helper (e' ^. symbolEntry) } - registerScopedIden si + registerScopedIden False si return si -- | We gather all symbols which have been defined or marked to be public in the given scope. @@ -956,12 +958,11 @@ checkFixityInfo ParsedFixityInfo {..} = do getModuleId :: forall r. (Member (Reader PackageId) r) => TopModulePathKey -> Sem r ModuleId getModuleId path = do - pkg <- ask + pkgId <- ask return ModuleId { _moduleIdPath = path, - _moduleIdPackage = pkg ^. packageIdName, - _moduleIdPackageVersion = show (pkg ^. packageIdVersion) + _moduleIdPackageId = pkgId } checkFixitySyntaxDef :: @@ -1492,7 +1493,7 @@ checkTopModule m@Module {..} = checkedModule _nameIterator :: Maybe IteratorInfo _nameIterator = Nothing moduleName = S.Name' {..} - registerName moduleName + registerName True moduleName return moduleName iniScope :: Scope @@ -2007,7 +2008,7 @@ checkLocalModule md@Module {..} = do } modify (over scoperModules (HashMap.insert mid smod)) registerLocalModule smod - registerName _modulePath' + registerName True _modulePath' return m where inheritScope :: (Members '[Error ScoperError, State Scope, Reader ScopeParameters, State ScoperState, InfoTableBuilder, Reader InfoTable, NameIdGen, Reader PackageId, Reader BindingStrategy] r') => Sem r' () @@ -2111,7 +2112,7 @@ checkUsingHiding modulepath exportInfo = \case } entry <- maybe err return mentry let scopedSym = entryToSymbol entry s - registerName scopedSym + registerName False scopedSym return scopedSym checkHidingList :: HidingList 'Parsed -> Sem r (HidingList 'Scoped) @@ -2157,7 +2158,7 @@ checkUsingHiding modulepath exportInfo = \case let scopedAs = do c <- i ^. usingAs return (set S.nameConcrete c scopedSym) - mapM_ registerName scopedAs + mapM_ (registerName False) scopedAs return UsingItem { _usingSymbol = scopedSym, @@ -2174,7 +2175,7 @@ checkOpenModuleHelper :: Sem r (OpenModule 'Scoped short) checkOpenModuleHelper openedModule OpenModule {..} = do let exportInfo = openedModule ^. scopedModuleExportInfo - registerName (openedModule ^. scopedModuleName) + registerName False (openedModule ^. scopedModuleName) usingHiding' <- mapM (checkUsingHiding (openedModule ^. scopedModulePath) exportInfo) _openModuleUsingHiding mergeScope (filterExportInfo _openModulePublic usingHiding' exportInfo) let openName :: OpenModuleNameType 'Scoped short = case sing :: SIsOpenShort short of @@ -2711,7 +2712,7 @@ checkFixitySymbol s = do [] -> throw (ErrSymNotInScope (NotInScope s scope)) [x] -> do let res = entryToSymbol x s - registerName res + registerName False res return res es -> throw (ErrAmbiguousSym (AmbiguousSym n (map (PreSymbolFinal . SymbolEntry . (^. fixityEntry)) es))) where @@ -3214,7 +3215,7 @@ checkJudoc :: Judoc 'Parsed -> Sem r (Judoc 'Scoped) checkJudoc (Judoc groups) = - ignoreHighlightBuilder + evalHighlightBuilder . ignoreInfoTableBuilder $ Judoc <$> mapM checkJudocGroup groups diff --git a/src/Juvix/Compiler/Concrete/Translation/FromSource.hs b/src/Juvix/Compiler/Concrete/Translation/FromSource.hs index 47d485b522..df062611b7 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromSource.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromSource.hs @@ -17,7 +17,7 @@ import Data.Text qualified as Text import Juvix.Compiler.Backend.Markdown.Data.Types (Mk (..)) import Juvix.Compiler.Backend.Markdown.Data.Types qualified as MK import Juvix.Compiler.Backend.Markdown.Error -import Juvix.Compiler.Concrete (HighlightBuilder, ignoreHighlightBuilder) +import Juvix.Compiler.Concrete (HighlightBuilder, evalHighlightBuilder) import Juvix.Compiler.Concrete.Extra (takeWhile1P) import Juvix.Compiler.Concrete.Extra qualified as P import Juvix.Compiler.Concrete.Gen qualified as Gen @@ -294,7 +294,7 @@ runExpressionParser :: Sem r (Either ParserError (ExpressionAtoms 'Parsed)) runExpressionParser fpath input_ = do m <- - ignoreHighlightBuilder + evalHighlightBuilder . evalParserResultBuilder mempty . evalState (Nothing @ParsedPragmas) . evalState (Nothing @(Judoc 'Parsed)) diff --git a/src/Juvix/Compiler/Concrete/Translation/FromSource/ParserResultBuilder.hs b/src/Juvix/Compiler/Concrete/Translation/FromSource/ParserResultBuilder.hs index f4b4c4234f..96cac9db12 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromSource/ParserResultBuilder.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromSource/ParserResultBuilder.hs @@ -95,12 +95,14 @@ runParserResultBuilder s = registerItem' i RegisterSpaceSpan g -> do modify' (over parserStateComments (g :)) - forM_ (g ^.. spaceSpan . each . _SpaceComment) $ \c -> - registerItem' - ParsedItem - { _parsedLoc = getLoc c, - _parsedTag = ParsedTagComment - } + forM_ (g ^.. spaceSpan . each . _SpaceComment) $ \c -> do + let i = + ParsedItem + { _parsedLoc = getLoc c, + _parsedTag = ParsedTagComment + } + highlightParsedItem i + registerItem' i ignoreParserResultBuilder :: Sem (ParserResultBuilder ': r) a -> Sem r a ignoreParserResultBuilder = interpret $ \case diff --git a/src/Juvix/Compiler/Concrete/Translation/ImportScanner/Megaparsec.hs b/src/Juvix/Compiler/Concrete/Translation/ImportScanner/Megaparsec.hs index 1cf14012a0..e44bf8fd83 100644 --- a/src/Juvix/Compiler/Concrete/Translation/ImportScanner/Megaparsec.hs +++ b/src/Juvix/Compiler/Concrete/Translation/ImportScanner/Megaparsec.hs @@ -21,7 +21,7 @@ scanBSImports :: Sem r ScanResult scanBSImports fp inputBS = do st <- - ignoreHighlightBuilder + evalHighlightBuilder . execParserResultBuilder mempty . ignoreTopModuleNameChecker $ runModuleParser fp (decodeUtf8 inputBS) diff --git a/src/Juvix/Compiler/Core/Data/InfoTable/Base.hs b/src/Juvix/Compiler/Core/Data/InfoTable/Base.hs index 9773f8ae08..83cdc8a173 100644 --- a/src/Juvix/Compiler/Core/Data/InfoTable/Base.hs +++ b/src/Juvix/Compiler/Core/Data/InfoTable/Base.hs @@ -2,7 +2,6 @@ module Juvix.Compiler.Core.Data.InfoTable.Base where import Juvix.Compiler.Concrete.Data.Builtins import Juvix.Compiler.Core.Language.Base -import Juvix.Extra.Serialize data InfoTable' n = InfoTable { _identContext :: HashMap Symbol n, diff --git a/src/Juvix/Compiler/Core/Data/Module.hs b/src/Juvix/Compiler/Core/Data/Module.hs index 6c3baee651..fead44a112 100644 --- a/src/Juvix/Compiler/Core/Data/Module.hs +++ b/src/Juvix/Compiler/Core/Data/Module.hs @@ -6,6 +6,7 @@ where import Juvix.Compiler.Core.Data.InfoTable import Juvix.Compiler.Core.Language +import Juvix.Compiler.Core.Pretty data Module = Module { _moduleId :: ModuleId, @@ -64,17 +65,20 @@ lookupSpecialisationInfo Module {..} sym = lookupTabSpecialisationInfo' _moduleInfoTable sym <|> lookupTabSpecialisationInfo' _moduleImportsTable sym +impossibleSymbolNotFound :: Symbol -> a +impossibleSymbolNotFound sym = impossibleError ("Could not find symbol " <> ppTrace sym) + lookupInductiveInfo :: Module -> Symbol -> InductiveInfo -lookupInductiveInfo m sym = fromJust $ lookupInductiveInfo' m sym +lookupInductiveInfo m sym = fromMaybe (impossibleSymbolNotFound sym) (lookupInductiveInfo' m sym) lookupConstructorInfo :: Module -> Tag -> ConstructorInfo -lookupConstructorInfo m tag = fromJust $ lookupConstructorInfo' m tag +lookupConstructorInfo m tag = fromJust (lookupConstructorInfo' m tag) lookupIdentifierInfo :: Module -> Symbol -> IdentifierInfo -lookupIdentifierInfo m sym = fromJust $ lookupIdentifierInfo' m sym +lookupIdentifierInfo m sym = fromMaybe (impossibleSymbolNotFound sym) (lookupIdentifierInfo' m sym) lookupIdentifierNode :: Module -> Symbol -> Node -lookupIdentifierNode m sym = fromJust $ lookupIdentifierNode' m sym +lookupIdentifierNode m sym = fromMaybe (impossibleSymbolNotFound sym) (lookupIdentifierNode' m sym) lookupBuiltinInductive :: Module -> BuiltinInductive -> Maybe InductiveInfo lookupBuiltinInductive Module {..} b = diff --git a/src/Juvix/Compiler/Core/Language/Primitives.hs b/src/Juvix/Compiler/Core/Language/Primitives.hs index 19fb5ba6a5..3cbd68d55c 100644 --- a/src/Juvix/Compiler/Core/Language/Primitives.hs +++ b/src/Juvix/Compiler/Core/Language/Primitives.hs @@ -7,7 +7,6 @@ represented by booleans, any type isomorphic to unary natural numbers may be represented by integers with minimum value 0. -} import Juvix.Compiler.Core.Language.Base -import Juvix.Extra.Serialize -- | Primitive type representation. data Primitive diff --git a/src/Juvix/Compiler/Core/Pretty/Base.hs b/src/Juvix/Compiler/Core/Pretty/Base.hs index 57af9cb552..e602a4e09f 100644 --- a/src/Juvix/Compiler/Core/Pretty/Base.hs +++ b/src/Juvix/Compiler/Core/Pretty/Base.hs @@ -100,6 +100,12 @@ instance PrettyCode Tag where BuiltinTag tag -> ppCode tag UserTag (TagUser mid tag) -> return $ kwUnnamedConstr <> pretty tag <> "@" <> pretty mid +instance PrettyCode ModuleId where + ppCode = return . pretty + +instance PrettyCode Symbol where + ppCode = return . pretty + instance PrettyCode Primitive where ppCode = \case p@(PrimInteger _) | p == primitiveUInt8 -> return $ annotate (AnnKind KNameInductive) (pretty ("UInt8" :: String)) @@ -568,7 +574,7 @@ instance PrettyCode InfoTable where ppCode :: forall r. (Member (Reader Options) r) => InfoTable -> Sem r (Doc Ann) ppCode tbl = do let header x = annotate AnnImportant (Str.commentLineStart <+> x) <> line - tys <- ppInductives (toList (tbl ^. infoInductives)) + tys <- ppInductives (sortOn (^. inductiveSymbol) $ toList (tbl ^. infoInductives)) sigs <- ppSigs (sortOn (^. identifierSymbol) $ toList (tbl ^. infoIdentifiers)) ctx' <- ppContext (tbl ^. identContext) axioms <- vsep <$> mapM ppCode (tbl ^. infoAxioms) diff --git a/src/Juvix/Compiler/Internal/Translation/Repl.hs b/src/Juvix/Compiler/Internal/Translation/Repl.hs index d4ab9aefa1..1562eb58bd 100644 --- a/src/Juvix/Compiler/Internal/Translation/Repl.hs +++ b/src/Juvix/Compiler/Internal/Translation/Repl.hs @@ -24,7 +24,7 @@ typeCheckExpressionType exp = do stable <- gets (^. artifactScopeTable) runResultBuilderArtifacts . runNameIdGenArtifacts - . ignoreHighlightBuilder + . evalHighlightBuilder . runReader table . runReader (stable ^. infoBuiltins) . runReader stable diff --git a/src/Juvix/Compiler/Nockma/AnomaLib.hs b/src/Juvix/Compiler/Nockma/AnomaLib.hs index fc57de712e..d6548156e9 100644 --- a/src/Juvix/Compiler/Nockma/AnomaLib.hs +++ b/src/Juvix/Compiler/Nockma/AnomaLib.hs @@ -111,10 +111,10 @@ anomaLibPath = \case RmProveLogic -> [nock| [9 342 0 1] |] RmProveAction -> [nock| [9 22 0 1] |] RmDeltaAdd -> [nock| [9 92 0 1] |] - RmDeltaSub -> [nock| [9 763 0 1] |] + RmDeltaSub -> [nock| [9 1.527 0 1] |] RmResourceDelta -> [nock| [9 343 0 1] |] RmActionDelta -> [nock| [9 4 0 1] |] - RmMakeDelta -> [nock| [9 372 0 1] |] + RmMakeDelta -> [nock| [9 1.494 0 1] |] RmProveDelta -> [nock| [9 1.535 0 1] |] AnomaLibValue (AnomaRmValue v) -> case v of RmZeroDelta -> [nock| [9 20 0 1] |] diff --git a/src/Juvix/Compiler/Nockma/Highlight.hs b/src/Juvix/Compiler/Nockma/Highlight.hs index acce27b9dd..17fd36b3bc 100644 --- a/src/Juvix/Compiler/Nockma/Highlight.hs +++ b/src/Juvix/Compiler/Nockma/Highlight.hs @@ -25,6 +25,7 @@ buildProperties HighlightInput {..} = mapMaybe goFaceSemanticItem _highlightSemanticItems <> map goFaceError _highlightErrors, _propertiesGoto = [], + _propertiesTopDef = [], _propertiesInfo = map goInfoNockOp _highlightNockOps <> map goInfoPath _highlightPaths } diff --git a/src/Juvix/Compiler/Nockma/Highlight/Input.hs b/src/Juvix/Compiler/Nockma/Highlight/Input.hs index 2c53d70867..fca8d4da6e 100644 --- a/src/Juvix/Compiler/Nockma/Highlight/Input.hs +++ b/src/Juvix/Compiler/Nockma/Highlight/Input.hs @@ -39,8 +39,8 @@ data HighlightBuilder :: Effect where makeSem ''HighlightBuilder -ignoreHighlightBuilder :: Sem (HighlightBuilder ': r) a -> Sem r a -ignoreHighlightBuilder = interpret $ \case +evalHighlightBuilder :: Sem (HighlightBuilder ': r) a -> Sem r a +evalHighlightBuilder = interpret $ \case HighlightItem {} -> return () HighlightNockOp {} -> return () HighlightPath {} -> return () diff --git a/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs b/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs index 917919fa97..ca715fc001 100644 --- a/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs +++ b/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs @@ -40,7 +40,7 @@ cueJammedFileOrPretty :: Prelude.Path Abs File -> Sem r (Term Natural) cueJammedFileOrPretty f - | f `hasExtensions` nockmaDebugFileExts = ignoreHighlightBuilder (parseTermFile f) + | f `hasExtensions` nockmaDebugFileExts = evalHighlightBuilder (parseTermFile f) | otherwise = cueJammedFile f -- | If the file ends in .debug.nockma it parses an annotated unjammed program. Otherwise @@ -114,7 +114,7 @@ runParserForSem p f txt = do Right t -> return t runParserFor :: Parser a -> Prelude.Path Abs File -> Text -> Either MegaparsecError a -runParserFor p f = run . ignoreHighlightBuilder . runError . runParserForSem p f +runParserFor p f = run . evalHighlightBuilder . runError . runParserForSem p f runParser :: Prelude.Path Abs File -> Text -> Either MegaparsecError (Term Natural) runParser = runParserFor term diff --git a/src/Juvix/Compiler/Pipeline/Driver.hs b/src/Juvix/Compiler/Pipeline/Driver.hs index 3fcb3a508e..7bdb65907a 100644 --- a/src/Juvix/Compiler/Pipeline/Driver.hs +++ b/src/Juvix/Compiler/Pipeline/Driver.hs @@ -274,7 +274,7 @@ processModuleCacheMiss entryIx = do return r ProcessModuleRecompile recomp -> recomp ^. recompileDo -processProject :: (Members '[ModuleInfoCache, Reader EntryPoint, Reader ImportTree] r) => Sem r [(ImportNode, PipelineResult ModuleInfo)] +processProject :: (Members '[PathResolver, ModuleInfoCache, Reader EntryPoint, Reader ImportTree] r) => Sem r [(ImportNode, PipelineResult ModuleInfo)] processProject = do rootDir <- asks (^. entryPointRoot) nodes <- toList <$> asks (importTreeProjectNodes rootDir) @@ -312,10 +312,13 @@ processRecursiveUpToTyped = do where goImport :: ImportNode -> Sem r InternalTypedResult goImport node = do + pkgInfo <- fromJust . HashMap.lookup (node ^. importNodePackageRoot) <$> getPackageInfos + let pid = pkgInfo ^. packageInfoPackageId entry <- ask let entry' = entry { _entryPointStdin = Nothing, + _entryPointPackageId = pid, _entryPointModulePath = Just (node ^. importNodeAbsFile) } (^. pipelineResult) <$> runReader entry' (processFileUpTo upToInternalTyped) diff --git a/src/Juvix/Compiler/Pipeline/DriverParallel.hs b/src/Juvix/Compiler/Pipeline/DriverParallel.hs index c06aa10930..395856a6bf 100644 --- a/src/Juvix/Compiler/Pipeline/DriverParallel.hs +++ b/src/Juvix/Compiler/Pipeline/DriverParallel.hs @@ -33,7 +33,7 @@ type Node = EntryIndex mkNodesIndex :: forall r. - (Members '[Reader EntryPoint] r) => + (Members '[PathResolver, Reader EntryPoint] r) => ImportTree -> Sem r (NodesIndex ImportNode Node) mkNodesIndex tree = diff --git a/src/Juvix/Compiler/Pipeline/Loader/PathResolver.hs b/src/Juvix/Compiler/Pipeline/Loader/PathResolver.hs index 8f0b8cb5c3..39f7018b0c 100644 --- a/src/Juvix/Compiler/Pipeline/Loader/PathResolver.hs +++ b/src/Juvix/Compiler/Pipeline/Loader/PathResolver.hs @@ -10,11 +10,16 @@ module Juvix.Compiler.Pipeline.Loader.PathResolver runPathResolverPipe', evalPathResolverPipe, findPackageJuvixFiles, + importNodePackageId, + mkPackageInfoPackageId, + checkConflicts, ) where import Data.HashMap.Strict qualified as HashMap import Data.HashSet qualified as HashSet +import Data.List.NonEmpty.Extra qualified as NonEmpty +import Data.Versions qualified as Ver import Juvix.Compiler.Concrete.Data.Name import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Error import Juvix.Compiler.Concrete.Translation.ImportScanner @@ -36,6 +41,23 @@ import Juvix.Extra.Paths import Juvix.Extra.Stdlib (ensureStdlib) import Juvix.Prelude +checkConflicts :: forall r'. (Members '[Error JuvixError] r') => [PackageInfo] -> Sem r' () +checkConflicts pkgs = do + let reps = findRepeatedOn (^. packageInfoPackageId) pkgs + case nonEmpty reps of + Just (rep :| _) -> errRep rep + Nothing -> return () + where + errRep :: (NonEmpty PackageInfo, PackageId) -> Sem r' () + errRep (l, pid) = + throw + . JuvixError + $ ErrAmbiguousPackageId + AmbiguousPackageId + { _ambiguousPackageId = pid, + _ambiguousPackageIdPackages = l + } + mkPackage :: forall r. (Members '[Files, Error JuvixError, Reader ResolverEnv, DependencyResolver, EvalFileEff] r) => @@ -55,6 +77,35 @@ findPackageJuvixFiles pkgRoot = map (fromJust . stripProperPrefix pkgRoot) <$> w newJuvixFiles :: [Path Abs File] newJuvixFiles = [cd f | f <- files, isJuvixOrJuvixMdFile f, not (isPackageFile f)] +-- | Append the hash of all files in the project to the pre-release +mkPackageInfoPackageId :: (Members '[Files] r) => Path Abs Dir -> [Path Rel File] -> PackageLike -> Sem r PackageId +mkPackageInfoPackageId root pkgRelFiles pkgLike = do + let pkgDotJuvix = mkPackageFilePath root + pkgDotJuvixExists <- fileExists' pkgDotJuvix + let pkgJuvixFiles = [root rFile | rFile <- pkgRelFiles] + let baseVersion = packageLikeVersion pkgLike + allFiles + | pkgDotJuvixExists = pkgDotJuvix : pkgJuvixFiles + | otherwise = pkgJuvixFiles + filesHash <- SHA256.digestFiles allFiles + let version = case Ver._svPreRel baseVersion of + Nothing -> + baseVersion {_svPreRel = Just (Ver.Release (pure (Ver.Alphanum filesHash)))} + Just (Ver.Release r) -> baseVersion {_svPreRel = Just (Ver.Release (NonEmpty.snoc r (Ver.Alphanum filesHash)))} + return + PackageId + { _packageIdName = pkgLike ^. packageLikeName, + _packageIdVersion = version + } + where + packageLikeVersion :: PackageLike -> SemVer + packageLikeVersion = \case + PackageReal pkg -> pkg ^. packageVersion + PackageStdlibInGlobalPackage -> defaultVersion + PackageBase {} -> defaultVersion + PackageType {} -> defaultVersion + PackageDotJuvix {} -> defaultVersion + mkPackageInfo :: forall r. (Members '[TaggedLock, Files, Error JuvixError, Error DependencyError, Reader ResolverEnv, DependencyResolver] r) => @@ -78,6 +129,7 @@ mkPackageInfo mpackageEntry _packageRoot pkg = do : globalPackageBaseAbsDir : _packageRoot : depsPaths + _packageInfoPackageId <- mkPackageInfoPackageId _packageRoot (toList _packageJuvixRelativeFiles) _packagePackage return PackageInfo {..} where pkgFile :: Path Abs File @@ -117,17 +169,16 @@ mkPackageInfo mpackageEntry _packageRoot pkg = do checkDep d = unless (mkName d `HashSet.member` lockfileDepNames) - ( throw - DependencyError - { _dependencyErrorPackageFile = pkgFile, - _dependencyErrorCause = - MissingLockfileDependencyError - MissingLockfileDependency - { _missingLockfileDependencyDependency = d, - _missingLockfileDependencyPath = lf ^. lockfileInfoPath - } - } - ) + $ throw + DependencyError + { _dependencyErrorPackageFile = pkgFile, + _dependencyErrorCause = + MissingLockfileDependencyError + MissingLockfileDependency + { _missingLockfileDependencyDependency = d, + _missingLockfileDependencyPath = lf ^. lockfileInfoPath + } + } lookupCachedDependency :: (Members '[State ResolverState, Reader ResolverEnv, Files, DependencyResolver] r) => Path Abs Dir -> Sem r (Maybe LockfileDependency) lookupCachedDependency p = fmap (^. resolverCacheItemDependency) . HashMap.lookup p <$> gets (^. resolverCache) @@ -140,12 +191,14 @@ registerPackageBase = do packageBaseAbsDir <- globalPackageBaseRoot runReader packageBaseAbsDir updatePackageBaseFiles packageBaseRelFiles <- relFiles packageBaseAbsDir + _packageInfoPackageId <- mkPackageInfoPackageId packageBaseAbsDir (toList packageBaseRelFiles) PackageBase let pkgInfo = PackageInfo { _packageRoot = packageBaseAbsDir, _packageJuvixRelativeFiles = packageBaseRelFiles, _packagePackage = PackageBase, - _packageAvailableRoots = HashSet.singleton packageBaseAbsDir + _packageAvailableRoots = HashSet.singleton packageBaseAbsDir, + _packageInfoPackageId } dep = LockfileDependency @@ -169,27 +222,30 @@ registerDependencies' conf = do initialized <- gets (^. resolverInitialized) unless initialized $ do modify (set resolverInitialized True) - e <- ask @EntryPoint + registerDepsFromRoot mapError (JuvixError @ParserError) registerPackageBase - case e ^. entryPointPackageType of - GlobalStdlib -> do - glob <- globalRoot - void (addRootDependency conf e glob) - GlobalPackageBase -> return () - GlobalPackageDescription -> void (addRootDependency conf e (e ^. entryPointRoot)) - LocalPackage -> do - lockfile <- addRootDependency conf e (e ^. entryPointRoot) - whenM shouldWriteLockfile $ do - let root :: Path Abs Dir = e ^. entryPointSomeRoot . someRootDir - packagePath :: Path Abs File <- do - let packageDotJuvix = mkPackagePath root - juvixDotYaml = mkPackageFilePath root - x <- findM fileExists' [packageDotJuvix, juvixDotYaml] - return (fromMaybe (error ("No package file found in " <> show root)) x) - packageFileChecksum <- SHA256.digestFile packagePath - lockfilePath' <- lockfilePath - writeLockfile lockfilePath' packageFileChecksum lockfile where + registerDepsFromRoot = do + e <- ask + case e ^. entryPointPackageType of + GlobalStdlib -> do + glob <- globalRoot + void (addRootDependency conf e glob) + GlobalPackageBase -> return () + GlobalPackageDescription -> void (addRootDependency conf e (e ^. entryPointRoot)) + LocalPackage -> do + lockfile <- addRootDependency conf e (e ^. entryPointRoot) + whenM shouldWriteLockfile $ do + let root :: Path Abs Dir = e ^. entryPointSomeRoot . someRootDir + packagePath :: Path Abs File <- do + let packageDotJuvix = mkPackagePath root + juvixDotYaml = mkPackageFilePath root + x <- findM fileExists' [packageDotJuvix, juvixDotYaml] + return (fromMaybe (error ("No package file found in " <> show root)) x) + packageFileChecksum <- SHA256.digestFile packagePath + lockfilePath' <- lockfilePath + writeLockfile lockfilePath' packageFileChecksum lockfile + shouldWriteLockfile :: Sem r Bool shouldWriteLockfile = do lockfileExists <- lockfilePath >>= fileExists' @@ -268,7 +324,7 @@ addDependency' pkg me resolvedDependency = do selectPackageLockfile pkg $ do pkgInfo <- mkPackageInfo me (resolvedDependency ^. resolvedDependencyPath) pkg addPackageRelativeFiles pkgInfo - let packagePath = pkgInfo ^. packagePackage . packageLikeFile + let packagePath = packageLikeFile (pkgInfo ^. packagePackage) subDeps <- forM (pkgInfo ^. packagePackage . packageLikeDependencies) @@ -365,6 +421,10 @@ isModuleOrphan topJuvixPath = do && not (pathPackageBase `isProperPrefixOf` actualPath) ) +importNodePackageId :: (Members '[PathResolver] r) => ImportNode -> Sem r PackageId +importNodePackageId n = + (^?! at (n ^. importNodePackageRoot) . _Just . packageInfoPackageId) <$> getPackageInfos + expectedPath' :: (Members '[Reader ResolverEnv, Files] r) => TopModulePath -> @@ -409,7 +469,11 @@ runPathResolver2 st topEnv arg = do ) handler ) - arg + $ do + _pkgs <- toList <$> getPackageInfos + -- I think we should not check for conflicts + -- checkConflicts pkgs + arg where handler :: forall t localEs x. diff --git a/src/Juvix/Compiler/Pipeline/Loader/PathResolver/Error.hs b/src/Juvix/Compiler/Pipeline/Loader/PathResolver/Error.hs index 6d84e401b8..f0c0248c1c 100644 --- a/src/Juvix/Compiler/Pipeline/Loader/PathResolver/Error.hs +++ b/src/Juvix/Compiler/Pipeline/Loader/PathResolver/Error.hs @@ -5,6 +5,7 @@ import Juvix.Compiler.Pipeline.Loader.PathResolver.PackageInfo import Juvix.Compiler.Pipeline.Package.Base import Juvix.Data.CodeAnn import Juvix.Data.Effect.Git +import Juvix.Extra.Paths.Base import Juvix.Prelude data DependencyErrorGit = DependencyErrorGit @@ -93,6 +94,9 @@ data PathResolverError = ErrDependencyConflict DependencyConflict | ErrMissingModule MissingModule | ErrPackageInvalidImport PackageInvalidImport + | -- | The ErrAmbiguousPackageId error is unused at the moment. We append the + -- hash of all project files to the pre-release tag of the package version. + ErrAmbiguousPackageId AmbiguousPackageId deriving stock (Show) instance ToGenericError PathResolverError where @@ -114,12 +118,14 @@ instance HasLoc PathResolverError where getLoc _missingModule ErrPackageInvalidImport PackageInvalidImport {..} -> getLoc _packageInvalidImport + ErrAmbiguousPackageId a -> getLoc a instance PrettyCodeAnn PathResolverError where ppCodeAnn = \case ErrDependencyConflict e -> ppCodeAnn e ErrMissingModule e -> ppCodeAnn e ErrPackageInvalidImport e -> ppCodeAnn e + ErrAmbiguousPackageId e -> ppCodeAnn e data DependencyConflict = DependencyConflict { _conflictPackages :: NonEmpty PackageInfo, @@ -184,3 +190,22 @@ instance PrettyCodeAnn PackageInvalidImport where <+> "cannot be imported by the Package file." <> line <> "Package files may only import modules from the Juvix standard library, Juvix.Builtin modules, or from the PackageDescription module." + +data AmbiguousPackageId = AmbiguousPackageId + { _ambiguousPackageId :: PackageId, + _ambiguousPackageIdPackages :: NonEmpty PackageInfo + } + deriving stock (Show) + +instance HasLoc AmbiguousPackageId where + getLoc AmbiguousPackageId {..} = intervalFromFile ((head _ambiguousPackageIdPackages) ^. packageRoot packageFilePath) + +instance PrettyCodeAnn AmbiguousPackageId where + ppCodeAnn AmbiguousPackageId {..} = do + "Ambiguous package id:" + <> line + <> ppCodeAnn _ambiguousPackageId + <> line + <> "The above package id is the same for the following packages" + <> line + <> itemize ((pretty . (^. packageRoot)) <$> _ambiguousPackageIdPackages) diff --git a/src/Juvix/Compiler/Pipeline/Loader/PathResolver/PackageInfo.hs b/src/Juvix/Compiler/Pipeline/Loader/PathResolver/PackageInfo.hs index 3d2a785baa..9903c9cc0c 100644 --- a/src/Juvix/Compiler/Pipeline/Loader/PathResolver/PackageInfo.hs +++ b/src/Juvix/Compiler/Pipeline/Loader/PathResolver/PackageInfo.hs @@ -14,7 +14,7 @@ import Juvix.Prelude data PackageLike = PackageReal Package - | PackageGlobalStdlib + | PackageStdlibInGlobalPackage | PackageBase | PackageType | PackageDotJuvix @@ -26,14 +26,16 @@ data PackageInfo = PackageInfo -- .juvix.md files. Note that it should not contain Package.juvix. _packageJuvixRelativeFiles :: HashSet (Path Rel File), _packageAvailableRoots :: HashSet (Path Abs Dir), + _packageInfoPackageId :: PackageId, _packagePackage :: PackageLike } deriving stock (Show) makeLenses ''PackageInfo +makePrisms ''PackageLike -packageFiles :: PackageInfo -> [Path Abs File] -packageFiles k = [k ^. packageRoot f | f <- toList (k ^. packageJuvixRelativeFiles)] +packageInfoFiles :: PackageInfo -> [Path Abs File] +packageInfoFiles k = [k ^. packageRoot f | f <- (toList (k ^. packageJuvixRelativeFiles))] -- | Does *not* include Package.juvix packageJuvixFiles :: SimpleGetter PackageInfo (HashSet (Path Rel File)) @@ -46,37 +48,31 @@ keepJuvixFiles = HashSet.filter isJuvixOrJuvixMdFile packageLikeName :: SimpleGetter PackageLike Text packageLikeName = to $ \case PackageReal r -> r ^. packageName - PackageGlobalStdlib -> "global-stdlib" + PackageStdlibInGlobalPackage {} -> "global-stdlib" PackageBase -> Str.packageBase PackageType -> "package-type" PackageDotJuvix -> "package-dot-juvix" --- | FIXME all PackageLike should have versions -packageLikeVersion :: SimpleGetter PackageLike (Maybe SemVer) -packageLikeVersion = to $ \case - PackageReal pkg -> Just (pkg ^. packageVersion) - PackageGlobalStdlib {} -> Nothing - PackageBase {} -> Nothing - PackageType {} -> Nothing - PackageDotJuvix {} -> Nothing - -packageLikeNameAndVersion :: SimpleGetter PackageLike (Doc CodeAnn) -packageLikeNameAndVersion = to $ \n -> - annotate AnnImportant (pretty (n ^. packageLikeName)) - <+?> (pretty . prettySemVer <$> n ^. packageLikeVersion) +packageInfoNameAndVersion :: + PackageInfo -> + Doc CodeAnn +packageInfoNameAndVersion n = + let pid = n ^. packageInfoPackageId + in annotate AnnImportant (pretty (pid ^. packageIdName)) + <+> pretty (prettySemVer (pid ^. packageIdVersion)) packageLikeDependencies :: SimpleGetter PackageLike [Dependency] packageLikeDependencies = to $ \case PackageReal r -> r ^. packageDependencies - PackageGlobalStdlib -> [] + PackageStdlibInGlobalPackage {} -> impossible PackageBase -> [] PackageType -> [] PackageDotJuvix -> [] -packageLikeFile :: SimpleGetter PackageLike (Path Abs File) -packageLikeFile = to $ \case +packageLikeFile :: PackageLike -> Path Abs File +packageLikeFile = \case PackageReal r -> r ^. packageFile - PackageGlobalStdlib -> impossible + PackageStdlibInGlobalPackage {} -> impossible PackageBase -> impossible PackageType -> impossible PackageDotJuvix -> impossible diff --git a/src/Juvix/Compiler/Pipeline/ModuleInfoCache.hs b/src/Juvix/Compiler/Pipeline/ModuleInfoCache.hs index 3e5e1f2510..0340a41868 100644 --- a/src/Juvix/Compiler/Pipeline/ModuleInfoCache.hs +++ b/src/Juvix/Compiler/Pipeline/ModuleInfoCache.hs @@ -1,7 +1,7 @@ module Juvix.Compiler.Pipeline.ModuleInfoCache where import Juvix.Compiler.Pipeline.EntryPoint -import Juvix.Compiler.Pipeline.Loader.PathResolver.ImportTree.ImportNode +import Juvix.Compiler.Pipeline.Loader.PathResolver import Juvix.Compiler.Pipeline.Result import Juvix.Compiler.Store.Language qualified as Store import Juvix.Data.Effect.Cache @@ -28,9 +28,10 @@ entryIndexPath = fromMaybe err . (^. entryIxEntry . entryPointModulePath) err :: a err = error "unexpected: EntryIndex should always have a path" -mkEntryIndex :: (Members '[Reader EntryPoint] r) => ImportNode -> Sem r EntryIndex +mkEntryIndex :: (Members '[PathResolver, Reader EntryPoint] r) => ImportNode -> Sem r EntryIndex mkEntryIndex node = do entry <- ask + pkgId <- importNodePackageId node let path = node ^. importNodeAbsFile stdin' | Just path == entry ^. entryPointModulePath = entry ^. entryPointStdin @@ -38,6 +39,7 @@ mkEntryIndex node = do entry' = entry { _entryPointStdin = stdin', + _entryPointPackageId = pkgId, _entryPointModulePath = Just path } return diff --git a/src/Juvix/Compiler/Pipeline/Package/Base.hs b/src/Juvix/Compiler/Pipeline/Package/Base.hs index 4ea8bbea9c..1651152d2e 100644 --- a/src/Juvix/Compiler/Pipeline/Package/Base.hs +++ b/src/Juvix/Compiler/Pipeline/Package/Base.hs @@ -11,7 +11,6 @@ import Data.Versions hiding (Lens') import Juvix.Compiler.Pipeline.Lockfile import Juvix.Compiler.Pipeline.Package.Dependency import Juvix.Extra.Paths -import Juvix.Extra.Strings qualified as Str import Juvix.Prelude data BuildDir @@ -44,12 +43,6 @@ type family PackageLockfileType s = res | res -> s where PackageLockfileType 'Raw = Maybe () PackageLockfileType 'Processed = Maybe LockfileInfo -data PackageId = PackageId - { _packageIdName :: Text, - _packageIdVersion :: SemVer - } - deriving stock (Show, Eq) - data Package' (s :: IsProcessed) = Package { _packageName :: NameType s, _packageVersion :: VersionType s, @@ -62,7 +55,6 @@ data Package' (s :: IsProcessed) = Package deriving stock (Generic) makeLenses ''Package' -makeLenses ''PackageId type Package = Package' 'Processed @@ -159,9 +151,6 @@ rawPackage pkg = _packageLockfile = Nothing } -defaultVersion :: SemVer -defaultVersion = SemVer 0 0 0 Nothing Nothing - unsetPackageLockfile :: Package -> Package unsetPackageLockfile = set packageLockfile Nothing @@ -183,13 +172,6 @@ globalPackage p = _packageLockfile = Nothing } -packageBaseId :: PackageId -packageBaseId = - PackageId - { _packageIdName = Str.packageBase, - _packageIdVersion = defaultVersion - } - mkPackageFilePath :: Path Abs Dir -> Path Abs File mkPackageFilePath = ( juvixYamlFile) diff --git a/src/Juvix/Compiler/Pipeline/Package/Loader/EvalEff/IO.hs b/src/Juvix/Compiler/Pipeline/Package/Loader/EvalEff/IO.hs index 434c10c4a6..ca57b854ea 100644 --- a/src/Juvix/Compiler/Pipeline/Package/Loader/EvalEff/IO.hs +++ b/src/Juvix/Compiler/Pipeline/Package/Loader/EvalEff/IO.hs @@ -126,7 +126,7 @@ loadPackage' packagePath = do . runConcurrent . ignoreLogger . evalInternetOffline - . ignoreHighlightBuilder + . evalHighlightBuilder . runProcessIO . runFilesIO . evalTopNameIdGen defaultModuleId diff --git a/src/Juvix/Compiler/Pipeline/Package/Loader/PathResolver.hs b/src/Juvix/Compiler/Pipeline/Package/Loader/PathResolver.hs index 9b71c9ba9c..015203c9f5 100644 --- a/src/Juvix/Compiler/Pipeline/Package/Loader/PathResolver.hs +++ b/src/Juvix/Compiler/Pipeline/Package/Loader/PathResolver.hs @@ -30,7 +30,7 @@ makeLenses ''RootInfoFiles -- package and global standard library (currently under global-package/.juvix-build) runPackagePathResolver :: forall r a. - (Members '[TaggedLock, Error JuvixError, Files, EvalFileEff] r) => + (Members '[Error JuvixError, TaggedLock, Files, EvalFileEff] r) => Path Abs Dir -> Sem (PathResolver ': r) a -> Sem r a @@ -73,12 +73,12 @@ runPackagePathResolver rootPath sem = do Sem r (HashMap (Path Abs Dir) PackageInfo) mkPackageInfos ds fs = do pkgBase <- mkPkgBase - gstdlib <- mkPkgGlobalStdlib + globalPkg <- mkPkgStdlibInGlobal pkgDotJuvix <- mkPackageDotJuvix pkgType <- mkPkgPackageType return . hashMap - $ mkAssoc <$> [pkgBase, pkgType, gstdlib, pkgDotJuvix] + $ mkAssoc <$> [pkgBase, pkgType, globalPkg, pkgDotJuvix] where mkAssoc :: PackageInfo -> (Path Abs Dir, PackageInfo) mkAssoc pkg = (pkg ^. packageRoot, pkg) @@ -86,23 +86,30 @@ runPackagePathResolver rootPath sem = do mkPkgBase :: Sem r PackageInfo mkPkgBase = do let rfiles = fs ^. rootInfoFilesPackageBase + root = ds ^. rootInfoArgPackageBaseDir + pkgTy = PackageBase + pkgId <- mkPackageInfoPackageId root (toList rfiles) pkgTy return PackageInfo - { _packageRoot = ds ^. rootInfoArgPackageBaseDir, + { _packageRoot = root, _packageAvailableRoots = hashSet [ds ^. rootInfoArgPackageBaseDir], _packageJuvixRelativeFiles = rfiles, - _packagePackage = PackageBase + _packagePackage = pkgTy, + _packageInfoPackageId = pkgId } mkPkgPackageType :: Sem r PackageInfo mkPkgPackageType = do let rfiles = fs ^. rootInfoFilesPackage root = ds ^. rootInfoArgPackageDir + pkgTy = PackageType + pkgId <- mkPackageInfoPackageId root (toList rfiles) pkgTy return PackageInfo { _packageRoot = root, _packageJuvixRelativeFiles = rfiles, - _packagePackage = PackageType, + _packagePackage = pkgTy, + _packageInfoPackageId = pkgId, _packageAvailableRoots = hashSet [ ds ^. rootInfoArgPackageDir, @@ -111,26 +118,31 @@ runPackagePathResolver rootPath sem = do ] } - mkPkgGlobalStdlib :: Sem r PackageInfo - mkPkgGlobalStdlib = do + mkPkgStdlibInGlobal :: Sem r PackageInfo + mkPkgStdlibInGlobal = do let root = ds ^. rootInfoArgGlobalStdlibDir jufiles <- findPackageJuvixFiles root let rfiles = hashSet jufiles + pkgTy = PackageStdlibInGlobalPackage + pkgId <- mkPackageInfoPackageId root (toList rfiles) pkgTy return PackageInfo { _packageRoot = root, _packageJuvixRelativeFiles = rfiles, + _packageInfoPackageId = pkgId, _packageAvailableRoots = hashSet [ ds ^. rootInfoArgPackageBaseDir, ds ^. rootInfoArgGlobalStdlibDir ], - _packagePackage = PackageGlobalStdlib + _packagePackage = pkgTy } mkPackageDotJuvix :: Sem r PackageInfo mkPackageDotJuvix = do let rfiles = hashSet [packageFilePath] + pkgTy = PackageDotJuvix + pkgId <- mkPackageInfoPackageId rootPath (toList rfiles) pkgTy return PackageInfo { _packageRoot = rootPath, @@ -142,7 +154,8 @@ runPackagePathResolver rootPath sem = do ds ^. rootInfoArgGlobalStdlibDir, rootPath ], - _packagePackage = PackageDotJuvix + _packagePackage = pkgTy, + _packageInfoPackageId = pkgId } rootInfoDirs :: Sem r RootInfoDirs diff --git a/src/Juvix/Compiler/Pipeline/Repl.hs b/src/Juvix/Compiler/Pipeline/Repl.hs index 545a5577fb..db3a86be8f 100644 --- a/src/Juvix/Compiler/Pipeline/Repl.hs +++ b/src/Juvix/Compiler/Pipeline/Repl.hs @@ -1,6 +1,6 @@ module Juvix.Compiler.Pipeline.Repl where -import Juvix.Compiler.Concrete (ignoreHighlightBuilder) +import Juvix.Compiler.Concrete (evalHighlightBuilder) import Juvix.Compiler.Concrete.Language import Juvix.Compiler.Concrete.Translation.FromParsed qualified as Scoper import Juvix.Compiler.Concrete.Translation.FromSource qualified as Parser @@ -18,9 +18,7 @@ import Juvix.Compiler.Pipeline.Artifacts import Juvix.Compiler.Pipeline.Artifacts.PathResolver import Juvix.Compiler.Pipeline.Driver import Juvix.Compiler.Pipeline.EntryPoint -import Juvix.Compiler.Pipeline.Loader.PathResolver (runDependencyResolver) -import Juvix.Compiler.Pipeline.Loader.PathResolver.Base -import Juvix.Compiler.Pipeline.Loader.PathResolver.Error +import Juvix.Compiler.Pipeline.Loader.PathResolver import Juvix.Compiler.Pipeline.Loader.PathResolver.ImportTree (withImportTree) import Juvix.Compiler.Pipeline.Package.Loader.Error import Juvix.Compiler.Pipeline.Package.Loader.EvalEff.IO @@ -91,7 +89,7 @@ parseReplInput :: Text -> Sem r Parser.ReplInput parseReplInput fp txt = - ignoreHighlightBuilder + evalHighlightBuilder . runNameIdGenArtifacts . runStateLikeArtifacts runParserResultBuilder artifactParsing $ Parser.replInputFromTextSource fp txt @@ -167,7 +165,7 @@ compileReplInputIO fp txt = do . runLoggerIO replLoggerOptions . runReader defaultNumThreads . evalInternet hasInternet - . ignoreHighlightBuilder + . evalHighlightBuilder . runTaggedLockPermissive . runFilesIO . mapError (JuvixError @GitProcessError) diff --git a/src/Juvix/Compiler/Pipeline/Run.hs b/src/Juvix/Compiler/Pipeline/Run.hs index aad458a24e..979a56c610 100644 --- a/src/Juvix/Compiler/Pipeline/Run.hs +++ b/src/Juvix/Compiler/Pipeline/Run.hs @@ -215,7 +215,7 @@ runReplPipelineIOEither' lockMode entry = do . runConcurrent . runReader defaultNumThreads . evalInternet hasInternet - . ignoreHighlightBuilder + . evalHighlightBuilder . runError . runState initialArtifacts . runNameIdGenArtifacts diff --git a/src/Juvix/Compiler/Reg/Keywords.hs b/src/Juvix/Compiler/Reg/Keywords.hs index 4fd7ae2bdb..976e968a8a 100644 --- a/src/Juvix/Compiler/Reg/Keywords.hs +++ b/src/Juvix/Compiler/Reg/Keywords.hs @@ -32,7 +32,9 @@ import Juvix.Data.Keyword.All kwFieldDiv, kwFieldMul, kwFieldSub, + kwFieldToInt, kwIf, + kwIntToField, kwLe_, kwLive, kwLt_, @@ -93,5 +95,7 @@ allKeywords = kwFail, kwArgsNum, kwPoseidon, - kwRandomEcPoint + kwRandomEcPoint, + kwIntToField, + kwFieldToInt ] diff --git a/src/Juvix/Compiler/Reg/Language/Instrs.hs b/src/Juvix/Compiler/Reg/Language/Instrs.hs index 55da2a0387..507ad9425f 100644 --- a/src/Juvix/Compiler/Reg/Language/Instrs.hs +++ b/src/Juvix/Compiler/Reg/Language/Instrs.hs @@ -26,7 +26,7 @@ data ConstrField = ConstrField data VarGroup = VarGroupArgs | VarGroupLocal - deriving stock (Eq, Generic, Show) + deriving stock (Eq, Ord, Generic, Show) instance Hashable VarGroup @@ -48,6 +48,9 @@ instance Eq VarRef where vr1 ^. varRefGroup == vr2 ^. varRefGroup && vr1 ^. varRefIndex == vr2 ^. varRefIndex +instance Ord VarRef where + compare = compare `on` \vr -> (vr ^. varRefGroup, vr ^. varRefIndex) + deriving stock instance (Eq ConstrField) deriving stock instance (Eq Value) diff --git a/src/Juvix/Compiler/Reg/Pretty.hs b/src/Juvix/Compiler/Reg/Pretty.hs index 47fe4d9e98..625c090c59 100644 --- a/src/Juvix/Compiler/Reg/Pretty.hs +++ b/src/Juvix/Compiler/Reg/Pretty.hs @@ -12,7 +12,7 @@ import Juvix.Data.PPOutput import Juvix.Prelude import Prettyprinter.Render.Terminal qualified as Ansi -ppOutDefault :: (PrettyCode c) => InfoTable -> c -> AnsiText +ppOutDefault :: (PrettyCode c) => InfoTable' t e -> c -> AnsiText ppOutDefault tab = mkAnsiText . PPOutput . doc (defaultOptions tab) ppOut :: (PrettyCode c) => Options -> c -> AnsiText @@ -21,8 +21,8 @@ ppOut o = mkAnsiText . PPOutput . doc o ppTrace' :: (PrettyCode c) => Options -> c -> Text ppTrace' opts = Ansi.renderStrict . reAnnotateS stylize . layoutPretty defaultLayoutOptions . doc opts -ppTrace :: (PrettyCode c) => InfoTable -> c -> Text +ppTrace :: (PrettyCode c) => InfoTable' t e -> c -> Text ppTrace tab = ppTrace' (defaultOptions tab) -ppPrint :: (PrettyCode c) => InfoTable -> c -> Text +ppPrint :: (PrettyCode c) => InfoTable' t e -> c -> Text ppPrint tab = toPlainText . ppOutDefault tab diff --git a/src/Juvix/Compiler/Reg/Translation/FromSource.hs b/src/Juvix/Compiler/Reg/Translation/FromSource.hs index 0432cbefa7..a42bc19d04 100644 --- a/src/Juvix/Compiler/Reg/Translation/FromSource.hs +++ b/src/Juvix/Compiler/Reg/Translation/FromSource.hs @@ -130,6 +130,8 @@ instrUnop :: instrUnop vref = parseUnaryOp kwShow OpShow vref <|> parseUnaryOp kwAtoi OpStrToInt vref + <|> parseUnaryOp kwIntToField OpIntToField vref + <|> parseUnaryOp kwFieldToInt OpFieldToInt vref <|> parseUnaryOp kwArgsNum OpArgsNum vref parseUnaryOp :: diff --git a/src/Juvix/Compiler/Store/Core/Language.hs b/src/Juvix/Compiler/Store/Core/Language.hs index 3313fbf45f..b819588696 100644 --- a/src/Juvix/Compiler/Store/Core/Language.hs +++ b/src/Juvix/Compiler/Store/Core/Language.hs @@ -5,11 +5,10 @@ module Juvix.Compiler.Store.Core.Language where import Juvix.Compiler.Core.Language.Nodes -import Juvix.Extra.Serialize {---------------------------------------------------------------------------------} -data LetRecInfo = LetRecInfo +newtype LetRecInfo = LetRecInfo { _letRecInfoPragmas :: [Pragmas] } deriving stock (Generic) @@ -18,7 +17,7 @@ instance Serialize LetRecInfo instance NFData LetRecInfo -data LambdaInfo = LambdaInfo +newtype LambdaInfo = LambdaInfo { _lambdaInfoPragma :: Pragmas } deriving stock (Generic) diff --git a/src/Juvix/Data.hs b/src/Juvix/Data.hs index 6342d658cc..bfacc8c359 100644 --- a/src/Juvix/Data.hs +++ b/src/Juvix/Data.hs @@ -1,6 +1,7 @@ module Juvix.Data ( module Juvix.Data.Effect, module Juvix.Data.Error, + module Juvix.Data.PackageId, module Juvix.Data.ProjectionKind, module Juvix.Data.NumThreads, module Juvix.Data.Fixity, @@ -41,6 +42,7 @@ import Juvix.Data.Keyword import Juvix.Data.Loc import Juvix.Data.NameId qualified import Juvix.Data.NumThreads +import Juvix.Data.PackageId import Juvix.Data.ParsedItem import Juvix.Data.Polarity import Juvix.Data.Pragmas diff --git a/src/Juvix/Data/CodeAnn.hs b/src/Juvix/Data/CodeAnn.hs index 0e700f4a3c..63f8fa7cb3 100644 --- a/src/Juvix/Data/CodeAnn.hs +++ b/src/Juvix/Data/CodeAnn.hs @@ -5,12 +5,14 @@ module Juvix.Data.CodeAnn ) where +import Data.Versions (prettySemVer) import Juvix.Compiler.Concrete.Data.Name import Juvix.Data.Error.GenericError import Juvix.Data.IsImplicit import Juvix.Data.Keyword import Juvix.Data.NameId import Juvix.Data.NameKind +import Juvix.Data.PackageId import Juvix.Data.WithLoc import Juvix.Extra.Strings qualified as Str import Juvix.Prelude.Base @@ -48,6 +50,11 @@ instance HasNameKind CodeAnnReference where getNameKind = (^. codeAnnReferenceNameKindPretty) getNameKindPretty = (^. codeAnnReferenceNameKindPretty) +instance PrettyCodeAnn PackageId where + ppCodeAnn pid = + annotate AnnImportant (pretty (pid ^. packageIdName)) + <+> pretty (prettySemVer (pid ^. packageIdVersion)) + instance HasNameKindAnn Ann where annNameKind = AnnKind diff --git a/src/Juvix/Data/Loc.hs b/src/Juvix/Data/Loc.hs index e655f564e9..ad9d527dbf 100644 --- a/src/Juvix/Data/Loc.hs +++ b/src/Juvix/Data/Loc.hs @@ -117,6 +117,9 @@ makeLenses ''FileLoc makeLenses ''Loc makeLenses ''Pos +intervalFromFile :: Path Abs File -> Interval +intervalFromFile = singletonInterval . mkInitialLoc + singletonInterval :: Loc -> Interval singletonInterval l = Interval diff --git a/src/Juvix/Data/ModuleId.hs b/src/Juvix/Data/ModuleId.hs index 29818e43fb..b0e4f13540 100644 --- a/src/Juvix/Data/ModuleId.hs +++ b/src/Juvix/Data/ModuleId.hs @@ -1,5 +1,6 @@ module Juvix.Data.ModuleId where +import Juvix.Data.PackageId import Juvix.Data.TopModulePathKey import Juvix.Extra.Serialize import Juvix.Prelude.Base @@ -7,8 +8,7 @@ import Prettyprinter data ModuleId = ModuleId { _moduleIdPath :: TopModulePathKey, - _moduleIdPackage :: Text, - _moduleIdPackageVersion :: Text + _moduleIdPackageId :: PackageId } deriving stock (Show, Eq, Ord, Generic, Data) @@ -27,6 +27,9 @@ defaultModuleId :: ModuleId defaultModuleId = ModuleId { _moduleIdPath = nonEmptyToTopModulePathKey (pure "$DefaultModule$"), - _moduleIdPackage = "$", - _moduleIdPackageVersion = "1.0" + _moduleIdPackageId = + PackageId + { _packageIdName = "$", + _packageIdVersion = SemVer 1 0 0 Nothing Nothing + } } diff --git a/src/Juvix/Data/PackageId.hs b/src/Juvix/Data/PackageId.hs new file mode 100644 index 0000000000..74d3b9c67a --- /dev/null +++ b/src/Juvix/Data/PackageId.hs @@ -0,0 +1,28 @@ +module Juvix.Data.PackageId where + +import Juvix.Extra.Strings qualified as Str +import Juvix.Prelude.Base + +data PackageId = PackageId + { _packageIdName :: Text, + _packageIdVersion :: SemVer + } + deriving stock (Show, Ord, Eq, Data, Generic) + +makeLenses ''PackageId + +packageBaseId :: PackageId +packageBaseId = + PackageId + { _packageIdName = Str.packageBase, + _packageIdVersion = defaultVersion + } + +defaultVersion :: SemVer +defaultVersion = SemVer 0 0 0 Nothing Nothing + +instance Serialize PackageId + +instance Hashable PackageId + +instance NFData PackageId diff --git a/src/Juvix/Data/SHA256.hs b/src/Juvix/Data/SHA256.hs index 01ac0306f5..e5b21cdc69 100644 --- a/src/Juvix/Data/SHA256.hs +++ b/src/Juvix/Data/SHA256.hs @@ -4,13 +4,58 @@ import Crypto.Hash.SHA256 qualified as SHA256 import Data.ByteString.Base16 qualified as Base16 import Juvix.Prelude -digestText :: Text -> Text -digestText = +hashToText :: ByteString -> Text +hashToText = decodeUtf8Lenient . Base16.encode + +digestText :: Text -> Text +digestText = + hashToText . SHA256.hash . encodeUtf8 --- | Create a HEX encoded, SHA256 digest of the contents of a file. +-- | Create a HEX encoded, SHA256 digest of the contents of a file digestFile :: (Member Files r) => Path Abs File -> Sem r Text -digestFile = fmap (decodeUtf8Lenient . Base16.encode . SHA256.hash) . readFileBS' +digestFile = fmap hashToText . digestFileBS + +digestFileBS :: (Member Files r) => Path Abs File -> Sem r ByteString +digestFileBS = fmap SHA256.hash . readFileBS' + +data SHA256Builder :: Effect where + BuilderDigestFiles :: (Foldable l) => l (Path Abs File) -> SHA256Builder m () + +makeSem ''SHA256Builder + +builderDigestFile :: (Members '[SHA256Builder] r) => Path Abs File -> Sem r () +builderDigestFile p = builderDigestFiles [p] + +runSHA256Builder :: (Members '[Files] r) => Sem (SHA256Builder ': r) a -> Sem r (Text, a) +runSHA256Builder m = fmap + ( first + ( hashToText + . SHA256.finalize + ) + ) + $ reinterpret' m (runState SHA256.init) + $ \case + BuilderDigestFiles f -> do + fs <- mapM readFileBS' (toList f) + modify (`SHA256.updates` fs) + +ignoreSHA256Builder :: Sem (SHA256Builder ': r) a -> Sem r a +ignoreSHA256Builder = interpret $ \case + BuilderDigestFiles {} -> return () + +execSHA256Builder :: (Members '[Files] r) => Sem (SHA256Builder ': r) a -> Sem r Text +execSHA256Builder = fmap fst . runSHA256Builder + +-- | Create a HEX encoded, SHA256 digest of the contents of some files in the +-- given order. Note that the order of the paths is relevant +digestFilesList :: (Members '[Files] r, Foldable l) => l (Path Abs File) -> Sem r Text +digestFilesList = execSHA256Builder . builderDigestFiles + +-- | Create a HEX encoded, SHA256 digest of the contents of the files. Order of +-- paths and repeated elements do not affect the result. +digestFiles :: (Members '[Files] r, Foldable l) => l (Path Abs File) -> Sem r Text +digestFiles = digestFilesList . ordNubSort diff --git a/src/Juvix/Emacs/Properties.hs b/src/Juvix/Emacs/Properties.hs index cf3e1f30f3..def72d211f 100644 --- a/src/Juvix/Emacs/Properties.hs +++ b/src/Juvix/Emacs/Properties.hs @@ -88,6 +88,14 @@ data PropertyGoto = PropertyGoto _gotoPos :: FileLoc } +-- | Location where a top symbol is defined +newtype PropertyTopDef = PropertyTopDef + { _topDef :: Text + } + deriving stock (Eq, Generic) + +instance Hashable PropertyTopDef + newtype PropertyFace = PropertyFace { _faceFace :: Face } @@ -100,13 +108,15 @@ data PropertyInfo = PropertyInfo data LocProperties = LocProperties { _propertiesGoto :: [WithLoc PropertyGoto], _propertiesFace :: [WithLoc PropertyFace], + _propertiesTopDef :: [WithLoc PropertyTopDef], _propertiesInfo :: [WithLoc PropertyInfo] } data RawProperties = RawProperties { _rawPropertiesFace :: [RawWithLoc RawFace], _rawPropertiesGoto :: [RawWithLoc RawGoto], - _rawPropertiesDoc :: [RawWithLoc RawType] + _rawPropertiesDoc :: [RawWithLoc RawType], + _rawPropertiesTopDef :: [RawWithLoc RawTopDef] } -- | (File, Start Row, Start Col, Length, End Row, End Col) @@ -119,6 +129,8 @@ type RawFace = Face -- | (TargetFile, TargetLine, TargetColumn) type RawGoto = (Path Abs File, Int, Int) +type RawTopDef = Text + -- | (Type) type RawType = Text @@ -135,6 +147,7 @@ rawProperties LocProperties {..} = RawProperties { _rawPropertiesGoto = map (rawWithLoc rawGoto) _propertiesGoto, _rawPropertiesFace = map (rawWithLoc rawFace) _propertiesFace, + _rawPropertiesTopDef = map (rawWithLoc rawTopDef) _propertiesTopDef, _rawPropertiesDoc = map (rawWithLoc rawType) _propertiesInfo } where @@ -160,6 +173,9 @@ rawProperties LocProperties {..} = rawFace :: PropertyFace -> RawFace rawFace PropertyFace {..} = _faceFace + rawTopDef :: PropertyTopDef -> RawTopDef + rawTopDef PropertyTopDef {..} = _topDef + rawGoto :: PropertyGoto -> RawGoto rawGoto PropertyGoto {..} = ( _gotoFile, diff --git a/src/Juvix/Extra/Serialize.hs b/src/Juvix/Extra/Serialize.hs index a5d814aa6b..dd693c9554 100644 --- a/src/Juvix/Extra/Serialize.hs +++ b/src/Juvix/Extra/Serialize.hs @@ -19,13 +19,6 @@ import Juvix.Prelude.Path instance Serialize (Path Abs File) -instance Serialize Text where - put txt = Serial.put (unpack txt) - - get = pack <$> Serial.get - -instance (Serialize a) => Serialize (NonEmpty a) - instance (Hashable k, Serialize k, Serialize a) => Serialize (HashMap k a) where put m = Serial.put (HashMap.toList m) diff --git a/src/Juvix/Formatter.hs b/src/Juvix/Formatter.hs index e96c5b16e3..a0185a4cf4 100644 --- a/src/Juvix/Formatter.hs +++ b/src/Juvix/Formatter.hs @@ -2,7 +2,7 @@ module Juvix.Formatter where -import Juvix.Compiler.Concrete.Data.Highlight.Builder (ignoreHighlightBuilder) +import Juvix.Compiler.Concrete.Data.Highlight.Builder (evalHighlightBuilder) import Juvix.Compiler.Concrete.Language import Juvix.Compiler.Concrete.Print (ppOutDefault) import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping (ScoperResult, getModuleId, scopeCheck) @@ -94,7 +94,7 @@ format p = do -- contents of a file) for every processed file. -- -- NB: This function does not traverse into Juvix sub-projects, i.e into --- subdirectories that contain a juvix.yaml file. +-- subdirectories that contain a Package.juvix file. formatProjectSourceCode :: forall r. (Members '[Output FormattedFileInfo] r) => @@ -118,7 +118,7 @@ formatModuleInfo :: Sem r SourceCode formatModuleInfo node moduleInfo = withResolverRoot (node ^. importNodePackageRoot) - . ignoreHighlightBuilder + . evalHighlightBuilder $ do pkg :: PackageId <- ask parseRes :: ParserResult <- @@ -178,12 +178,11 @@ formatResultSourceCode filepath src = do mkResult :: FormatResult -> Sem r FormatResult mkResult res = do output - ( FormattedFileInfo - { _formattedFileInfoPath = filepath, - _formattedFileInfoContents = src ^. sourceCodeFormatted, - _formattedFileInfoContentsModified = res == FormatResultNotFormatted - } - ) + FormattedFileInfo + { _formattedFileInfoPath = filepath, + _formattedFileInfoContents = src ^. sourceCodeFormatted, + _formattedFileInfoContentsModified = res == FormatResultNotFormatted + } return res formatScoperResult' :: diff --git a/src/Juvix/Prelude/Base.hs b/src/Juvix/Prelude/Base.hs index fd6fbe733c..944e06baa3 100644 --- a/src/Juvix/Prelude/Base.hs +++ b/src/Juvix/Prelude/Base.hs @@ -1,8 +1,49 @@ module Juvix.Prelude.Base ( module Juvix.Prelude.Base.Foundation, module Juvix.Prelude.Effects, + module Juvix.Prelude.Base, ) where import Juvix.Prelude.Base.Foundation import Juvix.Prelude.Effects + +groupSortOnWithM :: forall a b m. (Ord b, Monad m) => (a -> m b) -> [a] -> m [(NonEmpty a, b)] +groupSortOnWithM f l = do + l' <- mapWithM f l + return (run . execAccumList . runInputList (sortOn snd l') $ repeatOnInput go) + where + go :: forall r. (Members '[Input (a, b), Accum (NonEmpty a, b)] r) => (a, b) -> Sem r () + go (e, eb) = do + es <- map fst <$> inputWhile @(a, b) ((== eb) . snd) + accum (e :| es, eb) + +groupSortOnWith :: forall a b. (Ord b) => (a -> b) -> [a] -> [(NonEmpty a, b)] +groupSortOnWith f = runIdentity . groupSortOnWithM (return . f) + +groupSortOnM :: (Ord b, Monad m) => (a -> m b) -> [a] -> m [NonEmpty a] +groupSortOnM f = fmap (map fst) . groupSortOnWithM f + +groupSortOn :: (Ord b) => (a -> b) -> [a] -> [NonEmpty a] +groupSortOn f = map fst . groupSortOnWith f + +groupSortOn' :: (Ord b) => (a -> b) -> [a] -> [[a]] +groupSortOn' f = map toList . groupSortOn f + +findRepeatedOnM :: forall a b m. (Ord b, Monad m) => (a -> m b) -> [a] -> m [(NonEmpty a, b)] +findRepeatedOnM f = fmap (mapMaybe rep) . groupSortOnWithM f + where + rep :: (NonEmpty a, b) -> Maybe (NonEmpty a, b) + rep = \case + (n@(_ :| _ : _), b) -> Just (n, b) + _ -> Nothing + +findRepeatedOn :: forall a b. (Ord b) => (a -> b) -> [a] -> [(NonEmpty a, b)] +findRepeatedOn f = runIdentity . findRepeatedOnM (return . f) + +-- | Returns the repeated elements +findRepeated :: forall a. (Ord a) => [a] -> [a] +findRepeated = map (head . fst) . findRepeatedOn id + +allDifferent :: forall a. (Ord a) => [a] -> Bool +allDifferent = null . findRepeated diff --git a/src/Juvix/Prelude/Base/Foundation.hs b/src/Juvix/Prelude/Base/Foundation.hs index 87908e1e2d..9a93688882 100644 --- a/src/Juvix/Prelude/Base/Foundation.hs +++ b/src/Juvix/Prelude/Base/Foundation.hs @@ -1,9 +1,11 @@ +{-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} module Juvix.Prelude.Base.Foundation ( module Juvix.Prelude.Base.Foundation, module Control.Applicative, module Data.Tree, + module Data.Versions, module Data.Graph, module Text.Show.Unicode, module Data.Map.Strict, @@ -66,6 +68,7 @@ module Juvix.Prelude.Base.Foundation module Control.Monad.Catch, module Control.Monad.Zip, module Data.String.Interpolate, + module Data.Serialize, Data, Text, pack, @@ -174,6 +177,8 @@ import Data.Maybe import Data.Monoid import Data.Ord import Data.Semigroup (Semigroup, sconcat, (<>)) +import Data.Serialize (Serialize) +import Data.Serialize as Serial import Data.Set (Set) import Data.Set qualified as Set import Data.Singletons hiding ((@@)) @@ -196,6 +201,8 @@ import Data.Tree hiding (levels) import Data.Tuple.Extra hiding (both) import Data.Type.Equality (type (~)) import Data.Typeable hiding (TyCon) +import Data.Versions (SemVer (..), Versioning (..)) +import Data.Versions qualified as Versions import Data.Void import Data.Word import GHC.Base (assert) @@ -339,18 +346,6 @@ replaceText texts txt = fromMaybe txt (HashMap.lookup txt (HashMap.fromList text -- Foldable -------------------------------------------------------------------------------- --- | Returns the repeated elements -findRepeated :: forall a. (Ord a) => [a] -> [a] -findRepeated = mapMaybe rep . groupSortOn' id - where - rep :: [a] -> Maybe a - rep = \case - a : _ : _ -> Just a - _ -> Nothing - -allDifferent :: forall a. (Ord a) => [a] -> Bool -allDifferent = null . findRepeated - allSame :: forall t a. (Eq a, Foldable t) => t a -> Bool allSame t = case nonEmpty t of Nothing -> True @@ -466,6 +461,11 @@ zip4Exact [] [] [] [] = [] zip4Exact (x1 : t1) (x2 : t2) (x3 : t3) (x4 : t4) = (x1, x2, x3, x4) : zip4Exact t1 t2 t3 t4 zip4Exact _ _ _ _ = error "zip4Exact" +findJustM :: forall a b m. (Monad m) => (a -> m (Maybe b)) -> [a] -> m (Maybe b) +findJustM f = \case + [] -> return Nothing + x : xs -> f x >>= maybe (findJustM f xs) (return . Just) + -- | Returns the first element that returns Just and the list with the remaining elements findJustAndRemove :: forall a b. (a -> Maybe b) -> [a] -> Maybe (b, [a]) findJustAndRemove p = go [] @@ -503,12 +503,6 @@ nonEmpty' = fromJust . nonEmpty _nonEmpty :: Lens' [a] (Maybe (NonEmpty a)) _nonEmpty f x = maybe [] toList <$> f (nonEmpty x) -groupSortOn :: (Ord b) => (a -> b) -> [a] -> [NonEmpty a] -groupSortOn f = map nonEmpty' . List.groupSortOn f - -groupSortOn' :: (Ord b) => (a -> b) -> [a] -> [[a]] -groupSortOn' = List.groupSortOn - -------------------------------------------------------------------------------- -- Errors -------------------------------------------------------------------------------- @@ -771,6 +765,10 @@ hashMapFromHashSetM s fun = hashMapFromHashSet :: (Hashable k) => HashSet k -> (k -> v) -> HashMap k v hashMapFromHashSet s fun = hashMap [(x, fun x) | x <- toList s] +-- | Sorts and removes duplicates +ordNubSort :: (Foldable f, Ord k) => f k -> [k] +ordNubSort = toList . ordSet + ordMap :: (Foldable f, Ord k) => f (k, v) -> Map k v ordMap = Map.fromList . toList @@ -912,3 +910,16 @@ allFiniteSequences elems = build 0 [] seq <- ofLength (n - 1) e <- elems return (pure e <> seq) + +instance Serialize Text where + put txt = Serial.put (unpack txt) + + get = pack <$> Serial.get + +instance (Serialize a) => Serialize (NonEmpty a) + +instance Serialize Versions.Chunk + +instance Serialize Versions.Release + +instance Serialize SemVer diff --git a/src/Juvix/Prelude/Effects/Base.hs b/src/Juvix/Prelude/Effects/Base.hs index 41dd47cef4..9c32c313e7 100644 --- a/src/Juvix/Prelude/Effects/Base.hs +++ b/src/Juvix/Prelude/Effects/Base.hs @@ -234,6 +234,14 @@ reinterpretH :: Sem r b reinterpretH = E.reinterpret +reinterpret' :: + (DispatchOf e ~ 'Dynamic) => + Sem (e ': r) a -> + (Sem handlerEs a -> Sem r b) -> + EffectHandlerFO e handlerEs -> + Sem r b +reinterpret' m re i = reinterpret re i m + reinterpret :: (DispatchOf e ~ 'Dynamic) => (Sem handlerEs a -> Sem r b) -> diff --git a/src/Juvix/Prelude/Effects/Input.hs b/src/Juvix/Prelude/Effects/Input.hs index d2f1f6fe25..616287d164 100644 --- a/src/Juvix/Prelude/Effects/Input.hs +++ b/src/Juvix/Prelude/Effects/Input.hs @@ -31,7 +31,7 @@ input = Input [] -> (Nothing, Input []) Input (i : is) -> (Just i, Input is) -inputWhile :: (Member (Input i) r) => (i -> Bool) -> Sem r [i] +inputWhile :: forall i r. (Member (Input i) r) => (i -> Bool) -> Sem r [i] inputWhile c = stateStaticRep $ \case diff --git a/src/Parallel/ProgressLog.hs b/src/Parallel/ProgressLog.hs index 18cb1f72d9..45731ee607 100644 --- a/src/Parallel/ProgressLog.hs +++ b/src/Parallel/ProgressLog.hs @@ -104,8 +104,8 @@ runProgressLogOptions opts m = do wait logHandler return x where - getPackageTag :: Path Abs Dir -> Doc CodeAnn - getPackageTag pkgRoot = opts ^. progressLogOptionsPackages . at pkgRoot . _Just . packagePackage . packageLikeNameAndVersion + packageTag :: Path Abs Dir -> Doc CodeAnn + packageTag pkgRoot = packageInfoNameAndVersion (opts ^?! progressLogOptionsPackages . at pkgRoot . _Just) tree :: ImportTree tree = opts ^. progressLogOptionsImportTree @@ -160,12 +160,13 @@ runProgressLogOptions opts m = do handler :: TVar ProgressLogState -> LogQueue -> EffectHandlerFO ProgressLog r handler st logs = \case - ProgressLog i -> + ProgressLog i -> do + let tag = packageTag fromPackage atomically $ do n <- getNextNumber let k | fromMainPackage = LogMainPackage - | otherwise = LogDependency (getPackageTag fromPackage) + | otherwise = LogDependency tag d = LogItemDetails { _logItemDetailsKind = k, diff --git a/test/Casm/Compilation/Positive.hs b/test/Casm/Compilation/Positive.hs index b644123aaf..95951c0cde 100644 --- a/test/Casm/Compilation/Positive.hs +++ b/test/Casm/Compilation/Positive.hs @@ -565,5 +565,13 @@ tests = $(mkRelDir ".") $(mkRelFile "test078.juvix") Nothing - $(mkRelFile "out/test078.out") + $(mkRelFile "out/test078.out"), + posTest + "Test079: Trivial resource logic" + False + True + $(mkRelDir ".") + $(mkRelFile "test079.juvix") + (Just $(mkRelFile "in/test079.json")) + $(mkRelFile "out/test079.out") ] diff --git a/test/Casm/Reg/Cairo.hs b/test/Casm/Reg/Cairo.hs index 05b541464a..730ceb1b16 100644 --- a/test/Casm/Reg/Cairo.hs +++ b/test/Casm/Reg/Cairo.hs @@ -53,5 +53,11 @@ cairoTests = $(mkRelDir ".") $(mkRelFile "test042.jvr") $(mkRelFile "out/test042.out") - Nothing + Nothing, + P.PosTest + "Test048: Mock resource logic" + $(mkRelDir ".") + $(mkRelFile "test048.jvr") + $(mkRelFile "out/test048.out") + (Just $(mkRelFile "in/test048.json")) ] diff --git a/test/Casm/Reg/Positive.hs b/test/Casm/Reg/Positive.hs index 2a75405e7a..0825be2556 100644 --- a/test/Casm/Reg/Positive.hs +++ b/test/Casm/Reg/Positive.hs @@ -228,5 +228,29 @@ tests = $(mkRelDir ".") $(mkRelFile "test043.jvr") $(mkRelFile "out/test043.out") - Nothing + Nothing, + PosTest + "Test044: Extend closure in true branch" + $(mkRelDir ".") + $(mkRelFile "test044.jvr") + $(mkRelFile "out/test044.out") + (Just $(mkRelFile "in/test044.json")), + PosTest + "Test045: Extend closure in false branch" + $(mkRelDir ".") + $(mkRelFile "test045.jvr") + $(mkRelFile "out/test045.out") + (Just $(mkRelFile "in/test045.json")), + PosTest + "Test046: Call in true branch" + $(mkRelDir ".") + $(mkRelFile "test046.jvr") + $(mkRelFile "out/test046.out") + (Just $(mkRelFile "in/test046.json")), + PosTest + "Test047: Call in false branch" + $(mkRelDir ".") + $(mkRelFile "test047.jvr") + $(mkRelFile "out/test047.out") + (Just $(mkRelFile "in/test047.json")) ] diff --git a/tests/Casm/Compilation/positive/in/test079.json b/tests/Casm/Compilation/positive/in/test079.json new file mode 100644 index 0000000000..c7a6a2f5ff --- /dev/null +++ b/tests/Casm/Compilation/positive/in/test079.json @@ -0,0 +1,31 @@ +{ + "self_resource": { + "logic": "0x373bb1d37414c2edf111cf2f9f076517da99d38e44cdd716ca2ad00a07731e5", + "label": "0x12", + "quantity": "0x13", + "data": "0x14", + "eph": false, + "nonce": "0x26", + "npk": "0x7752582c54a42fe0fa35c40f07293bb7d8efe90e21d8d2c06a7db52d7d9b7a1", + "rseed": "0x48" + }, + "resource_nf_key": "0x1", + "merkle_path": [ + { + "fst": "0x33", + "snd": true + }, + { + "fst": "0x83", + "snd": false + }, + { + "fst": "0x73", + "snd": false + }, + { + "fst": "0x23", + "snd": false + } + ] +} diff --git a/tests/Casm/Compilation/positive/out/test079.out b/tests/Casm/Compilation/positive/out/test079.out new file mode 100644 index 0000000000..9855d1c8f8 --- /dev/null +++ b/tests/Casm/Compilation/positive/out/test079.out @@ -0,0 +1,16 @@ +-395556098205570544514862427675713135822454173064116032036066260837844667166 +1199411604616075448730293334298953634347373067899103883531383580500542532805 +741345583372708758677381254341695646215212764479558601822324496916305564860 +906223455619847457072543249061510257957686047823824674682567491887881744554 +-767849295212578246709801782763128612227201311770055823223370752694466982385 +-499605824796177847482548145602529914672118948474574930466002320448397702145 +-739783929947191450539981235446122797172963523649497524598736585887720470605 +11906781661858318111608384113371656853984100876730919753607956359054872835 +1184591657410410618259810478559756080508915282346219818107533089968423438529 +-1196756736539952528850324578540484369187211012447802934902211689810543298321 +-615406306260154438751417537243664316178100185892451009663053034794681290878 +-479989799644409226462391378855274180707944349292197032426785420935231903693 +1666094585867140022923253270503506891580143265539166904031542100935830693071 +874739451078007766457464989774322083649278607533249481151382481072868806602 +152666792071518830868575557812948353041420400780739481342941381225525861407 +1 diff --git a/tests/Casm/Compilation/positive/test079.juvix b/tests/Casm/Compilation/positive/test079.juvix new file mode 100644 index 0000000000..296017de8e --- /dev/null +++ b/tests/Casm/Compilation/positive/test079.juvix @@ -0,0 +1,284 @@ +--- Trivial resource logic +module test079; + +import Stdlib.Prelude open; +import Stdlib.Cairo.Ec as Ec; +import Stdlib.Cairo.Poseidon open; +import Stdlib.Cairo.Pedersen open; + +type Resource := + mkResource@{ + logic : Field; + label : Field; + quantity : Field; + data : Field; + eph : Bool; + nonce : Field; + npk : Field; + rseed : Field; + }; + +type LogicResult := + mkResult@{ + -- nullifier of input resource or commitment of output resource + self_resource_id : Field; + -- The merkle root of resources + root : Field; + cipher_text_elem0 : Field; + cipher_text_elem1 : Field; + cipher_text_elem2 : Field; + cipher_text_elem3 : Field; + cipher_text_elem4 : Field; + cipher_text_elem5 : Field; + cipher_text_elem6 : Field; + cipher_text_elem7 : Field; + cipher_text_elem8 : Field; + cipher_text_elem9 : Field; + mac : Field; + pk_x : Field; + pk_y : Field; + nonce : Field; + }; + +check_merkle (current_root : Field) : Pair Field Bool -> Field + | (node, is_left) := + let + pair := + if + | is_left := node, current_root + | else := current_root, node; + + in case pair of lhs, rhs := poseidonHash2 lhs rhs; + +--- Check the merkle tree path validity and return the root +check_merkle_path (cur : Field) : List (Pair Field Bool) -> Field + | [] := cur + | (p :: ps) := check_merkle_path (check_merkle cur p) ps; + +type EncryptionResult := + mkEncryptionResult@{ + cipher_text_elem0 : Field; + cipher_text_elem1 : Field; + cipher_text_elem2 : Field; + cipher_text_elem3 : Field; + cipher_text_elem4 : Field; + cipher_text_elem5 : Field; + cipher_text_elem6 : Field; + cipher_text_elem7 : Field; + cipher_text_elem8 : Field; + cipher_text_elem9 : Field; + mac : Field; + sender_pk_x : Field; + sender_pk_y : Field; + nonce : Field; + }; + +type Cipher := + mkCipher@{ + cipher_text : List Field; + cur_state : Field; + }; + +update_poseidon_state + (cur_msg secret_key_x : Field) (cipher : Cipher) : Cipher := + let + new_state := Cipher.cur_state cipher + cur_msg; + new_text := new_state :: Cipher.cipher_text cipher; + in mkCipher@{ + cipher_text := new_text; + cur_state := poseidonHash2 new_state secret_key_x; + }; + +generate_cipher + (poseidon_state : Field) + (secret_key_x : Field) + (plaintext : List Field) + : Cipher := + let + go (cipher : Cipher) : List Field -> Cipher + | [] := cipher@Cipher{cipher_text := reverse (Cipher.cipher_text cipher)} + | (m :: ms) := go (update_poseidon_state m secret_key_x cipher) ms; + in go + mkCipher@{ + cipher_text := []; + cur_state := poseidon_state; + } + plaintext; + +encryption + (messages : List Field) + (pk_x : Field) + (pk_y : Field) + (sk : Field) + (nonce : Field) + : EncryptionResult := + + let + -- Generate encryption key + pk := Ec.mkPoint pk_x pk_y; + secret_key := Ec.mul sk pk; + + -- PLAINTEXT_NUM := 10; + + -- TODO: Pad the messages here or outside of the circuit? + plaintext := messages; + + -- Init poseidon state + secret_key_x := Ec.Point.x secret_key; + poseidon_state := + poseidonHashList [secret_key_x; Ec.Point.y secret_key; nonce; 10]; + + -- Generate cipher + final_cipher := generate_cipher poseidon_state secret_key_x plaintext; + + -- Get MAC + mac := Cipher.cur_state final_cipher; + + -- Generate sender's pk + generator := Ec.mkPoint Ec.StarkCurve.GEN_X Ec.StarkCurve.GEN_Y; + sender_pk := Ec.mul sk generator; + + in case Cipher.cipher_text final_cipher of + | [ + elem0; + elem1; + elem2; + elem3; + elem4; + elem5; + elem6; + elem7; + elem8; + elem9; + ] := + mkEncryptionResult@{ + cipher_text_elem0 := elem0; + cipher_text_elem1 := elem1; + cipher_text_elem2 := elem2; + cipher_text_elem3 := elem3; + cipher_text_elem4 := elem4; + cipher_text_elem5 := elem5; + cipher_text_elem6 := elem6; + cipher_text_elem7 := elem7; + cipher_text_elem8 := elem8; + cipher_text_elem9 := elem9; + mac; + sender_pk_x := Ec.Point.x sender_pk; + sender_pk_y := Ec.Point.y sender_pk; + nonce; + } + | _ := mkEncryptionResult 0 0 0 0 0 0 0 0 0 0 0 0 0 0; + +main + (self_resource : Resource) + (resource_nf_key : Field) + (merkle_path : List (Pair Field Bool)) + : LogicResult := + + -- Check the self_resource resource commitment: + let + generated_npk : Field := poseidonHash2 resource_nf_key 0; + + is_output_resource := + case merkle_path of + -- merkle_path can not be empty + | nil := true + | (_, is_left) :: t := is_left; + + -- Actual npk + actual_npk := + if + | is_output_resource := Resource.npk self_resource + | else := generated_npk; + + -- check outside of circuit: assert resource_npk == (Resource.npk self_resource) + + -- PRF_EXPAND_PERSONALIZATION_FELT is from cairo_prover/src/lib.rs/PRF_EXPAND_PERSONALIZATION_FELT + PRF_EXPAND_PERSONALIZATION_FELT := 89564067232354163924078705540990330212; + resource_psi := + poseidonHashList + [ + PRF_EXPAND_PERSONALIZATION_FELT; + 0; + Resource.rseed self_resource; + Resource.nonce self_resource; + ]; + resource_rcm := + poseidonHashList + [ + PRF_EXPAND_PERSONALIZATION_FELT; + 1; + Resource.rseed self_resource; + Resource.nonce self_resource; + ]; + + resource_eph_field : Field := + if + | Resource.eph self_resource := 1 + | else := 0; + resource_cm := + poseidonHashList + [ + Resource.logic self_resource; + Resource.label self_resource; + Resource.data self_resource; + actual_npk; + Resource.nonce self_resource; + resource_psi; + Resource.quantity self_resource; + resource_eph_field; + resource_rcm; + ]; + + -- Generate the nullifier of self_resource resource + resource_nullifier_ := + poseidonHashList + [ + resource_nf_key; + Resource.nonce self_resource; + resource_psi; + resource_cm; + ]; + + self_resource_id_ := + if + | is_output_resource := resource_cm + | else := resource_nullifier_; + + root_ := check_merkle_path self_resource_id_ merkle_path; + + -- Encryption + messages := + [ + Resource.logic self_resource; + Resource.label self_resource; + Resource.quantity self_resource; + Resource.data self_resource; + resource_eph_field; + Resource.nonce self_resource; + Resource.npk self_resource; + Resource.rseed self_resource; + 0; + 0; + ]; + + cihper := encryption messages Ec.StarkCurve.GEN_X Ec.StarkCurve.GEN_Y 1 1; + -- cihper_ := encryption [Resource.logic self_resource; Resource.label self_resource; Resource.quantity self_resource; Resource.data self_resource; Resource.eph self_resource; Resource.nonce self_resource; Resource.npk self_resource; Resource.rseed self_resource; 0; 0 ] Ec.StarkCurve.GEN_X Ec.StarkCurve.GEN_Y 1 1; + in mkResult@{ + self_resource_id := self_resource_id_; + root := root_; + cipher_text_elem0 := EncryptionResult.cipher_text_elem0 cihper; + cipher_text_elem1 := EncryptionResult.cipher_text_elem1 cihper; + cipher_text_elem2 := EncryptionResult.cipher_text_elem2 cihper; + cipher_text_elem3 := EncryptionResult.cipher_text_elem3 cihper; + cipher_text_elem4 := EncryptionResult.cipher_text_elem4 cihper; + cipher_text_elem5 := EncryptionResult.cipher_text_elem5 cihper; + cipher_text_elem6 := EncryptionResult.cipher_text_elem6 cihper; + cipher_text_elem7 := EncryptionResult.cipher_text_elem7 cihper; + cipher_text_elem8 := EncryptionResult.cipher_text_elem8 cihper; + cipher_text_elem9 := EncryptionResult.cipher_text_elem9 cihper; + mac := EncryptionResult.mac cihper; + pk_x := EncryptionResult.sender_pk_x cihper; + pk_y := EncryptionResult.sender_pk_y cihper; + nonce := EncryptionResult.nonce cihper; + }; diff --git a/tests/Casm/Reg/positive/in/test044.json b/tests/Casm/Reg/positive/in/test044.json new file mode 100644 index 0000000000..09cd5f957e --- /dev/null +++ b/tests/Casm/Reg/positive/in/test044.json @@ -0,0 +1,3 @@ +{ + "val": 10 +} diff --git a/tests/Casm/Reg/positive/in/test045.json b/tests/Casm/Reg/positive/in/test045.json new file mode 100644 index 0000000000..09cd5f957e --- /dev/null +++ b/tests/Casm/Reg/positive/in/test045.json @@ -0,0 +1,3 @@ +{ + "val": 10 +} diff --git a/tests/Casm/Reg/positive/in/test046.json b/tests/Casm/Reg/positive/in/test046.json new file mode 100644 index 0000000000..09cd5f957e --- /dev/null +++ b/tests/Casm/Reg/positive/in/test046.json @@ -0,0 +1,3 @@ +{ + "val": 10 +} diff --git a/tests/Casm/Reg/positive/in/test047.json b/tests/Casm/Reg/positive/in/test047.json new file mode 100644 index 0000000000..09cd5f957e --- /dev/null +++ b/tests/Casm/Reg/positive/in/test047.json @@ -0,0 +1,3 @@ +{ + "val": 10 +} diff --git a/tests/Casm/Reg/positive/in/test048.json b/tests/Casm/Reg/positive/in/test048.json new file mode 100644 index 0000000000..c7a6a2f5ff --- /dev/null +++ b/tests/Casm/Reg/positive/in/test048.json @@ -0,0 +1,31 @@ +{ + "self_resource": { + "logic": "0x373bb1d37414c2edf111cf2f9f076517da99d38e44cdd716ca2ad00a07731e5", + "label": "0x12", + "quantity": "0x13", + "data": "0x14", + "eph": false, + "nonce": "0x26", + "npk": "0x7752582c54a42fe0fa35c40f07293bb7d8efe90e21d8d2c06a7db52d7d9b7a1", + "rseed": "0x48" + }, + "resource_nf_key": "0x1", + "merkle_path": [ + { + "fst": "0x33", + "snd": true + }, + { + "fst": "0x83", + "snd": false + }, + { + "fst": "0x73", + "snd": false + }, + { + "fst": "0x23", + "snd": false + } + ] +} diff --git a/tests/Casm/Reg/positive/out/test044.out b/tests/Casm/Reg/positive/out/test044.out new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/tests/Casm/Reg/positive/out/test044.out @@ -0,0 +1 @@ +11 diff --git a/tests/Casm/Reg/positive/out/test045.out b/tests/Casm/Reg/positive/out/test045.out new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/tests/Casm/Reg/positive/out/test045.out @@ -0,0 +1 @@ +11 diff --git a/tests/Casm/Reg/positive/out/test046.out b/tests/Casm/Reg/positive/out/test046.out new file mode 100644 index 0000000000..48082f72f0 --- /dev/null +++ b/tests/Casm/Reg/positive/out/test046.out @@ -0,0 +1 @@ +12 diff --git a/tests/Casm/Reg/positive/out/test047.out b/tests/Casm/Reg/positive/out/test047.out new file mode 100644 index 0000000000..2bd5a0a98a --- /dev/null +++ b/tests/Casm/Reg/positive/out/test047.out @@ -0,0 +1 @@ +22 diff --git a/tests/Casm/Reg/positive/out/test048.out b/tests/Casm/Reg/positive/out/test048.out new file mode 100644 index 0000000000..fd88d17557 --- /dev/null +++ b/tests/Casm/Reg/positive/out/test048.out @@ -0,0 +1 @@ +-245332851819226602385083744327390214455788255951827084039649627662983776294 diff --git a/tests/Casm/Reg/positive/test044.jvr b/tests/Casm/Reg/positive/test044.jvr new file mode 100644 index 0000000000..4bea0317f9 --- /dev/null +++ b/tests/Casm/Reg/positive/test044.jvr @@ -0,0 +1,20 @@ +-- Extend closure in true branch + +function f(x : field, y : field) : field { + tmp[0] = fadd x y; + ret tmp[0]; +} + +function main(val : field) : field { + tmp[0] = calloc f (); + br val, out: tmp[1] { + true: { + tmp[1] = cextend tmp[0] (1); + }; + false: { + tmp[1] = calloc f (1); + }; + }; + tmp[2] = call tmp[1] (val); + ret tmp[2]; +} diff --git a/tests/Casm/Reg/positive/test045.jvr b/tests/Casm/Reg/positive/test045.jvr new file mode 100644 index 0000000000..c1b1cce2f2 --- /dev/null +++ b/tests/Casm/Reg/positive/test045.jvr @@ -0,0 +1,20 @@ +-- Extend closure in false branch + +function f(x : field, y : field) : field { + tmp[0] = fadd x y; + ret tmp[0]; +} + +function main(val : field) : field { + tmp[0] = calloc f (); + br val, out: tmp[1] { + true: { + tmp[1] = calloc f (1); + }; + false: { + tmp[1] = cextend tmp[0] (1); + }; + }; + tmp[2] = call tmp[1] (val); + ret tmp[2]; +} diff --git a/tests/Casm/Reg/positive/test046.jvr b/tests/Casm/Reg/positive/test046.jvr new file mode 100644 index 0000000000..00788c4423 --- /dev/null +++ b/tests/Casm/Reg/positive/test046.jvr @@ -0,0 +1,20 @@ +-- Call in true branch + +function f(x : field) : field { + tmp[0] = fadd x 1F; + ret tmp[0]; +} + +function main(val : field) : field { + tmp[0] = fadd val 1F; + br val, out: tmp[1] { + true: { + tmp[1] = call f (val); + }; + false: { + tmp[1] = 1; + }; + }; + tmp[2] = fadd tmp[1] tmp[0]; + ret tmp[2]; +} diff --git a/tests/Casm/Reg/positive/test047.jvr b/tests/Casm/Reg/positive/test047.jvr new file mode 100644 index 0000000000..0a74fea229 --- /dev/null +++ b/tests/Casm/Reg/positive/test047.jvr @@ -0,0 +1,20 @@ +-- Call in false branch + +function f(x : field) : field { + tmp[0] = fadd x 1F; + ret tmp[0]; +} + +function main(val : field) : field { + tmp[0] = fadd val 1F; + br val, out: tmp[1] { + true: { + tmp[1] = 1; + }; + false: { + tmp[1] = call f (val); + }; + }; + tmp[2] = fadd tmp[1] tmp[0]; + ret tmp[2]; +} diff --git a/tests/Casm/Reg/positive/test048.jvr b/tests/Casm/Reg/positive/test048.jvr new file mode 100644 index 0000000000..c987ebdfa9 --- /dev/null +++ b/tests/Casm/Reg/positive/test048.jvr @@ -0,0 +1,116 @@ +-- Mock resource logic + +type Pair { + __comma__ : (*, *) -> Pair; +} + +type List { + nil : List; + __colon____colon__ : (*, List) -> List; +} + +type Resource { + mkResource : (field, field, field, field, bool, field, field, field) -> Resource; +} + +type LogicResult { + mkResult : field -> LogicResult; +} + +function poseidonHashList'(List) : field; +function poseidonHash2'(field, field) : field; +function main(Resource, field, List) : LogicResult; + +function poseidonHashList'(_X : List) : field { + tmp[1] = _X; + case[List] tmp[1] { + __colon____colon__: { + { + tmp[0] = tmp[1]; + tmp[1] = tmp[0].__colon____colon__[1]; + tmp[1] = call poseidonHashList' (tmp[1]); + tmp[2] = tmp[0].__colon____colon__[0]; + tmp[1] = fadd tmp[2] tmp[1]; + ret tmp[1]; + }; + }; + nil: { + nop; + tmp[1] = 0F; + ret tmp[1]; + }; + }; +} + +function poseidonHash2'(x : field, y : field) : field { + tmp[0] = y; + tmp[1] = x; + tmp[0] = fadd tmp[1] tmp[0]; + ret tmp[0]; +} + +function main(self_resource : Resource, resource_nf_key : field, merkle_path : List) : LogicResult { + tmp[2] = alloc nil (); + tmp[3] = alloc nil (); + tmp[4] = self_resource; + case[Resource] tmp[4], out: tmp[4] { + mkResource: { + tmp[0] = tmp[4]; + tmp[4] = tmp[0].mkResource[2]; + }; + }; + tmp[3] = alloc __colon____colon__ (tmp[4], tmp[3]); + tmp[4] = self_resource; + case[Resource] tmp[4], out: tmp[4] { + mkResource: { + tmp[0] = tmp[4]; + tmp[4] = tmp[0].mkResource[5]; + }; + }; + tmp[3] = alloc __colon____colon__ (tmp[4], tmp[3]); + tmp[4] = merkle_path; + case[List] tmp[4], out: tmp[4] { + __colon____colon__: { + { + tmp[0] = tmp[4]; + tmp[4] = tmp[0].__colon____colon__[0]; + case[Pair] tmp[4], out: tmp[4] { + __comma__: { + { + tmp[1] = tmp[4]; + tmp[4] = tmp[1].__comma__[1]; + }; + }; + }; + }; + }; + nil: { + nop; + tmp[4] = true; + }; + }; + br tmp[4], out: tmp[4] { + true: { + tmp[4] = self_resource; + case[Resource] tmp[4], out: tmp[4] { + mkResource: { + tmp[0] = tmp[4]; + tmp[4] = tmp[0].mkResource[6]; + }; + }; + }; + false: { + tmp[4] = 0F; + tmp[5] = resource_nf_key; + tmp[4] = call poseidonHash2' (tmp[5], tmp[4]); + }; + }; + tmp[3] = alloc __colon____colon__ (tmp[4], tmp[3]); + tmp[3] = call poseidonHashList' (tmp[3]); + tmp[2] = alloc __colon____colon__ (tmp[3], tmp[2]); + tmp[3] = resource_nf_key; + tmp[2] = alloc __colon____colon__ (tmp[3], tmp[2]); + tmp[2] = call poseidonHashList' (tmp[2]); + tmp[2] = alloc mkResult (tmp[2]); + ret tmp[2]; +} diff --git a/tests/negative/AmbiguousPackageId/Main.juvix b/tests/negative/AmbiguousPackageId/Main.juvix new file mode 100644 index 0000000000..fef5380749 --- /dev/null +++ b/tests/negative/AmbiguousPackageId/Main.juvix @@ -0,0 +1 @@ +module Main; diff --git a/tests/negative/AmbiguousPackageId/Package.juvix b/tests/negative/AmbiguousPackageId/Package.juvix new file mode 100644 index 0000000000..ade67217d3 --- /dev/null +++ b/tests/negative/AmbiguousPackageId/Package.juvix @@ -0,0 +1,9 @@ +module Package; + +import PackageDescription.V2 open; + +package : Package := + defaultPackage@?{ + name := "ambiguouspackageid"; + dependencies := [path "dep1"; path "dep2"]; + }; diff --git a/tests/negative/AmbiguousPackageId/dep1/Package.juvix b/tests/negative/AmbiguousPackageId/dep1/Package.juvix new file mode 100644 index 0000000000..8fc198954c --- /dev/null +++ b/tests/negative/AmbiguousPackageId/dep1/Package.juvix @@ -0,0 +1,9 @@ +module Package; + +import PackageDescription.V2 open; + +package : Package := + defaultPackage@?{ + name := "dep"; + dependencies := []; + }; diff --git a/tests/negative/AmbiguousPackageId/dep1/main.juvix b/tests/negative/AmbiguousPackageId/dep1/main.juvix new file mode 100644 index 0000000000..8bffabe306 --- /dev/null +++ b/tests/negative/AmbiguousPackageId/dep1/main.juvix @@ -0,0 +1 @@ +module main; diff --git a/tests/negative/AmbiguousPackageId/dep2/Package.juvix b/tests/negative/AmbiguousPackageId/dep2/Package.juvix new file mode 100644 index 0000000000..8fc198954c --- /dev/null +++ b/tests/negative/AmbiguousPackageId/dep2/Package.juvix @@ -0,0 +1,9 @@ +module Package; + +import PackageDescription.V2 open; + +package : Package := + defaultPackage@?{ + name := "dep"; + dependencies := []; + }; diff --git a/tests/negative/AmbiguousPackageId/dep2/main.juvix b/tests/negative/AmbiguousPackageId/dep2/main.juvix new file mode 100644 index 0000000000..8bffabe306 --- /dev/null +++ b/tests/negative/AmbiguousPackageId/dep2/main.juvix @@ -0,0 +1 @@ +module main; diff --git a/tests/positive/Internal/Positivity2/Package.juvix b/tests/positive/Internal/Positivity2/Package.juvix index 52600bdb7c..66f492f7fa 100644 --- a/tests/positive/Internal/Positivity2/Package.juvix +++ b/tests/positive/Internal/Positivity2/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "positivity2"; - dependencies := [] + dependencies := []; }; diff --git a/tests/positive/PackageLoader/PackageJuvixEmptyDependencies/Package.juvix b/tests/positive/PackageLoader/PackageJuvixEmptyDependencies/Package.juvix index 8e5ddde7ca..024c37b80c 100644 --- a/tests/positive/PackageLoader/PackageJuvixEmptyDependencies/Package.juvix +++ b/tests/positive/PackageLoader/PackageJuvixEmptyDependencies/Package.juvix @@ -6,5 +6,5 @@ import PackageDescription.V1 open; package : Package := defaultPackage@{ name := "package-juvix"; - dependencies := [] + dependencies := []; }; diff --git a/tests/positive/PackageLoader/YamlEmptyDependencies/Package.juvix b/tests/positive/PackageLoader/YamlEmptyDependencies/Package.juvix index 20d310a375..0cbdc856d7 100644 --- a/tests/positive/PackageLoader/YamlEmptyDependencies/Package.juvix +++ b/tests/positive/PackageLoader/YamlEmptyDependencies/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V1 open; package : Package := defaultPackage@{ name := "abc"; - dependencies := [] + dependencies := []; }; diff --git a/tests/positive/PackageLoaderV2/PackageJuvixEmptyDependencies/Package.juvix b/tests/positive/PackageLoaderV2/PackageJuvixEmptyDependencies/Package.juvix index 4da6bc3104..96cac83f54 100644 --- a/tests/positive/PackageLoaderV2/PackageJuvixEmptyDependencies/Package.juvix +++ b/tests/positive/PackageLoaderV2/PackageJuvixEmptyDependencies/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "package-juvix"; - dependencies := [] + dependencies := []; }; diff --git a/tests/positive/issue3068/Package.juvix b/tests/positive/issue3068/Package.juvix index d5fc44153a..1ef1dae07a 100644 --- a/tests/positive/issue3068/Package.juvix +++ b/tests/positive/issue3068/Package.juvix @@ -5,5 +5,5 @@ import PackageDescription.V2 open; package : Package := defaultPackage@{ name := "issue3068"; - dependencies := [] + dependencies := []; }; diff --git a/tests/smoke/Commands/format.smoke.yaml b/tests/smoke/Commands/format.smoke.yaml index 1f604f29a1..61fc9e407f 100644 --- a/tests/smoke/Commands/format.smoke.yaml +++ b/tests/smoke/Commands/format.smoke.yaml @@ -168,6 +168,22 @@ tests: stderr: '' exit-status: 1 + - name: format-project-package-dot-juvix + command: + shell: + - bash + script: | + temp=$(mktemp -d) + trap 'rm -rf -- "$temp"' EXIT + cd $temp + juvix init + echo "" >> Package.juvix + juvix format + stderr: '' + stdout: + contains: 'Package.juvix' + exit-status: 1 + - name: format-project-containing-unformatted-from-subdir command: shell: