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 symmetric and transitive closure relations #2960

Merged
merged 1 commit into from
May 8, 2023

Conversation

madman-bob
Copy link
Collaborator

Add SymClosure and TransClosure relations, which take the symmetric and transitive closures of a given relation.

public export
data TransClosure : Rel ty -> ty -> ty -> Type where
Nil : TransClosure rel x x
(::) : {x, y, z : ty} -> rel x y -> TransClosure rel y z -> TransClosure rel x z
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you only need y : ty, the others can be runtime irrelevant because they're determined by the endpoints which can be made runtime-relevant if need be.

@gallais gallais merged commit 9bfa049 into idris-lang:main May 8, 2023
19 checks passed
@madman-bob madman-bob deleted the trans-closure branch May 8, 2023 10:54
buzden added a commit to buzden/idris2-coop that referenced this pull request May 10, 2023
buzden added a commit to buzden/Idris2 that referenced this pull request May 10, 2023
buzden added a commit to buzden/idris2-coop that referenced this pull request May 10, 2023
buzden added a commit to buzden/idris2-coop that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants