Commit Graph

1299 Commits

Author SHA1 Message Date
Neil Brown
16279f4d1d Added tests for the Divide item to the QuickCheck tests in ArrayUsageCheckTest 2008-02-09 20:12:30 +00:00
Neil Brown
41ab2d6bde Introduced scaling of Modulo and Divide items, and tweaked some of the parameters to make the tests a little shorter 2008-02-09 17:23:49 +00:00
Neil Brown
25be01cb47 Added a coefficient for modulo and divide items 2008-02-09 15:08:10 +00:00
Neil Brown
c6b384d5d6 A large change, introducing tags for modulo items during array usage checking so that they can be accurately tested 2008-02-09 14:52:07 +00:00
Neil Brown
534fbd8db1 Added a new helper function to Utils, and corrected a comment too 2008-02-09 14:50:56 +00:00
Neil Brown
d0b94e402c Added (constant divisor, for now) modulo to the QuickCheck tests in ArrayUsageCheckTest 2008-02-09 11:36:37 +00:00
Neil Brown
7fbb83a813 Fiddled with the types of genNewItem and similar functions, ready to support compound expressions in the QuickCheck tests 2008-02-09 02:01:01 +00:00
Neil Brown
1a89fdd218 Refactored the multiplying out in ArrayUsageCheck slightly 2008-02-09 01:58:34 +00:00
Neil Brown
cbd4a98ad5 Improved the error message when an array usage check test fails 2008-02-09 01:55:07 +00:00
Neil Brown
842b6b7788 Simplified the QuickCheck test in ArrayUsageCheckTest 2008-02-09 00:57:01 +00:00
Neil Brown
618ac31ae2 Added a QuickCheck test for makeEquations 2008-02-09 00:20:20 +00:00
Neil Brown
2343110311 Refactored some of ArrayUsageCheckTest, simplified it a little and corrected a bug in the test framework
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.
2008-02-08 23:58:28 +00:00
Neil Brown
38002bf9a8 Added another array usage check test 2008-02-08 23:56:59 +00:00
Neil Brown
73f16267a9 Moved flattenParItems to UsageCheckUtils and added a couple of deriving (Show) clauses 2008-02-08 23:53:17 +00:00
Neil Brown
71915494a6 Added a test for multiplied variables 2008-02-08 23:49:20 +00:00
Neil Brown
914e9c3d71 Added a new test framework, based on simple monads, to allow easy unification of HUnit and QuickCheck tests with the minimum of work 2008-02-08 16:56:32 +00:00
Neil Brown
5bc57689f8 Tweaked some tests so that they are now correct 2008-02-08 14:03:45 +00:00
Neil Brown
64d7b35cfe Changed all the usage check passes to use CSMR, and thus changed usageCheckPass to be a PassR rather than Pass 2008-02-08 13:43:28 +00:00
Neil Brown
cc29010103 Fixed some more monomorphism restriction warnings in GenerateCTest 2008-02-08 13:35:04 +00:00
Neil Brown
b037b6a8ca Tidied up the new code relating to warnings, and moved it all into the Errors module (out of CompState and Pass) 2008-02-08 13:31:37 +00:00
Neil Brown
f17ff5071c Added a Warn monad for warnings, and incorporated a WriterT monad into the PassM stack to support the Warn monad, then changed all the rest of the code accordingly, including adding a Warn instance for the GenParser parser that hides it in the state 2008-02-08 13:22:23 +00:00
Neil Brown
95cdb39789 Generalised the type of the monad for the excludeConstr function, and correspondingly the functions that use it 2008-02-08 11:33:19 +00:00
Neil Brown
035c526bef Changed the TLP and PrettyShow modules to use CSMR instead of CSM 2008-02-08 11:29:09 +00:00
Neil Brown
c56cc6022a Switched everything in the EvalConstants module to use CSMR rather than CSM 2008-02-08 11:26:35 +00:00
Neil Brown
a3ebd96a86 Changed all the functions in the EvalLiterals, Types and ShowCode modules to use CSMR (instead of CSM) 2008-02-08 11:24:37 +00:00
Neil Brown
5f0eea493e Switched all the appropriate functions in CompState from CSM to CSMR 2008-02-08 11:24:16 +00:00
Neil Brown
de81b0e81c Added a version of PassM that only requires read access to the state (i.e. needs CSMR) called PassMR 2008-02-08 11:21:42 +00:00
Neil Brown
e3e9e912f2 Added a read-only version of CSM, named CSMR 2008-02-08 11:17:50 +00:00
Neil Brown
750612629b Corrected a bug caused by making Structured parameterised, where removeNesting only descended into Structureds the same type as the outer-most Structured (typically A.AST) 2008-02-08 12:11:35 +00:00
Neil Brown
e0d6c5eb08 Fixed the monomorphism restriction warnings in GenerateCTest 2008-02-08 01:11:20 +00:00
Neil Brown
7e7625385d Pulled out various types and definitions from GenerateC into a common module, GenerateCBased 2008-02-08 01:08:42 +00:00
Neil Brown
a143fb75ef Changed all the C/C++ backend functions to stop passing round GenOps everywhere; they now all properly pull it from the monad 2008-02-08 01:01:44 +00:00
Neil Brown
df832b450d Changed the C/C++ backends to read GenOps from a reader-monad rather than passing the ops around (rough draft) 2008-02-08 00:33:44 +00:00
Neil Brown
ecf4ceee35 Fixed the calculation of the upper bound for replicators that feature in the background knowledge 2008-02-07 18:02:20 +00:00
Neil Brown
0427c00859 Fixed the calculation of the upper bound on replicators (from + for - 1, not simply for) for directly relevant replicators 2008-02-07 18:01:13 +00:00
Neil Brown
66cb9b0bc0 Added a lot of comments to the functions at the top of the ArrayUsageCheck module 2008-02-07 17:56:42 +00:00
Neil Brown
e379710bbd Corrected a change that was accidentally recorded, switching primes for ats 2008-02-07 15:42:50 +00:00
Neil Brown
03ef5d23ba A patch recording the fix for modulo in replication that got the test passing, that properly detects whether a replicated variable is featured anywhere in the problem 2008-02-07 15:37:56 +00:00
Neil Brown
f82b6cf6a7 Finished writing the long test for replicated modulo, which seems to pass 2008-02-07 15:35:39 +00:00
Neil Brown
32959ad3a3 Fixed a part of ArrayUsageCheck to make sure it generates valid arrays 2008-02-07 00:25:30 +00:00
Neil Brown
96c948bd6e Simplified the setIndexVar/setIndexVar' functions and changed them to handle Modulo and Divide 2008-02-07 00:24:11 +00:00
Neil Brown
af0160e4fe Added a test to show up a bug in handling replicator from/for values 2008-02-07 00:23:08 +00:00
Neil Brown
4cb02c4c71 Added lots more checks in ArrayUsageCheckTest that aim to produce a useful message when a usage check is failing 2008-02-06 23:55:25 +00:00
Neil Brown
74d5bc675d Shorted the definition of generateMapping in ArrayUsageCheckTest 2008-02-06 23:55:01 +00:00
Neil Brown
4299951511 Moved the makeSize function from ArrayUsageCheck into Utils 2008-02-06 23:49:17 +00:00
Neil Brown
ba04340989 Changed the ArrayUsageCheckTest framework to give you a test failure (rather than an unhelpful Haskell error) when translateEquations fails to result in a valid array 2008-02-06 23:27:59 +00:00
Neil Brown
1ec341f671 Added another warning flag, -fwarn-incomplete-record-updates 2008-02-05 23:13:27 +00:00
Neil Brown
1fd85fbe51 Added the -fwarn-missing-signatures option and added all missing type signatures for non-test modules (and most for test modules too) 2008-02-05 23:06:03 +00:00
Neil Brown
3cb4e80749 Fixed a monomorphism restriction warning in the Unnest module 2008-02-05 22:53:37 +00:00
Neil Brown
caa0ddd2f9 Fixed a mistake in Makefile.am where one of the lines was not properly added to CompilerCommands 2008-02-05 22:47:59 +00:00