eo-phi-normalizer 0.3.1 → 0.4.0
raw patch · 108 files changed
+7365/−1215 lines, 108 filesdep +PyFdep +bytestringdep +cerealdep −string-interpolatesetup-changed
Dependencies added: PyF, bytestring, cereal, regex-compat, with-utf8
Dependencies removed: string-interpolate
Files
- CHANGELOG.md +28/−0
- Setup.hs +41/−18
- app/Main.hs +165/−158
- data/0.36.0/org/eolang/as-phi.phi +14/−0
- data/0.36.0/org/eolang/bool.phi +77/−0
- data/0.36.0/org/eolang/bytes.phi +72/−0
- data/0.36.0/org/eolang/cage.phi +28/−0
- data/0.36.0/org/eolang/cti.phi +16/−0
- data/0.36.0/org/eolang/dataized.phi +14/−0
- data/0.36.0/org/eolang/error.phi +14/−0
- data/0.36.0/org/eolang/float.phi +147/−0
- data/0.36.0/org/eolang/go.phi +63/−0
- data/0.36.0/org/eolang/goto.phi +14/−0
- data/0.36.0/org/eolang/heap.phi +103/−0
- data/0.36.0/org/eolang/if.phi +16/−0
- data/0.36.0/org/eolang/int.phi +86/−0
- data/0.36.0/org/eolang/io/stdin.phi +21/−0
- data/0.36.0/org/eolang/io/stdout.phi +17/−0
- data/0.36.0/org/eolang/malloc.phi +35/−0
- data/0.36.0/org/eolang/memory.phi +81/−0
- data/0.36.0/org/eolang/nan.phi +82/−0
- data/0.36.0/org/eolang/negative-infinity.phi +266/−0
- data/0.36.0/org/eolang/nop.phi +18/−0
- data/0.36.0/org/eolang/positive-infinity.phi +266/−0
- data/0.36.0/org/eolang/ram.phi +34/−0
- data/0.36.0/org/eolang/rust.phi +16/−0
- data/0.36.0/org/eolang/seq.phi +14/−0
- data/0.36.0/org/eolang/string.phi +28/−0
- data/0.36.0/org/eolang/switch.phi +80/−0
- data/0.36.0/org/eolang/try.phi +16/−0
- data/0.36.0/org/eolang/tuple.phi +131/−0
- data/0.36.0/org/eolang/while.phi +78/−0
- data/0.37.0/org/eolang/as-phi.phi +14/−0
- data/0.37.0/org/eolang/bytes.phi +109/−0
- data/0.37.0/org/eolang/cage.phi +28/−0
- data/0.37.0/org/eolang/cti.phi +16/−0
- data/0.37.0/org/eolang/dataized.phi +14/−0
- data/0.37.0/org/eolang/error.phi +14/−0
- data/0.37.0/org/eolang/false.phi +33/−0
- data/0.37.0/org/eolang/float.phi +142/−0
- data/0.37.0/org/eolang/go.phi +66/−0
- data/0.37.0/org/eolang/int.phi +86/−0
- data/0.37.0/org/eolang/io/stdin.phi +21/−0
- data/0.37.0/org/eolang/io/stdout.phi +17/−0
- data/0.37.0/org/eolang/malloc.phi +94/−0
- data/0.37.0/org/eolang/nan.phi +62/−0
- data/0.37.0/org/eolang/negative-infinity.phi +248/−0
- data/0.37.0/org/eolang/positive-infinity.phi +248/−0
- data/0.37.0/org/eolang/rust.phi +16/−0
- data/0.37.0/org/eolang/seq.phi +14/−0
- data/0.37.0/org/eolang/string.phi +28/−0
- data/0.37.0/org/eolang/switch.phi +73/−0
- data/0.37.0/org/eolang/true.phi +33/−0
- data/0.37.0/org/eolang/try.phi +16/−0
- data/0.37.0/org/eolang/tuple.phi +128/−0
- data/0.37.0/org/eolang/while.phi +72/−0
- data/0.38.0/org/eolang/as-phi.phi +14/−0
- data/0.38.0/org/eolang/bytes.phi +107/−0
- data/0.38.0/org/eolang/cage.phi +28/−0
- data/0.38.0/org/eolang/cti.phi +16/−0
- data/0.38.0/org/eolang/dataized.phi +14/−0
- data/0.38.0/org/eolang/error.phi +14/−0
- data/0.38.0/org/eolang/false.phi +33/−0
- data/0.38.0/org/eolang/float.phi +142/−0
- data/0.38.0/org/eolang/go.phi +69/−0
- data/0.38.0/org/eolang/int.phi +86/−0
- data/0.38.0/org/eolang/io/stdin.phi +21/−0
- data/0.38.0/org/eolang/io/stdout.phi +17/−0
- data/0.38.0/org/eolang/malloc.phi +95/−0
- data/0.38.0/org/eolang/nan.phi +62/−0
- data/0.38.0/org/eolang/negative-infinity.phi +246/−0
- data/0.38.0/org/eolang/positive-infinity.phi +246/−0
- data/0.38.0/org/eolang/rust.phi +16/−0
- data/0.38.0/org/eolang/seq.phi +14/−0
- data/0.38.0/org/eolang/string.phi +28/−0
- data/0.38.0/org/eolang/switch.phi +73/−0
- data/0.38.0/org/eolang/true.phi +33/−0
- data/0.38.0/org/eolang/try.phi +16/−0
- data/0.38.0/org/eolang/tuple.phi +128/−0
- data/0.38.0/org/eolang/while.phi +64/−0
- eo-phi-normalizer.cabal +119/−15
- grammar/EO/Phi/Syntax.cf +1/−2
- src/Language/EO/Phi/Dataize.hs +237/−47
- src/Language/EO/Phi/Dependencies.hs +78/−0
- src/Language/EO/Phi/Normalize.hs +2/−33
- src/Language/EO/Phi/Pipeline/Config.hs +122/−0
- src/Language/EO/Phi/Pipeline/EOTests/Data.hs +65/−0
- src/Language/EO/Phi/Pipeline/EOTests/PrepareTests.hs +60/−0
- src/Language/EO/Phi/Report/Data.hs +14/−77
- src/Language/EO/Phi/Report/Html.hs +170/−159
- src/Language/EO/Phi/Rules/Common.hs +326/−66
- src/Language/EO/Phi/Rules/Fast.hs +176/−0
- src/Language/EO/Phi/Rules/PhiPaper.hs +0/−10
- src/Language/EO/Phi/Rules/Yaml.hs +52/−20
- src/Language/EO/Phi/Syntax/Abs.hs +2/−7
- src/Language/EO/Phi/Syntax/Lex.hs +113/−173
- src/Language/EO/Phi/Syntax/Lex.x +6/−6
- src/Language/EO/Phi/Syntax/Par.hs +356/−354
- src/Language/EO/Phi/Syntax/Par.y +10/−11
- src/Language/EO/Phi/Syntax/Print.hs +1/−2
- src/Language/EO/Phi/Syntax/Skel.hs +1/−2
- src/Language/EO/Phi/ToLaTeX.hs +68/−0
- test/Language/EO/Phi/DataizeSpec.hs +29/−4
- test/Language/EO/PhiSpec.hs +4/−4
- test/Language/EO/Rules/PhiPaperSpec.hs +88/−46
- test/Main.hs +8/−0
- test/Spec.hs +1/−1
- test/Test/EO/Phi.hs +1/−0
CHANGELOG.md view
@@ -6,6 +6,34 @@ and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## v0.4.0 — 2024-06-03++This version supports fast dataization with built-in rules and improves metrics with both built-in and user-defined rules (via YAML).++New:++- Add built-in rules+- Add more built-in dataization functions ([#291](https://github.com/objectionary/normalizer/pull/291))+- Support LaTeX format in output ([#308](https://github.com/objectionary/normalizer/pull/308))+- Speed up pipeline by caching EO compilation results ([#340](https://github.com/objectionary/normalizer/pull/340))+- Write generated PHI files as eo-phi-normalizer data files ([#286](https://github.com/objectionary/normalizer/pull/286))+- Update and commit docs in CI ([#286](https://github.com/objectionary/normalizer/pull/286))++Changes and fixes:++- Switch to EO 0.38.0 ([#335](https://github.com/objectionary/normalizer/pull/335))+- Remove VTX and Sigma ([#335](https://github.com/objectionary/normalizer/pull/335))+- Fix normalization and dataization rules w.r.t. xi and rho (see [#297](https://github.com/objectionary/normalizer/pull/297))+- Fix confluence tests ([#319](https://github.com/objectionary/normalizer/pull/319))+- Fix pipeline tests ([#338](https://github.com/objectionary/normalizer/pull/338))+- Integrate `transform-eo-tests` into normalizer ([#365](https://github.com/objectionary/normalizer/pull/365))+- Switch to GHC 9.6.4 ([#263](https://github.com/objectionary/normalizer/pull/263))++Documentation and maintenance:++- Add the `Quick Start` page ([#317](https://github.com/objectionary/normalizer/pull/317))+- Add the `Pipeline` page ([#261](https://github.com/objectionary/normalizer/pull/261))+ ## v0.3.1 — 2024-04-12 This version supports proper dataization of test programs with dependencies.
Setup.hs view
@@ -1,36 +1,59 @@-{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE CPP #-}+{-# LANGUAGE QuasiQuotes #-}+ -- Source: https://github.com/haskell/cabal/issues/6726#issuecomment-918663262 -- | Custom Setup that runs bnfc to generate the language sub-libraries -- for the parsers included in Ogma. module Main (main) where +import Data.List (intercalate) import Distribution.Simple (defaultMainWithHooks, hookedPrograms, postConf, preBuild, simpleUserHooks) import Distribution.Simple.Program (Program (..), findProgramVersion, simpleProgram)-import System.Process (system)-import Data.String.Interpolate (i)+import PyF (fmt)+import System.Exit (ExitCode (..))+import System.Process (callCommand) -- | Run BNFC, happy, and alex on the grammar before the actual build step. -- -- All options for bnfc are hard-coded here. main :: IO ()-main = defaultMainWithHooks $ simpleUserHooks- { hookedPrograms = [ bnfcProgram ]- , postConf = \args flags packageDesc localBuildInfo -> do-#ifndef mingw32_HOST_OS- _ <- system [i|- bnfc --haskell -d -p Language.EO.Phi --generic -o src/ grammar/EO/Phi/Syntax.cf- cd src/Language/EO/Phi/Syntax- alex Lex.x- happy Par.y- |]+main =+ defaultMainWithHooks $+ simpleUserHooks+ { hookedPrograms = [bnfcProgram]+ , postConf = \args flags packageDesc localBuildInfo -> do+ let+ isWindows =+#ifdef mingw32_HOST_OS+ True+#else+ False #endif- postConf simpleUserHooks args flags packageDesc localBuildInfo- }+ -- See the details on the command form in https://github.com/objectionary/normalizer/issues/347#issuecomment-2117097070+ command = intercalate "; " $+ [ "set -ex" ] <>+ [ "chcp.com" | isWindows ] <>+ [ "chcp.com 65001" | isWindows ] <>+ [ "bnfc --haskell -d -p Language.EO.Phi --generic -o src/ grammar/EO/Phi/Syntax.cf"+ , "cd src/Language/EO/Phi/Syntax"+ , "alex Lex.x"+ , "happy Par.y"+ , "true"+ ] + fullCommand = [fmt|bash -c ' {command} '|]++ putStrLn fullCommand++ _ <- callCommand fullCommand++ postConf simpleUserHooks args flags packageDesc localBuildInfo+ }+ -- | NOTE: This should be in Cabal.Distribution.Simple.Program.Builtin. bnfcProgram :: Program-bnfcProgram = (simpleProgram "bnfc")- { programFindVersion = findProgramVersion "--version" id- }+bnfcProgram =+ (simpleProgram "bnfc")+ { programFindVersion = findProgramVersion "--version" id+ }
app/Main.hs view
@@ -21,44 +21,53 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-}+{-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-partial-fields #-} {-# OPTIONS_GHC -Wno-type-defaults #-} module Main (main) where -import Control.Monad (foldM, forM, unless, when)-import Data.Foldable (forM_)- import Control.Exception (Exception (..), SomeException, catch, throw)+import Control.Lens.Lens ((&))+import Control.Lens.Operators ((?~))+import Control.Monad (forM, unless, when) import Data.Aeson (ToJSON) import Data.Aeson.Encode.Pretty (Config (..), Indent (..), defConfig, encodePrettyToTextBuilder')-import Data.List (intercalate)-import Data.String.Interpolate (i, iii)+import Data.Foldable (forM_)+import Data.List (intercalate, isPrefixOf)+import Data.Maybe (fromMaybe) import Data.Text.Internal.Builder (toLazyText) import Data.Text.Lazy as TL (unpack) import Data.Yaml (decodeFileThrow) import GHC.Generics (Generic)-import Language.EO.Phi (AlphaIndex (AlphaIndex), Attribute (Alpha), Binding (..), Bytes (Bytes), Function (..), Object (Formation), Program (Program), parseProgram, printTree)+import Language.EO.Phi (Binding (LambdaBinding), Bytes (Bytes), Object (Formation), Program (Program), parseProgram, printTree) import Language.EO.Phi.Dataize+import Language.EO.Phi.Dependencies import Language.EO.Phi.Metrics.Collect as Metrics (getProgramMetrics) import Language.EO.Phi.Metrics.Data as Metrics (ProgramMetrics (..), splitPath)-import Language.EO.Phi.Report.Data (Report'InputConfig (..), Report'OutputConfig (..), ReportConfig (..), ReportItem (..), makeProgramReport, makeReport)-import Language.EO.Phi.Report.Html (ReportFormat (..), reportCSS, reportJS, toStringReport)-import Language.EO.Phi.Report.Html qualified as ReportHtml (ReportConfig (..))+import Language.EO.Phi.Pipeline.Config+import Language.EO.Phi.Pipeline.EOTests.PrepareTests (prepareTests)+import Language.EO.Phi.Report.Data (makeProgramReport, makeReport)+import Language.EO.Phi.Report.Html (reportCSS, reportJS, toStringReport) import Language.EO.Phi.Rules.Common+import Language.EO.Phi.Rules.Fast (fastYegorInsideOut, fastYegorInsideOutAsRule) import Language.EO.Phi.Rules.Yaml (RuleSet (rules, title), convertRuleNamed, parseRuleSetFromFile)+import Language.EO.Phi.ToLaTeX+import Main.Utf8 import Options.Applicative hiding (metavar) import Options.Applicative qualified as Optparse (metavar)+import PyF (fmt, fmtTrim) import System.Directory (createDirectoryIfMissing, doesFileExist) import System.FilePath (takeDirectory) import System.IO (IOMode (WriteMode), getContents', hFlush, hPutStr, hPutStrLn, openFile, stdout) data CLI'TransformPhi = CLI'TransformPhi { chain :: Bool- , rulesPath :: String+ , rulesPath :: Maybe String , outputFile :: Maybe String , single :: Bool , json :: Bool+ , latex :: Bool , inputFile :: Maybe FilePath , dependencies :: [FilePath] , maxDepth :: Int@@ -67,12 +76,15 @@ deriving (Show) data CLI'DataizePhi = CLI'DataizePhi- { rulesPath :: String+ { rulesPath :: Maybe String , inputFile :: Maybe FilePath , dependencies :: [FilePath] , outputFile :: Maybe String , recursive :: Bool , chain :: Bool+ , latex :: Bool+ , asPackage :: Bool+ , minimizeStuckTerms :: Bool } deriving (Show) @@ -88,16 +100,19 @@ } deriving (Show) +newtype CLI'PreparePipelineTests = CLI'PreparePipelineTests+ { configFile :: FilePath+ }+ deriving (Show)+ data CLI = CLI'TransformPhi' CLI'TransformPhi | CLI'DataizePhi' CLI'DataizePhi | CLI'MetricsPhi' CLI'MetricsPhi | CLI'ReportPhi' CLI'ReportPhi+ | CLI'PreparePipelineTests' CLI'PreparePipelineTests deriving (Show) -fileMetavarName :: String-fileMetavarName = "FILE"- data MetavarName = MetavarName { file :: String , int :: String@@ -137,19 +152,28 @@ } outputFileOption :: Parser (Maybe String)-outputFileOption = optional $ strOption (long "output-file" <> short 'o' <> metavar.file <> help [i|Output to #{fileMetavarName}. When this option is not specified, output to stdout.|])+outputFileOption = optional $ strOption (long "output-file" <> short 'o' <> metavar.file <> help [fmt|Output to {metavarName.file}. When this option is not specified, output to stdout.|]) inputFileArg :: Parser (Maybe String)-inputFileArg = optional $ strArgument (metavar.file <> help [i|#{fileMetavarName} to read input from. When no #{fileMetavarName} is specified, read from stdin.|])+inputFileArg = optional $ strArgument (metavar.file <> help [fmt|{metavarName.file} to read input from. When no {metavarName.file} is specified, read from stdin.|]) dependenciesArg :: Parser [FilePath] dependenciesArg = many $- strOption (long "dependency-file" <> short 'd' <> metavar.file <> help [i|#{fileMetavarName} to read dependencies from (zero or more dependency files allowed).|])+ strOption (long "dependency-file" <> short 'd' <> metavar.file <> help [fmt|{metavarName.file} to read dependencies from (zero or more dependency files allowed).|]) jsonSwitch :: Parser Bool jsonSwitch = switch (long "json" <> short 'j' <> help "Output JSON.") +latexSwitch :: Parser Bool+latexSwitch = switch (long "tex" <> help "Output LaTeX.")++asPackageSwitch :: Parser Bool+asPackageSwitch = switch (long "as-package" <> help "Automatically inject (λ → Package) in the program if necessary, to dataize all fields.")++minimizeStuckTermsSwitch :: Parser Bool+minimizeStuckTermsSwitch = switch (long "minimize-stuck-terms" <> help "If a dataized (sub)term is stuck (cannot be fully dataized), use the minimal (by size) intermediate result.")+ bindingsPathOption :: Parser (Maybe String) bindingsPathOption = optional $@@ -159,10 +183,10 @@ <> metavar.path <> help let path' = metavarName.path- in [iii|- Report metrics for bindings of a formation accessible in a program by the #{path'}.+ in [fmtTrim|+ Report metrics for bindings of a formation accessible in a program by the {path'}. When this option is not specified, metrics for bindings are not reported.- Example of a #{path'}: 'org.eolang'.+ Example of a {path'}: 'org.eolang'. |] ) @@ -171,6 +195,7 @@ , transform :: Parser CLI'TransformPhi , dataize :: Parser CLI'DataizePhi , report :: Parser CLI'ReportPhi+ , preparePipelineTests :: Parser CLI'PreparePipelineTests } commandParser :: CommandParser@@ -184,41 +209,45 @@ pure CLI'MetricsPhi{..} transform = do- rulesPath <-- let file' = metavarName.file- in strOption (long "rules" <> short 'r' <> metavar.file <> help [i|#{file'} with user-defined rules. Must be specified.|])+ rulesPath <- optional $ strOption (long "rules" <> short 'r' <> metavar.file <> help [fmt|{metavarName.file} with user-defined rules. If unspecified, builtin set of rules is used.|]) chain <- switch (long "chain" <> short 'c' <> help "Output transformation steps.") json <- jsonSwitch+ latex <- latexSwitch outputFile <- outputFileOption single <- switch (long "single" <> short 's' <> help "Output a single expression.") maxDepth <- let maxValue = 10- in option auto (long "max-depth" <> metavar.int <> value maxValue <> help [i|Maximum depth of rules application. Defaults to #{maxValue}.|])+ in option auto (long "max-depth" <> metavar.int <> value maxValue <> help [fmt|Maximum depth of rules application. Defaults to {maxValue}.|]) maxGrowthFactor <- let maxValue = 10- in option auto (long "max-growth-factor" <> metavar.int <> value maxValue <> help [i|The factor by which to allow the input term to grow before stopping. Defaults to #{maxValue}.|])+ in option auto (long "max-growth-factor" <> metavar.int <> value maxValue <> help [fmt|The factor by which to allow the input term to grow before stopping. Defaults to {maxValue}.|]) inputFile <- inputFileArg dependencies <- dependenciesArg pure CLI'TransformPhi{..} dataize = do- rulesPath <- strOption (long "rules" <> short 'r' <> metavar.file <> help [i|#{fileMetavarName} with user-defined rules. Must be specified.|])+ rulesPath <- optional $ strOption (long "rules" <> short 'r' <> metavar.file <> help [fmt|{metavarName.file} with user-defined rules. If unspecified, builtin set of rules is used.|]) inputFile <- inputFileArg dependencies <- dependenciesArg outputFile <- outputFileOption recursive <- switch (long "recursive" <> help "Apply dataization + normalization recursively.") chain <- switch (long "chain" <> help "Display all the intermediate steps.")+ latex <- latexSwitch+ asPackage <- asPackageSwitch+ minimizeStuckTerms <- minimizeStuckTermsSwitch pure CLI'DataizePhi{..} report = do- configFile <-- let file' = metavarName.file- in strOption (long "config" <> short 'c' <> metavar.file <> help [i|The #{file'} with a report configuration.|])+ configFile <- strOption (long "config" <> short 'c' <> metavar.file <> help [fmt|A report configuration {metavarName.file}.|]) pure CLI'ReportPhi{..}+ preparePipelineTests = do+ configFile <- strOption (long "config" <> short 'c' <> metavar.file <> help [fmt|A pipeline tests configuration {metavarName.file}.|])+ pure CLI'PreparePipelineTests{..} data CommandParserInfo = CommandParserInfo { metrics :: ParserInfo CLI , transform :: ParserInfo CLI , dataize :: ParserInfo CLI , report :: ParserInfo CLI+ , preparePipelineTests :: ParserInfo CLI } commandParserInfo :: CommandParserInfo@@ -228,6 +257,7 @@ , transform = info (CLI'TransformPhi' <$> commandParser.transform) (progDesc "Transform a PHI program.") , dataize = info (CLI'DataizePhi' <$> commandParser.dataize) (progDesc "Dataize a PHI program.") , report = info (CLI'ReportPhi' <$> commandParser.report) (progDesc "Generate reports about initial and normalized PHI programs.")+ , preparePipelineTests = info (CLI'PreparePipelineTests' <$> commandParser.preparePipelineTests) (progDesc "Prepare EO test files for the pipeline.") } data CommandNames = CommandNames@@ -235,6 +265,7 @@ , metrics :: String , dataize :: String , report :: String+ , preparePipelineTests :: String } commandNames :: CommandNames@@ -244,6 +275,7 @@ , metrics = "metrics" , dataize = "dataize" , report = "report"+ , preparePipelineTests = "prepare-pipeline-tests" } cli :: Parser CLI@@ -253,6 +285,7 @@ <> command commandNames.metrics commandParserInfo.metrics <> command commandNames.dataize commandParserInfo.dataize <> command commandNames.report commandParserInfo.report+ <> command commandNames.preparePipelineTests commandParserInfo.preparePipelineTests ) cliOpts :: ParserInfo CLI@@ -267,6 +300,9 @@ } deriving (Generic, ToJSON) +logEntryToPair :: LogEntry a -> (String, a)+logEntryToPair LogEntry{..} = (logEntryMessage, logEntryLog)+ encodeToJSONString :: (ToJSON a) => a -> String encodeToJSONString = TL.unpack . toLazyText . encodePrettyToTextBuilder' defConfig{confIndent = Spaces 2} @@ -286,11 +322,11 @@ instance Show CLI'Exception where show :: CLI'Exception -> String show = \case- NotAFormation{..} -> [i|Could not find bindings at path '#{bindingsPath}' because an object at '#{path}' is not a formation.|]- FileDoesNotExist{..} -> [i|File '#{file}' does not exist.|]- CouldNotRead{..} -> [i|Could not read the program:\n#{message}|]- CouldNotParse{..} -> [i|An error occurred when parsing the input program:\n#{message}|]- CouldNotNormalize -> [i|Could not normalize the program.|]+ NotAFormation{..} -> [fmt|Could not find bindings at path '{bindingsPath}' because an object at '{path}' is not a formation.|]+ FileDoesNotExist{..} -> [fmt|File '{file}' does not exist.|]+ CouldNotRead{..} -> [fmt|Could not read the program:\n{message}|]+ CouldNotParse{..} -> [fmt|An error occurred when parsing the input program:\n{message}|]+ CouldNotNormalize -> [fmt|Could not normalize the program.|] CouldNotMergeDependencies{..} -> message Impossible{..} -> message @@ -333,9 +369,9 @@ in Left $ Impossible- [iii|+ [fmtTrim| Impossible happened!- The option #{bindingsPath'} was not specified yet there were errors finding attributes by #{path'}.+ The option {bindingsPath'} was not specified yet there were errors finding attributes by {path'}. |] Just bindingsPath' -> Left $ NotAFormation (intercalate "." path) bindingsPath' )@@ -346,83 +382,15 @@ program <- getProgram inputFile either throw pure (getMetrics' program bindingsPath) --- ** Merging programs with dependencies--bindingAttr :: Binding -> Maybe Attribute-bindingAttr (AlphaBinding a _) = Just a-bindingAttr (EmptyBinding a) = Just a-bindingAttr (DeltaBinding _) = Just (Alpha (AlphaIndex "Δ"))-bindingAttr DeltaEmptyBinding = Just (Alpha (AlphaIndex "Δ"))-bindingAttr LambdaBinding{} = Just (Alpha (AlphaIndex "λ"))-bindingAttr MetaBindings{} = Nothing-bindingAttr MetaDeltaBinding{} = Nothing--zipBindings :: [Binding] -> [Binding] -> ([Binding], [(Binding, Binding)])-zipBindings xs ys = (xs' <> ys', collisions)- where- as = map bindingAttr xs- bs = map bindingAttr ys-- xs' = [x | x <- xs, bindingAttr x `notElem` bs]- ys' = [y | y <- ys, bindingAttr y `notElem` as]- collisions =- [ (x, y)- | x <- xs- , y <- ys- , bindingAttr x == bindingAttr y- ]--isPackage :: [Binding] -> Bool-isPackage = any isPackageBinding--isPackageBinding :: Binding -> Bool-isPackageBinding (LambdaBinding (Function "Package")) = True-isPackageBinding _ = False--mergeBinding :: Binding -> Binding -> Either String Binding-mergeBinding (AlphaBinding a (Formation xs)) (AlphaBinding b (Formation ys))- | a == b = AlphaBinding a . Formation <$> mergeBindings xs ys-mergeBinding x y | x == y = return x-mergeBinding x y =- Left $- concat @[]- [ "conflict when adding dependencies (trying to merge non-formations)"- , printTree x- , printTree y- ]--mergeBindings :: [Binding] -> [Binding] -> Either String [Binding]-mergeBindings xs ys- | isPackage xs && isPackage ys = do- case zipBindings xs ys of- (zs, collisions) -> do- ws <- mapM (uncurry mergeBinding) collisions- return (zs <> ws)- | otherwise =- Left $- concat @[]- [ "conflict when adding dependencies (trying to merge non-Package formations "- , printTree (Formation xs)- , printTree (Formation ys)- , " )"- ]--deepMerge :: Program -> Program -> Either String Program-deepMerge (Program xs) (Program ys) = Program <$> mergeBindings (mkPackage xs) (mkPackage ys)- where- mkPackage bs- | isPackage bs = bs- -- FIXME: check if lambda attribute exists and throw error!- | otherwise = LambdaBinding (Function "Package") : bs--deepMergePrograms :: [Program] -> Either String Program-deepMergePrograms [] = Right (Program [])-deepMergePrograms (p : ps) = foldM deepMerge p ps+injectLamdbaPackage :: [Binding] -> [Binding]+injectLamdbaPackage bs+ | any isPackageBinding bs = bs+ | otherwise = bs ++ [LambdaBinding "Package"] -- * Main main :: IO ()-main = do+main = withUtf8 do opts <- customExecParser pprefs cliOpts let printAsProgramOrAsObject = \case Formation bindings' -> printTree $ Program bindings'@@ -430,14 +398,21 @@ case opts of CLI'MetricsPhi' CLI'MetricsPhi{..} -> do (logStrLn, _) <- getLoggers outputFile+ -- logStrLn "Computing metrics" metrics <- getMetrics bindingsPath inputFile logStrLn $ encodeToJSONString metrics CLI'TransformPhi' CLI'TransformPhi{..} -> do program' <- getProgram inputFile deps <- mapM (getProgram . Just) dependencies (logStrLn, logStr) <- getLoggers outputFile- ruleSet <- parseRuleSetFromFile rulesPath- unless (single || json) $ logStrLn ruleSet.title+ -- logStrLn "Running transform"+ (builtin, ruleSetTitle, rules) <-+ case rulesPath of+ Just path -> do+ ruleSet <- parseRuleSetFromFile path+ return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)+ Nothing -> return (True, "Yegor's rules (builtin)", [fastYegorInsideOutAsRule])+ unless (single || json) $ logStrLn ruleSetTitle bindingsWithDeps <- case deepMergePrograms (program' : deps) of Left err -> throw (CouldNotMergeDependencies err) Right (Program bindingsWithDeps) -> return bindingsWithDeps@@ -445,10 +420,11 @@ uniqueResults -- Something here seems incorrect | chain = map fst $ applyRulesChainWith' limits ctx (Formation bindings)- | otherwise = pure . ("",) <$> applyRulesWith limits ctx (Formation bindings)+ | builtin = return [LogEntry "" (fastYegorInsideOut ctx (Formation bindings)) 0]+ | otherwise = (\x -> [LogEntry "" x 0]) <$> applyRulesWith limits ctx (Formation bindings) where limits = ApplicationLimits maxDepth (maxGrowthFactor * objectSize (Formation bindings))- ctx = defaultContext (convertRuleNamed <$> ruleSet.rules) (Formation bindingsWithDeps) -- IMPORTANT: context contains dependencies!+ ctx = (defaultContext rules (Formation bindingsWithDeps)){builtinRules = builtin} -- IMPORTANT: context contains dependencies! totalResults = length uniqueResults when (null uniqueResults || null (head uniqueResults)) (throw CouldNotNormalize) if@@ -456,17 +432,24 @@ logStrLn . encodeToJSONString . printAsProgramOrAsObject- $ snd (head (head uniqueResults))+ $ logEntryLog (head (head uniqueResults)) | single -> logStrLn . printAsProgramOrAsObject- $ snd (head (head uniqueResults))+ $ logEntryLog (head (head uniqueResults)) | json -> logStrLn . encodeToJSONString $ StructuredJSON { input = printTree program'- , output = (propagateName1 printAsProgramOrAsObject <$>) <$> uniqueResults+ , output = (logEntryToPair . fmap printAsProgramOrAsObject <$>) <$> uniqueResults }+ | chain && latex -> do+ logStrLn . toLatexString $ Formation bindings+ forM_ uniqueResults $ \steps -> do+ forM_ (init steps) $ \LogEntry{..} -> do+ logStrLn . toLatexString $ logEntryLog+ | latex ->+ logStrLn . toLatexString $ logEntryLog (head (head uniqueResults)) | otherwise -> do logStrLn "Input:" logStrLn (printTree program')@@ -475,68 +458,92 @@ logStrLn $ "Result " <> show index <> " out of " <> show totalResults <> ":" let n = length steps- forM_ (zip [1 ..] steps) $ \(k, (appliedRuleName, step)) -> do+ forM_ (zip [1 ..] steps) $ \(k, LogEntry{..}) -> do when chain $- logStr ("[ " <> show k <> " / " <> show n <> " ] " <> appliedRuleName <> ": ")- logStrLn . printAsProgramOrAsObject $ step+ logStr ("[ " <> show k <> " / " <> show n <> " ] " <> logEntryMessage <> ": ")+ logStrLn . printAsProgramOrAsObject $ logEntryLog logStrLn "----------------------------------------------------" CLI'DataizePhi' CLI'DataizePhi{..} -> do (logStrLn, _logStr) <- getLoggers outputFile+ -- logStrLn "Running dataize" program' <- getProgram inputFile deps <- mapM (getProgram . Just) dependencies bindingsWithDeps <- case deepMergePrograms (program' : deps) of Left err -> throw (CouldNotMergeDependencies err) Right (Program bindingsWithDeps) -> return bindingsWithDeps- ruleSet <- parseRuleSetFromFile rulesPath+ (builtin, _ruleSetTitle, rules) <-+ case rulesPath of+ Just path -> do+ ruleSet <- parseRuleSetFromFile path+ return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)+ Nothing -> return (True, "Yegor's rules (builtin)", [fastYegorInsideOutAsRule]) let (Program bindings) = program'- let inputObject = Formation bindings- let ctx = defaultContext (convertRuleNamed <$> ruleSet.rules) (Formation bindingsWithDeps) -- IMPORTANT: context contains dependencies!- ( if chain- then do- let dataizeChain- | recursive = dataizeRecursivelyChain'- | otherwise = dataizeStepChain'- forM_ (fst (dataizeChain ctx inputObject)) $ \case- (msg, Left obj) -> logStrLn (msg ++ ": " ++ printTree obj)- (msg, Right (Bytes bytes)) -> logStrLn (msg ++ ": " ++ bytes)- else do- let dataize- -- This should be moved to a separate subcommand- | recursive = dataizeRecursively- | otherwise = dataizeStep'- case dataize ctx inputObject of- Left obj -> logStrLn (printAsProgramOrAsObject obj)- Right (Bytes bytes) -> logStrLn bytes- )+ inputObject+ | asPackage = Formation (injectLamdbaPackage bindings)+ | otherwise = Formation bindings+ ctx =+ (defaultContext rules (Formation bindingsWithDeps)) -- IMPORTANT: context contains dependencies!+ { minimizeTerms = minimizeStuckTerms+ , builtinRules = builtin+ }+ if chain+ then do+ let dataizeChain+ | recursive = dataizeRecursivelyChain'+ | otherwise = dataizeStepChain'+ if latex+ then do+ logStrLn . toLatexString $ Formation bindings+ forM_ (fst (dataizeChain ctx inputObject)) $ \LogEntry{..} ->+ case logEntryLog of+ Left obj ->+ when ("Rule" `isPrefixOf` logEntryMessage) $+ logStrLn . toLatexString $+ obj+ Right (Bytes bytes) -> logStrLn bytes+ else do+ forM_ (fst (dataizeChain ctx inputObject)) $ \LogEntry{..} ->+ case logEntryLog of+ Left obj -> logStrLn (replicate logEntryLevel ' ' ++ logEntryMessage ++ ": " ++ printTree obj)+ Right (Bytes bytes) -> logStrLn (replicate logEntryLevel ' ' ++ logEntryMessage ++ ": " ++ bytes)+ else do+ let dataize+ -- This should be moved to a separate subcommand+ | recursive = dataizeRecursively+ | otherwise = dataizeStep'+ case dataize ctx inputObject of+ Left obj -> logStrLn (printAsProgramOrAsObject obj)+ Right (Bytes bytes) -> logStrLn bytes CLI'ReportPhi' CLI'ReportPhi{..} -> do- reportConfig <- decodeFileThrow configFile-- programReports <- forM reportConfig.items $ \item -> do- metricsPhi <- getMetrics item.bindingsPathPhi (Just item.phi)- metricsPhiNormalized <- getMetrics item.bindingsPathPhiNormalized (Just item.phiNormalized)- pure $ makeProgramReport reportConfig item metricsPhi metricsPhiNormalized-- css <- maybe (pure reportCSS) readFile (reportConfig.input >>= (.css))- js <- maybe (pure reportJS) readFile (reportConfig.input >>= (.js))+ pipelineConfig <- decodeFileThrow @_ @PipelineConfig configFile+ let testSets = filter (fromMaybe True . (.enable)) pipelineConfig.testSets+ programReports <- forM (zip [1 ..] testSets) $ \(index :: Int, (.phi) -> testSet) -> do+ let progress = [fmt|({index}/{length testSets})|] :: String+ putStrLn [fmt|Processing {progress}: {testSet.initial}|]+ metricsPhi <- getMetrics testSet.bindingsPathInitial (Just testSet.initial)+ putStrLn [fmt|Processing {progress}: {testSet.normalized}|]+ metricsPhiNormalized <- getMetrics testSet.bindingsPathNormalized (Just testSet.normalized)+ pure $ makeProgramReport pipelineConfig testSet metricsPhi metricsPhiNormalized - let report = makeReport reportConfig programReports- ReportConfig{..} = reportConfig- reportConfigHtml = ReportHtml.ReportConfig{format = ReportFormat'Html{..}, ..}- reportHtml = toStringReport reportConfigHtml report+ css <- maybe (pure reportCSS) readFile (pipelineConfig.report.input >>= (.css))+ js <- maybe (pure reportJS) readFile (pipelineConfig.report.input >>= (.js)) + let report = makeReport pipelineConfig programReports+ reportHtml = toStringReport ReportFormat'Html (pipelineConfig & #report . #input ?~ ReportInput{css = Just css, js = Just js}) report reportJson = encodeToJSONString report-- reportConfigMarkdown = ReportHtml.ReportConfig{format = ReportFormat'Markdown, ..}- reportMarkdown = toStringReport reportConfigMarkdown report+ reportMarkdown = toStringReport ReportFormat'Markdown pipelineConfig report forM_ @[] [ (x, y) | (Just x, y) <-- [ (reportConfig.output.html, reportHtml)- , (reportConfig.output.json, reportJson)- , (reportConfig.output.markdown, reportMarkdown)+ [ (pipelineConfig.report.output.html, reportHtml)+ , (pipelineConfig.report.output.json, reportJson)+ , (pipelineConfig.report.output.markdown, reportMarkdown) ] ] $ \(path, reportString) -> do createDirectoryIfMissing True (takeDirectory path) writeFile path reportString+ CLI'PreparePipelineTests' CLI'PreparePipelineTests{..} -> do+ config <- decodeFileThrow @_ @PipelineConfig configFile+ prepareTests config
+ data/0.36.0/org/eolang/as-phi.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ as-phi ↦ ⟦+ λ ⤍ Lorg_eolang_as_phi,+ x ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/bool.phi view
@@ -0,0 +1,77 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ bool ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ not ↦ ⟦+ φ ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ ).eq(+ α0 ↦ ξ.ρ+ )+ ⟧,+ and ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.ρ,+ α1 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.x,+ α1 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ ),+ α2 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ),+ α2 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ ⟧,+ or ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ ),+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.x,+ α1 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ ),+ α2 ↦ ξ.σ.σ.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/bytes.phi view
@@ -0,0 +1,72 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ bytes ↦ ⟦+ eq ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_eq,+ x ↦ ∅+ ⟧,+ size ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_size+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧,+ as-string ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_as_string+ ⟧,+ as-int ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_as_int+ ⟧,+ as-float ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_as_float+ ⟧,+ and ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_and,+ b ↦ ∅+ ⟧,+ or ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_or,+ b ↦ ∅+ ⟧,+ xor ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_xor,+ b ↦ ∅+ ⟧,+ not ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_not+ ⟧,+ left ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.right(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ right ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_right,+ x ↦ ∅+ ⟧,+ as-bool ↦ ⟦+ φ ↦ ξ.ρ.eq(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ ⟧,+ as-bytes ↦ ⟦+ φ ↦ ξ.ρ+ ⟧,+ concat ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_concat,+ b ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/cage.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cage ↦ ⟦+ object ↦ ∅,+ new ↦ ξ.φ.self,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_φ+ ⟧,+ encaged ↦ ⟦+ locator ↦ ∅,+ self ↦ ξ,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_φ+ ⟧,+ encage ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_encage,+ object ↦ ∅+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/cti.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cti ↦ ⟦+ delegate ↦ ∅,+ level ↦ ∅,+ message ↦ ∅,+ φ ↦ ξ.delegate+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/dataized.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ dataized ↦ ⟦+ λ ⤍ Lorg_eolang_dataized,+ target ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/error.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ error ↦ ⟦+ λ ⤍ Lorg_eolang_error,+ message ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/float.phi view
@@ -0,0 +1,147 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ float ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ x-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ self-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ+ ).as-bytes,+ nan-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.nan+ ).as-bytes,+ pos-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ neg-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ )+ ),+ α1 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ ),+ α2 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ ).and(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ )+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.x-as-bytes+ )+ )+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_float_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_float_times,+ x ↦ ∅+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_float_plus,+ x ↦ ∅+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ )+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_float_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/go.phi view
@@ -0,0 +1,63 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ go ↦ ⟦+ id ↦ Φ.org.eolang.malloc(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ ).id.as-bytes,+ to ↦ ⟦+ body ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ξ.body(+ α0 ↦ ξ.token+ ),+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.σ.ρ.id.eq(+ α0 ↦ ξ.e.id+ ),+ α1 ↦ ξ.e.value,+ α2 ↦ Φ.org.eolang.error(+ α0 ↦ ξ.e+ )+ )+ ⟧,+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ ),+ token ↦ ⟦+ backward ↦ Φ.org.eolang.error(+ α0 ↦ ⟦+ value ↦ ξ.σ.ρ.ρ.to(+ α0 ↦ ξ.σ.ρ.body+ ),+ id ↦ ξ.σ.ρ.ρ.id+ ⟧+ ),+ forward ↦ ⟦+ res ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ ⟦+ value ↦ ξ.σ.res,+ id ↦ ξ.σ.ρ.ρ.ρ.id+ ⟧+ )+ ⟧+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/goto.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ goto ↦ ⟦+ λ ⤍ Lambda,+ f ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/heap.phi view
@@ -0,0 +1,103 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ heap ↦ ⟦+ size ↦ ∅,+ malloc ↦ ⟦+ s ↦ ∅,+ next ↦ Φ.org.eolang.memory(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ new-next ↦ ξ.s.plus(+ α0 ↦ ξ.ρ.malloc.next.as-int+ ),+ φ ↦ ξ.new-next.gt(+ α0 ↦ ξ.σ.size+ ).if(+ α0 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 41-6C-6C-6F-63-61-74-69-6F-6E-20-66-61-69-6C-65-64-3A-20-62-61-64-20-61-6C-6C-6F-63-20-28-6E-6F-74-20-65-6E-6F-75-67-68-20-6D-65-6D-6F-72-79-20-69-6E-20-74-68-65-20-68-65-61-70-29+ )+ )+ ),+ α1 ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.malloc.next.write(+ α0 ↦ ξ.new-next+ )+ ),+ α1 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).plus(+ α0 ↦ ξ.ρ.malloc.next.as-int+ )+ )+ )+ )+ ⟧,+ free ↦ ⟦+ p ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.p+ ),+ α1 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ )+ )+ ⟧,+ pointer ↦ ⟦+ address ↦ ∅,+ length ↦ ∅,+ φ ↦ ξ.address,+ add ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.ρ.pointer(+ α0 ↦ ξ.σ.address.plus(+ α0 ↦ ξ.σ.length.times(+ α0 ↦ ξ.x+ )+ ),+ α1 ↦ ξ.σ.length+ )+ ⟧,+ sub ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.add(+ α0 ↦ ξ.x.times(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ )+ ⟧,+ block ↦ ⟦+ λ ⤍ Lambda,+ len ↦ ∅,+ inverse ↦ ∅+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/if.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ if ↦ ⟦+ λ ⤍ Lorg_eolang_if,+ condition ↦ ∅,+ left ↦ ∅,+ right ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/int.phi view
@@ -0,0 +1,86 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ int ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.σ.σ.int(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_int_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.σ.σ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_int_plus,+ x ↦ ∅+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_int_times,+ x ↦ ∅+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_int_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/io/stdin.phi view
@@ -0,0 +1,21 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdin ↦ ⟦+ next-line ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_next_line+ ⟧,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_φ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/io/stdout.phi view
@@ -0,0 +1,17 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdout ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdout,+ text ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/malloc.phi view
@@ -0,0 +1,35 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ malloc ↦ ⟦+ size ↦ ∅,+ pointer ↦ ξ.φ.pointer,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_φ+ ⟧,+ memory-block-pointer ↦ ⟦+ id ↦ ∅,+ pointer ↦ ξ,+ size ↦ ξ.ρ.size,+ read ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_memory_block_pointer_read,+ offset ↦ ∅,+ length ↦ ∅+ ⟧,+ write ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_memory_block_pointer_write,+ offset ↦ ∅,+ data ↦ ∅+ ⟧,+ free ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_memory_block_pointer_free+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/memory.phi view
@@ -0,0 +1,81 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ memory ↦ ⟦+ data ↦ ∅,+ alloc ↦ ξ.φ.alloc,+ φ ↦ ⟦+ bts ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.data+ ).as-bytes,+ p ↦ Φ.org.eolang.malloc(+ α0 ↦ ξ.bts.size+ ).pointer,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.p.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.bts+ )+ ),+ α1 ↦ ξ.ρ.allocated(+ α0 ↦ ξ.p+ )+ )+ )+ ⟧,+ allocated ↦ ⟦+ pointer ↦ ∅,+ alloc ↦ ξ,+ φ ↦ ξ.pointer.read(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.pointer.size+ ),+ write ↦ ⟦+ data ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.pointer.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.data+ )+ ),+ α1 ↦ ξ.ρ.pointer.read(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.ρ.pointer.size+ )+ )+ )+ ⟧,+ free ↦ ⟦+ φ ↦ ξ.ρ.pointer.free+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/nan.phi view
@@ -0,0 +1,82 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ nan ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.σ+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/negative-infinity.phi view
@@ -0,0 +1,266 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ negative-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.σ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ ⟧,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ ξ.σ.σ.negative-infinity,+ α2 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.positive-infinity.as-bytes+ ).as-bytes,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ ξ.σ.σ.negative-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ ξ.σ.σ.negative-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.σ.σ.σ.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ ξ.σ.σ.negative-infinity,+ α2 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/nop.phi view
@@ -0,0 +1,18 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ nop ↦ ⟦+ args ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/positive-infinity.phi view
@@ -0,0 +1,266 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ positive-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 3F-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.σ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ ξ.σ.σ.positive-infinity,+ α2 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ ξ.σ.σ.positive-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.positive-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ ξ.σ.σ.positive-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.σ.σ.σ.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ),+ α1 ↦ Φ.org.eolang.nan,+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ),+ α1 ↦ ξ.σ.σ.positive-infinity,+ α2 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/ram.phi view
@@ -0,0 +1,34 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ ram ↦ ⟦+ size ↦ ∅,+ write ↦ ⟦+ λ ⤍ Lambda,+ position ↦ ∅,+ data ↦ ∅+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lambda,+ position ↦ ∅,+ size ↦ ∅+ ⟧,+ ram-slice ↦ ⟦+ position ↦ ∅,+ size ↦ ∅,+ φ ↦ ⟦+ λ ⤍ Lambda+ ⟧,+ write ↦ ⟦+ λ ⤍ Lambda,+ data ↦ ∅+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/rust.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ rust ↦ ⟦+ λ ⤍ Lorg_eolang_rust,+ code ↦ ∅,+ portal ↦ ∅,+ params ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/seq.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ seq ↦ ⟦+ λ ⤍ Lorg_eolang_seq,+ steps ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/string.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ string ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ length ↦ ⟦+ λ ⤍ Lorg_eolang_string_length+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_string_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/switch.phi view
@@ -0,0 +1,80 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ switch ↦ ⟦+ cases ↦ ∅,+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.cases.length+ ).as-bytes,+ case-at ↦ ⟦+ index ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.index.eq(+ α0 ↦ ξ.ρ.len+ ),+ α1 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ ),+ α2 ↦ Φ.org.eolang.if(+ α0 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ α1 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ ),+ α2 ↦ ξ.ρ.case-at(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ case ↦ ξ.ρ.cases.at(+ α0 ↦ ξ.index+ )+ ⟧,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.len.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 73-77-69-74-63-68-20-63-61-73-65-73-20-61-72-65-20-65-6D-70-74-79+ )+ )+ ),+ α2 ↦ ξ.case-at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/try.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ try ↦ ⟦+ λ ⤍ Lorg_eolang_try,+ main ↦ ∅,+ catch ↦ ∅,+ finally ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/tuple.phi view
@@ -0,0 +1,131 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ tuple ↦ ⟦+ head ↦ ∅,+ tail ↦ ∅,+ empty ↦ ⟦+ at ↦ ⟦+ i ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-67-65-74-20-61-6E-20-6F-62-6A-65-63-74-20-66-72-6F-6D-20-74-68-65-20-65-6D-70-74-79-20-74-75-70-6C-65+ )+ )+ )+ ⟧,+ with ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.σ.tuple(+ α0 ↦ ξ.σ.σ.σ.tuple.empty,+ α1 ↦ ξ.x+ )+ ⟧,+ length ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ⟧,+ length ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ ξ.len+ ),+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.head.length.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ ).as-bytes+ ⟧,+ at ↦ ⟦+ i ↦ ∅,+ len ↦ ξ.ρ.length,+ index ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.if(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.idx+ ),+ α1 ↦ ξ.len.plus(+ α0 ↦ ξ.idx+ ),+ α2 ↦ ξ.idx+ )+ ).as-bytes,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.index+ ).or(+ α0 ↦ ξ.len.lte(+ α0 ↦ ξ.index+ )+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 47-69-76-65-6E-20-69-6E-64-65-78-20-69-73-20-6F-75-74-20-6F-66-20-74-75-70-6C-65-20-62-6F-75-6E-64-73+ )+ )+ ),+ α2 ↦ ξ.at-fast(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.len+ )+ ),+ at-fast ↦ ⟦+ tup ↦ ∅,+ len ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ ).gt(+ α0 ↦ ξ.ρ.index+ ),+ α1 ↦ ξ.ρ.at-fast(+ α0 ↦ ξ.tup.head,+ α1 ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ),+ α2 ↦ ξ.tup.tail+ )+ ⟧,+ idx ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.i+ ).as-bytes+ ⟧,+ with ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.tuple(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.x+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.36.0/org/eolang/while.phi view
@@ -0,0 +1,78 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ while ↦ ⟦+ condition ↦ ∅,+ body ↦ ∅,+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.condition,+ α1 ↦ ξ.start(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ α2 ↦ Φ.org.eolang.bool(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ )+ )+ ),+ start ↦ ⟦+ index ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.body(+ α0 ↦ ξ.index+ )+ ),+ α1 ↦ ξ.ρ.loop(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ )+ ⟧,+ loop ↦ ⟦+ index ↦ ∅,+ current ↦ ξ.ρ.body(+ α0 ↦ ξ.index+ ),+ φ ↦ Φ.org.eolang.if(+ α0 ↦ ξ.ρ.condition,+ α1 ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.current+ ),+ α1 ↦ ξ.ρ.loop(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ α2 ↦ ξ.current+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/as-phi.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ as-phi ↦ ⟦+ λ ⤍ Lorg_eolang_as_phi,+ x ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/bytes.phi view
@@ -0,0 +1,109 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ bytes ↦ ⟦+ Δ ⤍ ∅,+ eq ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_eq,+ b ↦ ∅+ ⟧,+ size ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_size+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧,+ as-string ↦ ⟦+ φ ↦ Φ.org.eolang.string(+ α0 ↦ ξ.ρ+ )+ ⟧,+ as-int ↦ ⟦+ φ ↦ ξ.ρ.size.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ ξ.ρ+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-63-6F-6E-76-65-72-74-20-6E-6F-6E-20-38-20-6C-65-6E-67-74-68-20-62-79-74-65-73-20-74-6F-20-69-6E-74+ )+ )+ )+ )+ ⟧,+ as-float ↦ ⟦+ φ ↦ ξ.ρ.size.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ ξ.ρ+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-63-6F-6E-76-65-72-74-20-6E-6F-6E-20-38-20-6C-65-6E-67-74-68-20-62-79-74-65-73-20-74-6F-20-66-6C-6F-61-74+ )+ )+ )+ )+ ⟧,+ and ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_and,+ b ↦ ∅+ ⟧,+ or ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_or,+ b ↦ ∅+ ⟧,+ xor ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_xor,+ b ↦ ∅+ ⟧,+ not ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_not+ ⟧,+ left ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.right(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ right ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_right,+ x ↦ ∅+ ⟧,+ as-bool ↦ ⟦+ φ ↦ ξ.ρ.eq(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ ⟧,+ as-bytes ↦ ⟦+ φ ↦ ξ.ρ+ ⟧,+ concat ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_concat,+ b ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/cage.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cage ↦ ⟦+ object ↦ ∅,+ new ↦ ξ.φ.self,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_φ+ ⟧,+ encaged ↦ ⟦+ locator ↦ ∅,+ self ↦ ξ,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_φ+ ⟧,+ encage ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_encage,+ object ↦ ∅+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/cti.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cti ↦ ⟦+ delegate ↦ ∅,+ level ↦ ∅,+ message ↦ ∅,+ φ ↦ ξ.delegate+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/dataized.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ dataized ↦ ⟦+ λ ⤍ Lorg_eolang_dataized,+ target ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/error.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ error ↦ ⟦+ λ ⤍ Lorg_eolang_error,+ message ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/false.phi view
@@ -0,0 +1,33 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ false ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ ),+ not ↦ Φ.org.eolang.true,+ if ↦ ⟦+ left ↦ ∅,+ right ↦ ∅,+ φ ↦ ξ.right+ ⟧,+ and ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ+ ⟧,+ or ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ).eq(+ α0 ↦ ξ.x+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/float.phi view
@@ -0,0 +1,142 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ float ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ x-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ self-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ+ ).as-bytes,+ nan-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.nan+ ).as-bytes,+ pos-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ neg-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ φ ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.false,+ α1 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ ).and(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ )+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.x-as-bytes+ )+ )+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_float_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_float_times,+ x ↦ ∅+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_float_plus,+ x ↦ ∅+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.σ.σ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ )+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_float_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/go.phi view
@@ -0,0 +1,66 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ go ↦ ⟦+ id ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.malloc.of(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ ),+ α1 ↦ ⟦+ φ ↦ ξ.m.put(+ α0 ↦ ξ.m.id+ ),+ m ↦ ∅+ ⟧+ )+ ).as-bytes,+ to ↦ ⟦+ body ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ξ.body(+ α0 ↦ ξ.token+ ),+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ ξ.σ.ρ.id.eq(+ α0 ↦ ξ.e.id+ ).if(+ α0 ↦ ξ.e.value,+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ ξ.e+ )+ )+ ⟧,+ α2 ↦ Φ.org.eolang.true+ ),+ token ↦ ⟦+ backward ↦ Φ.org.eolang.error(+ α0 ↦ ⟦+ value ↦ ξ.σ.ρ.ρ.to(+ α0 ↦ ξ.σ.ρ.body+ ),+ id ↦ ξ.σ.ρ.ρ.id+ ⟧+ ),+ forward ↦ ⟦+ res ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ ⟦+ value ↦ ξ.σ.res,+ id ↦ ξ.σ.ρ.ρ.ρ.id+ ⟧+ )+ ⟧+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/int.phi view
@@ -0,0 +1,86 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ int ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.σ.σ.int(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_int_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.σ.σ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_int_plus,+ x ↦ ∅+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ )+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_int_times,+ x ↦ ∅+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_int_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/io/stdin.phi view
@@ -0,0 +1,21 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdin ↦ ⟦+ next-line ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_next_line+ ⟧,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_φ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/io/stdout.phi view
@@ -0,0 +1,17 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdout ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdout,+ text ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/malloc.phi view
@@ -0,0 +1,94 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ malloc ↦ ⟦+ for ↦ ⟦+ object ↦ ∅,+ scope ↦ ∅,+ bts ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.object+ ).as-bytes,+ φ ↦ ξ.σ.of(+ α0 ↦ ξ.bts.size,+ α1 ↦ ⟦+ m ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.m.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.σ.bts+ )+ ),+ α1 ↦ ξ.σ.scope(+ α0 ↦ ξ.m+ )+ )+ )+ ⟧+ )+ ⟧,+ of ↦ ⟦+ size ↦ ∅,+ scope ↦ ∅,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_φ+ ⟧,+ allocated ↦ ⟦+ id ↦ ∅,+ size ↦ ξ.ρ.size,+ φ ↦ ξ.get,+ read ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_allocated_read,+ offset ↦ ∅,+ length ↦ ∅+ ⟧,+ write ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_allocated_write,+ offset ↦ ∅,+ data ↦ ∅+ ⟧,+ get ↦ ⟦+ φ ↦ ξ.ρ.read(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.ρ.size+ )+ ⟧,+ put ↦ ⟦+ object ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.object+ )+ ),+ α1 ↦ ξ.ρ.get+ )+ )+ ⟧+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/nan.phi view
@@ -0,0 +1,62 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ nan ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.σ+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/negative-infinity.phi view
@@ -0,0 +1,248 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ negative-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.σ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.false+ )+ ⟧,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ φ ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.σ.σ.negative-infinity,+ α1 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.positive-infinity.as-bytes+ ).as-bytes,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.σ.σ.negative-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.σ.σ.negative-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.σ.σ.σ.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.false+ )+ ⟧,+ φ ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.σ.σ.negative-infinity,+ α1 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/positive-infinity.phi view
@@ -0,0 +1,248 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ positive-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 3F-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.σ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.false+ )+ ⟧,+ φ ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.σ.σ.positive-infinity,+ α1 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.σ.σ.positive-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.σ.σ.positive-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.σ.σ.positive-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.σ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.σ.σ.σ.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α1 ↦ ⟦+ e ↦ ∅,+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.σ.num+ )+ ⟧,+ α2 ↦ Φ.org.eolang.false+ )+ ⟧,+ φ ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.σ.σ.positive-infinity,+ α1 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/rust.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ rust ↦ ⟦+ λ ⤍ Lorg_eolang_rust,+ code ↦ ∅,+ portal ↦ ∅,+ params ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/seq.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ seq ↦ ⟦+ λ ⤍ Lorg_eolang_seq,+ steps ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/string.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ string ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ length ↦ ⟦+ λ ⤍ Lorg_eolang_string_length+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_string_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/switch.phi view
@@ -0,0 +1,73 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ switch ↦ ⟦+ cases ↦ ∅,+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.cases.length+ ).as-bytes,+ case-at ↦ ⟦+ index ↦ ∅,+ φ ↦ ξ.index.eq(+ α0 ↦ ξ.ρ.len+ ).if(+ α0 ↦ Φ.org.eolang.true,+ α1 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).if(+ α0 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ ),+ α1 ↦ ξ.ρ.case-at(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ case ↦ ξ.ρ.cases.at(+ α0 ↦ ξ.index+ )+ ⟧,+ φ ↦ ξ.len.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 73-77-69-74-63-68-20-63-61-73-65-73-20-61-72-65-20-65-6D-70-74-79+ )+ )+ ),+ α1 ↦ ξ.case-at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/true.phi view
@@ -0,0 +1,33 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ true ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ),+ not ↦ Φ.org.eolang.false,+ if ↦ ⟦+ left ↦ ∅,+ right ↦ ∅,+ φ ↦ ξ.left+ ⟧,+ and ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ).eq(+ α0 ↦ ξ.x+ )+ ⟧,+ or ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/try.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ try ↦ ⟦+ λ ⤍ Lorg_eolang_try,+ main ↦ ∅,+ catch ↦ ∅,+ finally ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/tuple.phi view
@@ -0,0 +1,128 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ tuple ↦ ⟦+ head ↦ ∅,+ tail ↦ ∅,+ empty ↦ ⟦+ at ↦ ⟦+ i ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-67-65-74-20-61-6E-20-6F-62-6A-65-63-74-20-66-72-6F-6D-20-74-68-65-20-65-6D-70-74-79-20-74-75-70-6C-65+ )+ )+ )+ ⟧,+ with ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.σ.tuple(+ α0 ↦ ξ.σ.σ.σ.tuple.empty,+ α1 ↦ ξ.x+ )+ ⟧,+ length ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ⟧,+ length ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ ξ.len+ ),+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.head.length.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ ).as-bytes+ ⟧,+ at ↦ ⟦+ i ↦ ∅,+ len ↦ ξ.ρ.length,+ index ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.idx+ ).if(+ α0 ↦ ξ.len.plus(+ α0 ↦ ξ.idx+ ),+ α1 ↦ ξ.idx+ )+ ).as-bytes,+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.index+ ).or(+ α0 ↦ ξ.len.lte(+ α0 ↦ ξ.index+ )+ ).if(+ α0 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 47-69-76-65-6E-20-69-6E-64-65-78-20-69-73-20-6F-75-74-20-6F-66-20-74-75-70-6C-65-20-62-6F-75-6E-64-73+ )+ )+ ),+ α1 ↦ ξ.at-fast(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.len+ )+ ),+ at-fast ↦ ⟦+ tup ↦ ∅,+ len ↦ ∅,+ φ ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ ).gt(+ α0 ↦ ξ.ρ.index+ ).if(+ α0 ↦ ξ.ρ.at-fast(+ α0 ↦ ξ.tup.head,+ α1 ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ),+ α1 ↦ ξ.tup.tail+ )+ ⟧,+ idx ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.i+ ).as-bytes+ ⟧,+ with ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.σ.σ.tuple(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.x+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.37.0/org/eolang/while.phi view
@@ -0,0 +1,72 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ while ↦ ⟦+ condition ↦ ∅,+ body ↦ ∅,+ φ ↦ ξ.condition.as-bool.if(+ α0 ↦ ξ.start(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ α1 ↦ Φ.org.eolang.false+ ),+ start ↦ ⟦+ index ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.body(+ α0 ↦ ξ.index+ )+ ),+ α1 ↦ ξ.ρ.loop(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ )+ ⟧,+ loop ↦ ⟦+ index ↦ ∅,+ current ↦ ξ.ρ.body(+ α0 ↦ ξ.index+ ),+ φ ↦ ξ.ρ.condition.as-bool.if(+ α0 ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.current+ ),+ α1 ↦ ξ.ρ.loop(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ α1 ↦ ξ.current+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/as-phi.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ as-phi ↦ ⟦+ λ ⤍ Lorg_eolang_as_phi,+ x ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/bytes.phi view
@@ -0,0 +1,107 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ bytes ↦ ⟦+ Δ ⤍ ∅,+ as-bytes ↦ ξ,+ eq ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_eq,+ b ↦ ∅+ ⟧,+ size ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_size+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧,+ as-string ↦ ⟦+ φ ↦ Φ.org.eolang.string(+ α0 ↦ ξ.ρ+ )+ ⟧,+ as-int ↦ ⟦+ φ ↦ ξ.ρ.size.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ ξ.ρ+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-63-6F-6E-76-65-72-74-20-6E-6F-6E-20-38-20-6C-65-6E-67-74-68-20-62-79-74-65-73-20-74-6F-20-69-6E-74+ )+ )+ )+ )+ ⟧,+ as-float ↦ ⟦+ φ ↦ ξ.ρ.size.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ ξ.ρ+ ),+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-63-6F-6E-76-65-72-74-20-6E-6F-6E-20-38-20-6C-65-6E-67-74-68-20-62-79-74-65-73-20-74-6F-20-66-6C-6F-61-74+ )+ )+ )+ )+ ⟧,+ and ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_and,+ b ↦ ∅+ ⟧,+ or ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_or,+ b ↦ ∅+ ⟧,+ xor ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_xor,+ b ↦ ∅+ ⟧,+ not ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_not+ ⟧,+ left ↦ ⟦+ φ ↦ ξ.ρ.right(+ α0 ↦ ξ.x.neg+ ),+ x ↦ ∅+ ⟧,+ right ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_right,+ x ↦ ∅+ ⟧,+ as-bool ↦ ⟦+ φ ↦ ξ.ρ.eq(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ )+ )+ ⟧,+ concat ↦ ⟦+ λ ⤍ Lorg_eolang_bytes_concat,+ b ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/cage.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cage ↦ ⟦+ object ↦ ∅,+ new ↦ ξ.φ.self,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_φ+ ⟧,+ encaged ↦ ⟦+ locator ↦ ∅,+ self ↦ ξ,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_φ+ ⟧,+ encage ↦ ⟦+ λ ⤍ Lorg_eolang_cage_encaged_encage,+ object ↦ ∅+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/cti.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ cti ↦ ⟦+ φ ↦ ξ.delegate,+ delegate ↦ ∅,+ level ↦ ∅,+ message ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/dataized.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ dataized ↦ ⟦+ λ ⤍ Lorg_eolang_dataized,+ target ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/error.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ error ↦ ⟦+ λ ⤍ Lorg_eolang_error,+ message ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/false.phi view
@@ -0,0 +1,33 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ false ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-+ ),+ not ↦ Φ.org.eolang.true,+ if ↦ ⟦+ φ ↦ ξ.right,+ left ↦ ∅,+ right ↦ ∅+ ⟧,+ and ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧,+ or ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ).eq(+ α0 ↦ ξ.x+ ),+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/float.phi view
@@ -0,0 +1,142 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ float ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ x-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ self-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ+ ).as-bytes,+ nan-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.nan+ ).as-bytes,+ pos-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.ρ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ neg-zero-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.ρ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ ).as-bytes,+ φ ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.nan-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.false,+ α1 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.x-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ ).and(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.pos-zero-as-bytes+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.neg-zero-as-bytes+ )+ )+ ).or(+ α0 ↦ ξ.self-as-bytes.eq(+ α0 ↦ ξ.x-as-bytes+ )+ )+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.ρ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.ρ.ρ.float(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_float_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ )+ )+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_float_times,+ x ↦ ∅+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_float_plus,+ x ↦ ∅+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.ρ.ρ.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ )+ )+ ⟧,+ minus ↦ ⟦+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ ),+ x ↦ ∅+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_float_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/go.phi view
@@ -0,0 +1,69 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ go ↦ ⟦+ id ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.malloc.of(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-08+ )+ ),+ α1 ↦ ⟦+ φ ↦ ξ.m.put(+ α0 ↦ ξ.m.id+ ),+ m ↦ ∅+ ⟧+ )+ ).as-bytes,+ to ↦ ⟦+ body ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ ξ.body(+ α0 ↦ ξ.token+ ),+ α1 ↦ ξ.auto-named-attr-at-64-9,+ α2 ↦ Φ.org.eolang.true+ ),+ token ↦ ⟦+ backward ↦ Φ.org.eolang.error(+ α0 ↦ ξ.jump(+ α0 ↦ ξ.ρ.ρ.to(+ α0 ↦ ξ.ρ.body+ )+ )+ ),+ jump ↦ ⟦+ value ↦ ∅,+ id ↦ ξ.ρ.ρ.ρ.id+ ⟧,+ forward ↦ ⟦+ res ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ ξ.ρ.jump(+ α0 ↦ ξ.res+ )+ )+ ⟧+ ⟧,+ auto-named-attr-at-64-9 ↦ ⟦+ e ↦ ∅,+ φ ↦ ξ.ρ.ρ.id.eq(+ α0 ↦ ξ.e.id+ ).if(+ α0 ↦ ξ.e.value,+ α1 ↦ Φ.org.eolang.error(+ α0 ↦ ξ.e+ )+ )+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/int.phi view
@@ -0,0 +1,86 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ int ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.ρ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.ρ.minus(+ α0 ↦ ξ.ρ.ρ.int(+ α0 ↦ ξ.value+ )+ )+ ),+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.gt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ gt ↦ ⟦+ λ ⤍ Lorg_eolang_int_gt,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.lt(+ α0 ↦ ξ.value+ ).not,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ.times(+ α0 ↦ ξ.ρ.ρ.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ⟧,+ plus ↦ ⟦+ λ ⤍ Lorg_eolang_int_plus,+ x ↦ ∅+ ⟧,+ minus ↦ ⟦+ φ ↦ ξ.ρ.plus(+ α0 ↦ ξ.x.neg+ ),+ x ↦ ∅+ ⟧,+ times ↦ ⟦+ λ ⤍ Lorg_eolang_int_times,+ x ↦ ∅+ ⟧,+ div ↦ ⟦+ λ ⤍ Lorg_eolang_int_div,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/io/stdin.phi view
@@ -0,0 +1,21 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdin ↦ ⟦+ next-line ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_next_line+ ⟧,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdin_φ+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/io/stdout.phi view
@@ -0,0 +1,17 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ io ↦ ⟦+ stdout ↦ ⟦+ λ ⤍ Lorg_eolang_io_stdout,+ text ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/malloc.phi view
@@ -0,0 +1,95 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ malloc ↦ ⟦+ for ↦ ⟦+ object ↦ ∅,+ scope ↦ ∅,+ bts ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.object+ ).as-bytes,+ φ ↦ ξ.ρ.ρ.malloc.of(+ α0 ↦ ξ.bts.size,+ α1 ↦ ξ.auto-named-attr-at-89-9+ ),+ auto-named-attr-at-89-9 ↦ ⟦+ m ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.m.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.ρ.bts+ )+ ),+ α1 ↦ ξ.ρ.scope(+ α0 ↦ ξ.m+ )+ )+ )+ ⟧+ ⟧,+ of ↦ ⟦+ size ↦ ∅,+ scope ↦ ∅,+ φ ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_φ+ ⟧,+ allocated ↦ ⟦+ id ↦ ∅,+ size ↦ ξ.ρ.size,+ φ ↦ ξ.get,+ read ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_allocated_read,+ offset ↦ ∅,+ length ↦ ∅+ ⟧,+ write ↦ ⟦+ λ ⤍ Lorg_eolang_malloc_of_allocated_write,+ offset ↦ ∅,+ data ↦ ∅+ ⟧,+ get ↦ ⟦+ φ ↦ ξ.ρ.read(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.ρ.size+ )+ ⟧,+ put ↦ ⟦+ object ↦ ∅,+ φ ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.ρ.write(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ α1 ↦ ξ.object+ )+ ),+ α1 ↦ ξ.ρ.get+ )+ )+ ⟧+ ⟧+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/nan.phi view
@@ -0,0 +1,62 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ nan ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ φ ↦ Φ.org.eolang.false,+ x ↦ ∅+ ⟧,+ lt ↦ ⟦+ φ ↦ Φ.org.eolang.false,+ x ↦ ∅+ ⟧,+ lte ↦ ⟦+ φ ↦ Φ.org.eolang.false,+ x ↦ ∅+ ⟧,+ gt ↦ ⟦+ φ ↦ Φ.org.eolang.false,+ x ↦ ∅+ ⟧,+ gte ↦ ⟦+ φ ↦ Φ.org.eolang.false,+ x ↦ ∅+ ⟧,+ times ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧,+ plus ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧,+ neg ↦ ⟦+ φ ↦ ξ.ρ+ ⟧,+ minus ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧,+ div ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/negative-infinity.phi view
@@ -0,0 +1,246 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ negative-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ BF-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.num+ ),+ α1 ↦ ξ.auto-named-attr-at-69-26,+ α2 ↦ Φ.org.eolang.false+ ),+ auto-named-attr-at-69-26 ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.ρ.num+ ),+ e ↦ ∅+ ⟧+ ⟧,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.ρ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ φ ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.ρ.ρ.negative-infinity,+ α1 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.positive-infinity.as-bytes+ ).as-bytes,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.ρ.ρ.negative-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.ρ.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.ρ.ρ.negative-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.ρ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.ρ.ρ.ρ.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.num+ ),+ α1 ↦ ξ.auto-named-attr-at-136-27,+ α2 ↦ Φ.org.eolang.false+ ),+ auto-named-attr-at-136-27 ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.ρ.num+ ),+ e ↦ ∅+ ⟧+ ⟧,+ φ ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.ρ.ρ.negative-infinity,+ α1 ↦ Φ.org.eolang.positive-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/positive-infinity.phi view
@@ -0,0 +1,246 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ positive-infinity ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 3F-F0-00-00-00-00-00-00+ )+ ).div(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ lt ↦ ⟦+ x ↦ ∅,+ φ ↦ Φ.org.eolang.false+ ⟧,+ lte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.eq(+ α0 ↦ ξ.x+ )+ ⟧,+ gt ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ φ ↦ ξ.value.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).or(+ α0 ↦ ξ.ρ.eq(+ α0 ↦ ξ.value+ )+ ).not+ ⟧,+ gte ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.x.as-bytes.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ ).not+ ⟧,+ times ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.ρ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 80-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ is-num-gt-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.num+ ),+ α1 ↦ ξ.auto-named-attr-at-81-26,+ α2 ↦ Φ.org.eolang.false+ ),+ auto-named-attr-at-81-26 ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lt(+ α0 ↦ ξ.ρ.num+ ),+ e ↦ ∅+ ⟧+ ⟧,+ φ ↦ ξ.is-nan-or-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gt-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.ρ.ρ.positive-infinity,+ α1 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ plus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ neg-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.negative-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.neg-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.ρ.ρ.positive-infinity+ )+ ⟧,+ minus ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ pos-inf-as-bytes ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.ρ.positive-infinity+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ φ ↦ ξ.is-nan(+ α0 ↦ ξ.value+ ).or(+ α0 ↦ ξ.value.eq(+ α0 ↦ ξ.pos-inf-as-bytes+ )+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.ρ.ρ.positive-infinity+ )+ ⟧,+ div ↦ ⟦+ x ↦ ∅,+ value ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.x+ ).as-bytes,+ is-nan ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.nan.as-bytes+ )+ ⟧,+ is-nan-or-infinite ↦ ⟦+ num ↦ ∅,+ φ ↦ ξ.ρ.is-nan(+ α0 ↦ ξ.num+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ ξ.ρ.ρ.ρ.positive-infinity+ )+ ).or(+ α0 ↦ ξ.num.eq(+ α0 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧,+ is-num-gte-zero ↦ ⟦+ num ↦ ∅,+ φ ↦ Φ.org.eolang.try(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.num+ ),+ α1 ↦ ξ.auto-named-attr-at-136-27,+ α2 ↦ Φ.org.eolang.false+ ),+ auto-named-attr-at-136-27 ↦ ⟦+ φ ↦ Φ.org.eolang.float(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).lte(+ α0 ↦ ξ.ρ.num+ ),+ e ↦ ∅+ ⟧+ ⟧,+ φ ↦ ξ.is-nan-or-infinite(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ Φ.org.eolang.nan,+ α1 ↦ ξ.is-num-gte-zero(+ α0 ↦ ξ.value+ ).if(+ α0 ↦ ξ.ρ.ρ.positive-infinity,+ α1 ↦ Φ.org.eolang.negative-infinity+ )+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/rust.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ rust ↦ ⟦+ λ ⤍ Lorg_eolang_rust,+ code ↦ ∅,+ portal ↦ ∅,+ params ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/seq.phi view
@@ -0,0 +1,14 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ seq ↦ ⟦+ λ ⤍ Lorg_eolang_seq,+ steps ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/string.phi view
@@ -0,0 +1,28 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ string ↦ ⟦+ as-bytes ↦ ∅,+ φ ↦ ξ.as-bytes,+ eq ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.as-bytes.eq(+ α0 ↦ ξ.x.as-bytes+ )+ ⟧,+ length ↦ ⟦+ λ ⤍ Lorg_eolang_string_length+ ⟧,+ slice ↦ ⟦+ λ ⤍ Lorg_eolang_string_slice,+ start ↦ ∅,+ len ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/switch.phi view
@@ -0,0 +1,73 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ switch ↦ ⟦+ cases ↦ ∅,+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.cases.length+ ).as-bytes,+ case-at ↦ ⟦+ index ↦ ∅,+ φ ↦ ξ.index.eq(+ α0 ↦ ξ.ρ.len+ ).if(+ α0 ↦ Φ.org.eolang.true,+ α1 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).if(+ α0 ↦ ξ.case.at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ ),+ α1 ↦ ξ.ρ.case-at(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ case ↦ ξ.ρ.cases.at(+ α0 ↦ ξ.index+ )+ ⟧,+ φ ↦ ξ.len.eq(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).if(+ α0 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 73-77-69-74-63-68-20-63-61-73-65-73-20-61-72-65-20-65-6D-70-74-79+ )+ )+ ),+ α1 ↦ ξ.case-at(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ )+ )+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/true.phi view
@@ -0,0 +1,33 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ true ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ),+ not ↦ Φ.org.eolang.false,+ if ↦ ⟦+ φ ↦ ξ.left,+ left ↦ ∅,+ right ↦ ∅+ ⟧,+ and ↦ ⟦+ φ ↦ Φ.org.eolang.bytes(+ Δ ⤍ 01-+ ).eq(+ α0 ↦ ξ.x+ ),+ x ↦ ∅+ ⟧,+ or ↦ ⟦+ φ ↦ ξ.ρ,+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/try.phi view
@@ -0,0 +1,16 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ try ↦ ⟦+ λ ⤍ Lorg_eolang_try,+ main ↦ ∅,+ catch ↦ ∅,+ finally ↦ ∅+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/tuple.phi view
@@ -0,0 +1,128 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ tuple ↦ ⟦+ head ↦ ∅,+ tail ↦ ∅,+ empty ↦ ⟦+ length ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ),+ at ↦ ⟦+ i ↦ ∅,+ φ ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 43-61-6E-27-74-20-67-65-74-20-61-6E-20-6F-62-6A-65-63-74-20-66-72-6F-6D-20-74-68-65-20-65-6D-70-74-79-20-74-75-70-6C-65+ )+ )+ )+ ⟧,+ with ↦ ⟦+ x ↦ ∅,+ φ ↦ ξ.ρ.ρ.ρ.tuple(+ α0 ↦ ξ.ρ.ρ.ρ.tuple.empty,+ α1 ↦ ξ.x+ )+ ⟧+ ⟧,+ length ↦ ⟦+ φ ↦ Φ.org.eolang.int(+ α0 ↦ ξ.len+ ),+ len ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.ρ.head.length.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ ).as-bytes+ ⟧,+ at ↦ ⟦+ i ↦ ∅,+ len ↦ ξ.ρ.length,+ index ↦ Φ.org.eolang.dataized(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.idx+ ).if(+ α0 ↦ ξ.len.plus(+ α0 ↦ ξ.idx+ ),+ α1 ↦ ξ.idx+ )+ ).as-bytes,+ φ ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ ).gt(+ α0 ↦ ξ.index+ ).or(+ α0 ↦ ξ.len.lte(+ α0 ↦ ξ.index+ )+ ).if(+ α0 ↦ Φ.org.eolang.error(+ α0 ↦ Φ.org.eolang.string(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 47-69-76-65-6E-20-69-6E-64-65-78-20-69-73-20-6F-75-74-20-6F-66-20-74-75-70-6C-65-20-62-6F-75-6E-64-73+ )+ )+ ),+ α1 ↦ ξ.at-fast(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.len+ )+ ),+ at-fast ↦ ⟦+ tup ↦ ∅,+ len ↦ ∅,+ φ ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ ).gt(+ α0 ↦ ξ.ρ.index+ ).if(+ α0 ↦ ξ.ρ.at-fast(+ α0 ↦ ξ.tup.head,+ α1 ↦ ξ.len.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ FF-FF-FF-FF-FF-FF-FF-FF+ )+ )+ )+ ),+ α1 ↦ ξ.tup.tail+ )+ ⟧,+ idx ↦ Φ.org.eolang.dataized(+ α0 ↦ ξ.i+ ).as-bytes+ ⟧,+ with ↦ ⟦+ φ ↦ ξ.ρ.ρ.tuple(+ α0 ↦ ξ.ρ,+ α1 ↦ ξ.x+ ),+ x ↦ ∅+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
+ data/0.38.0/org/eolang/while.phi view
@@ -0,0 +1,64 @@+{+ ⟦+ org ↦ ⟦+ eolang ↦ ⟦+ while ↦ ⟦+ condition ↦ ∅,+ body ↦ ∅,+ φ ↦ ξ.condition(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ).as-bool.if(+ α0 ↦ ξ.loop(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-00+ )+ )+ ),+ α1 ↦ Φ.org.eolang.false+ ),+ loop ↦ ⟦+ index ↦ ∅,+ current ↦ ξ.ρ.body(+ α0 ↦ ξ.index+ ),+ φ ↦ ξ.ρ.condition(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ ).as-bool.if(+ α0 ↦ Φ.org.eolang.seq(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple(+ α0 ↦ Φ.org.eolang.tuple.empty,+ α1 ↦ ξ.current+ ),+ α1 ↦ ξ.ρ.loop(+ α0 ↦ ξ.index.plus(+ α0 ↦ Φ.org.eolang.int(+ α0 ↦ Φ.org.eolang.bytes(+ Δ ⤍ 00-00-00-00-00-00-00-01+ )+ )+ )+ )+ )+ ),+ α1 ↦ ξ.current+ )+ ⟧+ ⟧,+ λ ⤍ Package+ ⟧,+ λ ⤍ Package+ ⟧+ ⟧+}
eo-phi-normalizer.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: eo-phi-normalizer-version: 0.3.1+version: 0.4.0 synopsis: Command line normalizer of 𝜑-calculus expressions. description: Please see the README on GitHub at <https://github.com/objectionary/eo-phi-normalizer#readme> homepage: https://github.com/objectionary/eo-phi-normalizer#readme@@ -22,6 +22,83 @@ grammar/EO/Phi/Syntax.cf report/main.js report/styles.css+ data/0.36.0/org/eolang/as-phi.phi+ data/0.36.0/org/eolang/bool.phi+ data/0.36.0/org/eolang/bytes.phi+ data/0.36.0/org/eolang/cage.phi+ data/0.36.0/org/eolang/cti.phi+ data/0.36.0/org/eolang/dataized.phi+ data/0.36.0/org/eolang/error.phi+ data/0.36.0/org/eolang/float.phi+ data/0.36.0/org/eolang/go.phi+ data/0.36.0/org/eolang/goto.phi+ data/0.36.0/org/eolang/heap.phi+ data/0.36.0/org/eolang/if.phi+ data/0.36.0/org/eolang/int.phi+ data/0.36.0/org/eolang/io/stdin.phi+ data/0.36.0/org/eolang/io/stdout.phi+ data/0.36.0/org/eolang/malloc.phi+ data/0.36.0/org/eolang/memory.phi+ data/0.36.0/org/eolang/nan.phi+ data/0.36.0/org/eolang/negative-infinity.phi+ data/0.36.0/org/eolang/nop.phi+ data/0.36.0/org/eolang/positive-infinity.phi+ data/0.36.0/org/eolang/ram.phi+ data/0.36.0/org/eolang/rust.phi+ data/0.36.0/org/eolang/seq.phi+ data/0.36.0/org/eolang/string.phi+ data/0.36.0/org/eolang/switch.phi+ data/0.36.0/org/eolang/try.phi+ data/0.36.0/org/eolang/tuple.phi+ data/0.36.0/org/eolang/while.phi+ data/0.37.0/org/eolang/as-phi.phi+ data/0.37.0/org/eolang/bytes.phi+ data/0.37.0/org/eolang/cage.phi+ data/0.37.0/org/eolang/cti.phi+ data/0.37.0/org/eolang/dataized.phi+ data/0.37.0/org/eolang/error.phi+ data/0.37.0/org/eolang/false.phi+ data/0.37.0/org/eolang/float.phi+ data/0.37.0/org/eolang/go.phi+ data/0.37.0/org/eolang/int.phi+ data/0.37.0/org/eolang/io/stdin.phi+ data/0.37.0/org/eolang/io/stdout.phi+ data/0.37.0/org/eolang/malloc.phi+ data/0.37.0/org/eolang/nan.phi+ data/0.37.0/org/eolang/negative-infinity.phi+ data/0.37.0/org/eolang/positive-infinity.phi+ data/0.37.0/org/eolang/rust.phi+ data/0.37.0/org/eolang/seq.phi+ data/0.37.0/org/eolang/string.phi+ data/0.37.0/org/eolang/switch.phi+ data/0.37.0/org/eolang/true.phi+ data/0.37.0/org/eolang/try.phi+ data/0.37.0/org/eolang/tuple.phi+ data/0.37.0/org/eolang/while.phi+ data/0.38.0/org/eolang/as-phi.phi+ data/0.38.0/org/eolang/bytes.phi+ data/0.38.0/org/eolang/cage.phi+ data/0.38.0/org/eolang/cti.phi+ data/0.38.0/org/eolang/dataized.phi+ data/0.38.0/org/eolang/error.phi+ data/0.38.0/org/eolang/false.phi+ data/0.38.0/org/eolang/float.phi+ data/0.38.0/org/eolang/go.phi+ data/0.38.0/org/eolang/int.phi+ data/0.38.0/org/eolang/io/stdin.phi+ data/0.38.0/org/eolang/io/stdout.phi+ data/0.38.0/org/eolang/malloc.phi+ data/0.38.0/org/eolang/nan.phi+ data/0.38.0/org/eolang/negative-infinity.phi+ data/0.38.0/org/eolang/positive-infinity.phi+ data/0.38.0/org/eolang/rust.phi+ data/0.38.0/org/eolang/seq.phi+ data/0.38.0/org/eolang/string.phi+ data/0.38.0/org/eolang/switch.phi+ data/0.38.0/org/eolang/true.phi+ data/0.38.0/org/eolang/try.phi+ data/0.38.0/org/eolang/tuple.phi+ data/0.38.0/org/eolang/while.phi source-repository head type: git@@ -30,20 +107,25 @@ custom-setup setup-depends: Cabal >=2.4.0.1 && <4.0+ , PyF , base >=4.11.0.0 && <5.0 , process >=1.6.3.0- , string-interpolate library exposed-modules: Language.EO.Phi Language.EO.Phi.Dataize+ Language.EO.Phi.Dependencies Language.EO.Phi.Metrics.Collect Language.EO.Phi.Metrics.Data Language.EO.Phi.Normalize+ Language.EO.Phi.Pipeline.Config+ Language.EO.Phi.Pipeline.EOTests.Data+ Language.EO.Phi.Pipeline.EOTests.PrepareTests Language.EO.Phi.Report.Data Language.EO.Phi.Report.Html Language.EO.Phi.Rules.Common+ Language.EO.Phi.Rules.Fast Language.EO.Phi.Rules.PhiPaper Language.EO.Phi.Rules.Yaml Language.EO.Phi.Syntax@@ -52,32 +134,36 @@ Language.EO.Phi.Syntax.Par Language.EO.Phi.Syntax.Print Language.EO.Phi.TH+ Language.EO.Phi.ToLaTeX other-modules: Paths_eo_phi_normalizer hs-source-dirs: src default-extensions: ImportQualifiedPost- ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists+ ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists build-tools: alex >=3.2.4 , happy >=1.19.9 build-tool-depends: BNFC:bnfc >=2.9.4.1 build-depends:- aeson+ PyF+ , aeson , array >=0.5.5.0 , base >=4.7 && <5 , blaze-html , blaze-markup+ , bytestring+ , cereal , directory , file-embed >=0.0.16.0 , filepath , generic-lens , lens , mtl+ , regex-compat , scientific- , string-interpolate , template-haskell , text , yaml@@ -91,19 +177,22 @@ app default-extensions: ImportQualifiedPost- ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists -threaded -rtsopts -with-rtsopts=-N+ ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists -threaded -rtsopts -with-rtsopts=-N build-tools: alex >=3.2.4 , happy >=1.19.9 build-tool-depends: BNFC:bnfc >=2.9.4.1 build-depends:- aeson+ PyF+ , aeson , aeson-pretty , array >=0.5.5.0 , base >=4.7 && <5 , blaze-html , blaze-markup+ , bytestring+ , cereal , directory , eo-phi-normalizer , file-embed >=0.0.16.0@@ -112,10 +201,11 @@ , lens , mtl , optparse-applicative+ , regex-compat , scientific- , string-interpolate , template-haskell , text+ , with-utf8 , yaml default-language: Haskell2010 @@ -125,12 +215,17 @@ other-modules: Language.EO.Phi Language.EO.Phi.Dataize+ Language.EO.Phi.Dependencies Language.EO.Phi.Metrics.Collect Language.EO.Phi.Metrics.Data Language.EO.Phi.Normalize+ Language.EO.Phi.Pipeline.Config+ Language.EO.Phi.Pipeline.EOTests.Data+ Language.EO.Phi.Pipeline.EOTests.PrepareTests Language.EO.Phi.Report.Data Language.EO.Phi.Report.Html Language.EO.Phi.Rules.Common+ Language.EO.Phi.Rules.Fast Language.EO.Phi.Rules.PhiPaper Language.EO.Phi.Rules.Yaml Language.EO.Phi.Syntax@@ -140,24 +235,28 @@ Language.EO.Phi.Syntax.Print Language.EO.Phi.Syntax.Skel Language.EO.Phi.TH+ Language.EO.Phi.ToLaTeX Paths_eo_phi_normalizer hs-source-dirs: test/doctests src default-extensions: ImportQualifiedPost- ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists+ ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists build-tools: alex >=3.2.4 , happy >=1.19.9 build-tool-depends: BNFC:bnfc >=2.9.4.1 build-depends:- aeson+ PyF+ , aeson , array >=0.5.5.0 , base >=4.7 && <5 , blaze-html , blaze-markup+ , bytestring+ , cereal , directory , doctest-parallel , eo-phi-normalizer@@ -166,8 +265,8 @@ , generic-lens , lens , mtl+ , regex-compat , scientific- , string-interpolate , template-haskell , text , yaml@@ -175,12 +274,13 @@ test-suite spec type: exitcode-stdio-1.0- main-is: Spec.hs+ main-is: Main.hs other-modules: Language.EO.Phi.DataizeSpec Language.EO.PhiSpec Language.EO.Rules.PhiPaperSpec Language.EO.YamlSpec+ Spec Test.EO.Phi Test.EO.Yaml Test.Metrics.Phi@@ -189,19 +289,22 @@ test default-extensions: ImportQualifiedPost- ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists -threaded -rtsopts -with-rtsopts=-N+ ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-missing-export-lists -threaded -rtsopts -with-rtsopts=-N build-tools: alex >=3.2.4 , happy >=1.19.9 build-tool-depends: BNFC:bnfc >=2.9.4.1 build-depends:- QuickCheck+ PyF+ , QuickCheck , aeson , array >=0.5.5.0 , base >=4.7 && <5 , blaze-html , blaze-markup+ , bytestring+ , cereal , directory , eo-phi-normalizer , file-embed >=0.0.16.0@@ -211,9 +314,10 @@ , hspec-discover , lens , mtl+ , regex-compat , scientific- , string-interpolate , template-haskell , text+ , with-utf8 , yaml default-language: Haskell2010
grammar/EO/Phi/Syntax.cf view
@@ -22,6 +22,7 @@ GlobalObject. Object ::= "Φ"; ThisObject. Object ::= "ξ"; Termination. Object ::= "⊥" ;+MetaSubstThis. Object ::= Object "[" "ξ" "↦" Object "]" ; MetaObject. Object ::= MetaId ; MetaFunction. Object ::= MetaFunctionName "(" Object ")" ; @@ -36,8 +37,6 @@ Phi. Attribute ::= "φ" ; -- decoratee object Rho. Attribute ::= "ρ" ; -- parent object-Sigma. Attribute ::= "σ" ; -- home object-VTX. Attribute ::= "ν" ; -- the vertex identifier (an object that represents the unique identifier of the containing object) Label. Attribute ::= LabelId ; Alpha. Attribute ::= AlphaIndex ; MetaAttr. Attribute ::= MetaId ;
src/Language/EO/Phi/Dataize.hs view
@@ -9,20 +9,19 @@ module Language.EO.Phi.Dataize where -import Control.Arrow (ArrowChoice (left))+import Control.Arrow (left)+import Data.Bits import Data.List (singleton)+import Data.List.NonEmpty qualified as NonEmpty++-- import Data.List.NonEmpty qualified as NonEmpty import Data.Maybe (listToMaybe)-import Data.String.Interpolate (i)-import Language.EO.Phi (Binding (DeltaEmptyBinding, EmptyBinding)) import Language.EO.Phi.Rules.Common-import Language.EO.Phi.Syntax.Abs (- AlphaIndex (AlphaIndex),- Attribute (Alpha, Phi, Rho),- Binding (AlphaBinding, DeltaBinding, LambdaBinding),- Bytes (Bytes),- Function (Function),- Object (Application, Formation, ObjectDispatch, Termination),- )+import Language.EO.Phi.Rules.Fast (fastYegorInsideOut)+import Language.EO.Phi.Rules.Yaml (substThis)+import Language.EO.Phi.Syntax.Abs+import PyF (fmt)+import System.IO.Unsafe (unsafePerformIO) -- | Perform one step of dataization to the object (if possible). dataizeStep :: Context -> Object -> (Context, Either Object Bytes)@@ -38,7 +37,7 @@ dataizeRecursively :: Context -> Object -> Either Object Bytes dataizeRecursively ctx obj = snd $ dataizeRecursivelyChain' ctx obj -dataizeStepChain' :: Context -> Object -> ([(String, Either Object Bytes)], Either Object Bytes)+dataizeStepChain' :: Context -> Object -> ([LogEntry (Either Object Bytes)], Either Object Bytes) dataizeStepChain' ctx obj = snd <$> head (runChain (dataizeStepChain obj) ctx) -- FIXME: head is bad -- | Perform one step of dataization to the object (if possible), reporting back individiual steps.@@ -60,8 +59,7 @@ logStep "Dataizing inside phi" (Left decoratee) ctx <- getContext let extendedContext = (extendContextWith obj ctx){currentAttr = Phi}- logStep "Dataizing inside phi" (Left decoratee)- withContext extendedContext $ dataizeStepChain decoratee+ return (extendedContext, Left (substThis obj decoratee)) | otherwise = do logStep "No change to formation" (Left obj) ctx <- getContext@@ -71,12 +69,14 @@ isEmpty DeltaEmptyBinding = True isEmpty _ = False hasEmpty = any isEmpty bs-dataizeStepChain (Application obj bindings) = do+-- IMPORTANT: dataize the object being copied IF normalization is stuck on it!+dataizeStepChain (Application obj bindings) = incLogLevel $ do logStep "Dataizing inside application" (Left obj) modifyContext (\c -> c{dataizePackage = False}) $ do (ctx, obj') <- dataizeStepChain obj return (ctx, left (`Application` bindings) obj')-dataizeStepChain (ObjectDispatch obj attr) = do+-- IMPORTANT: dataize the object being dispatched IF normalization is stuck on it!+dataizeStepChain (ObjectDispatch obj attr) = incLogLevel $ do logStep "Dataizing inside dispatch" (Left obj) modifyContext (\c -> c{dataizePackage = False}) $ do (ctx, obj') <- dataizeStepChain obj@@ -86,41 +86,71 @@ ctx <- getContext return (ctx, Left obj) -dataizeRecursivelyChain' :: Context -> Object -> ([(String, Either Object Bytes)], Either Object Bytes)-dataizeRecursivelyChain' ctx obj = head (runChain (dataizeRecursivelyChain obj) ctx)+dataizeRecursivelyChain' :: Context -> Object -> ([LogEntry (Either Object Bytes)], Either Object Bytes)+dataizeRecursivelyChain' ctx obj = head (runChain (dataizeRecursivelyChain False obj) ctx) -- | Recursively perform normalization and dataization until we get bytes in the end, -- reporting intermediate steps-dataizeRecursivelyChain :: Object -> DataizeChain (Either Object Bytes)-dataizeRecursivelyChain obj = do- ctx <- getContext- msplit (transformNormLogs (applyRulesChain obj)) >>= \case- Nothing -> do- logStep "No rules applied" (Left obj)- return (Left obj)- -- We trust that all chains lead to the same result due to confluence- Just (normObj, _alternatives) -> do- (ctx', step) <- dataizeStepChain normObj- case step of- (Left stillObj)- | stillObj == normObj && ctx `sameContext` ctx' -> return step -- dataization changed nothing- | otherwise -> withContext ctx' $ dataizeRecursivelyChain stillObj -- partially dataized- bytes -> return bytes+dataizeRecursivelyChain :: Bool -> Object -> DataizeChain (Either Object Bytes)+dataizeRecursivelyChain = fmap minimizeObject' . go+ where+ go normalizeRequired obj = do+ logStep "Dataizing" (Left obj)+ ctx <- getContext+ let globalObject = NonEmpty.last (outerFormations ctx)+ let limits = defaultApplicationLimits (objectSize globalObject)+ let normalizedObj+ | builtinRules ctx = do+ let obj' = fastYegorInsideOut ctx obj+ logStep "Normalized" obj'+ return obj'+ | otherwise = applyRulesChainWith limits obj+ msplit (transformNormLogs normalizedObj) >>= \case+ Nothing -> do+ logStep "No rules applied" (Left obj)+ return (Left obj)+ -- We trust that all chains lead to the same result due to confluence+ Just (normObj, _alternatives)+ | normObj == obj && normalizeRequired -> return (Left obj)+ | otherwise -> do+ (ctx', step) <- dataizeStepChain normObj+ case step of+ (Left stillObj)+ | stillObj == normObj && ctx `sameContext` ctx' -> do+ logStep "Dataization changed nothing" (Left stillObj)+ return step -- dataization changed nothing+ | otherwise -> do+ logStep "Dataization changed something" (Left stillObj)+ withContext ctx' $ go False stillObj -- partially dataized+ bytes -> return bytes --- | Given normalization context, a function on data (bytes interpreted as integers), an object,+-- | Given converters between Bytes and some data type, a binary function on this data type, an object, -- and the current state of evaluation, returns the new object and a possibly modified state along with intermediate steps.-evaluateDataizationFunChain :: (Int -> Int -> Int) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)-evaluateDataizationFunChain func obj _state = do+evaluateDataizationFunChain ::+ -- | How to convert the result back to bytes+ (res -> Bytes) ->+ -- | How to interpret the bytes in terms of the given data type+ (Bytes -> a) ->+ -- | How to wrap the bytes in an object+ (Bytes -> Object) ->+ -- | A binary function on the data+ (a -> a -> res) ->+ Object ->+ EvaluationState ->+ DataizeChain (Object, EvaluationState)+evaluateDataizationFunChain resultToBytes bytesToParam wrapBytes func obj _state = do let o_rho = ObjectDispatch obj Rho let o_a0 = ObjectDispatch obj (Alpha (AlphaIndex "α0"))- logStep "Evaluating LHS" (Left o_rho)- lhs <- dataizeRecursivelyChain o_rho- logStep "Evaluating RHS" (Left o_a0)- rhs <- dataizeRecursivelyChain o_a0+ lhs <- incLogLevel $ do+ logStep "Evaluating LHS" (Left o_rho)+ dataizeRecursivelyChain True o_rho+ rhs <- incLogLevel $ do+ logStep "Evaluating RHS" (Left o_a0)+ dataizeRecursivelyChain True o_a0 result <- case (lhs, rhs) of (Right l, Right r) -> do- let (Bytes bytes) = intToBytes (bytesToInt r `func` bytesToInt l)- resultObj = [i|Φ.org.eolang.float(Δ ⤍ #{bytes})|]+ let bytes = resultToBytes (bytesToParam r `func` bytesToParam l)+ resultObj = wrapBytes bytes logStep "Evaluated function" (Left resultObj) return resultObj _ -> do@@ -128,12 +158,168 @@ return Termination return (result, ()) +evaluateBinaryDataizationFunChain ::+ -- | How to convert the result back to bytes+ (res -> Bytes) ->+ -- | How to interpret the bytes in terms of the given data type+ (Bytes -> a) ->+ -- | How to wrap the bytes in an object+ (Bytes -> Object) ->+ -- | Extract the 1st argument to be dataized+ (Object -> Object) ->+ -- | Extract the 2nd argument to be dataized+ (Object -> Object) ->+ -- | A binary function on the argument+ (a -> a -> res) ->+ Object ->+ EvaluationState ->+ DataizeChain (Object, EvaluationState)+evaluateBinaryDataizationFunChain resultToBytes bytesToParam wrapBytes arg1 arg2 func obj _state = do+ let lhsArg = arg1 obj+ let rhsArg = arg2 obj+ lhs <- incLogLevel $ do+ logStep "Evaluating LHS" (Left lhsArg)+ dataizeRecursivelyChain True lhsArg+ rhs <- incLogLevel $ do+ logStep "Evaluating RHS" (Left rhsArg)+ dataizeRecursivelyChain True rhsArg+ result <- case (lhs, rhs) of+ (Right l, Right r) -> do+ let bytes = resultToBytes (bytesToParam l `func` bytesToParam r)+ resultObj = wrapBytes bytes+ logStep "Evaluated function" (Left resultObj)+ return resultObj+ (Left _l, Left _r) -> do+ logStep "Couldn't find bytes in both LHS and RHS" (Left Termination)+ return Termination -- (Formation [AlphaBinding (Label "lhs") l, AlphaBinding (Label "rhs") r])+ (Left _l, _) -> do+ logStep "Couldn't find bytes in LHS" (Left Termination)+ return Termination -- (Formation [AlphaBinding (Label "lhs") (hideRho1 l)])+ (_, Left _r) -> do+ logStep "Couldn't find bytes in RHS" (Left Termination)+ return Termination -- (Formation [AlphaBinding (Label "rhs") r])+ return (result, ())++-- | Unary functions operate on the given object without any additional parameters+evaluateUnaryDataizationFunChain ::+ -- | How to convert the result back to bytes+ (res -> Bytes) ->+ -- | How to interpret the bytes in terms of the given data type+ (Bytes -> a) ->+ -- | How to wrap the bytes in an object+ (Bytes -> Object) ->+ -- | Extract the argument to be dataized+ (Object -> Object) ->+ -- | A unary function on the argument+ (a -> res) ->+ Object ->+ EvaluationState ->+ DataizeChain (Object, EvaluationState)+evaluateUnaryDataizationFunChain resultToBytes bytesToParam wrapBytes extractArg func =+ evaluateBinaryDataizationFunChain resultToBytes bytesToParam wrapBytes extractArg extractArg (const . func)++evaluateIODataizationFunChain :: IO String -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateIODataizationFunChain action _obj state =+ return (Formation [DeltaBinding (stringToBytes (unsafePerformIO action))], state)++extractRho :: Object -> Object+extractRho = (`ObjectDispatch` Rho)+extractAlpha0 :: Object -> Object+extractAlpha0 = (`ObjectDispatch` Alpha (AlphaIndex "α0"))+extractLabel :: String -> Object -> Object+extractLabel attrName = (`ObjectDispatch` Label (LabelId attrName))+wrapBytesInInt :: Bytes -> Object+wrapBytesInInt (Bytes bytes) = [fmt|Φ.org.eolang.int(as-bytes ↦ Φ.org.eolang.bytes(Δ ⤍ {bytes}))|]+wrapBytesInFloat :: Bytes -> Object+wrapBytesInFloat (Bytes bytes) = [fmt|Φ.org.eolang.float(as-bytes ↦ Φ.org.eolang.bytes(Δ ⤍ {bytes}))|]+wrapBytesInString :: Bytes -> Object+wrapBytesInString (Bytes bytes) = [fmt|Φ.org.eolang.string(as-bytes ↦ Φ.org.eolang.bytes(Δ ⤍ {bytes}))|]+wrapBytesInBytes :: Bytes -> Object+wrapBytesInBytes (Bytes bytes) = [fmt|Φ.org.eolang.bytes(Δ ⤍ {bytes})|]++wrapBytesAsBool :: Bytes -> Object+wrapBytesAsBool bytes+ | bytesToInt bytes == 0 = [fmt|Φ.org.eolang.false|]+ | otherwise = [fmt|Φ.org.eolang.true|]++-- This should maybe get converted to a type class and some instances?+evaluateIntIntIntFunChain :: (Int -> Int -> Int) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateIntIntIntFunChain = evaluateBinaryDataizationFunChain intToBytes bytesToInt wrapBytesInInt extractRho (extractLabel "x")++evaluateIntIntBoolFunChain :: (Int -> Int -> Bool) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateIntIntBoolFunChain = evaluateBinaryDataizationFunChain boolToBytes bytesToInt wrapBytesAsBool extractRho (extractLabel "x")++-- Int because Bytes are just a string, but Int has a Bits instance+evaluateBytesBytesBytesFunChain :: (Int -> Int -> Int) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateBytesBytesBytesFunChain = evaluateBinaryDataizationFunChain intToBytes bytesToInt wrapBytesInBytes extractRho (extractLabel "b")++evaluateBytesBytesFunChain :: (Int -> Int) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateBytesBytesFunChain = evaluateUnaryDataizationFunChain intToBytes bytesToInt wrapBytesInBytes extractRho++evaluateFloatFloatFloatFunChain :: (Double -> Double -> Double) -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)+evaluateFloatFloatFloatFunChain = evaluateBinaryDataizationFunChain floatToBytes bytesToFloat wrapBytesInFloat extractRho (extractLabel "x")+ -- | Like `evaluateDataizationFunChain` but specifically for the built-in functions. -- This function is not safe. It returns undefined for unknown functions evaluateBuiltinFunChain :: String -> Object -> EvaluationState -> DataizeChain (Object, EvaluationState)-evaluateBuiltinFunChain "Plus" obj = evaluateDataizationFunChain (+) obj-evaluateBuiltinFunChain "Times" obj = evaluateDataizationFunChain (*) obj-evaluateBuiltinFunChain "Package" (Formation bindings) = do+-- int+evaluateBuiltinFunChain "Lorg_eolang_int_gt" obj = evaluateIntIntBoolFunChain (>) obj+evaluateBuiltinFunChain "Lorg_eolang_int_plus" obj = evaluateIntIntIntFunChain (+) obj+evaluateBuiltinFunChain "Lorg_eolang_int_times" obj = evaluateIntIntIntFunChain (*) obj+evaluateBuiltinFunChain "Lorg_eolang_int_div" obj = evaluateIntIntIntFunChain div obj+-- bytes+evaluateBuiltinFunChain "Lorg_eolang_bytes_eq" obj = evaluateBinaryDataizationFunChain boolToBytes bytesToInt wrapBytesAsBool extractRho (extractLabel "b") (==) obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_size" obj = evaluateUnaryDataizationFunChain intToBytes id wrapBytesInBytes extractRho (\(Bytes bytes) -> length (words (map dashToSpace bytes))) obj+ where+ dashToSpace '-' = ' '+ dashToSpace c = c+evaluateBuiltinFunChain "Lorg_eolang_bytes_slice" obj = \state -> do+ thisStr <- incLogLevel $ dataizeRecursivelyChain True (extractRho obj)+ bytes <- case thisStr of+ Right bytes -> pure bytes+ Left _ -> fail "Couldn't find bytes"+ evaluateBinaryDataizationFunChain id bytesToInt wrapBytesInBytes (extractLabel "start") (extractLabel "len") (sliceBytes bytes) obj state+evaluateBuiltinFunChain "Lorg_eolang_bytes_and" obj = evaluateBytesBytesBytesFunChain (.&.) obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_or" obj = evaluateBytesBytesBytesFunChain (.|.) obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_xor" obj = evaluateBytesBytesBytesFunChain (.^.) obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_not" obj = evaluateBytesBytesFunChain complement obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_right" obj = evaluateBinaryDataizationFunChain intToBytes bytesToInt wrapBytesInBytes extractRho (extractLabel "x") (\x i -> shift x (-i)) obj+evaluateBuiltinFunChain "Lorg_eolang_bytes_concat" obj = evaluateBinaryDataizationFunChain id id wrapBytesInBytes extractRho (extractLabel "b") concatBytes obj+-- float+evaluateBuiltinFunChain "Lorg_eolang_float_gt" obj = evaluateBinaryDataizationFunChain boolToBytes bytesToFloat wrapBytesInBytes extractRho (extractLabel "x") (>) obj+evaluateBuiltinFunChain "Lorg_eolang_float_times" obj = evaluateFloatFloatFloatFunChain (*) obj+evaluateBuiltinFunChain "Lorg_eolang_float_plus" obj = evaluateFloatFloatFloatFunChain (+) obj+evaluateBuiltinFunChain "Lorg_eolang_float_div" obj = evaluateFloatFloatFloatFunChain (/) obj+-- string+evaluateBuiltinFunChain "Lorg_eolang_string_length" obj = evaluateUnaryDataizationFunChain intToBytes bytesToString wrapBytesInInt extractRho length obj+evaluateBuiltinFunChain "Lorg_eolang_string_slice" obj = \state -> do+ thisStr <- incLogLevel $ dataizeRecursivelyChain True (extractRho obj)+ string <- case thisStr of+ Right bytes -> pure $ bytesToString bytes+ Left _ -> fail "Couldn't find bytes"+ evaluateBinaryDataizationFunChain stringToBytes bytesToInt wrapBytesInString (extractLabel "start") (extractLabel "len") (\start len -> take len (drop start string)) obj state+-- malloc+-- evaluateBuiltinFunChain "Lorg_eolang_malloc_φ" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_malloc_memory_block_pointer_read" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_malloc_memory_block_pointer_write" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_malloc_memory_block_pointer_free" obj = _ -- TODO+-- cage+-- evaluateBuiltinFunChain "Lorg_eolang_cage_φ" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_cage_encaged_φ" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_cage_encaged_encage" obj = _ -- TODO+-- I/O+-- evaluateBuiltinFunChain "Lorg_eolang_io_stdin_next_line" obj = evaluateIODataizationFunChain getLine obj+-- evaluateBuiltinFunChain "Lorg_eolang_io_stdin_φ" obj = evaluateIODataizationFunChain getContents obj+-- evaluateBuiltinFunChain "Lorg_eolang_io_stdout" obj = evaluateUnaryDataizationFunChain boolToBytes bytesToString wrapBytesInBytes (extractLabel "text") ((`seq` True) . unsafePerformIO . putStrLn) obj+-- others+evaluateBuiltinFunChain "Lorg_eolang_dataized" obj =+ evaluateUnaryDataizationFunChain id id wrapBytesInBytes (extractLabel "target") id obj+evaluateBuiltinFunChain "Lorg_eolang_error" obj = evaluateUnaryDataizationFunChain stringToBytes bytesToString wrapBytesInBytes (extractLabel "message") error obj+-- evaluateBuiltinFunChain "Lorg_eolang_seq" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_as_phi" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_rust" obj = _ -- TODO+-- evaluateBuiltinFunChain "Lorg_eolang_try" obj = _ -- TODO+evaluateBuiltinFunChain "Package" obj@(Formation bindings) = do \state -> do fmap dataizePackage getContext >>= \case True -> do@@ -147,10 +333,14 @@ isPackage (LambdaBinding (Function "Package")) = True isPackage _ = False dataizeBindingChain (AlphaBinding attr o) = do- dataizationResult <- dataizeRecursivelyChain o+ ctx <- getContext+ let extendedContext = (extendContextWith obj ctx){currentAttr = attr}+ dataizationResult <- incLogLevel $ withContext extendedContext $ dataizeRecursivelyChain False o return (AlphaBinding attr (either id (Formation . singleton . DeltaBinding) dataizationResult)) dataizeBindingChain b = return b-evaluateBuiltinFunChain _ obj = \state -> return (obj, state)+evaluateBuiltinFunChain atomName obj = \state -> do+ logStep ("[WARNING]: unknown atom (" <> atomName <> ")") (Left obj)+ return (obj, state) -- | Like `evaluateDataizationFun` but specifically for the built-in functions. -- This function is not safe. It returns undefined for unknown functions
+ src/Language/EO/Phi/Dependencies.hs view
@@ -0,0 +1,78 @@+{-# LANGUAGE TypeApplications #-}++module Language.EO.Phi.Dependencies where++import Language.EO.Phi++import Control.Monad (foldM)++bindingAttr :: Binding -> Maybe Attribute+bindingAttr (AlphaBinding a _) = Just a+bindingAttr (EmptyBinding a) = Just a+bindingAttr (DeltaBinding _) = Just (Alpha (AlphaIndex "Δ"))+bindingAttr DeltaEmptyBinding = Just (Alpha (AlphaIndex "Δ"))+bindingAttr LambdaBinding{} = Just (Alpha (AlphaIndex "λ"))+bindingAttr MetaBindings{} = Nothing+bindingAttr MetaDeltaBinding{} = Nothing++zipBindings :: [Binding] -> [Binding] -> ([Binding], [(Binding, Binding)])+zipBindings xs ys = (xs' <> ys', collisions)+ where+ as = map bindingAttr xs+ bs = map bindingAttr ys++ xs' = [x | x <- xs, bindingAttr x `notElem` bs]+ ys' = [y | y <- ys, bindingAttr y `notElem` as]+ collisions =+ [ (x, y)+ | x <- xs+ , y <- ys+ , bindingAttr x == bindingAttr y+ ]++isPackage :: [Binding] -> Bool+isPackage = any isPackageBinding++isPackageBinding :: Binding -> Bool+isPackageBinding (LambdaBinding (Function "Package")) = True+isPackageBinding _ = False++mergeBinding :: Binding -> Binding -> Either String Binding+mergeBinding (AlphaBinding a (Formation xs)) (AlphaBinding b (Formation ys))+ | a == b = AlphaBinding a . Formation <$> mergeBindings xs ys+mergeBinding x y | x == y = return x+mergeBinding x y =+ Left $+ concat @[]+ [ "conflict when adding dependencies (trying to merge non-formations)"+ , printTree x+ , printTree y+ ]++mergeBindings :: [Binding] -> [Binding] -> Either String [Binding]+mergeBindings xs ys+ | isPackage xs && isPackage ys = do+ case zipBindings xs ys of+ (zs, collisions) -> do+ ws <- mapM (uncurry mergeBinding) collisions+ return (zs <> ws)+ | otherwise =+ Left $+ concat @[]+ [ "conflict when adding dependencies (trying to merge non-Package formations "+ , printTree (Formation xs)+ , printTree (Formation ys)+ , " )"+ ]++deepMerge :: Program -> Program -> Either String Program+deepMerge (Program xs) (Program ys) = Program <$> mergeBindings (mkPackage xs) (mkPackage ys)+ where+ mkPackage bs+ | isPackage bs = bs+ -- FIXME: check if lambda attribute exists and throw error!+ | otherwise = LambdaBinding (Function "Package") : bs++deepMergePrograms :: [Program] -> Either String Program+deepMergePrograms [] = Right (Program [])+deepMergePrograms (p : ps) = foldM deepMerge p ps
src/Language/EO/Phi/Normalize.hs view
@@ -12,25 +12,17 @@ import Control.Monad.State import Data.Maybe (fromMaybe) -import Control.Lens.Setter ((+=))-import Control.Monad (forM) import Data.Generics.Labels () import GHC.Generics (Generic)-import Language.EO.Phi.Rules.Common (getMaxNu, intToBytesObject, lookupBinding, objectBindings)+import Language.EO.Phi.Rules.Common (lookupBinding, objectBindings) import Language.EO.Phi.Syntax.Abs data Context = Context { globalObject :: [Binding] , thisObject :: [Binding]- , maxNu :: Int } deriving (Generic) -isNu :: Binding -> Bool-isNu (AlphaBinding VTX _) = True-isNu (EmptyBinding VTX) = True-isNu _ = False- -- | Normalize an input 𝜑-program. normalize :: Program -> Program normalize (Program bindings) = evalState (Program . objectBindings <$> normalizeObject (Formation bindings)) context@@ -39,36 +31,12 @@ Context { globalObject = bindings , thisObject = bindings- , maxNu = getMaxNu (Formation bindings) } -rule1 :: Object -> State Context Object-rule1 (Formation bindings) = do- normalizedBindings <- forM bindings $ \case- AlphaBinding a object- | a /= VTX ->- do- object' <- rule1 object- pure (AlphaBinding a object')- b -> pure b- finalBindings <-- if not $ any isNu normalizedBindings- then do- #maxNu += 1- nus <- gets maxNu- let dataObject = intToBytesObject nus- pure (AlphaBinding VTX dataObject : normalizedBindings)- else do- pure normalizedBindings- pure (Formation finalBindings)-rule1 object = pure object- normalizeObject :: Object -> State Context Object normalizeObject object = do this <- gets thisObject case object of- -- Rule 1- obj@(Formation _) -> rule1 obj ObjectDispatch ThisObject a -> pure $ fromMaybe object (lookupBinding a this) _ -> pure object @@ -83,6 +51,7 @@ Termination -> PeeledObject HeadTermination [] MetaObject _ -> PeeledObject HeadTermination [] MetaFunction _ _ -> error "To be honest, I'm not sure what should be here"+ MetaSubstThis{} -> error "impossible" where followedBy (PeeledObject object actions) action = PeeledObject object (actions ++ [action])
+ src/Language/EO/Phi/Pipeline/Config.hs view
@@ -0,0 +1,122 @@+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE InstanceSigs #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TemplateHaskell #-}+{-# OPTIONS_GHC -Wno-partial-fields #-}++module Language.EO.Phi.Pipeline.Config where++import Data.Aeson (ToJSON)+import Data.Aeson.Types (FromJSON)+import GHC.Generics (Generic)+import Language.EO.Phi.Metrics.Data+import Language.EO.Phi.TH (deriveJSON)+import Text.Printf (printf)++data TestSetPhi = TestSetPhi+ { initial :: FilePath+ , normalized :: FilePath+ , bindingsPathInitial :: Maybe String+ , bindingsPathNormalized :: Maybe String+ }+ deriving stock (Show, Generic)++$(deriveJSON ''TestSetPhi)++data MetricsChangeCategory a+ = MetricsChange'Good {change :: a}+ | MetricsChange'Bad {change :: a}+ | MetricsChange'NA+ deriving stock (Show, Generic, Eq)++$(deriveJSON ''MetricsChangeCategory)++type MetricsChange = Metrics Percent++newtype Percent = Percent {percent :: Double}+ deriving newtype+ (FromJSON, ToJSON, Num, Fractional, Floating, Eq, Ord, Real, RealFrac, RealFloat)++roundToStr :: Int -> Double -> String+roundToStr = printf "%0.*f%%"++instance Show Percent where+ show :: Percent -> String+ show Percent{..} = roundToStr 2 (percent * 100)++type MetricsChangeCategorized = Metrics (MetricsChangeCategory Percent)++data ReportInput = ReportInput+ { js :: Maybe FilePath+ , css :: Maybe FilePath+ }+ deriving stock (Show, Generic)++$(deriveJSON ''ReportInput)++data ReportOutput = ReportOutput+ { html :: Maybe FilePath+ , json :: Maybe FilePath+ , markdown :: Maybe FilePath+ }+ deriving stock (Show, Generic)++$(deriveJSON ''ReportOutput)++data ReportConfig = ReportConfig+ { input :: Maybe ReportInput+ , output :: ReportOutput+ , expectedMetricsChange :: MetricsChange+ , expectedImprovedProgramsPercentage :: Percent+ }+ deriving stock (Show, Generic)++$(deriveJSON ''ReportConfig)++data TestSetEO = TestSetEO+ { original :: FilePath+ , yaml :: FilePath+ , filtered :: FilePath+ , include :: Maybe [String]+ -- ^+ -- Program names to include.+ --+ -- `Nothing` is equivalent to all programs.+ , exclude :: Maybe [String]+ -- ^+ -- Program names to exclude+ --+ -- `Nothing` is equivalent to no programs.+ }+ deriving stock (Show, Generic)++$(deriveJSON ''TestSetEO)++data TestSet = TestSet+ { eo :: TestSetEO+ , phi :: TestSetPhi+ , enable :: Maybe Bool+ -- ^+ -- Whether to enable this test set.+ }+ deriving stock (Show, Generic)++$(deriveJSON ''TestSet)++data PipelineConfig = PipelineConfig+ { report :: ReportConfig+ , testSets :: [TestSet]+ }+ deriving stock (Show, Generic)++$(deriveJSON ''PipelineConfig)++data ReportFormat+ = ReportFormat'Html+ | -- | GitHub Flavored Markdown+ ReportFormat'Markdown+ deriving stock (Eq)
+ src/Language/EO/Phi/Pipeline/EOTests/Data.hs view
@@ -0,0 +1,65 @@+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE InstanceSigs #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE ViewPatterns #-}++module Language.EO.Phi.Pipeline.EOTests.Data where++import Control.Monad (guard)+import Data.String (IsString (..))+import Data.Text qualified as T+import Data.Yaml.Aeson+import GHC.Generics (Generic)+import Language.EO.Phi.TH (deriveJSON)+import Text.Read (readMaybe)++data Pos = Pos+ { file :: FilePath+ , line :: Int+ }+ deriving stock (Show)++instance ToJSON Pos where+ toJSON :: Pos -> Value+ toJSON Pos{..} = String (fromString (file <> ":" <> show line))++instance FromJSON Pos where+ parseJSON :: Value -> Parser Pos+ parseJSON = withText "Pos" $ \(T.unpack -> x) -> do+ let (file, rs) = span (/= ':') x+ guard (not . null $ file)+ guard (length rs > 1)+ let line' = readMaybe (drop 1 rs)+ maybe (fail $ x <> " is not a number") (\line -> pure Pos{..}) line'++data Program = Program+ { source :: Pos+ , name :: String+ , text :: String+ }+ deriving stock (Show, Generic)++$(deriveJSON ''Program)++data Test = Test+ { source :: String+ , license :: String+ , meta :: String+ , programs :: [Program]+ }+ deriving stock (Show, Generic)++$(deriveJSON ''Test)++data TestContent = TestContent+ { source :: FilePath+ , meta :: String+ , programs :: [Program]+ }+ deriving stock (Show, Generic)++$(deriveJSON ''TestContent)
+ src/Language/EO/Phi/Pipeline/EOTests/PrepareTests.hs view
@@ -0,0 +1,60 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedRecordDot #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ViewPatterns #-}++module Language.EO.Phi.Pipeline.EOTests.PrepareTests where++import Control.Monad+import Data.Function ((&))+import Data.Functor ((<&>))+import Data.Maybe (fromMaybe)+import Data.Yaml (encodeFile)+import Language.EO.Phi.Pipeline.Config+import Language.EO.Phi.Pipeline.EOTests.Data+import System.Directory+import System.FilePath.Posix++prepareTests :: PipelineConfig -> IO ()+prepareTests config = do+ forM_ (filter (fromMaybe True . (.enable)) config.testSets) $ \((.eo) -> testSet) -> do+ test@Test{source, meta} <- parseTest testSet.original+ let exclude = fromMaybe [] testSet.exclude+ include = fromMaybe (test.programs <&> (.name)) testSet.include & filter (`notElem` exclude)+ programs = filter (\x -> x.name `elem` include) test.programs+ testContent = TestContent{..}++ -- write yaml+ let target = testSet.yaml+ targetTmp = target <.> ".tmp"+ createDirectoryIfMissing True (takeDirectory target)+ encodeFile targetTmp testContent+ readFile targetTmp >>= appendFile target+ removeFile targetTmp++ -- write eo+ createDirectoryIfMissing True (takeDirectory testSet.filtered)+ writeFile testSet.filtered meta+ forM_ programs (\x -> appendFile testSet.filtered x.text)++parseProgramsRaw :: ([(Int, [String])], (Int, [[Char]]), Int) -> [[Char]] -> [(Int, String)]+parseProgramsRaw (programs', (programStart, program), curLine) (line'@(x : _) : xs)+ | (program /= [] && head program == "" || null program) && (x == '[' || x == '#') = parseProgramsRaw ((programStart, program) : programs', (curLine, [line']), curLine + 1) xs+ | otherwise = parseProgramsRaw (programs', (programStart, line' : program), curLine + 1) xs+parseProgramsRaw (programs', (programStart, program), curLine) ("" : xs) = parseProgramsRaw (programs', (programStart, "" : program), curLine + 1) xs+parseProgramsRaw (programs', program, _) [] = (unlines <$>) <$> drop 1 (reverse ((reverse <$>) <$> (program : programs')))++parseTest' :: FilePath -> [String] -> Test+parseTest' source eoCode =+ let+ (license, k') = span (\case '#' : _ -> True; "" -> True; _ -> False) eoCode+ (meta, k'') = span (\case '+' : _ -> True; "" -> True; _ -> False) k'+ programsStart = length license + length meta + 1+ programsRaw = parseProgramsRaw ([], (programsStart, []), programsStart) k''+ programs = programsRaw <&> (\(line, text) -> Program{source = Pos{file = source, ..}, name = text & dropWhile (/= '[') & drop 5 & takeWhile (/= '\n'), ..})+ in+ Test{license = unlines license, meta = unlines meta, ..}++parseTest :: FilePath -> IO Test+parseTest path = readFile path <&> (parseTest' path . lines)
src/Language/EO/Phi/Report/Data.hs view
@@ -16,75 +16,12 @@ module Language.EO.Phi.Report.Data where -import Data.Aeson (FromJSON, ToJSON)-import GHC.Generics (Generic) import Language.EO.Phi.Metrics.Data (BindingMetrics (..), Metrics (..), MetricsCount, ProgramMetrics) import Language.EO.Phi.Metrics.Data qualified as Metrics+import Language.EO.Phi.Pipeline.Config import Language.EO.Phi.TH (deriveJSON)-import Text.Printf (printf) import Prelude hiding (div, id, span) -data ReportItem = ReportItem- { phi :: FilePath- , phiNormalized :: FilePath- , bindingsPathPhi :: Maybe String- , bindingsPathPhiNormalized :: Maybe String- }- deriving stock (Show, Generic)--$(deriveJSON ''ReportItem)--data MetricsChangeCategory a- = MetricsChange'Good {change :: a}- | MetricsChange'Bad {change :: a}- | MetricsChange'NA- deriving stock (Show, Generic, Eq)--$(deriveJSON ''MetricsChangeCategory)--type MetricsChange = Metrics Percent--newtype Percent = Percent {percent :: Double}- deriving newtype- (FromJSON, ToJSON, Num, Fractional, Floating, Eq, Ord, Real, RealFrac, RealFloat)--roundToStr :: Int -> Double -> String-roundToStr = printf "%0.*f%%"--instance Show Percent where- show :: Percent -> String- show Percent{..} = roundToStr 2 (percent * 100)--type MetricsChangeCategorized = Metrics (MetricsChangeCategory Percent)--data Report'InputConfig = Report'InputConfig- { js :: Maybe FilePath- , css :: Maybe FilePath- }- deriving stock (Show, Generic)--$(deriveJSON ''Report'InputConfig)--data Report'OutputConfig = Report'OutputConfig- { html :: Maybe FilePath- , json :: Maybe FilePath- , markdown :: Maybe FilePath- }- deriving stock (Show, Generic)--$(deriveJSON ''Report'OutputConfig)--data ReportConfig = ReportConfig- { input :: Maybe Report'InputConfig- , output :: Report'OutputConfig- , expectedMetricsChange :: MetricsChange- , expectedImprovedProgramsPercentage :: Percent- , items :: [ReportItem]- }- deriving stock (Show, Generic)--$(deriveJSON ''ReportConfig)- data ReportRow = ReportRow { fileInitial :: Maybe FilePath , fileNormalized :: Maybe FilePath@@ -135,21 +72,21 @@ initial = fromIntegral <$> countInitial normalized = fromIntegral <$> countNormalized -makeProgramReport :: ReportConfig -> ReportItem -> ProgramMetrics -> ProgramMetrics -> ProgramReport-makeProgramReport reportConfig reportItem metricsPhi metricsPhiNormalized =+makeProgramReport :: PipelineConfig -> TestSetPhi -> ProgramMetrics -> ProgramMetrics -> ProgramReport+makeProgramReport pipelineConfig testSet metricsPhi metricsPhiNormalized = ProgramReport{..} where bindingsRows = case (metricsPhi.bindingsByPathMetrics, metricsPhiNormalized.bindingsByPathMetrics) of- (Just bindingsMetricsNormalized, Just bindingsMetricsInitial) ->+ (Just bindingsMetricsInitial, Just bindingsMetricsNormalized) -> [ ReportRow- { fileInitial = Just reportItem.phi- , fileNormalized = Just reportItem.phiNormalized- , bindingsPathInitial = Just bindingsMetricsNormalized.path+ { fileInitial = Just testSet.initial+ , fileNormalized = Just testSet.normalized+ , bindingsPathInitial = Just bindingsMetricsInitial.path , bindingsPathNormalized = Just bindingsMetricsNormalized.path , attributeInitial = Just attributeInitial , attributeNormalized = Just attributeNormalized- , metricsChange = calculateMetricsChange reportConfig.expectedMetricsChange metricsInitial metricsNormalized+ , metricsChange = calculateMetricsChange pipelineConfig.report.expectedMetricsChange metricsInitial metricsNormalized , metricsInitial = metricsInitial , metricsNormalized = metricsNormalized }@@ -159,25 +96,25 @@ _ -> [] programRow = ReportRow- { fileInitial = Just reportItem.phi- , fileNormalized = Just reportItem.phiNormalized+ { fileInitial = Just testSet.initial+ , fileNormalized = Just testSet.normalized , bindingsPathInitial = Nothing , bindingsPathNormalized = Nothing , attributeInitial = Nothing , attributeNormalized = Nothing- , metricsChange = calculateMetricsChange reportConfig.expectedMetricsChange metricsPhi.programMetrics metricsPhiNormalized.programMetrics+ , metricsChange = calculateMetricsChange pipelineConfig.report.expectedMetricsChange metricsPhi.programMetrics metricsPhiNormalized.programMetrics , metricsInitial = metricsPhi.programMetrics , metricsNormalized = metricsPhiNormalized.programMetrics } -makeReport :: ReportConfig -> [ProgramReport] -> Report-makeReport reportConfig programReports =+makeReport :: PipelineConfig -> [ProgramReport] -> Report+makeReport pipelineConfig programReports = Report{..} where programRows = (.programRow) <$> programReports metricsInitial = foldMap (.metricsInitial) programRows metricsNormalized = foldMap (.metricsNormalized) programRows- metricsChange = calculateMetricsChange reportConfig.expectedMetricsChange metricsInitial metricsNormalized+ metricsChange = calculateMetricsChange pipelineConfig.report.expectedMetricsChange metricsInitial metricsNormalized totalRow = ReportRow { fileInitial = Nothing
src/Language/EO/Phi/Report/Html.hs view
@@ -8,6 +8,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE NoImplicitPrelude #-}@@ -18,17 +19,23 @@ import Data.FileEmbed (embedFileRelative) import Data.List (intercalate)-import Data.Maybe (fromMaybe)-import Data.String.Interpolate+import Data.Maybe (catMaybes, fromMaybe) import Data.Text qualified as T import Data.Text.Encoding qualified as T import Language.EO.Phi.Metrics.Data (Metrics (..), MetricsCount, toListMetrics)-import Language.EO.Phi.Report.Data (MetricsChange, MetricsChangeCategorized, MetricsChangeCategory (..), Percent (..), ProgramReport (..), Report (..), ReportRow (..))+import Language.EO.Phi.Pipeline.Config+import Language.EO.Phi.Report.Data+import PyF (fmt) import Text.Blaze.Html.Renderer.String (renderHtml) import Text.Blaze.Html5 hiding (i)-import Text.Blaze.Html5.Attributes (class_, colspan, id, onclick, type_, value)+import Text.Blaze.Html5 qualified as TBH+import Text.Blaze.Html5.Attributes (charset, class_, colspan, content, id, lang, onclick, type_, value)+import Text.Blaze.Html5.Attributes qualified as TBHA import Prelude hiding (div, id, span) +-- $setup+-- >>> import Text.Blaze.Html.Renderer.String (renderHtml)+ -- | JavaScript file to embed into HTML reports reportJS :: String reportJS = T.unpack $ T.decodeUtf8 $(embedFileRelative "report/main.js")@@ -46,13 +53,14 @@ , dispatches = "Dispatches" } -toHtmlReportHeader :: Html-toHtmlReportHeader =+toHtmlReportTableHeader :: Html+toHtmlReportTableHeader = thead $ toHtml [ tr $ toHtml- [ th ! colspan "2" ! class_ "no-sort" $ "Attribute"+ [ th ! colspan "1" ! class_ "no-sort" $ ""+ , th ! colspan "2" ! class_ "no-sort" $ "Attribute" , th ! colspan "4" ! class_ "no-sort" $ "Change" , th ! colspan "4" ! class_ "no-sort" $ "Initial" , th ! colspan "4" ! class_ "no-sort" $ "Normalized"@@ -60,7 +68,8 @@ ] , tr . toHtml $ th- <$> [ "Attribute Initial"+ <$> [ "Test #"+ , "Attribute Initial" , "Attribute Normalized" ] <> ( concat@@ -75,45 +84,29 @@ ] ] -data ReportFormat- = ReportFormat'Html- { css :: String- , js :: String- }- | -- | GitHub Flavored Markdown- ReportFormat'Markdown- deriving stock (Eq)--data ReportConfig = ReportConfig- { expectedMetricsChange :: MetricsChange- , expectedImprovedProgramsPercentage :: Percent- , format :: ReportFormat- }- instance ToMarkup Percent where toMarkup :: Percent -> Markup toMarkup = toMarkup . show --- >>> import Text.Blaze.Html.Renderer.String (renderHtml)--- >>> reportConfig = ReportConfig { expectedMetricsChange = 0, format = ReportFormat'Markdown }+-- >>> pipelineConfig = ReportConfig { general = ReportGeneralConfig { expectedMetricsChange = 0, format = ReportFormat'Markdown } } ----- >>> renderHtml $ toHtmlChange reportConfig (MetricsChange'Bad 0.2)+-- >>> renderHtml $ toHtmlChange pipelineConfig (MetricsChange'Bad 0.2) -- "<td class=\"number bad\">0.2\128308</td>" ----- >>> renderHtml $ toHtmlChange reportConfig (MetricsChange'Good 0.5)+-- >>> renderHtml $ toHtmlChange pipelineConfig (MetricsChange'Good 0.5) -- "<td class=\"number good\">0.5\128994</td>"--- >>> renderHtml $ toHtmlChange reportConfig (MetricsChange'NA :: MetricsChangeCategory Double)+-- >>> renderHtml $ toHtmlChange pipelineConfig (MetricsChange'NA :: MetricsChangeCategory Double) -- "<td class=\"number not-applicable\">N/A\128995</td>"-toHtmlChange :: (ToMarkup a) => ReportConfig -> MetricsChangeCategory a -> Html-toHtmlChange reportConfig = \case+toHtmlChange :: (ToMarkup a) => ReportFormat -> MetricsChangeCategory a -> Html+toHtmlChange reportFormat = \case MetricsChange'NA -> td ! class_ "number not-applicable" $ toHtml ("N/A" :: String) <> toHtml ['🟣' | isMarkdown] MetricsChange'Bad{..} -> td ! class_ "number bad" $ toHtml change <> toHtml ['🔴' | isMarkdown] MetricsChange'Good{..} -> td ! class_ "number good" $ toHtml change <> toHtml ['🟢' | isMarkdown] where- isMarkdown = reportConfig.format == ReportFormat'Markdown+ isMarkdown = reportFormat == ReportFormat'Markdown -toHtmlMetricsChange :: ReportConfig -> MetricsChangeCategorized -> [Html]-toHtmlMetricsChange reportConfig change = toHtmlChange reportConfig <$> toListMetrics change+toHtmlMetricsChange :: ReportFormat -> MetricsChangeCategorized -> [Html]+toHtmlMetricsChange reportFormat change = toHtmlChange reportFormat <$> toListMetrics change toHtmlMetrics :: MetricsCount -> [Html] toHtmlMetrics metrics =@@ -121,16 +114,17 @@ . toHtml <$> toListMetrics metrics -toHtmlReportRow :: ReportConfig -> ReportRow -> Html-toHtmlReportRow reportConfig reportRow =+toHtmlReportRow :: ReportFormat -> Int -> ReportRow -> Html+toHtmlReportRow reportFormat index reportRow = tr . toHtml $ ( td . toHtml- <$> [ fromMaybe "[N/A]" reportRow.attributeInitial+ <$> [ [fmt|{index}|]+ , fromMaybe "[N/A]" reportRow.attributeInitial , fromMaybe "[N/A]" reportRow.attributeNormalized ] )- <> toHtmlMetricsChange reportConfig reportRow.metricsChange+ <> toHtmlMetricsChange reportFormat reportRow.metricsChange <> toHtmlMetrics reportRow.metricsInitial <> toHtmlMetrics reportRow.metricsNormalized <> ( td@@ -142,125 +136,124 @@ ] ) -toHtmlReport :: ReportConfig -> Report -> Html-toHtmlReport reportConfig report =- toHtml $- [ h2 "Overview"- <> p- [i|- We translate EO files into initial PHI programs.- Next, we normalize these programs and get normalized PHI programs.- Then, we collect metrics for initial and normalized PHI programs.- |]- <> h2 "Metrics"- <> p- [i|- An EO file contains multiple test objects.- After translation, these test objects become attributes in PHI programs.- We call these attributes "tests".- |]- <> p- [i|- We collect metrics on the number of #{intercalate ", " (toListMetrics metricsNames)} in tests.- We want normalized tests to have less such elements than initial tests do.- |]- <> p "A metric change for a test is calculated by the formula"- <> p (code "(metric_initial - metric_normalized) / metric_initial")- <> p "where:"- <> ul- ( toHtml- [ li $ code "metric_initial" <> " is the metric for the initial test"- , li $ code "metric_normalized" <> " is the metric for the normalized test"- ]- )- <> h3 "Expected"- <> p- [i|- Metric changes are expected to be as follows or greater:- |]- <> ul- ( toHtml . toListMetrics $- makePercentItem- <$> metricsNames- <*> reportConfig.expectedMetricsChange- )- <> p- ( let expectedImprovedProgramsPercentage = reportConfig.expectedImprovedProgramsPercentage- in [i|We expect such changes for at least #{expectedImprovedProgramsPercentage} of tests.|]- )- <> h3 "Actual"- <> p [i|We normalized #{testsCount} tests.|]- <> p [i|All metrics were improved for #{makeNumber allChangesGoodCount} tests.|]- <> p [i|Tests where a particular metric was improved:|]- <> ul- ( toHtml . toListMetrics $- makeItem- <$> metricsNames- <*> particularMetricsChangeGoodCount- )- <> h2 "Table"- <> p [i|The table below provides detailed information about tests.|]- ]- <> [- -- https://stackoverflow.com/a/55743302- -- https://stackoverflow.com/a/3169849- ( script ! type_ "text/javascript" $- [i|- function copytable(el) {- var urlField = document.getElementById(el)- var range = document.createRange()- range.selectNode(urlField)- window.getSelection().addRange(range)- document.execCommand('copy')+toHtmlReport :: ReportFormat -> PipelineConfig -> Report -> Html+toHtmlReport reportFormat pipelineConfig report =+ toHtml+ [ docType+ , TBH.html ! lang "en-US" $+ toHtml+ [ TBH.head $+ toHtml $+ [ meta ! charset "utf-8"+ , meta ! TBHA.name "viewport" ! content "width=device-width, initial-scale=1.0"+ , TBH.title "Report"+ , -- https://stackoverflow.com/a/55743302+ -- https://stackoverflow.com/a/3169849+ script ! type_ "text/javascript" $+ [fmt|+ function copytable(el) {{+ var urlField = document.getElementById(el)+ var range = document.createRange()+ range.selectNode(urlField)+ window.getSelection().addRange(range)+ document.execCommand('copy') - if (window.getSelection().empty) { // Chrome- window.getSelection().empty();- } else if (window.getSelection().removeAllRanges) { // Firefox- window.getSelection().removeAllRanges();- }- }- |]- )- <> (input ! type_ "button" ! value "Copy to Clipboard" ! onclick "copytable('table')")- <> h3 "Columns"- <> p "Columns in this table are sortable."- <> p "Hover over a header cell from the second row of header cells (Attribute Initial, etc.) to see a triangle demonstrating the sorting order."- <> ul- ( toHtml- [ li "▾: descending"- , li "▴: ascending"- , li "▸: unordered"+ if (window.getSelection().empty) {{ // Chrome+ window.getSelection().empty();+ }} else if (window.getSelection().removeAllRanges) {{ // Firefox+ window.getSelection().removeAllRanges();+ }}+ }}+ |] ]- )- <> p "Click on the triangle to change the sorting order in the corresponding column."- | not isMarkdown- ]- <> [ table ! class_ "sortable" ! id "table" $- toHtml- [ toHtmlReportHeader- , tbody . toHtml $- toHtmlReportRow reportConfig- <$> concat [programReport.bindingsRows | programReport <- report.programReports]- ]- ]- <> ( case reportConfig.format of- ReportFormat'Html{..} ->- [ style ! type_ "text/css" $ toHtml css- , script $ toHtml js- ]- ReportFormat'Markdown -> []- )+ <> case reportFormat of+ ReportFormat'Html ->+ catMaybes+ [ pipelineConfig.report.input >>= (.js) >>= \js -> pure (script $ toHtml js)+ , pipelineConfig.report.input >>= (.css) >>= \css -> pure (style ! type_ "text/css" $ toHtml css)+ ]+ ReportFormat'Markdown -> []+ , body $+ toHtml $+ [ h2 "Overview"+ <> p+ [fmt|+ We translate EO files into initial PHI programs.+ Next, we normalize these programs and get normalized PHI programs.+ Then, we collect metrics for initial and normalized PHI programs.+ |]+ <> h2 "Metrics"+ <> p+ [fmt|+ An EO file contains multiple test objects.+ After translation, these test objects become attributes in PHI programs.+ We call these attributes "tests".+ |]+ <> p+ [fmt|+ We collect metrics on the number of {intercalate ", " (toListMetrics metricsNames)} in tests.+ We want normalized tests to have less such elements than initial tests do.+ |]+ <> p "A metric change for a test is calculated by the formula"+ <> p (code "(metric_initial - metric_normalized) / metric_initial")+ <> p "where:"+ <> ul+ ( toHtml+ [ li $ code "metric_initial" <> " is the metric for the initial test"+ , li $ code "metric_normalized" <> " is the metric for the normalized test"+ ]+ )+ <> h3 "Expected"+ <> p [fmt|Metric changes are expected to be as follows or greater:|]+ <> ul+ ( toHtml . toListMetrics $+ mkPercentItem+ <$> metricsNames+ <*> pipelineConfig.report.expectedMetricsChange+ )+ <> p+ ( let expectedImprovedProgramsPercentage = pipelineConfig.report.expectedImprovedProgramsPercentage+ in [fmt|We expect such changes for at least {expectedImprovedProgramsPercentage:s} of tests.|]+ )+ <> h3 "Actual"+ <> p [fmt|We normalized {testsCount} tests.|]+ <> p [fmt|All metrics were improved for {mkNumber allGoodMetricsCount testsCount} tests.|]+ <> p [fmt|Tests where a particular metric was improved:|]+ <> ul+ ( toHtml . toListMetrics $+ mkItem'+ <$> metricsNames+ <*> particularMetricsChangeGoodCount+ )+ <> h2 "Table"+ <> p [fmt|The table below provides detailed information about tests.|]+ ]+ <> [ (TBH.input ! type_ "button" ! value "Copy to Clipboard" ! onclick "copytable('table')")+ <> h3 "Columns"+ <> p "Columns in this table are sortable."+ <> p "Hover over a header cell from the second row of header cells (Attribute Initial, etc.) to see a triangle demonstrating the sorting order."+ <> ul+ ( toHtml+ [ li "▾: descending"+ , li "▴: ascending"+ , li "▸: unordered"+ ]+ )+ <> p "Click on the triangle to change the sorting order in the corresponding column."+ | not isMarkdown+ ]+ <> [ table ! class_ "sortable" ! id "table" $+ toHtml+ [ toHtmlReportTableHeader+ , tbody . toHtml $+ uncurry (toHtmlReportRow reportFormat)+ <$> zip [1 ..] (concat [programReport.bindingsRows | programReport <- report.programReports])+ ]+ ]+ ]+ ] where- isMarkdown = reportConfig.format == ReportFormat'Markdown-- makePercentItem :: String -> Percent -> Html- makePercentItem name percent = li $ b [i|#{name}: |] <> toHtml percent-- makeNumber :: Int -> String- makeNumber number = [i|#{number} (#{mkPercentage allChangesGoodCount})|]-- makeItem :: String -> Int -> Html- makeItem name number = li $ b [i|#{name}: |] <> toHtml (makeNumber number)+ isMarkdown = reportFormat == ReportFormat'Markdown tests = concatMap (.bindingsRows) report.programReports @@ -272,13 +265,31 @@ MetricsChange'Good _ -> True _ -> False - countAllChanges cond = length $ filter (all cond) metricsChanges- allChangesGoodCount = countAllChanges isGood-- mkPercentage x = Percent $ fromIntegral x / fromIntegral testsCount+ countAllMetricsSatisfyingCondition cond = length $ filter (all cond) metricsChanges+ allGoodMetricsCount = countAllMetricsSatisfyingCondition isGood particularMetricsChangeGoodCount :: Metrics Int particularMetricsChangeGoodCount = sum $ ((\x -> if x then 1 else 0) . isGood <$>) <$> metricsChanges -toStringReport :: ReportConfig -> Report -> String-toStringReport reportConfig report = renderHtml $ toHtmlReport reportConfig report+ mkItem' = mkItem testsCount++-- |+-- >>> renderHtml (mkItem 10 "foo" 4)+-- "<li><b>foo: </b>4 (40.00%)</li>"+mkItem :: Int -> String -> Int -> Html+mkItem total name part = li $ b [fmt|{name}: |] <> toHtml (mkNumber part total)++mkPercentItem :: String -> Percent -> Html+mkPercentItem name percent = li $ b [fmt|{name}: |] <> toHtml percent++mkPercentage :: Int -> Int -> Percent+mkPercentage part total = Percent $ fromIntegral part / fromIntegral total++-- |+-- >>> mkNumber 3 5+-- "3 (60.00%)"+mkNumber :: Int -> Int -> String+mkNumber part total = [fmt|{part} ({mkPercentage part total:s})|]++toStringReport :: ReportFormat -> PipelineConfig -> Report -> String+toStringReport reportFormat pipelineConfig report = renderHtml $ toHtmlReport reportFormat pipelineConfig report
src/Language/EO/Phi/Rules/Common.hs view
@@ -1,20 +1,25 @@ {-# HLINT ignore "Use &&" #-} {-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} +{-# HLINT ignore "Redundant fmap" #-}+ module Language.EO.Phi.Rules.Common where import Control.Applicative (Alternative ((<|>)), asum) import Control.Arrow (Arrow (first)) import Control.Monad-import Data.List (nubBy, sortOn)+import Data.ByteString qualified as ByteString.Strict+import Data.Char (toUpper)+import Data.List (intercalate, minimumBy, nubBy, sortOn) import Data.List.NonEmpty (NonEmpty (..), (<|)) import Data.List.NonEmpty qualified as NonEmpty+import Data.Ord (comparing)+import Data.Serialize qualified as Serialize import Data.String (IsString (..)) import Language.EO.Phi.Syntax.Abs import Language.EO.Phi.Syntax.Lex (Token)@@ -44,19 +49,22 @@ unsafeParseWith :: ([Token] -> Either String a) -> String -> a unsafeParseWith parser input = case parseWith parser input of- Left parseError -> error parseError+ Left parseError -> error (parseError <> "\non input\n" <> input <> "\n") Right object -> object type NamedRule = (String, Rule) data Context = Context- { allRules :: [NamedRule]+ { builtinRules :: Bool+ , allRules :: [NamedRule] , outerFormations :: NonEmpty Object , currentAttr :: Attribute , insideFormation :: Bool -- ^ Temporary hack for applying Ksi and Phi rules when dataizing , dataizePackage :: Bool -- ^ Temporary flag to only dataize Package attributes for the top-level formation.+ , minimizeTerms :: Bool+ , insideSubObject :: Bool } sameContext :: Context -> Context -> Bool@@ -69,11 +77,14 @@ defaultContext :: [NamedRule] -> Object -> Context defaultContext rules obj = Context- { allRules = rules+ { builtinRules = False+ , allRules = rules , outerFormations = NonEmpty.singleton obj- , currentAttr = Sigma+ , currentAttr = Phi , insideFormation = False , dataizePackage = True+ , minimizeTerms = False+ , insideSubObject = False } -- | A rule tries to apply a transformation to the root object, if possible.@@ -94,23 +105,32 @@ { outerFormations = obj <| outerFormations ctx } +isEmptyBinding :: Binding -> Bool+isEmptyBinding EmptyBinding{} = True+isEmptyBinding DeltaEmptyBinding{} = True+isEmptyBinding _ = False+ withSubObject :: (Context -> Object -> [(String, Object)]) -> Context -> Object -> [(String, Object)] withSubObject f ctx root = f ctx root <|> case root of- Formation bindings ->- propagateName1 Formation <$> withSubObjectBindings f ((extendContextWith root ctx){insideFormation = True}) bindings+ Formation bindings+ | not (any isEmptyBinding bindings) -> propagateName1 Formation <$> withSubObjectBindings f ((extendContextWith root subctx){insideFormation = True}) bindings+ | otherwise -> [] Application obj bindings -> asum- [ propagateName2 Application <$> withSubObject f ctx obj <*> pure bindings- , propagateName1 (Application obj) <$> withSubObjectBindings f ctx bindings+ [ propagateName2 Application <$> withSubObject f subctx obj <*> pure bindings+ , propagateName1 (Application obj) <$> withSubObjectBindings f subctx bindings ]- ObjectDispatch obj a -> propagateName2 ObjectDispatch <$> withSubObject f ctx obj <*> pure a+ ObjectDispatch obj a -> propagateName2 ObjectDispatch <$> withSubObject f subctx obj <*> pure a GlobalObject{} -> [] ThisObject{} -> [] Termination -> [] MetaObject _ -> [] MetaFunction _ _ -> []+ MetaSubstThis _ _ -> []+ where+ subctx = ctx{insideSubObject = True} -- | Given a unary function that operates only on plain objects, -- converts it to a function that operates on named objects@@ -124,6 +144,9 @@ withSubObjectBindings :: (Context -> Object -> [(String, Object)]) -> Context -> [Binding] -> [(String, [Binding])] withSubObjectBindings _ _ [] = []+withSubObjectBindings f ctx (b@(AlphaBinding Rho _) : bs) =+ -- do not apply rules inside ρ-bindings+ [(name, b : bs') | (name, bs') <- withSubObjectBindings f ctx bs] withSubObjectBindings f ctx (b : bs) = asum [ [(name, b' : bs) | (name, b') <- withSubObjectBinding f ctx b]@@ -158,8 +181,8 @@ defaultApplicationLimits :: Int -> ApplicationLimits defaultApplicationLimits sourceTermSize = ApplicationLimits- { maxDepth = 13- , maxTermSize = sourceTermSize * 10+ { maxDepth = 130+ , maxTermSize = sourceTermSize * 10000 } objectSize :: Object -> Int@@ -172,6 +195,7 @@ Termination -> 1 MetaObject{} -> 1 -- should be impossible MetaFunction{} -> 1 -- should be impossible+ MetaSubstThis{} -> 1 -- should be impossible bindingSize :: Binding -> Int bindingSize = \case@@ -226,7 +250,6 @@ attr (MetaBindings metaId) = MetaAttr metaId equalBinding :: Binding -> Binding -> Bool-equalBinding (AlphaBinding VTX _) (AlphaBinding VTX _) = True -- TODO #166:15min Renumerate vertices uniformly instead of ignoring them equalBinding (AlphaBinding attr1 obj1) (AlphaBinding attr2 obj2) = attr1 == attr2 && equalObject obj1 obj2 -- Ignore deltas for now while comparing since different normalization paths can lead to different vertex data -- TODO #120:30m normalize the deltas instead of ignoring since this actually suppresses problems@@ -235,13 +258,19 @@ -- * Chain variants +data LogEntry log = LogEntry+ { logEntryMessage :: String+ , logEntryLog :: log+ , logEntryLevel :: Int+ }+ deriving (Show, Functor)+ newtype Chain log result = Chain- {runChain :: Context -> [([(String, log)], result)]}+ {runChain :: Context -> [([LogEntry log], result)]} deriving (Functor) type NormalizeChain = Chain Object type DataizeChain = Chain (Either Object Bytes)- instance Applicative (Chain a) where pure x = Chain (const [([], x)]) (<*>) = ap@@ -254,9 +283,18 @@ , (steps', y) <- runChain (f x) ctx ] +instance MonadFail (Chain a) where+ fail _msg = Chain (const [])+ logStep :: String -> info -> Chain info ()-logStep msg info = Chain $ const [([(msg, info)], ())]+logStep msg info = Chain $ const [([LogEntry msg info 0], ())] +incLogLevel :: Chain info a -> Chain info a+incLogLevel (Chain k) =+ Chain $+ map (first (map (\LogEntry{..} -> LogEntry{logEntryLevel = logEntryLevel + 1, ..})))+ . k+ choose :: [a] -> Chain log a choose xs = Chain $ \_ctx -> [(mempty, x) | x <- xs] @@ -272,6 +310,32 @@ transformNormLogs :: NormalizeChain a -> DataizeChain a transformNormLogs = transformLogs Left +listen :: Chain log a -> Chain log (a, [LogEntry log])+listen (Chain k) = Chain (map (\(logs, result) -> (logs, (result, logs))) . k)++minimizeObject' :: DataizeChain (Either Object Bytes) -> DataizeChain (Either Object Bytes)+minimizeObject' m = do+ fmap minimizeTerms getContext >>= \case+ True -> minimizeObject m+ False -> m++minimizeObject :: DataizeChain (Either Object Bytes) -> DataizeChain (Either Object Bytes)+minimizeObject m = do+ (x, entries) <- listen m+ case x of+ Left obj' -> do+ let objectsOnCurrentLevel =+ [logEntryLog | LogEntry{..} <- entries, logEntryLevel == 0]+ return (Left (smallestObject objectsOnCurrentLevel obj'))+ Right _ -> return x++smallestObject :: [Either Object bytes] -> Object -> Object+smallestObject objs obj = minimumBy (comparing objectSize) (obj : lefts objs)+ where+ lefts [] = []+ lefts (Left x : xs) = x : lefts xs+ lefts (Right{} : xs) = lefts xs+ getContext :: Chain a Context getContext = Chain $ \ctx -> [([], ctx)] @@ -281,14 +345,14 @@ modifyContext :: (Context -> Context) -> Chain log a -> Chain log a modifyContext g (Chain f) = Chain (f . g) -applyRulesChain' :: Context -> Object -> [([(String, Object)], Object)]+applyRulesChain' :: Context -> Object -> [([LogEntry Object], Object)] applyRulesChain' ctx obj = applyRulesChainWith' (defaultApplicationLimits (objectSize obj)) ctx obj -- | Apply the rules until the object is normalized, preserving the history (chain) of applications. applyRulesChain :: Object -> NormalizeChain Object applyRulesChain obj = applyRulesChainWith (defaultApplicationLimits (objectSize obj)) obj -applyRulesChainWith' :: ApplicationLimits -> Context -> Object -> [([(String, Object)], Object)]+applyRulesChainWith' :: ApplicationLimits -> Context -> Object -> [([LogEntry Object], Object)] applyRulesChainWith' limits ctx obj = runChain (applyRulesChainWith limits obj) ctx -- | A variant of `applyRulesChain` with a maximum application depth.@@ -308,7 +372,9 @@ logStep ruleName obj' if objectSize obj' < maxTermSize then applyRulesChainWith limits{maxDepth = maxDepth - 1} obj'- else return obj'+ else do+ logStep "Max term size hit" obj'+ return obj' -- * Helpers @@ -318,7 +384,7 @@ lookupBinding a (AlphaBinding a' object : bindings) | a == a' = Just object | otherwise = lookupBinding a bindings-lookupBinding _ _ = Nothing+lookupBinding a (_ : bindings) = lookupBinding a bindings objectBindings :: Object -> [Binding] objectBindings (Formation bs) = bs@@ -326,60 +392,254 @@ objectBindings (ObjectDispatch obj _attr) = objectBindings obj objectBindings _ = [] -intToBytes :: Int -> Bytes-intToBytes n = Bytes $ insertDashes $ pad $ showHex n ""+padLeft :: Int -> [Char] -> [Char]+padLeft n s = replicate (n - length s) '0' ++ s++-- | Split a list into chunks of given size.+-- All lists in the result are guaranteed to have length less than or equal to the given size.+--+-- >>> chunksOf 2 "012345678"+-- ["01","23","45","67","8"]+--+-- See 'paddedLeftChunksOf' for a version with padding to guarantee exact chunk size.+chunksOf :: Int -> [a] -> [[a]]+chunksOf _ [] = []+chunksOf n xs = chunk : chunksOf n leftover where- pad s = (if even (length s) then "" else "0") ++ s- insertDashes s- | length s <= 2 = s ++ "-"- | otherwise =- let go = \case- [] -> []- [x] -> [x]- [x, y] -> [x, y, '-']- (x : y : xs) -> x : y : '-' : go xs- in go s+ (chunk, leftover) = splitAt n xs --- | Assuming the bytes are well-formed (otherwise crashes)+-- | Split a list into chunks of given size,+-- padding on the left if necessary.+-- All lists in the result are guaranteed to have given size.+--+-- >>> paddedLeftChunksOf '0' 2 "1234567"+-- ["01","23","45","67"]+-- >>> paddedLeftChunksOf '0' 2 "123456"+-- ["12","34","56"]+--+-- prop> n > 0 ==> all (\chunk -> length chunk == n) (paddedLeftChunksOf c n s)+paddedLeftChunksOf :: a -> Int -> [a] -> [[a]]+paddedLeftChunksOf padSymbol n xs+ | padSize == n = chunksOf n xs+ | otherwise = chunksOf n (replicate padSize padSymbol ++ xs)+ where+ len = length xs+ padSize = n - len `mod` n++-- | Normalize the bytestring representation to fit valid 'Bytes' token.+--+-- >>> normalizeBytes "238714ABCDEF"+-- "23-87-14-AB-CD-EF"+--+-- >>> normalizeBytes "0238714ABCDEF"+-- "00-23-87-14-AB-CD-EF"+--+-- >>> normalizeBytes "4"+-- "04-"+normalizeBytes :: String -> String+normalizeBytes = withDashes . paddedLeftChunksOf '0' 2 . map toUpper+ where+ withDashes = \case+ [] -> "00-"+ [byte] -> byte <> "-"+ bytes -> intercalate "-" bytes++-- | Concatenate 'Bytes'.+-- FIXME: we should really use 'ByteString' instead of the underlying 'String' representation.+--+-- >>> concatBytes "00-" "01-02"+-- Bytes "00-01-02"+--+-- >>> concatBytes "03-04" "01-02"+-- Bytes "03-04-01-02"+--+-- >>> concatBytes "03-04" "01-"+-- Bytes "03-04-01"+concatBytes :: Bytes -> Bytes -> Bytes+concatBytes (Bytes xs) (Bytes zs) = Bytes (normalizeBytes (filter (/= '-') (xs <> zs)))++-- | Select a slice (section) of 'Bytes'.+--+-- >>> sliceBytes "12-34-56" 1 1+-- Bytes "34-"+--+-- >>> sliceBytes "12-34-56" 1 0+-- Bytes "00-"+--+-- >>> sliceBytes "12-34-56" 0 2+-- Bytes "12-34"+sliceBytes :: Bytes -> Int -> Int -> Bytes+sliceBytes (Bytes bytes) start len = Bytes $ normalizeBytes $ take (2 * len) (drop (2 * start) (filter (/= '-') bytes))++-- | Convert an 'Int' into 'Bytes' representation.+--+-- >>> intToBytes 7+-- Bytes "00-00-00-00-00-00-00-07"+-- >>> intToBytes (3^33)+-- Bytes "00-13-BF-EF-A6-5A-BB-83"+-- >>> intToBytes (-1)+-- Bytes "FF-FF-FF-FF-FF-FF-FF-FF"+intToBytes :: Int -> Bytes+intToBytes n = Bytes $ normalizeBytes $ foldMap (padLeft 2 . (`showHex` "")) $ ByteString.Strict.unpack $ Serialize.encode n++-- | Parse 'Bytes' as 'Int'.+--+-- >>> bytesToInt "00-13-BF-EF-A6-5A-BB-83"+-- 5559060566555523+-- >>> bytesToInt "AB-"+-- 171+--+-- May error on invalid 'Bytes':+--+-- >>> bytesToInt "s"+-- *** Exception: Prelude.head: empty list+-- ...+-- ...+-- ...+-- ...+-- ...+-- ... bytesToInt :: Bytes -> Int-bytesToInt (Bytes (filter (/= '-') . dropWhile (== '0') -> bytes))+bytesToInt (Bytes (dropWhile (== '0') . filter (/= '-') -> bytes)) | null bytes = 0 | otherwise = fst $ head $ readHex bytes -minNu :: Int-minNu = -1+-- | Convert 'Bool' to 'Bytes'.+--+-- >>> boolToBytes False+-- Bytes "00-00-00-00-00-00-00-00"+-- >>> boolToBytes True+-- Bytes "00-00-00-00-00-00-00-01"+boolToBytes :: Bool -> Bytes+boolToBytes True = intToBytes 1+boolToBytes False = intToBytes 0 -class HasMaxNu a where- -- | get maximum vertex index- --- -- >>> getMaxNu @Object "⟦ a ↦ ⟦ ν ↦ ⟦ Δ ⤍ 03- ⟧ ⟧, b ↦ ⟦ ⟧ ⟧"- -- 3- getMaxNu :: a -> Int+-- | Interpret 'Bytes' as 'Bool'.+--+-- Zero is interpreted as 'False'.+--+-- >>> bytesToBool "00-"+-- False+--+-- >>> bytesToBool "00-00"+-- False+--+-- Everything else is interpreted as 'True'.+--+-- >>> bytesToBool "01-"+-- True+--+-- >>> bytesToBool "00-01"+-- True+--+-- >>> bytesToBool "AB-CD"+-- True+bytesToBool :: Bytes -> Bool+bytesToBool (Bytes (dropWhile (== '0') . filter (/= '-') -> [])) = False+bytesToBool _ = True -instance HasMaxNu Program where- getMaxNu :: Program -> Int- getMaxNu (Program bindings) = getMaxNu (Formation bindings)+-- | Encode 'String' as 'Bytes'.+--+-- >>> stringToBytes "Hello, world!"+-- Bytes "48-65-6C-6C-6F-2C-20-77-6F-72-6C-64-21"+--+-- >>> stringToBytes "Привет, мир!"+-- Bytes "04-1F-44-04-38-43-24-35-44-22-C2-04-3C-43-84-40-21"+stringToBytes :: String -> Bytes+stringToBytes s = Bytes $ normalizeBytes $ foldMap (padLeft 2 . (`showHex` "") . fromEnum) s -instance HasMaxNu Object where- getMaxNu :: Object -> Int- getMaxNu = \case- Formation bindings -> maximum (minNu : (getMaxNu <$> bindings))- Application obj bindings -> maximum (minNu : getMaxNu obj : (getMaxNu <$> bindings))- ObjectDispatch obj _ -> getMaxNu obj- _ -> minNu+-- | Decode 'String' from 'Bytes'.+--+-- >>> bytesToString "48-65-6C-6C-6F-2C-20-77-6F-72-6C-64-21"+-- "Hello, world!"+bytesToString :: Bytes -> String+bytesToString (Bytes bytes) = map (toEnum . fst . head . readHex) $ words (map dashToSpace bytes)+ where+ dashToSpace '-' = ' '+ dashToSpace c = c -instance HasMaxNu Binding where- getMaxNu :: Binding -> Int- getMaxNu = \case- AlphaBinding VTX (Formation [DeltaBinding (Bytes bs)]) ->- case readHex [x | x <- bs, x /= '-'] of- [(val, "")] -> val- _ -> error "Vertex number is incorrect"- AlphaBinding _ obj -> getMaxNu obj- _ -> minNu+-- | Encode 'Double' as 'Bytes' following IEEE754.+--+-- Note: it is called "float" in EO, but it actually occupies 8 bytes so it corresponds to 'Double'.+--+-- >>> floatToBytes 0+-- Bytes "00-00-00-00-00-00-00-00"+--+-- >>> floatToBytes (-0.1)+-- Bytes "BF-B9-99-99-99-99-99-9A"+--+-- >>> floatToBytes (1/0) -- Infinity+-- Bytes "7F-F0-00-00-00-00-00-00"+--+-- >>> floatToBytes (asin 2) `elem` ["FF-F8-00-00-00-00-00-00", "7F-F8-00-00-00-00-00-00"] -- sNaN or qNaN+-- True+floatToBytes :: Double -> Bytes+floatToBytes f = Bytes $ normalizeBytes $ foldMap (padLeft 2 . (`showHex` "")) $ ByteString.Strict.unpack $ Serialize.encode f -intToBytesObject :: Int -> Object-intToBytesObject n = Formation [DeltaBinding $ intToBytes n]+-- | Decode 'Double' from 'Bytes' following IEEE754.+--+-- >>> bytesToFloat "00-00-00-00-00-00-00-00"+-- 0.0+--+-- >>> bytesToFloat "BF-B9-99-99-99-99-99-9A"+-- -0.1+--+-- >>> bytesToFloat "7F-F0-00-00-00-00-00-00"+-- Infinity+--+-- >>> bytesToFloat "FF-F8-00-00-00-00-00-00"+-- NaN+bytesToFloat :: Bytes -> Double+bytesToFloat (Bytes bytes) =+ case Serialize.decode $ ByteString.Strict.pack $ map (fst . head . readHex) $ words (map dashToSpace bytes) of+ Left msg -> error msg+ Right x -> x+ where+ dashToSpace '-' = ' '+ dashToSpace c = c -nuCountAsDataObj :: Object -> Object-nuCountAsDataObj = intToBytesObject . getMaxNu+isRhoBinding :: Binding -> Bool+isRhoBinding (AlphaBinding Rho _) = True+isRhoBinding _ = False++hideRhoInBinding :: Binding -> Binding+hideRhoInBinding = \case+ AlphaBinding a obj -> AlphaBinding a (hideRho obj)+ binding -> binding++hideRho :: Object -> Object+hideRho = \case+ Formation bindings ->+ Formation+ [ hideRhoInBinding binding+ | binding <- filter (not . isRhoBinding) bindings+ ]+ Application obj bindings ->+ Application+ (hideRho obj)+ [ hideRhoInBinding binding+ | binding <- filter (not . isRhoBinding) bindings+ ]+ ObjectDispatch obj a -> ObjectDispatch (hideRho obj) a+ obj -> obj++hideRhoInBinding1 :: Binding -> Binding+hideRhoInBinding1 = \case+ AlphaBinding a obj -> AlphaBinding a (hideRho obj)+ binding -> binding++hideRho1 :: Object -> Object+hideRho1 = \case+ Formation bindings ->+ Formation+ [ hideRhoInBinding1 binding+ | binding <- bindings+ ]+ Application obj bindings ->+ Application+ (hideRho1 obj)+ [ hideRhoInBinding1 binding+ | binding <- bindings+ ]+ ObjectDispatch obj a -> ObjectDispatch (hideRho1 obj) a+ obj -> obj
+ src/Language/EO/Phi/Rules/Fast.hs view
@@ -0,0 +1,176 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}++module Language.EO.Phi.Rules.Fast where++-- import Debug.Trace (trace)++import Data.List.NonEmpty qualified as NonEmpty+import Language.EO.Phi.Rules.Common+import Language.EO.Phi.Rules.Yaml qualified as Yaml+import Language.EO.Phi.Syntax (printTree)+import Language.EO.Phi.Syntax.Abs+import System.IO.Unsafe (unsafePerformIO)++-- $setup+-- >>> :set -XOverloadedStrings++runWithYegorRules :: (Context -> Object -> Object) -> Object -> IO ()+runWithYegorRules f obj = putStrLn (printTree (f (defaultContext yegorRules obj) obj))++yegorRuleSet :: Yaml.RuleSet+{-# NOINLINE yegorRuleSet #-}+yegorRuleSet =+ unsafePerformIO $+ Yaml.parseRuleSetFromFile "eo-phi-normalizer/test/eo/phi/rules/yegor.yaml"++yegorRules :: [NamedRule]+yegorRules = map Yaml.convertRuleNamed (Yaml.rules yegorRuleSet)++withBinding :: (Context -> Object -> Object) -> Context -> Binding -> Binding+withBinding f ctx = \case+ AlphaBinding Rho obj -> AlphaBinding Rho obj -- do not apply f inside ρ-bindings+ AlphaBinding a obj -> AlphaBinding a (f ctx{currentAttr = a} obj)+ binding -> binding++isLambdaBinding :: Binding -> Bool+isLambdaBinding LambdaBinding{} = True+isLambdaBinding _ = False++withSubObjects :: (Context -> Object -> Object) -> Context -> Object -> Object+withSubObjects f ctx = go+ where+ go = \case+ root@(Formation bindings)+ | not (any isEmptyBinding bindings) && not (any isLambdaBinding bindings) ->+ let extendedContext = (extendContextWith root ctx){insideFormation = True}+ in Formation+ [ withBinding f extendedContext binding+ | binding <- bindings+ ]+ Application obj bindings ->+ Application+ (f ctx obj)+ [ withBinding f ctx binding+ | binding <- bindings+ ]+ ObjectDispatch obj a -> ObjectDispatch (f ctx obj) a+ obj -> obj++-- | Normalize an object, following a version of call-by-value strategy:+--+-- 1. Apply rules in subobjects/subterms before applying a rule at root.+-- 2. Do not apply rules under formations with at least one void (empty) binding.+--+-- > runWithYegorRules applyRulesInsideOut "⟦ x ↦ ⟦⟧, y ↦ ⟦ z ↦ ⟦ w ↦ ξ.ρ.ρ.x ⟧ ⟧ ⟧.y.z.w"+-- ⟦ ρ ↦ ⟦ ρ ↦ ⟦ ⟧ ⟧ ⟧+applyRulesInsideOut :: Context -> Object -> Object+applyRulesInsideOut ctx obj = do+ let obj' = withSubObjects applyRulesInsideOut ctx obj+ case applyOneRuleAtRoot ctx obj' of+ [] ->+ -- trace ("No rule can be applied to object\n " <> printTree obj') $+ obj'+ (_ruleName, obj'') : _ ->+ -- trace (ruleName <> ": \n " <> printTree obj' <> "\n → " <> printTree obj'') $+ applyRulesInsideOut ctx obj''++fastYegorInsideOutAsRule :: NamedRule+fastYegorInsideOutAsRule = ("Yegor's rules (hardcoded)", \ctx obj -> [fastYegorInsideOut ctx obj])++fastYegorInsideOut :: Context -> Object -> Object+fastYegorInsideOut ctx = \case+ root | insideSubObject ctx -> root -- this rule is only applied at root+ root@GlobalObject+ | not (insideFormation ctx) ->+ NonEmpty.last (outerFormations ctx)+ | otherwise -> root+ root@ThisObject+ | not (insideFormation ctx) ->+ NonEmpty.head (outerFormations ctx)+ | otherwise -> root+ ObjectDispatch obj a ->+ case fastYegorInsideOut ctx obj of+ this@(Formation bindings) ->+ case lookupBinding a bindings of+ Just objA -> fastYegorInsideOut ctx (Yaml.substThis this objA)+ Nothing ->+ case lookupBinding Phi bindings of+ Just objPhi -> fastYegorInsideOut ctx (ObjectDispatch (Yaml.substThis this objPhi) a)+ Nothing -> ObjectDispatch this a+ this -> ObjectDispatch this a+ Application obj argBindings ->+ case fastYegorInsideOut ctx obj of+ obj'@(Formation bindings) ->+ case argBindings of+ [AlphaBinding (Alpha "α0") arg0, AlphaBinding (Alpha "α1") arg1] ->+ case filter isEmptyBinding bindings of+ EmptyBinding a0 : EmptyBinding a1 : _ -> do+ let arg0' = fastYegorInsideOut ctx arg0+ let arg1' = fastYegorInsideOut ctx arg1+ Formation+ ( AlphaBinding a0 arg0'+ : AlphaBinding a1 arg1'+ : [ binding+ | binding <- bindings+ , case binding of+ EmptyBinding x | x `elem` [a0, a1] -> False+ _ -> True+ ]+ )+ _ -> Application obj' argBindings+ [AlphaBinding (Alpha "α0") arg0] ->+ case filter isEmptyBinding bindings of+ EmptyBinding a0 : _ -> do+ let arg0' = fastYegorInsideOut ctx arg0+ Formation+ ( AlphaBinding a0 arg0'+ : [ binding+ | binding <- bindings+ , case binding of+ EmptyBinding x | x == a0 -> False+ _ -> True+ ]+ )+ _ -> Application obj' argBindings+ [AlphaBinding a argA] -> do+ let argA' = fastYegorInsideOut ctx argA+ Formation+ ( AlphaBinding a argA'+ : [ binding+ | binding <- bindings+ , case binding of+ EmptyBinding x | x == a -> False+ _ -> True+ ]+ )+ [DeltaBinding bytes] -> do+ Formation+ ( DeltaBinding bytes+ : [ binding+ | binding <- bindings+ , case binding of+ DeltaEmptyBinding -> False+ _ -> True+ ]+ )+ _ -> Application obj' argBindings+ obj' -> Application obj' argBindings+ root@(Formation bindings)+ | any isEmptyBinding bindings || any isLambdaBinding bindings -> root+ | otherwise ->+ Formation+ [ binding'+ | binding <- bindings+ , let binding' =+ case binding of+ AlphaBinding Rho _ -> binding+ AlphaBinding a objA -> do+ let ctx' = (extendContextWith root ctx){insideFormation = True, currentAttr = a}+ AlphaBinding a (fastYegorInsideOut ctx' objA)+ _ -> binding+ ]+ Termination -> Termination+ MetaSubstThis{} -> error "impossible MetaSubstThis!"+ MetaObject{} -> error "impossible MetaObject!"+ MetaFunction{} -> error "impossible MetaFunction!"
src/Language/EO/Phi/Rules/PhiPaper.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE LambdaCase #-}- module Language.EO.Phi.Rules.PhiPaper where import Control.Monad (guard)@@ -7,14 +5,6 @@ import Language.EO.Phi.Rules.Common -- * Yegor's Rules---- | Rule 1.-rule1 :: Rule-rule1 _ = \case- Formation bindings ->- let Program bindings' = normalize (Program bindings)- in [Formation bindings']- _ -> [] -- | Rule 6. rule6 :: Rule
src/Language/EO/Phi/Rules/Yaml.hs view
@@ -13,9 +13,8 @@ module Language.EO.Phi.Rules.Yaml where -import Control.Lens ((+=)) import Control.Monad (guard)-import Control.Monad.State (State, evalState, gets)+import Control.Monad.State (State, evalState) import Data.Aeson (FromJSON (..), Options (sumEncoding), SumEncoding (UntaggedValue), genericParseJSON) import Data.Aeson.Types (defaultOptions) import Data.Coerce (coerce)@@ -23,13 +22,13 @@ import Data.List.NonEmpty qualified as NonEmpty import Data.Maybe (fromMaybe) import Data.String (IsString (..))-import Data.String.Interpolate (i) import Data.Yaml qualified as Yaml import GHC.Generics (Generic)-import Language.EO.Phi (printTree)++import Language.EO.Phi import Language.EO.Phi.Rules.Common (Context (insideFormation, outerFormations), NamedRule) import Language.EO.Phi.Rules.Common qualified as Common-import Language.EO.Phi.Syntax.Abs+import PyF (fmt) -- $setup -- >>> :set -XOverloadedStrings@@ -136,6 +135,7 @@ objectHasMetavars Termination = False objectHasMetavars (MetaObject _) = True objectHasMetavars (MetaFunction _ _) = True+objectHasMetavars (MetaSubstThis _ _) = True -- technically not a metavar, but a substitution bindingHasMetavars :: Binding -> Bool bindingHasMetavars (AlphaBinding attr obj) = attrHasMetavars attr || objectHasMetavars obj@@ -149,8 +149,6 @@ attrHasMetavars :: Attribute -> Bool attrHasMetavars Phi = False attrHasMetavars Rho = False-attrHasMetavars Sigma = False-attrHasMetavars VTX = False attrHasMetavars (Label _) = False attrHasMetavars (Alpha _) = False attrHasMetavars (MetaAttr _) = True@@ -221,7 +219,7 @@ , "}" ] where- showMappings metas = intercalate "; " $ map (\(MetaId metaId, obj) -> [i|#{metaId} -> '#{printTree obj}'|]) metas+ showMappings metas = intercalate "; " $ map (\(MetaId metaId, obj) -> [fmt|{metaId} -> '{printTree obj}'|]) metas instance Semigroup Subst where (<>) = mergeSubst@@ -245,7 +243,9 @@ GlobalObject -> GlobalObject ThisObject -> ThisObject obj@(MetaObject x) -> fromMaybe obj $ lookup x objectMetas- obj -> obj+ Termination -> Termination+ MetaSubstThis obj thisObj -> MetaSubstThis (applySubst subst thisObj) (applySubst subst obj)+ obj@MetaFunction{} -> obj applySubstAttr :: Subst -> Attribute -> Attribute applySubstAttr Subst{..} = \case@@ -293,28 +293,22 @@ -- | Evaluate meta functions -- given top-level context as an object -- and an object------ >>> evaluateMetaFuncs "⟦ a ↦ ⟦ ν ↦ ⟦ Δ ⤍ 03- ⟧ ⟧, b ↦ ⟦ ⟧ ⟧" "⟦ a ↦ ⟦ ν ↦ @T(⟦ a ↦ ⟦ ν ↦ ⟦ Δ ⤍ 03- ⟧ ⟧, b ↦ ⟦ ⟧ ⟧) ⟧, b ↦ ⟦ ⟧ ⟧"--- Formation [AlphaBinding (Label (LabelId "a")) (Formation [AlphaBinding VTX (Formation [DeltaBinding (Bytes "04-")])]),AlphaBinding (Label (LabelId "b")) (Formation [])] evaluateMetaFuncs :: Object -> Object -> Object-evaluateMetaFuncs obj' obj =+evaluateMetaFuncs _obj' obj = evalState (evaluateMetaFuncs' obj)- MetaState{nuCount = Common.getMaxNu obj' + 1}+ MetaState{} -newtype MetaState = MetaState- { nuCount :: Int+data MetaState = MetaState+ { } deriving (Generic) evaluateMetaFuncs' :: Object -> State MetaState Object-evaluateMetaFuncs' (MetaFunction (MetaFunctionName "@T") _) = do- nuCount' <- gets (Common.intToBytesObject . nuCount)- #nuCount += 1- pure nuCount' evaluateMetaFuncs' (Formation bindings) = Formation <$> mapM evaluateMetaFuncsBinding bindings evaluateMetaFuncs' (Application obj bindings) = Application <$> evaluateMetaFuncs' obj <*> mapM evaluateMetaFuncsBinding bindings evaluateMetaFuncs' (ObjectDispatch obj a) = ObjectDispatch <$> evaluateMetaFuncs' obj <*> pure a+evaluateMetaFuncs' (MetaSubstThis obj thisObj) = evaluateMetaFuncs' (substThis thisObj obj) evaluateMetaFuncs' obj = pure obj evaluateMetaFuncsBinding :: Binding -> State MetaState Binding@@ -375,3 +369,41 @@ } ] matchAttr _ _ = []++substThis :: Object -> Object -> Object+substThis thisObj = go+ where+ isAttachedRho (AlphaBinding Rho _) = True+ isAttachedRho _ = False++ isEmptyRho (EmptyBinding Rho) = True+ isEmptyRho _ = False++ go = \case+ ThisObject -> thisObj -- ξ is substituted+ -- IMPORTANT: we are injecting a ρ-attribute in formations!+ obj@(Formation bindings)+ | any isAttachedRho bindings -> obj+ | otherwise -> Formation (filter (not . isEmptyRho) bindings ++ [AlphaBinding Rho thisObj])+ -- everywhere else we simply recursively traverse the φ-term+ Application obj bindings -> Application (go obj) (map (substThisBinding thisObj) bindings)+ ObjectDispatch obj a -> ObjectDispatch (go obj) a+ GlobalObject -> GlobalObject+ Termination -> Termination+ obj@MetaSubstThis{} -> error ("impossible: trying to substitute ξ in " <> printTree obj)+ obj@MetaObject{} -> error ("impossible: trying to substitute ξ in " <> printTree obj)+ obj@MetaFunction{} -> error ("impossible: trying to substitute ξ in " <> printTree obj)++-- {⟦ x ↦ ⟦ b ↦ ⟦ Δ ⤍ 01- ⟧, φ ↦ ⟦ b ↦ ⟦ Δ ⤍ 02- ⟧, c ↦ ⟦ a ↦ ξ.ρ.ρ.b ⟧.a ⟧.c ⟧.φ, λ ⤍ Package ⟧}++-- {⟦ λ ⤍ Package, x ↦ ⟦ b ↦ ⟦⟧ ⟧ ⟧}++substThisBinding :: Object -> Binding -> Binding+substThisBinding obj = \case+ AlphaBinding a obj' -> AlphaBinding a (substThis obj obj')+ EmptyBinding a -> EmptyBinding a+ DeltaBinding bytes -> DeltaBinding bytes+ DeltaEmptyBinding -> DeltaEmptyBinding+ LambdaBinding bytes -> LambdaBinding bytes+ b@MetaBindings{} -> error ("impossible: trying to substitute ξ in " <> printTree b)+ b@MetaDeltaBinding{} -> error ("impossible: trying to substitute ξ in " <> printTree b)
src/Language/EO/Phi/Syntax/Abs.hs view
@@ -25,6 +25,7 @@ | GlobalObject | ThisObject | Termination+ | MetaSubstThis Object Object | MetaObject MetaId | MetaFunction MetaFunctionName Object deriving (C.Eq, C.Ord, C.Show, C.Read, C.Data, C.Typeable, C.Generic)@@ -40,13 +41,7 @@ deriving (C.Eq, C.Ord, C.Show, C.Read, C.Data, C.Typeable, C.Generic) data Attribute- = Phi- | Rho- | Sigma- | VTX- | Label LabelId- | Alpha AlphaIndex- | MetaAttr MetaId+ = Phi | Rho | Label LabelId | Alpha AlphaIndex | MetaAttr MetaId deriving (C.Eq, C.Ord, C.Show, C.Read, C.Data, C.Typeable, C.Generic) data RuleAttribute = ObjectAttr Attribute | DeltaAttr | LambdaAttr
src/Language/EO/Phi/Syntax/Lex.hs view
@@ -53,87 +53,87 @@ , 931 , -140 , -146- , 841- , -144+ , -111+ , -118 , -139- , 904- , 1032- , 1288- , 1407+ , 874+ , 1002+ , 1258+ , 1377 , 0 , 0 , 0- , 1520- , 1585- , 1649- , -136- , -137- , 1777- , 1905- , 2161- , 2280- , 2408- , 2552- , -16+ , 1490+ , 1555+ , 1619+ , -132+ , -138+ , 1747+ , 1875+ , 2131+ , 2250+ , 2378+ , 2522+ , -12 , 0- , 2633- , 2889- , 2890- , 3018- , 2483- , 3083- , 3196+ , 2603+ , 2859+ , 2860+ , 2988+ , 2453+ , 3053+ , 3166 , 0 , 0 , 0 , 0- , 3410- , 3624- , 3880- , 3881- , 4009- , 3266- , 3476- , 4122+ , 3380+ , 3594+ , 3850+ , 3851+ , 3979+ , 3236+ , 3446+ , 4092 , 0 , 0 , 0 , 911 , 0- , -131- , 856- , -106- , -83- , -46+ , -116+ , 1255+ , -135+ , 1247+ , 71 , 0- , 6- , 4378- , 4623- , 4868- , 5104- , 5360- , 5361- , 5489+ , -11+ , 4348+ , 4593+ , 4838+ , 5074+ , 5330+ , 5331+ , 5459 , -114 , -105- , 4314- , 4560- , 5602+ , 4284+ , 4530+ , 5572 , 0 , 0 , 0- , 5858- , 6094- , 4804+ , 5828+ , 6064+ , 4774 , -80- , 6222- , 6335+ , 6192+ , 6305 , 0 , 0 ] alex_table :: Array Int Int-alex_table = listArray (0 :: Int, 6590)+alex_table = listArray (0 :: Int, 6560) [ 0 , 70 , 70@@ -157,19 +157,19 @@ , -1 , -1 , 71- , 39+ , 71 , 70 , 31- , 60 , 71- , 71+ , 39 , -1 , -1- , 48- , 71+ , 60 , 71 , 71 , 71+ , 77+ , 48 , 71 , 78 , 71@@ -185,7 +185,7 @@ , 20 , 20 , 71- , 77+ , 71 , -1 , -1 , 86@@ -222,7 +222,7 @@ , 71 , -1 , -1- , 71+ , 0 , 94 , 94 , 94@@ -332,14 +332,14 @@ , 8 , 8 , 8- , 25+ , 75 , 76- , 0- , 0+ , 71 , 0 , 0 , 0 , 0+ , 71 , 0 , 0 , 0@@ -1123,49 +1123,19 @@ , 19 , 19 , 19- , 71- , 26 , 0- , 75 , 0- , 72 , 0+ , 0+ , 0+ , 0+ , 0 , 19 , 19 , 19 , 19 , 19 , 19- , 0- , 0- , 0- , 0- , 0- , 71- , 0- , 0- , 0- , 0- , 0- , 0- , 0- , 27- , 0- , 0- , 6- , 0- , 74- , 0- , 0- , 0- , 0- , 0- , 0- , 0- , 71- , 0- , 71- , 71 , 29 , 10 , 10@@ -1553,13 +1523,13 @@ , -1 , -1 , 0- , 0+ , 74 , -1- , 0- , 0- , 0+ , 25 , 0+ , 27 , 0+ , 71 , 0 , 0 , 0@@ -1577,19 +1547,18 @@ , -1 , 0 , 0- , 0- , 0+ , 71+ , 72 , 0 , -1 , -1 , -1- , 0+ , 26 , 0 , -1 , -1 , -1- , 0- , 0+ , 6 , 0 , 0 , 0@@ -1599,9 +1568,10 @@ , 0 , 0 , 0+ , 71 , -1 , -1- , 0+ , 71 , 0 , 0 , -1@@ -6728,7 +6698,7 @@ ] alex_check :: Array Int Int-alex_check = listArray (0 :: Int, 6590)+alex_check = listArray (0 :: Int, 6560) [ -1 , 9 , 10@@ -6751,20 +6721,20 @@ , 159 , 166 , 167- , 166- , 159+ , 133+ , 141 , 32 , 33- , 42+ , 165+ , 159 , 166 , 167+ , 42 , 166- , 167- , 47 , 40 , 41- , 165- , 141+ , 45+ , 47 , 44 , 45 , 46@@ -6779,10 +6749,10 @@ , 55 , 56 , 57- , 133- , 45 , 166 , 167+ , 166+ , 167 , 159 , -1 , 64@@ -6812,12 +6782,12 @@ , 88 , 89 , 90- , 129+ , 91 , -1- , 131+ , 93 , 166 , 167- , 134+ , -1 , 97 , 98 , 99@@ -6929,12 +6899,12 @@ , 57 , 206 , 207- , -1- , -1+ , 129 , -1 , -1 , -1 , -1+ , 134 , -1 , -1 , -1@@ -7718,49 +7688,19 @@ , 55 , 56 , 57- , 148- , 134 , -1- , 136 , -1- , 138 , -1+ , -1+ , -1+ , -1+ , -1 , 65 , 66 , 67 , 68 , 69 , 70- , -1- , -1- , -1- , -1- , -1- , 166- , -1- , -1- , -1- , -1- , -1- , -1- , -1- , 159- , -1- , -1- , 177- , -1- , 164- , -1- , -1- , -1- , -1- , -1- , -1- , -1- , 187- , -1- , 189- , 190 , 128 , 129 , 130@@ -8148,13 +8088,13 @@ , 9 , 10 , -1- , -1+ , 134 , 13- , -1- , -1- , -1+ , 136 , -1+ , 138 , -1+ , 148 , -1 , -1 , -1@@ -8172,19 +8112,18 @@ , 33 , -1 , -1- , -1- , -1+ , 166+ , 159 , -1 , 39 , 40 , 41- , -1+ , 164 , -1 , 44 , 45 , 46- , -1- , -1+ , 177 , -1 , -1 , -1@@ -8194,9 +8133,10 @@ , -1 , -1 , -1+ , 187 , 58 , 59- , -1+ , 190 , -1 , -1 , 63@@ -13913,12 +13853,12 @@ -- | The keywords and symbols of the language organized as binary search tree. resWords :: BTree resWords =- b "\958" 11- (b "}" 6- (b "," 3 (b ")" 2 (b "(" 1 N N) N) (b "{" 5 (b "." 4 N N) N))- (b "\955" 9 (b "\934" 8 (b "\916" 7 N N) N) (b "\957" 10 N N)))+ b "\955" 11+ (b "]" 6+ (b "," 3 (b ")" 2 (b "(" 1 N N) N) (b "[" 5 (b "." 4 N N) N))+ (b "\916" 9 (b "}" 8 (b "{" 7 N N) N) (b "\934" 10 N N))) (b "\8709" 16- (b "\966" 14 (b "\963" 13 (b "\961" 12 N N) N) (b "\8614" 15 N N))+ (b "\966" 14 (b "\961" 13 (b "\958" 12 N N) N) (b "\8614" 15 N N)) (b "\10215" 19 (b "\10214" 18 (b "\8869" 17 N N) N) (b "\10509" 20 N N))) where
src/Language/EO/Phi/Syntax/Lex.x view
@@ -28,7 +28,7 @@ -- Symbols and non-identifier-like reserved words -@rsyms = \Φ | \ξ | \Δ | \λ | \φ | \ρ | \σ | \ν | \{ | \⟦ | \⟧ | \} | \( | \) | \. | \⊥ | \↦ | \∅ | \⤍ | \,+@rsyms = \Φ | \ξ | \Δ | \λ | \φ | \ρ | \{ | \⟦ | \⟧ | \} | \( | \) | \. | \⊥ | \[ | \↦ | \] | \∅ | \⤍ | \, :- @@ -186,12 +186,12 @@ -- | The keywords and symbols of the language organized as binary search tree. resWords :: BTree resWords =- b "\958" 11- (b "}" 6- (b "," 3 (b ")" 2 (b "(" 1 N N) N) (b "{" 5 (b "." 4 N N) N))- (b "\955" 9 (b "\934" 8 (b "\916" 7 N N) N) (b "\957" 10 N N)))+ b "\955" 11+ (b "]" 6+ (b "," 3 (b ")" 2 (b "(" 1 N N) N) (b "[" 5 (b "." 4 N N) N))+ (b "\916" 9 (b "}" 8 (b "{" 7 N N) N) (b "\934" 10 N N))) (b "\8709" 16- (b "\966" 14 (b "\963" 13 (b "\961" 12 N N) N) (b "\8614" 15 N N))+ (b "\966" 14 (b "\961" 13 (b "\958" 12 N N) N) (b "\8614" 15 N N)) (b "\10215" 19 (b "\10214" 18 (b "\8869" 17 N N) N) (b "\10509" 20 N N))) where
src/Language/EO/Phi/Syntax/Par.hs view
@@ -151,7 +151,10 @@ action_85, action_86, action_87,- action_88 :: () => Prelude.Int -> ({-HappyReduction (Err) = -}+ action_88,+ action_89,+ action_90,+ action_91 :: () => Prelude.Int -> ({-HappyReduction (Err) = -} Prelude.Int -> (Token) -> HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)@@ -201,8 +204,7 @@ happyReduce_49, happyReduce_50, happyReduce_51,- happyReduce_52,- happyReduce_53 :: () => ({-HappyReduction (Err) = -}+ happyReduce_52 :: () => ({-HappyReduction (Err) = -} Prelude.Int -> (Token) -> HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)@@ -211,13 +213,13 @@ -> [(Token)] -> (Err) HappyAbsSyn) happyExpList :: Happy_Data_Array.Array Prelude.Int Prelude.Int-happyExpList = Happy_Data_Array.listArray (0,196) ([0,0,1,0,0,9216,6168,0,0,237,7,0,30336,896,0,0,49210,1,0,7584,224,0,8192,193,0,0,24720,0,0,144,0,0,18432,0,0,0,0,64,0,0,0,0,0,9,0,0,0,0,0,0,3792,112,0,16384,14343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7584,224,0,0,0,0,8192,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,1,0,0,4096,0,0,0,8,0,0,0,0,0,0,0,0,32,0,0,36864,0,0,0,0,0,0,0,0,0,0,0,0,0,16384,49211,1,0,0,0,0,0,0,0,0,16384,0,0,46080,7171,0,0,8192,0,0,60672,1792,0,0,32884,3,0,1152,771,0,0,4096,0,0,8192,68,0,36864,24688,0,0,948,28,0,0,0,0,0,4096,0,0,0,0,0,512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45056,0,0,0,0,0,0,2048,0,0,0,0,0,0,0,1024,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0+happyExpList = Happy_Data_Array.listArray (0,207) ([0,0,4,0,0,20480,6168,0,0,212,7,0,27136,896,0,0,49200,1,0,6784,224,0,32768,194,0,0,24896,0,0,144,0,0,18432,0,0,0,0,64,0,0,0,0,0,9,0,0,0,0,0,0,3392,112,0,0,14342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6784,224,0,0,0,0,8192,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,256,0,0,0,0,0,0,0,4,0,0,16384,0,0,0,32,0,0,0,0,0,0,0,0,128,0,0,16384,6,0,0,0,0,0,0,0,0,0,0,0,0,0,212,7,0,0,0,0,0,0,0,0,0,1,0,16384,28685,0,0,32768,0,0,20480,7171,0,0,384,14,0,8192,0,0,0,1556,6,0,0,32,0,0,34880,0,0,57984,192,0,40960,14342,0,0,0,0,0,0,32,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,0,0,0,1024,0,0,0,0,0,2048,0,0,0,0,0,0,0,1024,0,0,64,0,0,0,0,0,0,24896,96,0,0,0,0,51200,1,0,0,0,0,0,0,0,0,0 ]) {-# NOINLINE happyExpListPerState #-} happyExpListPerState st = token_strs_expected- where token_strs = ["error","%dummy","%start_pProgram","%start_pObject","%start_pBinding","%start_pListBinding","%start_pAttribute","%start_pRuleAttribute","%start_pPeeledObject","%start_pObjectHead","%start_pObjectAction","%start_pListObjectAction","Bytes","Function","LabelId","AlphaIndex","MetaId","MetaFunctionName","Program","Object","Binding","ListBinding","Attribute","RuleAttribute","PeeledObject","ObjectHead","ObjectAction","ListObjectAction","'('","')'","','","'.'","'{'","'}'","'\916'","'\934'","'\955'","'\957'","'\958'","'\961'","'\963'","'\966'","'\8614'","'\8709'","'\8869'","'\10214'","'\10215'","'\10509'","L_Bytes","L_Function","L_LabelId","L_AlphaIndex","L_MetaId","L_MetaFunctionName","%eof"]+ where token_strs = ["error","%dummy","%start_pProgram","%start_pObject","%start_pBinding","%start_pListBinding","%start_pAttribute","%start_pRuleAttribute","%start_pPeeledObject","%start_pObjectHead","%start_pObjectAction","%start_pListObjectAction","Bytes","Function","LabelId","AlphaIndex","MetaId","MetaFunctionName","Program","Object","Binding","ListBinding","Attribute","RuleAttribute","PeeledObject","ObjectHead","ObjectAction","ListObjectAction","'('","')'","','","'.'","'['","']'","'{'","'}'","'\916'","'\934'","'\955'","'\958'","'\961'","'\966'","'\8614'","'\8709'","'\8869'","'\10214'","'\10215'","'\10509'","L_Bytes","L_Function","L_LabelId","L_AlphaIndex","L_MetaId","L_MetaFunctionName","%eof"] bit_start = st Prelude.* 55 bit_end = (st Prelude.+ 1) Prelude.* 55 read_bit = readArrayBit happyExpList@@ -227,76 +229,68 @@ f (Prelude.False, _) = [] f (Prelude.True, nr) = [token_strs Prelude.!! nr] -action_0 (33) = happyShift action_55-action_0 (19) = happyGoto action_54+action_0 (35) = happyShift action_53+action_0 (19) = happyGoto action_52 action_0 _ = happyFail (happyExpListPerState 0) -action_1 (36) = happyShift action_49-action_1 (39) = happyShift action_50-action_1 (45) = happyShift action_51-action_1 (46) = happyShift action_52-action_1 (53) = happyShift action_37-action_1 (54) = happyShift action_53-action_1 (17) = happyGoto action_46-action_1 (18) = happyGoto action_47-action_1 (20) = happyGoto action_48+action_1 (38) = happyShift action_47+action_1 (40) = happyShift action_48+action_1 (45) = happyShift action_49+action_1 (46) = happyShift action_50+action_1 (53) = happyShift action_35+action_1 (54) = happyShift action_51+action_1 (17) = happyGoto action_44+action_1 (18) = happyGoto action_45+action_1 (20) = happyGoto action_46 action_1 _ = happyFail (happyExpListPerState 1) -action_2 (35) = happyShift action_43-action_2 (37) = happyShift action_44-action_2 (38) = happyShift action_31-action_2 (40) = happyShift action_32-action_2 (41) = happyShift action_33-action_2 (42) = happyShift action_34-action_2 (51) = happyShift action_35-action_2 (52) = happyShift action_36-action_2 (53) = happyShift action_37+action_2 (37) = happyShift action_41+action_2 (39) = happyShift action_42+action_2 (41) = happyShift action_31+action_2 (42) = happyShift action_32+action_2 (51) = happyShift action_33+action_2 (52) = happyShift action_34+action_2 (53) = happyShift action_35 action_2 (15) = happyGoto action_24 action_2 (16) = happyGoto action_25-action_2 (17) = happyGoto action_39-action_2 (21) = happyGoto action_45-action_2 (23) = happyGoto action_42+action_2 (17) = happyGoto action_37+action_2 (21) = happyGoto action_43+action_2 (23) = happyGoto action_40 action_2 _ = happyFail (happyExpListPerState 2) -action_3 (35) = happyShift action_43-action_3 (37) = happyShift action_44-action_3 (38) = happyShift action_31-action_3 (40) = happyShift action_32-action_3 (41) = happyShift action_33-action_3 (42) = happyShift action_34-action_3 (51) = happyShift action_35-action_3 (52) = happyShift action_36-action_3 (53) = happyShift action_37+action_3 (37) = happyShift action_41+action_3 (39) = happyShift action_42+action_3 (41) = happyShift action_31+action_3 (42) = happyShift action_32+action_3 (51) = happyShift action_33+action_3 (52) = happyShift action_34+action_3 (53) = happyShift action_35 action_3 (15) = happyGoto action_24 action_3 (16) = happyGoto action_25-action_3 (17) = happyGoto action_39-action_3 (21) = happyGoto action_40-action_3 (22) = happyGoto action_41-action_3 (23) = happyGoto action_42-action_3 _ = happyReduce_32+action_3 (17) = happyGoto action_37+action_3 (21) = happyGoto action_38+action_3 (22) = happyGoto action_39+action_3 (23) = happyGoto action_40+action_3 _ = happyReduce_33 -action_4 (38) = happyShift action_31-action_4 (40) = happyShift action_32-action_4 (41) = happyShift action_33-action_4 (42) = happyShift action_34-action_4 (51) = happyShift action_35-action_4 (52) = happyShift action_36-action_4 (53) = happyShift action_37+action_4 (41) = happyShift action_31+action_4 (42) = happyShift action_32+action_4 (51) = happyShift action_33+action_4 (52) = happyShift action_34+action_4 (53) = happyShift action_35 action_4 (15) = happyGoto action_24 action_4 (16) = happyGoto action_25 action_4 (17) = happyGoto action_26-action_4 (23) = happyGoto action_38+action_4 (23) = happyGoto action_36 action_4 _ = happyFail (happyExpListPerState 4) -action_5 (35) = happyShift action_29-action_5 (37) = happyShift action_30-action_5 (38) = happyShift action_31-action_5 (40) = happyShift action_32-action_5 (41) = happyShift action_33-action_5 (42) = happyShift action_34-action_5 (51) = happyShift action_35-action_5 (52) = happyShift action_36-action_5 (53) = happyShift action_37+action_5 (37) = happyShift action_29+action_5 (39) = happyShift action_30+action_5 (41) = happyShift action_31+action_5 (42) = happyShift action_32+action_5 (51) = happyShift action_33+action_5 (52) = happyShift action_34+action_5 (53) = happyShift action_35 action_5 (15) = happyGoto action_24 action_5 (16) = happyGoto action_25 action_5 (17) = happyGoto action_26@@ -304,16 +298,16 @@ action_5 (24) = happyGoto action_28 action_5 _ = happyFail (happyExpListPerState 5) -action_6 (36) = happyShift action_18-action_6 (39) = happyShift action_19+action_6 (38) = happyShift action_18+action_6 (40) = happyShift action_19 action_6 (45) = happyShift action_20 action_6 (46) = happyShift action_21 action_6 (25) = happyGoto action_22 action_6 (26) = happyGoto action_23 action_6 _ = happyFail (happyExpListPerState 6) -action_7 (36) = happyShift action_18-action_7 (39) = happyShift action_19+action_7 (38) = happyShift action_18+action_7 (40) = happyShift action_19 action_7 (45) = happyShift action_20 action_7 (46) = happyShift action_21 action_7 (26) = happyGoto action_17@@ -328,7 +322,7 @@ action_9 (32) = happyShift action_15 action_9 (27) = happyGoto action_12 action_9 (28) = happyGoto action_13-action_9 _ = happyReduce_52+action_9 _ = happyReduce_51 action_10 (49) = happyShift action_11 action_10 _ = happyFail (happyExpListPerState 10)@@ -338,40 +332,36 @@ action_12 (29) = happyShift action_14 action_12 (32) = happyShift action_15 action_12 (27) = happyGoto action_12-action_12 (28) = happyGoto action_69-action_12 _ = happyReduce_52+action_12 (28) = happyGoto action_68+action_12 _ = happyReduce_51 action_13 (55) = happyAccept action_13 _ = happyFail (happyExpListPerState 13) -action_14 (35) = happyShift action_43-action_14 (37) = happyShift action_44-action_14 (38) = happyShift action_31-action_14 (40) = happyShift action_32-action_14 (41) = happyShift action_33-action_14 (42) = happyShift action_34-action_14 (51) = happyShift action_35-action_14 (52) = happyShift action_36-action_14 (53) = happyShift action_37+action_14 (37) = happyShift action_41+action_14 (39) = happyShift action_42+action_14 (41) = happyShift action_31+action_14 (42) = happyShift action_32+action_14 (51) = happyShift action_33+action_14 (52) = happyShift action_34+action_14 (53) = happyShift action_35 action_14 (15) = happyGoto action_24 action_14 (16) = happyGoto action_25-action_14 (17) = happyGoto action_39-action_14 (21) = happyGoto action_40-action_14 (22) = happyGoto action_68-action_14 (23) = happyGoto action_42-action_14 _ = happyReduce_32+action_14 (17) = happyGoto action_37+action_14 (21) = happyGoto action_38+action_14 (22) = happyGoto action_67+action_14 (23) = happyGoto action_40+action_14 _ = happyReduce_33 -action_15 (38) = happyShift action_31-action_15 (40) = happyShift action_32-action_15 (41) = happyShift action_33-action_15 (42) = happyShift action_34-action_15 (51) = happyShift action_35-action_15 (52) = happyShift action_36-action_15 (53) = happyShift action_37+action_15 (41) = happyShift action_31+action_15 (42) = happyShift action_32+action_15 (51) = happyShift action_33+action_15 (52) = happyShift action_34+action_15 (53) = happyShift action_35 action_15 (15) = happyGoto action_24 action_15 (16) = happyGoto action_25 action_15 (17) = happyGoto action_26-action_15 (23) = happyGoto action_67+action_15 (23) = happyGoto action_66 action_15 _ = happyFail (happyExpListPerState 15) action_16 (55) = happyAccept@@ -380,28 +370,26 @@ action_17 (55) = happyAccept action_17 _ = happyFail (happyExpListPerState 17) -action_18 _ = happyReduce_47+action_18 _ = happyReduce_46 -action_19 _ = happyReduce_48+action_19 _ = happyReduce_47 -action_20 _ = happyReduce_49+action_20 _ = happyReduce_48 -action_21 (35) = happyShift action_43-action_21 (37) = happyShift action_44-action_21 (38) = happyShift action_31-action_21 (40) = happyShift action_32-action_21 (41) = happyShift action_33-action_21 (42) = happyShift action_34-action_21 (51) = happyShift action_35-action_21 (52) = happyShift action_36-action_21 (53) = happyShift action_37+action_21 (37) = happyShift action_41+action_21 (39) = happyShift action_42+action_21 (41) = happyShift action_31+action_21 (42) = happyShift action_32+action_21 (51) = happyShift action_33+action_21 (52) = happyShift action_34+action_21 (53) = happyShift action_35 action_21 (15) = happyGoto action_24 action_21 (16) = happyGoto action_25-action_21 (17) = happyGoto action_39-action_21 (21) = happyGoto action_40-action_21 (22) = happyGoto action_66-action_21 (23) = happyGoto action_42-action_21 _ = happyReduce_32+action_21 (17) = happyGoto action_37+action_21 (21) = happyGoto action_38+action_21 (22) = happyGoto action_65+action_21 (23) = happyGoto action_40+action_21 _ = happyReduce_33 action_22 (55) = happyAccept action_22 _ = happyFail (happyExpListPerState 22)@@ -409,241 +397,236 @@ action_23 (29) = happyShift action_14 action_23 (32) = happyShift action_15 action_23 (27) = happyGoto action_12-action_23 (28) = happyGoto action_65-action_23 _ = happyReduce_52+action_23 (28) = happyGoto action_64+action_23 _ = happyReduce_51 -action_24 _ = happyReduce_39+action_24 _ = happyReduce_38 -action_25 _ = happyReduce_40+action_25 _ = happyReduce_39 -action_26 _ = happyReduce_41+action_26 _ = happyReduce_40 -action_27 _ = happyReduce_42+action_27 _ = happyReduce_41 action_28 (55) = happyAccept action_28 _ = happyFail (happyExpListPerState 28) -action_29 _ = happyReduce_43+action_29 _ = happyReduce_42 -action_30 _ = happyReduce_44+action_30 _ = happyReduce_43 -action_31 _ = happyReduce_38+action_31 _ = happyReduce_37 action_32 _ = happyReduce_36 -action_33 _ = happyReduce_37+action_33 _ = happyReduce_12 -action_34 _ = happyReduce_35+action_34 _ = happyReduce_13 -action_35 _ = happyReduce_12+action_35 _ = happyReduce_14 -action_36 _ = happyReduce_13+action_36 (55) = happyAccept+action_36 _ = happyFail (happyExpListPerState 36) -action_37 _ = happyReduce_14+action_37 (43) = happyReduce_40+action_37 _ = happyReduce_31 -action_38 (55) = happyAccept-action_38 _ = happyFail (happyExpListPerState 38)+action_38 (31) = happyShift action_63+action_38 _ = happyReduce_34 -action_39 (43) = happyReduce_41-action_39 _ = happyReduce_30+action_39 (55) = happyAccept+action_39 _ = happyFail (happyExpListPerState 39) -action_40 (31) = happyShift action_64-action_40 _ = happyReduce_33+action_40 (43) = happyShift action_62+action_40 _ = happyFail (happyExpListPerState 40) -action_41 (55) = happyAccept+action_41 (48) = happyShift action_61 action_41 _ = happyFail (happyExpListPerState 41) -action_42 (43) = happyShift action_63+action_42 (48) = happyShift action_60 action_42 _ = happyFail (happyExpListPerState 42) -action_43 (48) = happyShift action_62+action_43 (55) = happyAccept action_43 _ = happyFail (happyExpListPerState 43) -action_44 (48) = happyShift action_61-action_44 _ = happyFail (happyExpListPerState 44)+action_44 _ = happyReduce_24 -action_45 (55) = happyAccept+action_45 (29) = happyShift action_59 action_45 _ = happyFail (happyExpListPerState 45) -action_46 _ = happyReduce_23+action_46 (29) = happyShift action_56+action_46 (32) = happyShift action_57+action_46 (33) = happyShift action_58+action_46 (55) = happyAccept+action_46 _ = happyFail (happyExpListPerState 46) -action_47 (29) = happyShift action_60-action_47 _ = happyFail (happyExpListPerState 47)+action_47 _ = happyReduce_20 -action_48 (29) = happyShift action_58-action_48 (32) = happyShift action_59-action_48 (55) = happyAccept-action_48 _ = happyFail (happyExpListPerState 48)+action_48 _ = happyReduce_21 -action_49 _ = happyReduce_20+action_49 _ = happyReduce_22 -action_50 _ = happyReduce_21+action_50 (37) = happyShift action_41+action_50 (39) = happyShift action_42+action_50 (41) = happyShift action_31+action_50 (42) = happyShift action_32+action_50 (51) = happyShift action_33+action_50 (52) = happyShift action_34+action_50 (53) = happyShift action_35+action_50 (15) = happyGoto action_24+action_50 (16) = happyGoto action_25+action_50 (17) = happyGoto action_37+action_50 (21) = happyGoto action_38+action_50 (22) = happyGoto action_55+action_50 (23) = happyGoto action_40+action_50 _ = happyReduce_33 -action_51 _ = happyReduce_22+action_51 _ = happyReduce_15 -action_52 (35) = happyShift action_43-action_52 (37) = happyShift action_44-action_52 (38) = happyShift action_31-action_52 (40) = happyShift action_32-action_52 (41) = happyShift action_33-action_52 (42) = happyShift action_34-action_52 (51) = happyShift action_35-action_52 (52) = happyShift action_36-action_52 (53) = happyShift action_37-action_52 (15) = happyGoto action_24-action_52 (16) = happyGoto action_25-action_52 (17) = happyGoto action_39-action_52 (21) = happyGoto action_40-action_52 (22) = happyGoto action_57-action_52 (23) = happyGoto action_42-action_52 _ = happyReduce_32+action_52 (55) = happyAccept+action_52 _ = happyFail (happyExpListPerState 52) -action_53 _ = happyReduce_15+action_53 (46) = happyShift action_54+action_53 _ = happyFail (happyExpListPerState 53) -action_54 (55) = happyAccept-action_54 _ = happyFail (happyExpListPerState 54)+action_54 (37) = happyShift action_41+action_54 (39) = happyShift action_42+action_54 (41) = happyShift action_31+action_54 (42) = happyShift action_32+action_54 (51) = happyShift action_33+action_54 (52) = happyShift action_34+action_54 (53) = happyShift action_35+action_54 (15) = happyGoto action_24+action_54 (16) = happyGoto action_25+action_54 (17) = happyGoto action_37+action_54 (21) = happyGoto action_38+action_54 (22) = happyGoto action_84+action_54 (23) = happyGoto action_40+action_54 _ = happyReduce_33 -action_55 (46) = happyShift action_56+action_55 (47) = happyShift action_83 action_55 _ = happyFail (happyExpListPerState 55) -action_56 (35) = happyShift action_43-action_56 (37) = happyShift action_44-action_56 (38) = happyShift action_31-action_56 (40) = happyShift action_32-action_56 (41) = happyShift action_33-action_56 (42) = happyShift action_34-action_56 (51) = happyShift action_35-action_56 (52) = happyShift action_36-action_56 (53) = happyShift action_37+action_56 (37) = happyShift action_41+action_56 (39) = happyShift action_42+action_56 (41) = happyShift action_31+action_56 (42) = happyShift action_32+action_56 (51) = happyShift action_33+action_56 (52) = happyShift action_34+action_56 (53) = happyShift action_35 action_56 (15) = happyGoto action_24 action_56 (16) = happyGoto action_25-action_56 (17) = happyGoto action_39-action_56 (21) = happyGoto action_40-action_56 (22) = happyGoto action_84-action_56 (23) = happyGoto action_42-action_56 _ = happyReduce_32+action_56 (17) = happyGoto action_37+action_56 (21) = happyGoto action_38+action_56 (22) = happyGoto action_82+action_56 (23) = happyGoto action_40+action_56 _ = happyReduce_33 -action_57 (47) = happyShift action_83+action_57 (41) = happyShift action_31+action_57 (42) = happyShift action_32+action_57 (51) = happyShift action_33+action_57 (52) = happyShift action_34+action_57 (53) = happyShift action_35+action_57 (15) = happyGoto action_24+action_57 (16) = happyGoto action_25+action_57 (17) = happyGoto action_26+action_57 (23) = happyGoto action_81 action_57 _ = happyFail (happyExpListPerState 57) -action_58 (35) = happyShift action_43-action_58 (37) = happyShift action_44-action_58 (38) = happyShift action_31-action_58 (40) = happyShift action_32-action_58 (41) = happyShift action_33-action_58 (42) = happyShift action_34-action_58 (51) = happyShift action_35-action_58 (52) = happyShift action_36-action_58 (53) = happyShift action_37-action_58 (15) = happyGoto action_24-action_58 (16) = happyGoto action_25-action_58 (17) = happyGoto action_39-action_58 (21) = happyGoto action_40-action_58 (22) = happyGoto action_82-action_58 (23) = happyGoto action_42-action_58 _ = happyReduce_32+action_58 (40) = happyShift action_80+action_58 _ = happyFail (happyExpListPerState 58) -action_59 (38) = happyShift action_31-action_59 (40) = happyShift action_32-action_59 (41) = happyShift action_33-action_59 (42) = happyShift action_34-action_59 (51) = happyShift action_35-action_59 (52) = happyShift action_36-action_59 (53) = happyShift action_37-action_59 (15) = happyGoto action_24-action_59 (16) = happyGoto action_25-action_59 (17) = happyGoto action_26-action_59 (23) = happyGoto action_81+action_59 (38) = happyShift action_47+action_59 (40) = happyShift action_48+action_59 (45) = happyShift action_49+action_59 (46) = happyShift action_50+action_59 (53) = happyShift action_35+action_59 (54) = happyShift action_51+action_59 (17) = happyGoto action_44+action_59 (18) = happyGoto action_45+action_59 (20) = happyGoto action_79 action_59 _ = happyFail (happyExpListPerState 59) -action_60 (36) = happyShift action_49-action_60 (39) = happyShift action_50-action_60 (45) = happyShift action_51-action_60 (46) = happyShift action_52-action_60 (53) = happyShift action_37-action_60 (54) = happyShift action_53-action_60 (17) = happyGoto action_46-action_60 (18) = happyGoto action_47-action_60 (20) = happyGoto action_80+action_60 (50) = happyShift action_78+action_60 (14) = happyGoto action_77 action_60 _ = happyFail (happyExpListPerState 60) -action_61 (50) = happyShift action_79-action_61 (14) = happyGoto action_78+action_61 (44) = happyShift action_76+action_61 (49) = happyShift action_11+action_61 (53) = happyShift action_35+action_61 (13) = happyGoto action_74+action_61 (17) = happyGoto action_75 action_61 _ = happyFail (happyExpListPerState 61) -action_62 (44) = happyShift action_77-action_62 (49) = happyShift action_11-action_62 (53) = happyShift action_37-action_62 (13) = happyGoto action_75-action_62 (17) = happyGoto action_76+action_62 (38) = happyShift action_47+action_62 (40) = happyShift action_48+action_62 (44) = happyShift action_73+action_62 (45) = happyShift action_49+action_62 (46) = happyShift action_50+action_62 (53) = happyShift action_35+action_62 (54) = happyShift action_51+action_62 (17) = happyGoto action_44+action_62 (18) = happyGoto action_45+action_62 (20) = happyGoto action_72 action_62 _ = happyFail (happyExpListPerState 62) -action_63 (36) = happyShift action_49-action_63 (39) = happyShift action_50-action_63 (44) = happyShift action_74-action_63 (45) = happyShift action_51-action_63 (46) = happyShift action_52-action_63 (53) = happyShift action_37-action_63 (54) = happyShift action_53-action_63 (17) = happyGoto action_46-action_63 (18) = happyGoto action_47-action_63 (20) = happyGoto action_73-action_63 _ = happyFail (happyExpListPerState 63)+action_63 (37) = happyShift action_41+action_63 (39) = happyShift action_42+action_63 (41) = happyShift action_31+action_63 (42) = happyShift action_32+action_63 (51) = happyShift action_33+action_63 (52) = happyShift action_34+action_63 (53) = happyShift action_35+action_63 (15) = happyGoto action_24+action_63 (16) = happyGoto action_25+action_63 (17) = happyGoto action_37+action_63 (21) = happyGoto action_38+action_63 (22) = happyGoto action_71+action_63 (23) = happyGoto action_40+action_63 _ = happyReduce_33 -action_64 (35) = happyShift action_43-action_64 (37) = happyShift action_44-action_64 (38) = happyShift action_31-action_64 (40) = happyShift action_32-action_64 (41) = happyShift action_33-action_64 (42) = happyShift action_34-action_64 (51) = happyShift action_35-action_64 (52) = happyShift action_36-action_64 (53) = happyShift action_37-action_64 (15) = happyGoto action_24-action_64 (16) = happyGoto action_25-action_64 (17) = happyGoto action_39-action_64 (21) = happyGoto action_40-action_64 (22) = happyGoto action_72-action_64 (23) = happyGoto action_42-action_64 _ = happyReduce_32+action_64 _ = happyReduce_44 -action_65 _ = happyReduce_45+action_65 (47) = happyShift action_70+action_65 _ = happyFail (happyExpListPerState 65) -action_66 (47) = happyShift action_71-action_66 _ = happyFail (happyExpListPerState 66)+action_66 _ = happyReduce_50 -action_67 _ = happyReduce_51+action_67 (30) = happyShift action_69+action_67 _ = happyFail (happyExpListPerState 67) -action_68 (30) = happyShift action_70-action_68 _ = happyFail (happyExpListPerState 68)+action_68 _ = happyReduce_52 -action_69 _ = happyReduce_53+action_69 _ = happyReduce_49 -action_70 _ = happyReduce_50+action_70 _ = happyReduce_45 -action_71 _ = happyReduce_46+action_71 _ = happyReduce_35 -action_72 _ = happyReduce_34+action_72 (29) = happyShift action_56+action_72 (32) = happyShift action_57+action_72 (33) = happyShift action_58+action_72 _ = happyReduce_26 -action_73 (29) = happyShift action_58-action_73 (32) = happyShift action_59-action_73 _ = happyReduce_25+action_73 _ = happyReduce_27 -action_74 _ = happyReduce_26+action_74 _ = happyReduce_28 -action_75 _ = happyReduce_27+action_75 _ = happyReduce_32 -action_76 _ = happyReduce_31+action_76 _ = happyReduce_29 -action_77 _ = happyReduce_28+action_77 _ = happyReduce_30 -action_78 _ = happyReduce_29+action_78 _ = happyReduce_11 -action_79 _ = happyReduce_11+action_79 (29) = happyShift action_56+action_79 (30) = happyShift action_88+action_79 (32) = happyShift action_57+action_79 (33) = happyShift action_58+action_79 _ = happyFail (happyExpListPerState 79) -action_80 (29) = happyShift action_58-action_80 (30) = happyShift action_87-action_80 (32) = happyShift action_59+action_80 (43) = happyShift action_87 action_80 _ = happyFail (happyExpListPerState 80) action_81 _ = happyReduce_19@@ -656,15 +639,34 @@ action_84 (47) = happyShift action_85 action_84 _ = happyFail (happyExpListPerState 84) -action_85 (34) = happyShift action_88+action_85 (36) = happyShift action_90 action_85 _ = happyFail (happyExpListPerState 85) action_86 _ = happyReduce_18 -action_87 _ = happyReduce_24+action_87 (38) = happyShift action_47+action_87 (40) = happyShift action_48+action_87 (45) = happyShift action_49+action_87 (46) = happyShift action_50+action_87 (53) = happyShift action_35+action_87 (54) = happyShift action_51+action_87 (17) = happyGoto action_44+action_87 (18) = happyGoto action_45+action_87 (20) = happyGoto action_89+action_87 _ = happyFail (happyExpListPerState 87) -action_88 _ = happyReduce_16+action_88 _ = happyReduce_25 +action_89 (29) = happyShift action_56+action_89 (32) = happyShift action_57+action_89 (33) = happyShift action_58+action_89 (34) = happyShift action_91+action_89 _ = happyFail (happyExpListPerState 89)++action_90 _ = happyReduce_16++action_91 _ = happyReduce_23+ happyReduce_10 = happySpecReduce_1 13 happyReduction_10 happyReduction_10 (HappyTerminal (PT _ (T_Bytes happy_var_1))) = HappyAbsSyn13@@ -764,15 +766,27 @@ (Language.EO.Phi.Syntax.Abs.Termination ) -happyReduce_23 = happySpecReduce_1 20 happyReduction_23-happyReduction_23 (HappyAbsSyn17 happy_var_1)+happyReduce_23 = happyReduce 6 20 happyReduction_23+happyReduction_23 (_ `HappyStk`+ (HappyAbsSyn20 happy_var_5) `HappyStk`+ _ `HappyStk`+ _ `HappyStk`+ _ `HappyStk`+ (HappyAbsSyn20 happy_var_1) `HappyStk`+ happyRest)+ = HappyAbsSyn20+ (Language.EO.Phi.Syntax.Abs.MetaSubstThis happy_var_1 happy_var_5+ ) `HappyStk` happyRest++happyReduce_24 = happySpecReduce_1 20 happyReduction_24+happyReduction_24 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn20 (Language.EO.Phi.Syntax.Abs.MetaObject happy_var_1 )-happyReduction_23 _ = notHappyAtAll +happyReduction_24 _ = notHappyAtAll -happyReduce_24 = happyReduce 4 20 happyReduction_24-happyReduction_24 (_ `HappyStk`+happyReduce_25 = happyReduce 4 20 happyReduction_25+happyReduction_25 (_ `HappyStk` (HappyAbsSyn20 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn18 happy_var_1) `HappyStk`@@ -781,215 +795,203 @@ (Language.EO.Phi.Syntax.Abs.MetaFunction happy_var_1 happy_var_3 ) `HappyStk` happyRest -happyReduce_25 = happySpecReduce_3 21 happyReduction_25-happyReduction_25 (HappyAbsSyn20 happy_var_3)+happyReduce_26 = happySpecReduce_3 21 happyReduction_26+happyReduction_26 (HappyAbsSyn20 happy_var_3) _ (HappyAbsSyn23 happy_var_1) = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.AlphaBinding happy_var_1 happy_var_3 )-happyReduction_25 _ _ _ = notHappyAtAll +happyReduction_26 _ _ _ = notHappyAtAll -happyReduce_26 = happySpecReduce_3 21 happyReduction_26-happyReduction_26 _+happyReduce_27 = happySpecReduce_3 21 happyReduction_27+happyReduction_27 _ _ (HappyAbsSyn23 happy_var_1) = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.EmptyBinding happy_var_1 )-happyReduction_26 _ _ _ = notHappyAtAll +happyReduction_27 _ _ _ = notHappyAtAll -happyReduce_27 = happySpecReduce_3 21 happyReduction_27-happyReduction_27 (HappyAbsSyn13 happy_var_3)+happyReduce_28 = happySpecReduce_3 21 happyReduction_28+happyReduction_28 (HappyAbsSyn13 happy_var_3) _ _ = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.DeltaBinding happy_var_3 )-happyReduction_27 _ _ _ = notHappyAtAll +happyReduction_28 _ _ _ = notHappyAtAll -happyReduce_28 = happySpecReduce_3 21 happyReduction_28-happyReduction_28 _+happyReduce_29 = happySpecReduce_3 21 happyReduction_29+happyReduction_29 _ _ _ = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.DeltaEmptyBinding ) -happyReduce_29 = happySpecReduce_3 21 happyReduction_29-happyReduction_29 (HappyAbsSyn14 happy_var_3)+happyReduce_30 = happySpecReduce_3 21 happyReduction_30+happyReduction_30 (HappyAbsSyn14 happy_var_3) _ _ = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.LambdaBinding happy_var_3 )-happyReduction_29 _ _ _ = notHappyAtAll +happyReduction_30 _ _ _ = notHappyAtAll -happyReduce_30 = happySpecReduce_1 21 happyReduction_30-happyReduction_30 (HappyAbsSyn17 happy_var_1)+happyReduce_31 = happySpecReduce_1 21 happyReduction_31+happyReduction_31 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.MetaBindings happy_var_1 )-happyReduction_30 _ = notHappyAtAll +happyReduction_31 _ = notHappyAtAll -happyReduce_31 = happySpecReduce_3 21 happyReduction_31-happyReduction_31 (HappyAbsSyn17 happy_var_3)+happyReduce_32 = happySpecReduce_3 21 happyReduction_32+happyReduction_32 (HappyAbsSyn17 happy_var_3) _ _ = HappyAbsSyn21 (Language.EO.Phi.Syntax.Abs.MetaDeltaBinding happy_var_3 )-happyReduction_31 _ _ _ = notHappyAtAll +happyReduction_32 _ _ _ = notHappyAtAll -happyReduce_32 = happySpecReduce_0 22 happyReduction_32-happyReduction_32 = HappyAbsSyn22+happyReduce_33 = happySpecReduce_0 22 happyReduction_33+happyReduction_33 = HappyAbsSyn22 ([] ) -happyReduce_33 = happySpecReduce_1 22 happyReduction_33-happyReduction_33 (HappyAbsSyn21 happy_var_1)+happyReduce_34 = happySpecReduce_1 22 happyReduction_34+happyReduction_34 (HappyAbsSyn21 happy_var_1) = HappyAbsSyn22 ((:[]) happy_var_1 )-happyReduction_33 _ = notHappyAtAll +happyReduction_34 _ = notHappyAtAll -happyReduce_34 = happySpecReduce_3 22 happyReduction_34-happyReduction_34 (HappyAbsSyn22 happy_var_3)+happyReduce_35 = happySpecReduce_3 22 happyReduction_35+happyReduction_35 (HappyAbsSyn22 happy_var_3) _ (HappyAbsSyn21 happy_var_1) = HappyAbsSyn22 ((:) happy_var_1 happy_var_3 )-happyReduction_34 _ _ _ = notHappyAtAll --happyReduce_35 = happySpecReduce_1 23 happyReduction_35-happyReduction_35 _- = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.Phi- )+happyReduction_35 _ _ _ = notHappyAtAll happyReduce_36 = happySpecReduce_1 23 happyReduction_36 happyReduction_36 _ = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.Rho+ (Language.EO.Phi.Syntax.Abs.Phi ) happyReduce_37 = happySpecReduce_1 23 happyReduction_37 happyReduction_37 _ = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.Sigma+ (Language.EO.Phi.Syntax.Abs.Rho ) happyReduce_38 = happySpecReduce_1 23 happyReduction_38-happyReduction_38 _+happyReduction_38 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.VTX+ (Language.EO.Phi.Syntax.Abs.Label happy_var_1 )+happyReduction_38 _ = notHappyAtAll happyReduce_39 = happySpecReduce_1 23 happyReduction_39-happyReduction_39 (HappyAbsSyn15 happy_var_1)+happyReduction_39 (HappyAbsSyn16 happy_var_1) = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.Label happy_var_1+ (Language.EO.Phi.Syntax.Abs.Alpha happy_var_1 ) happyReduction_39 _ = notHappyAtAll happyReduce_40 = happySpecReduce_1 23 happyReduction_40-happyReduction_40 (HappyAbsSyn16 happy_var_1)+happyReduction_40 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.Alpha happy_var_1+ (Language.EO.Phi.Syntax.Abs.MetaAttr happy_var_1 ) happyReduction_40 _ = notHappyAtAll -happyReduce_41 = happySpecReduce_1 23 happyReduction_41-happyReduction_41 (HappyAbsSyn17 happy_var_1)- = HappyAbsSyn23- (Language.EO.Phi.Syntax.Abs.MetaAttr happy_var_1+happyReduce_41 = happySpecReduce_1 24 happyReduction_41+happyReduction_41 (HappyAbsSyn23 happy_var_1)+ = HappyAbsSyn24+ (Language.EO.Phi.Syntax.Abs.ObjectAttr happy_var_1 ) happyReduction_41 _ = notHappyAtAll happyReduce_42 = happySpecReduce_1 24 happyReduction_42-happyReduction_42 (HappyAbsSyn23 happy_var_1)+happyReduction_42 _ = HappyAbsSyn24- (Language.EO.Phi.Syntax.Abs.ObjectAttr happy_var_1+ (Language.EO.Phi.Syntax.Abs.DeltaAttr )-happyReduction_42 _ = notHappyAtAll happyReduce_43 = happySpecReduce_1 24 happyReduction_43 happyReduction_43 _ = HappyAbsSyn24- (Language.EO.Phi.Syntax.Abs.DeltaAttr- )--happyReduce_44 = happySpecReduce_1 24 happyReduction_44-happyReduction_44 _- = HappyAbsSyn24 (Language.EO.Phi.Syntax.Abs.LambdaAttr ) -happyReduce_45 = happySpecReduce_2 25 happyReduction_45-happyReduction_45 (HappyAbsSyn28 happy_var_2)+happyReduce_44 = happySpecReduce_2 25 happyReduction_44+happyReduction_44 (HappyAbsSyn28 happy_var_2) (HappyAbsSyn26 happy_var_1) = HappyAbsSyn25 (Language.EO.Phi.Syntax.Abs.PeeledObject happy_var_1 happy_var_2 )-happyReduction_45 _ _ = notHappyAtAll +happyReduction_44 _ _ = notHappyAtAll -happyReduce_46 = happySpecReduce_3 26 happyReduction_46-happyReduction_46 _+happyReduce_45 = happySpecReduce_3 26 happyReduction_45+happyReduction_45 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn26 (Language.EO.Phi.Syntax.Abs.HeadFormation happy_var_2 )-happyReduction_46 _ _ _ = notHappyAtAll +happyReduction_45 _ _ _ = notHappyAtAll -happyReduce_47 = happySpecReduce_1 26 happyReduction_47-happyReduction_47 _+happyReduce_46 = happySpecReduce_1 26 happyReduction_46+happyReduction_46 _ = HappyAbsSyn26 (Language.EO.Phi.Syntax.Abs.HeadGlobal ) -happyReduce_48 = happySpecReduce_1 26 happyReduction_48-happyReduction_48 _+happyReduce_47 = happySpecReduce_1 26 happyReduction_47+happyReduction_47 _ = HappyAbsSyn26 (Language.EO.Phi.Syntax.Abs.HeadThis ) -happyReduce_49 = happySpecReduce_1 26 happyReduction_49-happyReduction_49 _+happyReduce_48 = happySpecReduce_1 26 happyReduction_48+happyReduction_48 _ = HappyAbsSyn26 (Language.EO.Phi.Syntax.Abs.HeadTermination ) -happyReduce_50 = happySpecReduce_3 27 happyReduction_50-happyReduction_50 _+happyReduce_49 = happySpecReduce_3 27 happyReduction_49+happyReduction_49 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn27 (Language.EO.Phi.Syntax.Abs.ActionApplication happy_var_2 )-happyReduction_50 _ _ _ = notHappyAtAll +happyReduction_49 _ _ _ = notHappyAtAll -happyReduce_51 = happySpecReduce_2 27 happyReduction_51-happyReduction_51 (HappyAbsSyn23 happy_var_2)+happyReduce_50 = happySpecReduce_2 27 happyReduction_50+happyReduction_50 (HappyAbsSyn23 happy_var_2) _ = HappyAbsSyn27 (Language.EO.Phi.Syntax.Abs.ActionDispatch happy_var_2 )-happyReduction_51 _ _ = notHappyAtAll +happyReduction_50 _ _ = notHappyAtAll -happyReduce_52 = happySpecReduce_0 28 happyReduction_52-happyReduction_52 = HappyAbsSyn28+happyReduce_51 = happySpecReduce_0 28 happyReduction_51+happyReduction_51 = HappyAbsSyn28 ([] ) -happyReduce_53 = happySpecReduce_2 28 happyReduction_53-happyReduction_53 (HappyAbsSyn28 happy_var_2)+happyReduce_52 = happySpecReduce_2 28 happyReduction_52+happyReduction_52 (HappyAbsSyn28 happy_var_2) (HappyAbsSyn27 happy_var_1) = HappyAbsSyn28 ((:) happy_var_1 happy_var_2 )-happyReduction_53 _ _ = notHappyAtAll +happyReduction_52 _ _ = notHappyAtAll happyNewToken action sts stk [] = action 55 55 notHappyAtAll (HappyState action) sts stk []
src/Language/EO/Phi/Syntax/Par.y view
@@ -45,15 +45,15 @@ ')' { PT _ (TS _ 2) } ',' { PT _ (TS _ 3) } '.' { PT _ (TS _ 4) }- '{' { PT _ (TS _ 5) }- '}' { PT _ (TS _ 6) }- 'Δ' { PT _ (TS _ 7) }- 'Φ' { PT _ (TS _ 8) }- 'λ' { PT _ (TS _ 9) }- 'ν' { PT _ (TS _ 10) }- 'ξ' { PT _ (TS _ 11) }- 'ρ' { PT _ (TS _ 12) }- 'σ' { PT _ (TS _ 13) }+ '[' { PT _ (TS _ 5) }+ ']' { PT _ (TS _ 6) }+ '{' { PT _ (TS _ 7) }+ '}' { PT _ (TS _ 8) }+ 'Δ' { PT _ (TS _ 9) }+ 'Φ' { PT _ (TS _ 10) }+ 'λ' { PT _ (TS _ 11) }+ 'ξ' { PT _ (TS _ 12) }+ 'ρ' { PT _ (TS _ 13) } 'φ' { PT _ (TS _ 14) } '↦' { PT _ (TS _ 15) } '∅' { PT _ (TS _ 16) }@@ -100,6 +100,7 @@ | 'Φ' { Language.EO.Phi.Syntax.Abs.GlobalObject } | 'ξ' { Language.EO.Phi.Syntax.Abs.ThisObject } | '⊥' { Language.EO.Phi.Syntax.Abs.Termination }+ | Object '[' 'ξ' '↦' Object ']' { Language.EO.Phi.Syntax.Abs.MetaSubstThis $1 $5 } | MetaId { Language.EO.Phi.Syntax.Abs.MetaObject $1 } | MetaFunctionName '(' Object ')' { Language.EO.Phi.Syntax.Abs.MetaFunction $1 $3 } @@ -123,8 +124,6 @@ Attribute : 'φ' { Language.EO.Phi.Syntax.Abs.Phi } | 'ρ' { Language.EO.Phi.Syntax.Abs.Rho }- | 'σ' { Language.EO.Phi.Syntax.Abs.Sigma }- | 'ν' { Language.EO.Phi.Syntax.Abs.VTX } | LabelId { Language.EO.Phi.Syntax.Abs.Label $1 } | AlphaIndex { Language.EO.Phi.Syntax.Abs.Alpha $1 } | MetaId { Language.EO.Phi.Syntax.Abs.MetaAttr $1 }
src/Language/EO/Phi/Syntax/Print.hs view
@@ -161,6 +161,7 @@ Language.EO.Phi.Syntax.Abs.GlobalObject -> prPrec i 0 (concatD [doc (showString "\934")]) Language.EO.Phi.Syntax.Abs.ThisObject -> prPrec i 0 (concatD [doc (showString "\958")]) Language.EO.Phi.Syntax.Abs.Termination -> prPrec i 0 (concatD [doc (showString "\8869")])+ Language.EO.Phi.Syntax.Abs.MetaSubstThis object1 object2 -> prPrec i 0 (concatD [prt 0 object1, doc (showString "["), doc (showString "\958"), doc (showString "\8614"), prt 0 object2, doc (showString "]")]) Language.EO.Phi.Syntax.Abs.MetaObject metaid -> prPrec i 0 (concatD [prt 0 metaid]) Language.EO.Phi.Syntax.Abs.MetaFunction metafunctionname object -> prPrec i 0 (concatD [prt 0 metafunctionname, doc (showString "("), prt 0 object, doc (showString ")")]) @@ -183,8 +184,6 @@ prt i = \case Language.EO.Phi.Syntax.Abs.Phi -> prPrec i 0 (concatD [doc (showString "\966")]) Language.EO.Phi.Syntax.Abs.Rho -> prPrec i 0 (concatD [doc (showString "\961")])- Language.EO.Phi.Syntax.Abs.Sigma -> prPrec i 0 (concatD [doc (showString "\963")])- Language.EO.Phi.Syntax.Abs.VTX -> prPrec i 0 (concatD [doc (showString "\957")]) Language.EO.Phi.Syntax.Abs.Label labelid -> prPrec i 0 (concatD [prt 0 labelid]) Language.EO.Phi.Syntax.Abs.Alpha alphaindex -> prPrec i 0 (concatD [prt 0 alphaindex]) Language.EO.Phi.Syntax.Abs.MetaAttr metaid -> prPrec i 0 (concatD [prt 0 metaid])
src/Language/EO/Phi/Syntax/Skel.hs view
@@ -51,6 +51,7 @@ Language.EO.Phi.Syntax.Abs.GlobalObject -> failure x Language.EO.Phi.Syntax.Abs.ThisObject -> failure x Language.EO.Phi.Syntax.Abs.Termination -> failure x+ Language.EO.Phi.Syntax.Abs.MetaSubstThis object1 object2 -> failure x Language.EO.Phi.Syntax.Abs.MetaObject metaid -> failure x Language.EO.Phi.Syntax.Abs.MetaFunction metafunctionname object -> failure x @@ -68,8 +69,6 @@ transAttribute x = case x of Language.EO.Phi.Syntax.Abs.Phi -> failure x Language.EO.Phi.Syntax.Abs.Rho -> failure x- Language.EO.Phi.Syntax.Abs.Sigma -> failure x- Language.EO.Phi.Syntax.Abs.VTX -> failure x Language.EO.Phi.Syntax.Abs.Label labelid -> failure x Language.EO.Phi.Syntax.Abs.Alpha alphaindex -> failure x Language.EO.Phi.Syntax.Abs.MetaAttr metaid -> failure x
+ src/Language/EO/Phi/ToLaTeX.hs view
@@ -0,0 +1,68 @@+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE OverloadedStrings #-}++module Language.EO.Phi.ToLaTeX where++import Data.Foldable (fold)+import Data.List (intersperse)+import Data.String (IsString)+import Data.Text qualified as T+import Language.EO.Phi+import Text.Regex (mkRegex, subRegex)++newtype LaTeX = LaTeX {unLaTeX :: String}+ deriving newtype (IsString, Semigroup, Monoid)++instance Show LaTeX where+ show = latexToString++class ToLatex a where+ toLatex :: a -> LaTeX+ toLatexString :: a -> String+ toLatexString = latexToString . toLatex++instance ToLatex Program where+ toLatex (Program bindings) =+ "\\Big\\{ " <> toLatex (Formation bindings) <> " \\Big\\}"++instance ToLatex Attribute where+ toLatex Phi = "@"+ toLatex Rho = "^"+ toLatex (Alpha (AlphaIndex a)) = LaTeX ("\\alpha_" ++ tail a)+ toLatex (Label (LabelId l)) = LaTeX l+ toLatex (MetaAttr _) = error "rendering MetaBindings in LaTex format"++instance ToLatex Binding where+ toLatex (AlphaBinding attr obj) = toLatex attr <> " -> " <> toLatex obj+ toLatex (EmptyBinding attr) = toLatex attr <> " -> ?"+ toLatex (DeltaBinding (Bytes bytes)) = "D> " <> LaTeX bytes+ toLatex DeltaEmptyBinding = "D> ?"+ toLatex (LambdaBinding (Function fn)) = "L> " <> LaTeX fn+ toLatex (MetaBindings _) = error "rendering MetaBindings in LaTex format"+ toLatex (MetaDeltaBinding _) = error "rendering MetaDeltaBinding in LaTex format"++instance ToLatex Object where+ toLatex (Formation bindings) =+ "[[ " <> fold (intersperse ", " (map toLatex bindings)) <> " ]]"+ toLatex (Application obj bindings) =+ toLatex obj <> "( " <> fold (intersperse ", " (map toLatex bindings)) <> " )"+ toLatex (ObjectDispatch obj attr) =+ toLatex obj <> "." <> toLatex attr+ toLatex GlobalObject = "Q"+ toLatex ThisObject = "$"+ toLatex Termination = "\\dead"+ toLatex (MetaObject _) = error "rendering MetaObject in LaTex format"+ toLatex (MetaFunction _ _) = error "rendering MetaFunction in LaTex format"+ toLatex (MetaSubstThis _ _) = error "rendering MetaSubstThis in LaTex format"++removeOrgEolang :: String -> String+removeOrgEolang = T.unpack . T.replace "Q.org.eolang" "QQ" . T.pack++removeAlpha :: String -> String+removeAlpha s = subRegex (mkRegex "\\\\alpha_([0-9]+) ->") s "\\1->"++-- >>> toLatex ("{ ⟦ α0 ↦ ξ, α1 ↦ Φ.org.eolang.bytes( Δ ⤍ 00- ) ⟧ }" :: Program)+-- \Big\{ [[ 0-> $, 1-> QQ.bytes( D> 00- ) ]] \Big\}+latexToString :: LaTeX -> String+latexToString = removeAlpha . removeOrgEolang . unLaTeX
test/Language/EO/Phi/DataizeSpec.hs view
@@ -7,15 +7,34 @@ import Control.Monad (forM_) import Test.Hspec +import Language.EO.Phi (printTree) import Language.EO.Phi qualified as Phi import Language.EO.Phi.Dataize (dataizeRecursively)+import Language.EO.Phi.Dependencies (deepMergePrograms) import Language.EO.Phi.Rules.Common (defaultContext, equalObject) import Language.EO.Phi.Rules.Yaml (convertRuleNamed, parseRuleSetFromFile, rules) import Test.EO.Phi (DataizationResult (Bytes, Object), DataizeTest (..), DataizeTestGroup (..), dataizationTests) -shouldDataizeTo :: Either Phi.Object Phi.Bytes -> Either Phi.Object Phi.Bytes -> Expectation-shouldDataizeTo lhs = flip shouldSatisfy $ either (either equalObject (const (const False)) lhs) (either (const (const False)) (==) lhs)+newtype ObjectOrBytes = ObjectOrBytes (Either Phi.Object Phi.Bytes) +instance Show ObjectOrBytes where+ show (ObjectOrBytes (Left obj)) = printTree obj+ show (ObjectOrBytes (Right bytes)) = printTree bytes++instance Eq ObjectOrBytes where+ ObjectOrBytes (Left x) == ObjectOrBytes (Left y) =+ x `equalObject` y+ ObjectOrBytes (Right x) == ObjectOrBytes (Right y) =+ x == y+ _ == _ = False++getProgram :: FilePath -> IO Phi.Program+getProgram inputFile = do+ src <- readFile inputFile+ case Phi.parseProgram src of+ Left err -> error ("Error parsing program from '" ++ inputFile ++ "': " ++ err)+ Right program -> pure program+ spec :: Spec spec = do DataizeTestGroup{..} <- runIO (dataizationTests "test/eo/phi/dataization.yaml")@@ -24,12 +43,18 @@ describe title $ forM_ tests $ \test -> do+ deps <- runIO $ mapM getProgram test.dependencies+ let mergedProgs = case deepMergePrograms (test.input : deps) of+ Left err -> error ("Error merging programs: " ++ err)+ Right prog -> prog+ let ctx = defaultContext rules (progToObj mergedProgs) let inputObj = progToObj test.input let expectedResult = case test.output of Object obj -> Left obj Bytes bytes -> Right bytes- it test.name $- dataizeRecursively (defaultContext rules inputObj) inputObj `shouldDataizeTo` expectedResult+ it test.name $ do+ let dataizedResult = dataizeRecursively ctx inputObj+ ObjectOrBytes dataizedResult `shouldBe` ObjectOrBytes expectedResult progToObj :: Phi.Program -> Phi.Object progToObj (Phi.Program bindings) = Phi.Formation bindings
test/Language/EO/PhiSpec.hs view
@@ -13,13 +13,13 @@ import Data.Char (isSpace) import Data.List (dropWhileEnd) import Data.String (IsString (..))-import Data.String.Interpolate (i) import Data.Yaml (decodeFileThrow) import Language.EO.Phi import Language.EO.Phi.Metrics.Collect (getProgramMetrics) import Language.EO.Phi.Metrics.Data (BindingsByPathMetrics (..), ProgramMetrics (..)) import Language.EO.Phi.Rules.Common (Rule, defaultContext, equalProgram)-import Language.EO.Phi.Rules.PhiPaper (rule1, rule6)+import Language.EO.Phi.Rules.PhiPaper (rule6)+import PyF (fmt) import Test.EO.Phi import Test.Hspec import Test.Metrics.Phi (MetricsTest (..), MetricsTestSet (..))@@ -34,9 +34,9 @@ spec :: Spec spec = do describe "Pre-defined rules" $- forM_ ([(1, rule1), (6, rule6)] :: [(Int, Rule)]) $+ forM_ ([(6, rule6)] :: [(Int, Rule)]) $ \(idx, rule) -> do- PhiTestGroup{..} <- runIO (fileTests [i|test/eo/phi/rule-#{idx}.yaml|])+ PhiTestGroup{..} <- runIO (fileTests [fmt|test/eo/phi/rule-{idx}.yaml|]) describe title $ forM_ tests $ \PhiTest{..} ->
test/Language/EO/Rules/PhiPaperSpec.hs view
@@ -1,18 +1,23 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NumericUnderscores #-}-{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -Wno-orphans #-}+{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} +{-# HLINT ignore "Use ++" #-}+{-# HLINT ignore "Functor law" #-}+ module Language.EO.Rules.PhiPaperSpec where import Control.Monad (forM_, guard) import Data.Aeson (FromJSON) import Data.Data (Data (toConstr))+import Data.Function (on) import Data.List (intercalate) import Data.List qualified as List import Data.Yaml qualified as Yaml@@ -35,14 +40,11 @@ oneof [ pure Phi , pure Rho- , pure Sigma- , pure VTX , Label <$> arbitrary ] instance Arbitrary LabelId where arbitrary = LabelId <$> arbitraryNonEmptyString- shrink = genericShrink instance Arbitrary AlphaIndex where arbitrary = AlphaIndex <$> arbitraryNonEmptyString instance Arbitrary Bytes where@@ -55,50 +57,91 @@ arbitrary = Phi.MetaFunctionName . ("@" ++) <$> arbitraryNonEmptyString instance Arbitrary Binding where- arbitrary =- oneof- [ EmptyBinding . Label <$> arbitrary- , do- attr <- arbitrary- obj <- case attr of- VTX ->- Formation <$> do- bytes <- arbitrary- return [DeltaBinding bytes]- _ -> arbitrary- return (AlphaBinding attr obj)- , DeltaBinding <$> arbitrary- , LambdaBinding <$> arbitrary- , pure DeltaEmptyBinding+ arbitrary = sized $ \n -> do+ frequency+ [ (1, EmptyBinding . Label <$> arbitrary)+ ,+ ( n+ , do+ attr <- arbitrary+ AlphaBinding attr <$> arbitrary+ )+ , (1, DeltaBinding <$> arbitrary)+ , (1, LambdaBinding <$> arbitrary)+ , (1, pure DeltaEmptyBinding) ]- shrink (AlphaBinding VTX _) = [] -- do not shrink vertex bindings shrink (AlphaBinding attr obj) = AlphaBinding attr <$> shrink obj shrink _ = [] -- do not shrink deltas and lambdas +-- | Split an integer into a list of positive integers,+-- whose sum is less than or equal the initial one.+--+-- n >= 0 ==> splitInt n >>= \xs -> sum xs <= n+splitInt :: Int -> Gen [Int]+splitInt n+ | n <= 0 = return []+ | otherwise =+ frequency+ [ (1, return [])+ ,+ ( n+ , do+ k <- chooseInt (1, n)+ xs <- splitInt (n - k)+ return (k : xs)+ )+ ]++-- | Generate a list of items,+-- such that the total size of the items does not exceed a given size.+listOf' :: Gen a -> Gen [a]+listOf' x = sized $ \n -> do+ elemSizes <- splitInt n+ mapM (`resize` x) elemSizes++bindingAttr :: Binding -> Attribute+bindingAttr = \case+ AlphaBinding a _ -> a+ EmptyBinding a -> a+ DeltaBinding{} -> Label "Δ"+ DeltaEmptyBinding{} -> Label "Δ"+ LambdaBinding{} -> Label "λ"+ MetaDeltaBinding{} -> Label "Δ"+ MetaBindings{} -> error "attempting to retrieve attribute of meta bindings"++arbitraryBindings :: Gen [Binding]+arbitraryBindings =+ List.nubBy ((==) `on` bindingAttr)+ <$> listOf' arbitrary++arbitraryAlphaLabelBindings :: Gen [Binding]+arbitraryAlphaLabelBindings =+ List.nubBy ((==) `on` bindingAttr)+ <$> listOf' (AlphaBinding <$> (Label <$> arbitrary) <*> arbitrary)++sizedLiftA2 :: (a -> b -> c) -> Gen a -> Gen b -> Gen c+sizedLiftA2 f x y = sized $ \n -> do+ xSize <- chooseInt (1, n - 1)+ let ySize = n - xSize+ f <$> resize xSize x <*> resize ySize y+ instance Arbitrary Object where- arbitrary = sized $ \n -> do- let arbitraryBinding = resize (n `div` 2) arbitrary- arbitraryAttr = resize (n `div` 2) arbitrary- arbitraryObj = resize (n `div` 2) arbitrary- sameAttr (AlphaBinding attr1 _) (AlphaBinding attr2 _) = attr1 == attr2- sameAttr (EmptyBinding attr1) (EmptyBinding attr2) = attr1 == attr2- sameAttr b1 b2 = toConstr b1 == toConstr b2- arbitraryBindings = List.nubBy sameAttr <$> listOf arbitraryBinding- arbitraryAlphaLabelBinding =- resize (n `div` 2) $- (AlphaBinding . Label <$> arbitrary) <*> arbitrary- arbitraryAlphaLabelBindings = List.nubBy sameAttr <$> listOf arbitraryAlphaLabelBinding- if n > 0- then- oneof- [ Formation <$> arbitraryBindings- , liftA2 Application arbitraryObj arbitraryAlphaLabelBindings- , liftA2 ObjectDispatch arbitraryObj arbitraryAttr- , ObjectDispatch GlobalObject <$> arbitraryAttr- , pure ThisObject- , pure Termination+ arbitrary = sized $ \n ->+ frequency $+ concat+ [ if n <= 1+ then []+ else+ [ (n, Formation <$> arbitraryBindings)+ , (n, sizedLiftA2 Application arbitrary arbitraryAlphaLabelBindings)+ , (n, sizedLiftA2 ObjectDispatch arbitrary arbitrary)+ ]+ ,+ [ (1, ObjectDispatch GlobalObject <$> arbitrary)+ , (1, pure ThisObject)+ , (1, pure Termination) ]- else pure $ Formation []+ ] shrink = genericShrink data CriticalPair = CriticalPair@@ -121,7 +164,7 @@ _ -> error "IMPOSSIBLE HAPPENED" where fan = do- obj <- Formation . List.nubBy sameAttr <$> listOf arbitrary+ obj <- Formation . List.nubBy sameAttr <$> listOf' arbitrary return (obj, applyOneRule (defaultContext rules obj) obj) sameAttr (AlphaBinding attr1 _) (AlphaBinding attr2 _) = attr1 == attr2@@ -206,7 +249,6 @@ confluentCriticalPairN :: SearchLimits -> [NamedRule] -> CriticalPair -> Bool confluentCriticalPairN limits rules CriticalPair{..} =- -- should normalize the VTXs before checking -- NOTE: we are using intersectByLevelBy to ensure that we first check -- terms generated after one rule application, then include terms after two rules applications, etc. -- This helps find the confluence points without having to compute all terms up to depth N,@@ -234,9 +276,9 @@ confluent :: [NamedRule] -> Property confluent rulesFromYaml = withMaxSuccess 1_000 $- forAllShrink (resize 40 $ genCriticalPair rulesFromYaml) (shrinkCriticalPair rulesFromYaml) $+ forAllShrink (resize 100 $ genCriticalPair rulesFromYaml) (shrinkCriticalPair rulesFromYaml) $ \pair@CriticalPair{..} ->- within 100_000 $ -- 0.1 second timeout per test+ discardAfter 100_000 $ -- 0.1 second timeout per test (discard the test if it takes more than that) confluentCriticalPairN (defaultSearchLimits (objectSize sourceTerm)) rulesFromYaml pair confluentOnObject :: [NamedRule] -> Object -> Bool
+ test/Main.hs view
@@ -0,0 +1,8 @@+module Main where++import Main.Utf8+import Spec qualified+import Test.Hspec.Runner++main :: IO ()+main = withUtf8 $ hspecWith defaultConfig Spec.spec
test/Spec.hs view
@@ -1,1 +1,1 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover #-}+{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}
test/Test/EO/Phi.hs view
@@ -45,6 +45,7 @@ { name :: String , input :: Phi.Program , output :: DataizationResult+ , dependencies :: [FilePath] } deriving (Generic, FromJSON) data DataizationResult