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

fix: print program #131

Merged
merged 2 commits into from
Feb 21, 2024
Merged

fix: print program #131

merged 2 commits into from
Feb 21, 2024

Conversation

deemp
Copy link
Member

@deemp deemp commented Feb 16, 2024

Closes #108 and fixes printing without a --single flag.

stack run -- --single --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml program.phi

before:

⟦ a ↦ ξ.b (c ↦ ⟦ ⟧).d (ρ ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧ ⟧) ⟧

after:

{ ⟦ a ↦ ξ.b (c ↦ ⟦ ⟧).d (ρ ↦ ⟦ b ↦ ⟦ d ↦ ⟦ φ ↦ ξ.ρ.c, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧, c ↦ ∅, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧ ⟧) ⟧ }

stack run -- --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml program.phi

before:

Rule set based on Yegor's draft
Input:
{ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧, e ↦ ξ.b (c ↦ ⟦ ⟧).d ⟧.e ⟧ }
====================================================
Result 1 out of 1:
⟦ a ↦ ξ.b (c ↦ ⟦ ⟧).d (ρ ↦ ⟦ b ↦ ⟦ d ↦ ⟦ φ ↦ ξ.ρ.c, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧, c ↦ ∅, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧ ⟧) ⟧
----------------------------------------------------

after:

Rule set based on Yegor's draft
Input:
{ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧, e ↦ ξ.b (c ↦ ⟦ ⟧).d ⟧.e ⟧ }
====================================================
Result 1 out of 1:
{ ⟦ a ↦ ξ.b (c ↦ ⟦ ⟧).d (ρ ↦ ⟦ b ↦ ⟦ d ↦ ⟦ φ ↦ ξ.ρ.c, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧, c ↦ ∅, ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧ ⟧) ⟧ }
----------------------------------------------------

PR-Codex overview

This PR updates the CLI help message and refactors the printing logic in Main.hs.

Detailed summary

  • Updated CLI help message for a better description
  • Refactored printing logic for single normalized expression output
  • Improved error handling for empty results
  • Refactored printing logic for steps in the main function

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@deemp deemp linked an issue Feb 16, 2024 that may be closed by this pull request
1 task
@deemp deemp force-pushed the 108-fix-single-flag branch from a4c012c to b509326 Compare February 20, 2024 17:25
@fizruk fizruk merged commit a5378e7 into master Feb 21, 2024
5 checks passed
@fizruk fizruk deleted the 108-fix-single-flag branch February 21, 2024 14:39
@fizruk fizruk mentioned this pull request Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: single flag
2 participants