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

feat(rules): add implication normalisation rules #597

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

niklasdewally
Copy link
Collaborator

@niklasdewally niklasdewally commented Jan 20, 2025

Adds the following normalisation rules for implication:

  • Contrapositive !p -> !q ~~> q->p where p,q are safe

  • Negation !(p -> q) ~~> p/\ !q where p->q is safe

  • Left distributivity: (r->p) -> (r->q) ~~> (r -> (p ~> q))

  • Import-export / uncurrying: p -> (q->r) ~~> (p/\q) -> r

Import-export has a lower priority of 8400 to allow distributivity to apply first.

For example, we want to do:

((r -> p) -> (r -> q)) ~> (r -> (p -> q))  [left-distributivity]
(r -> (p -> q)) ~> (r/\p) ~> q [uncurry]

not

((r->p) -> (r->q)) ~> ((r->p) /\ r) -> q) ~> [uncurry]

Adds the following normalisation rules for implication:

  + Contrapositive `!p -> !q ~~> q->p    where p,q are safe`

  + Negation `!(p -> q) ~~> p/\ !q    where p->q is safe`

  + Left distributivity: `(r->p) -> (r->q) ~~> (r -> (p ~> q))`

  + Import-export / uncurrying: `p -> (q->r) ~~> (p/\q) -> r`

Import-export has a lower priority of 8400 to allow distributivity to
apply first.

For example, we want to do:

```
((r -> p) -> (r -> q)) ~> (r -> (p -> q))  [left-distributivity]
(r -> (p -> q)) ~> (r/\p) ~> q [uncurry]
```

not

```
((r->p) -> (r->q)) ~> ((r->p) /\ r) -> q) ~> [uncurry]
```
@niklasdewally niklasdewally self-assigned this Jan 20, 2025
@niklasdewally
Copy link
Collaborator Author

niklasdewally commented Jan 20, 2025

Closes: #511

@niklasdewally niklasdewally linked an issue Jan 20, 2025 that may be closed by this pull request
6 tasks
@niklasdewally niklasdewally merged commit 970bbe5 into main Jan 20, 2025
14 checks passed
@niklasdewally niklasdewally deleted the nik/normalise-implies branch January 20, 2025 21:34
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.

Implement ->
2 participants