Skip to content

UnionFind monad#195

Draft
hsegoufin wants to merge 28 commits into
affeldt-aist:masterfrom
hsegoufin:UnionFindMonad
Draft

UnionFind monad#195
hsegoufin wants to merge 28 commits into
affeldt-aist:masterfrom
hsegoufin:UnionFindMonad

Conversation

@hsegoufin

Copy link
Copy Markdown

Interface for UnionFind as a monad and a draft of the model.

@affeldt-aist

Copy link
Copy Markdown
Owner

Please remove the file .DS_Store.

Comment thread theories/core/hierarchy.v Outdated
Require Import preamble.
From HB Require Import structures.


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please don't add blank lines.

Comment thread theories/core/hierarchy.v Outdated
End join_laws.
End JoinLaws.

HB.mixin Record isMonad (F : UU0 -> UU0) of Functor F := {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There is already a factory with the same name.

Comment thread theories/core/hierarchy.v
#[short(type=functor)]
HB.structure Definition Functor := {F of isFunctor F}.


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

Comment thread theories/core/hierarchy.v
Comment on lines +323 to +324


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +55 to +56


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +185 to +194
(*set u := union f x y.
rewrite find_equation; symmetry; rewrite find_equation.
case: (ltngtP (find f x) (find f y)) => xy.
- have Hx : is_root u (find f x) by exact/is_root_unionL/ltnW.
rewrite Hx /= /union' xy eqxx (ltn_eqF xy).
exact/find_root.
- have Hy : is_root u (find f y) by exact/is_root_unionR/ltnW.
rewrite Hy /= /union' xy ltnNge (ltnW xy) /= eqxx (ltn_eqF xy).
exact/esym/find_root.
- by rewrite /= /union' xy ltnn find_is_root.*)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this comment left intentionally?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need to comment, all this is wip.
Yes, it is intentional to compare different proof styles, but it will certainly not be in the final PR.

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.

4 participants