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

Example: Leftist heap implementation #2982

Merged
merged 4 commits into from
Jul 10, 2023
Merged

Conversation

tdardinier
Copy link
Member

This PR adds an example implementation of a leftist heap, parametric on a type with a total order (using an ad-hoc typeclass), and provides an interface for creating heaps, inserting elements, merging two heaps, extracting a minimum. The specifications use a list representation of the heap (e.g., the sorted list representation of the merge of two heaps is the normal merge of the list representations of the two heaps).

@mtzguido
Copy link
Member

Thanks Thibault, this looks good. Once we get a total order typeclass in ulib we could use it, but no need to block this.

@mtzguido mtzguido enabled auto-merge July 10, 2023 23:52
@mtzguido mtzguido merged commit 6f18f9c into FStarLang:master Jul 10, 2023
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.

2 participants