From 90a6181db6505ec0d241432127a4bcd045a0317c Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Sat, 10 Feb 2024 18:05:47 +0300 Subject: [PATCH 1/2] Add rule 12 to Yegor's user-defined rules --- eo-phi-normalizer/test/eo/phi/rules/yegor.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/eo-phi-normalizer/test/eo/phi/rules/yegor.yaml b/eo-phi-normalizer/test/eo/phi/rules/yegor.yaml index c41b0c06a..47b8a6ed0 100644 --- a/eo-phi-normalizer/test/eo/phi/rules/yegor.yaml +++ b/eo-phi-normalizer/test/eo/phi/rules/yegor.yaml @@ -136,3 +136,20 @@ rules: input: '⟦ ρ ↦ ⟦ ⟧, σ ↦ ⟦ ⟧ ⟧.x' output: '⊥' matches: true + + - name: Rule 12 + description: 'Accessing an attribute on bottom' + pattern: | + ⊥.!a + result: | + ⊥ + when: [] + tests: + - name: 'Dispatch on bottom is bottom' + input: '⊥.a' + output: '⊥' + matches: true + - name: 'Dispatch on anything else is not touched' + input: '⟦ ⟧.a' + output: '⟦ ⟧.a' + matches: false From c248d6091fa0cdbf403a7f57300ca44d2cc0bd7f Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Sat, 10 Feb 2024 19:12:57 +0300 Subject: [PATCH 2/2] Add a case for matching Termination --- eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs b/eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs index 7437f8d60..4dab1a80c 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs +++ b/eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs @@ -240,6 +240,7 @@ matchObject (MetaObject m) obj = , bindingsMetas = [] , attributeMetas = [] } +matchObject Termination Termination = [emptySubst] matchObject _ _ = [] -- ? emptySubst ? matchBindings :: [Binding] -> [Binding] -> [Subst]