Tidy-ups resulting from code review due to looking at codebase after a long absence.
Have also increased the degree of checking on the tests for the test case enumerable factories. This hasn't exposed any new bugs, but gives greater peace of mind.
Correct all tests that have sloppy (albeit correct) logic that allows generated partial test vectors to have test variable indices that breach the test-wide limit.
This is OK for the time being, because the tests don't care about the limit from the point of view of checking assertions, however this will change when test cases are produced incrementally, so in goes this fix.
Introduce extra state in 'MergedPartialTestVectorRepresentations' that tracks the overall number of test variables. We will need this later to detect full test vectors.

--HG--
branch : IncrementalTestCaseEnumeration
extra : rebase_source : 461a625eafa3a9f8d3cc163c942d00b0137778f0
Have modified the API on 'MergedPartialTestVectorRepresentations' to allow early retrieval of full test vectors when calling 'MergeOrAdd'. Although the API has changed, the early retrieval functionality is not implemented, so all test vectors are still being reported via subsequent enumeration.
This breaks a unit test in debug mode due to a tail-recursive function blowing the stack when it is compiled in the 'Debug' configuration - will fix this soon.

--HG--
branch : IncrementalTestCaseEnumeration
Fixed stack-overflow problem in test 'TestThatDuplicatedLevelValuesAreTreatedAsDistinctWhenMakingTestCases' - now using a nasty but fortunately encapsulated piece of mutable local state when merging partial test vectors.

--HG--
branch : IncrementalTestCaseEnumeration
Bolstered tests for 'MergedPartialTestVectorRepresentations' to check that full test vectors access early during merge / addition are not provided later when enumerating over the merged data structure.

--HG--
branch : IncrementalTestCaseEnumeration
Added in more internal assertion checking to make sure that test variable indices stay within the permitted range when merge-and-removing a partial test vector.
This is groundwork for the following commit, where the implementation will detect a full test vector during the merge-and-remove.

--HG--
branch : IncrementalTestCaseEnumeration
Have added in checks on the test variable indices into the invariant checking logic, also switched on postcondition checking for the 'merge-and-remove' step and switched on invariant checking for 1 out of 10 cases on average.
Will disable the postcondition and invariant checks soon after; for now, this is just for while working on incremental test case enumeration.

--HG--
branch : IncrementalTestCaseEnumeration
Changed representation of initial empty state for 'MergedPartialTestVectorRepresentations', to simplify the invariant and internal assertions.

--HG--
branch : IncrementalTestCaseEnumeration
Squashed commit - implemented incremental generation of test vectors using a new 'early-access for full test vectors' modification of the API for 'MergedPartialTestVectorRepresentations': this now reports back all completely full test vectors as it merges / adds partial test vectors in. Any vectors left that are not completely filled are then accessed via the old enumeration API, which has been modified to either include the full test vectors (same as the old behaviour) or only enumerate the remaining partial test vectors not yielded by the early access API. Various tests for 'MergedPartialTestVectorRepresentations' have been either toughed up with more expectations / test data generation or had some bug-fixing done to their logic. There have also been some cleanups to the code and some more internal assertion checking / strengthening of invariants for 'MergedPartialTestVectorRepresentations'.

This passes all tests, but the code sequence for test vector removal duing merging requires a bit of cleanup via continuations and the suppression of full test vectors during final enumeration could be made much more efficient to good effect.

Patch comments:-

Remove invariant check.
* * *
imported patch DetectingAndProducingFullTestVectorsIncrementally.diff
* * *
BetterDetectionOfFullTestVectors.diff
* * *
... but also revealing them early on. Next stop is to detect the stored ones as being full when doing final traversal.
* * *
Now suppressing any full test vectors present in a 'MergedPartialTestVectorRepresentations' that have already been yielded back to the client while calling 'MergeOrAdd'.
Also had to modify test expectations to take into account that full test vectors now disappear from the enumeration of a 'MergedPartialTestVectorRepresentations'.
This breaks a test and there are known problems with the implementation at time of commit - there is unnecessary padding of merged test vectors with trailing wildcard nodes, and the code for suppressing full test vectors during enumeration can also suppress suffices of full test vectors.
* * *
Toughen up the test to flush out a known problem seen when hacking around with a test earlier. Now rewarded by expected failure. More test toughening to come...
* * *
Forcing more test failures....
* * *
Make sure that filling out a partial test vector with indeterminate entries does not pad out with indeterminates at the end.
* * *
Fix bug in detecting full test vectors while enumerating.
* * *
Sensible and conservative detection of full test vectors - only I can't do anything about it yet during a 'merge-and-remove'. Ugh.
* * *
Ugly, but effective, hack that now ensures that full test vectors are only reported once via the early access API.
* * *
Correct bug in test expectations noted during review - test still fails, but now I know it is because of a genuine bug in the code under test.
* * *
Tidy-up - no change in behaviour, still have bug to fix.
* * *
Fix for failing unit test - was confusing the detection of full test vectors presented to 'MergeOrAdd' with the filling out of the indeterminate entries in the vector up to the last determinate test variable.

--HG--
branch : IncrementalTestCaseEnumeration
Toughened up unit tests for 'MergedPartialTestVectorRepresentations' some more.

--HG--
branch : IncrementalTestCaseEnumeration
Refactoring to use parameter object to keep track of tramp data passed down through recursive tree traversal.

--HG--
branch : IncrementalTestCaseEnumeration
Tidy up context data initialisation.

--HG--
branch : IncrementalTestCaseEnumeration
Removal of lifted lambdas, this is to make it easier to introduce continuations side-by-side with search contexts later on.

--HG--
branch : IncrementalTestCaseEnumeration
An orgy of continuation passing is now in place: this removes the old three-way return value logic when merge-and-removing a partial test vector.
I seem to have traded the nasty three-way logic and horrible option workflows for some equally horrible continuation passing logic.
This also causes stack overflows when running the unit tests for 'MergedPartialTestVectorRepresentations' in debug mode, because the continuation rely heavily on tail-call optimisation, which is disabled in debug builds.
Needs more work...

--HG--
branch : IncrementalTestCaseEnumeration
Switch on tail-call optimisation in debug builds for 'MergedPartialTestVectorRepresentations' - otherwise the stack overflows when running tests on a debug build.

--HG--
branch : IncrementalTestCaseEnumeration
Add in a continuation monad with monad-plus semantics - the zero value starts a failure condition, the '+' operator either uses the lhs value on success, or goes to the rhs value on failure - or fails overall if that doesn't work.

--HG--
branch : IncrementalTestCaseEnumeration
extra : rebase_source : 79263998c230801d8b3ae7bdf52d72f3d3e99d93
Tidy up calculation of maximum strength - used to use Power Collections to do this, now using the base F# modules.

--HG--
branch : IncrementalTestCaseEnumeration
Remove unnecessary conversion of sequence to list: this helps (but is not enough in itself) to get incremental generation of full test vectors.

--HG--
branch : IncrementalTestCaseEnumeration
Invert the order of iteration through partial test vectors - instead of having the choice of combination of test variables as the outer loop and the cross product of these variables as the inner loop, invert this nesting.
The idea is to see whether this will cause earlier merging of partial test vectors into full ones, which will support incremental generation of test cases.

--HG--
branch : IncrementalTestCaseEnumeration