Open hummy123 opened 1 year ago
Checking.
I think all of these are good suggestions and appreciate your rigorous standards. I'll have them implemented in the next few days hopefully.
Hi @gdziadkiewicz and thanks again for the feedback. (I personally think it's easier to reply "here" rather than you jumping up/down the page navigating to different comments, but let me know if you prefer the other way of individual threads.)
AaTree.ofList/Array/Seq
), which I understand over the for loop that iterates over the input list and asserts AaTree.exists
for each of them.
Expect.containsAll
we would need to use AaTree.toList/Array/Seq
to build a list from the tree first. ofList
with toList
) is something I should worry about, but happy to make use of it in the test if asked (we have conversion toList/Array/Seq
methods that build a list with of
and check the output with to
, so I think in that case we would be collapsing the conversion to/from tests since their logic would be exactly the same.toSeq
as suggested, but the :>
cast is still there (get a type inference error which I'm not sure how to solve in an OOP-style definition).Seq
uences in F# (kind of new to the language/FP in general), so I don't feel confident writing a lazy toSeq
implementation but I think it's a good idea. Happy to replace the current impplementation with your code (although I can't write test for a lazy function because of my inexperience with them).open
for Expecto.Flip
as suggested and have the tests running successfully.
I reviewed my code and compared it with the paper (and also with the Isabelle HOL proof linked below which corrects the paper in a couple of places) and made some changes.
Summary of my mistakes (now fixed):
adjust
function when deleting the left child when it should call the function in all cases (less than, greater than, equal).Summary of changes from the proof (corrects errors in the paper, and corrections now implemented in code):
dellrg
which the proof calls split_max
recursed the left subtree in the original but is meant to recurse the right sutree.nlvl
helper function.Isabelle HOL proof for reference: https://isabelle.in.tum.de/library/HOL/HOL-Data_Structures/AA_Set.html .
@hummy123 the CI build is failing due to problems with code formatting. Could you resolve that?
@gdziadkiewicz Got it working thanks to your help (haven't used FAKE/GitHub actions much before).
Here's the action running successfully on my own fork: https://github.com/hummy123/FSharpx.Collections/actions/runs/3841007372/jobs/6540731078 .
(Also updated FAKE as it was giving me errors.)
@hummy123 I'm sorry that I'm not able to work on it quicker. Would you mind if I add some property tests to your code and change the toSeq
implementation to the one I proposed?
@gdziadkiewicz No worries - appreciate your time. Anything that makes the code better and tests more resilient sounds good to me, so go ahead.
I wasn't able to run the test in this repository as I don't have .NET 6.0.401 SDK installed (only a version matching .NET 7), but I don't expect anything to break since it was just mostly a copy-paste from my other repository.
Appreciate the time taken in reviewing this.