Most of this is trivial -- e.g. getting rid of dummy definitions of
coarbitrary, which is a separate typeclass in QC2, and changing the
parameter specs to use the new Args type.
The chunk of code that runs a QC test as an HUnit test is now quite a
bit simpler because QC's top-level interface returns a result. However,
this means that some gymnastics are required to get at the right
definition of Result in different places -- QC2 has two different types
called Result, and we use both for different jobs!
For some reason, the usage check tests are now very slow to run (perhaps because of all the operator definitions added to each one?), which needs further investigation.
This allows us to check situations like this:
PAR i = 0 FOR 10
IF
i = 0
a[10] := 3
TRUE
a[i] := 3
Previously this would have been flagged unsafe (because 10 can overlap with 10 between the replicated branches).
But with this change, the equations on the replicators (including: i'>=i+1, i = 0, i' = 0) are included alongside 10=10, so there is no solution over all because the replicator equations prevent a solution (i.e. the 10 can't be used twice in parallel).
All the passes now have their information (name, pre-requisites and post- properties) stored at the point where the pass is declared, which means the pass lists are just a simple list of pass functions.
The main consequence of this change was that the tests had to be changed. Now, instead of taking a "pass applied to data" item (type: PassM b), they take both the pass (type: Pass) and source data (type: b), and apply them later. This was the decision that involved the simplest changes to the existing tests (simply unbracketing the application of the pass to the source). I also had to include a few old-style versions though (testPass', testPassShouldFail') for where the functions were being used to test things that weren't actually passes (mainly StructureOccam).
Fixes#48
Previously, the assertEquivalentProblems function and functions used by it dealt with results inside Maybe, sometimes then inside IO. These functions have been migrated to the new TestMonad. Instead of using Maybe, any problems with the test are dealt with by failing the test instead.
The assertEquivalentProblems function used to take a list of labelled expressions for comparison purposes. Now that we have an ordering on the AST, this is pointless. Instead we can directly sort the lists by the expressions involved. This simplifies the code a little.
Finally, a bug has been fixed. The mapping between expected and actual columns in the swapColumns' function of translateEquations was being used as a backward mapping, even though it was in fact a forward mapping. So that has also been corrected.