Skip to content

Commit

Permalink
Add an if guard in dsuFromInteractions
Browse files Browse the repository at this point in the history
  • Loading branch information
huynhtrankhanh committed Nov 16, 2024
1 parent ec1db89 commit 31f036c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion theories/DisjointSetUnionCode.v
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ Definition unite (dsu : list Slot) (a b : nat) :=
Fixpoint dsuFromInteractions (dsu : list Slot) (interactions : list (nat * nat)) :=
match interactions with
| [] => dsu
| (a, b)::tail => dsuFromInteractions (unite dsu a b) tail
| (a, b)::tail => if decide (a < length dsu /\ b < length dsu) then dsuFromInteractions (unite dsu a b) tail else dsuFromInteractions dsu tail
end.

Lemma pathCompressPreservesLength (dsu : list Slot) (n a b : nat) : length (pathCompress dsu n a b) = length dsu.
Expand Down

0 comments on commit 31f036c

Please sign in to comment.