Skip to content

Fractional (1.5) fixity for Relation.Nullary.¬_ #1999

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

Closed
wants to merge 2 commits into from

Conversation

Saransh-cpp
Copy link
Contributor

Fixes #1635

This PR adds a fractional (1.5) fixity for Relation.Nullary.¬_, discussed as a possible solution to the issue in the thread.

Following the experiment of @jamesmckinna, I decided to put ¬ at level 1.5, and it did break Data.Fin.Properties.¬∀⟶∃¬-smallest (similar to setting it to 2) and Data.List.Relation.Binary.Sublist.Setoid._⊂_ (I'm not sure why here, _×_ and ¬_ have different fixities).

Adding brackets - (¬ P i) and × (¬ (xs ≋ ys)) - worked and now ¬ is not at the same level as Σ and _×_. Using ¬ ∃[ A ] B without any brackets works for me, but it would be nice if someone could check this on their end too. I'd also be happy to close this PR if everyone decides not to add the fractional fixity.

@MatthewDaggitt
Copy link
Contributor

@Saransh-cpp thanks for the PR! As this is a breaking change, we definitely need a CHANGELOG entry. Otherwise it looks good.

@gallais
Copy link
Member

gallais commented Jul 29, 2023

What's the reasoning behind this? It does not seem to be shedding any parens
and actually forces us to introduce more. Is there really a need for this change?

@Saransh-cpp
Copy link
Contributor Author

After this PR, the users won't need parens with ¬ and ∃-syntax - ¬ ∃[ A ] B would work fine (parens are required right now - ¬ (∃[ A ] B) - should work the same for Σ-syntax as well).

But, changing the fixity of negation brings out some conflicts with ×'s fixity. Its like this PR fixes one parens problem, but adds another minor parens problem, and I am not sure how to deal with that. I'll be happy to make edits to the CHANGELOG or close this.

@MatthewDaggitt
Copy link
Contributor

Thanks for raising it @gallais! Yup, given the discussion in #1635 I think the solution proposed there of adding special syntax for negated existentials is a better way of fixing of the problem.

Therefore I'm closing this PR. Thanks for exploring it @Saransh-cpp !

@Saransh-cpp Saransh-cpp deleted the negation-fixity-fix branch August 11, 2023 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking library-design status: won't-merge Decided against merging the PR in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Precedence of negation and sigma/exists syntax
3 participants