From f2afef5b61d814ebf6c6ee8f3bc8eddf7f26e618 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Tue, 31 Dec 2024 13:26:38 +0300 Subject: [PATCH 1/2] fix(eo-phi-normalizer): use new.yaml by default --- eo-phi-normalizer/app/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo-phi-normalizer/app/Main.hs b/eo-phi-normalizer/app/Main.hs index 0342253e..74ce5347 100644 --- a/eo-phi-normalizer/app/Main.hs +++ b/eo-phi-normalizer/app/Main.hs @@ -276,7 +276,7 @@ data CommandParser = CommandParser } rulesFile :: String -rulesFile = "yegor.yaml" +rulesFile = "new.yaml" commandParser :: CommandParser commandParser = @@ -607,7 +607,7 @@ main = withCorrectLocale do -- Temporary hack while rules are not stabilized. -- Nothing -> return (True, "Yegor's rules (builtin)", [fastYegorInsideOutAsRule]) Nothing -> do - ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/yegor.yaml") + ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/new.yaml") return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules) unless (single || json || latex) $ logStrLn ruleSetTitle bindingsWithDeps <- case deepMergePrograms (program' : deps) of From e8ab3fd6b3e6d56dcd63edf889d1e37eda951a6b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 31 Dec 2024 10:31:44 +0000 Subject: [PATCH 2/2] chore(ci): Update Markdown files --- .../docs/src/eo-phi-normalizer/print-rules.md | 2 +- site/docs/src/eo-phi-normalizer/rewrite.md | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/site/docs/src/eo-phi-normalizer/print-rules.md b/site/docs/src/eo-phi-normalizer/print-rules.md index f5eeeed0..4ea3f1c7 100644 --- a/site/docs/src/eo-phi-normalizer/print-rules.md +++ b/site/docs/src/eo-phi-normalizer/print-rules.md @@ -16,7 +16,7 @@ Usage: eo-phi-normalizer print-rules [-c|--compact] [-r|--rules FILE] [--tex] Available options: -c,--compact Print rules, each on a single line. -r,--rules FILE FILE with user-defined rules. If unspecified, - yegor.yaml is rendered. + new.yaml is rendered. --tex Output LaTeX. -h,--help Show this help text ``` diff --git a/site/docs/src/eo-phi-normalizer/rewrite.md b/site/docs/src/eo-phi-normalizer/rewrite.md index 81b3906e..faeef9b7 100644 --- a/site/docs/src/eo-phi-normalizer/rewrite.md +++ b/site/docs/src/eo-phi-normalizer/rewrite.md @@ -147,17 +147,37 @@ eo-phi-normalizer rewrite --chain --tex bar.phi ``` ```tex -% Rule set based on Yegor's draft +% Rule set following Nov 2024 revision \documentclass{article} \usepackage{eolang} \begin{document} + +This is the 1st possible chain of normalizing rewritings: + +\begin{phiquation*} +[[ m -> [[ x -> [[ t -> [[ D> 42- ]] ]].t ]].x ]] \trans_{\rulename{DOT}} + \trans [[ m -> [[ x -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] ) ]].x ]] \trans_{\rulename{DOT}} + \trans [[ m -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] )( ^ -> [[ x -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] ) ]] ) ]] \trans_{\rulename{RHO}} + \trans [[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]]( )( ^ -> [[ x -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] ) ]] ) ]] \trans_{\rulename{DUP}} + \trans [[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]]( ^ -> [[ x -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] ) ]] ) ]] \trans_{\rulename{STAY}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]]( ) ]] \trans_{\rulename{DUP}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]] ]] \trans_{\rulename{NF}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]] ]]. +\end{phiquation*} + +This is the 2nd possible chain of normalizing rewritings: + \begin{phiquation*} [[ m -> [[ x -> [[ t -> [[ D> 42- ]] ]].t ]].x ]] \trans_{\rulename{DOT}} + \trans [[ m -> [[ x -> [[ D> 42- ]]( ^ -> [[ t -> [[ D> 42- ]] ]] ) ]].x ]] \trans_{\rulename{RHO}} + \trans [[ m -> [[ x -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]]( ) ]].x ]] \trans_{\rulename{DUP}} \trans [[ m -> [[ x -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]] ]].x ]] \trans_{\rulename{DOT}} - \trans [[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]] ]] \trans_{\rulename{NF}} - \trans [[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]] ]]. + \trans [[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]]( ^ -> [[ x -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]] ]] ) ]] \trans_{\rulename{STAY}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]]( ) ]] \trans_{\rulename{DUP}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]] ]] \trans_{\rulename{NF}} + \trans [[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]] ]]. \end{phiquation*} \end{document} @@ -232,14 +252,14 @@ eo-phi-normalizer rewrite --tex bar.phi ``` ```tex -% Rule set based on Yegor's draft +% Rule set following Nov 2024 revision \documentclass{article} \usepackage{eolang} \begin{document} \begin{phiquation*} -[[ m -> [[ D> 42-, ^ -> [[ t -> [[ D> 42- ]] ]] ]] ]] +[[ m -> [[ ^ -> [[ t -> [[ D> 42- ]] ]], D> 42- ]] ]] \end{phiquation*} \end{document}