Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add R_DOT_ρ #468

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eo-phi-normalizer/test/eo/phi/dataization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ tests:
{⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.c ⟧.b ⟧.a , λ ⤍ Package ⟧}
output:
object: |
⟦ x ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ, ρ ↦ ⟦ ρ ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ ⟧, c ↦ ξ.ρ ⟧ ⟧, λ ⤍ Package ⟧
⟦ x ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ, ρ ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ ⟧ ⟧ ⟧, λ ⤍ Package ⟧

- name: "usage of Φ with a loop"
dependencies: []
Expand Down
17 changes: 17 additions & 0 deletions eo-phi-normalizer/test/eo/phi/rules/yegor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ rules:
- apply_in_abstract_subformations: false
- nf_inside_formation: '!b'
- nf: '⟦ !B ⟧'
- not_equal: ['!τ', 'ρ']
tests:
- name: Should match
input: ⟦ hello ↦ ⟦⟧ ⟧.hello
output: ['⟦ ρ ↦ ⟦ hello ↦ ⟦⟧ ⟧ ⟧']
- name: Shouldn't match
input: ⟦ ⟧.hello
output: []
- name: Shouldn't match
input: ⟦ ρ ↦ ⟦⟧ ⟧.ρ
output: []
- name: Should apply in subformations
input: ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ⟦⟧ ⟧ ⟧.b ⟧
output: ['⟦ a ↦ ⟦ c ↦ ⟦⟧, ρ ↦ ⟦ b ↦ ⟦ c ↦ ⟦⟧ ⟧ ⟧ ⟧ ⟧']
Expand All @@ -93,6 +97,19 @@ rules:
# input: ⟦ ⟧.hello
# output: []

- name: R_DOT_ρ
description: 'Accessing ρ-binding'
pattern: |
⟦ ρ ↦ !b, !B ⟧.ρ
result: |
!b
when:
- nf: '⟦ !B ⟧'
tests:
- name: Should match
input: ⟦ ρ ↦ ⟦ ⟧ ⟧.ρ
output: ['⟦ ⟧']

- name: R_COPY2
description: 'Application of α-binding'
# Warning: this is not correct for the chain variant because it only matches the first two bindings
Expand Down