Commit Graph

1278 Commits

Author SHA1 Message Date
Neil Brown
5cb964092d Added a new module full of properties about the AST, most now with associated validity checks 2008-02-19 09:49:05 +00:00
Neil Brown
2e6718ac50 Changed all the lists of passes to add pre- and post- properties 2008-02-19 09:43:40 +00:00
Neil Brown
859a6286ac Added functions to PassList that build a dependency graph from a list of properties (based on their pre- and post- properties) and use it to return an ordered pass list 2008-02-19 09:43:16 +00:00
Neil Brown
79f67d577f Added functions that allow you to specify the pre- and post- properties for a pass 2008-02-19 09:37:20 +00:00
Neil Brown
2bbcd4ec9a Added Eq and Ord instances for the Pass_ data structure (going solely by pass name) 2008-02-19 09:36:41 +00:00
Neil Brown
360abc195e Moved the enabling/disabling of passes based on CompState from PassList to the point of the declaration of the passes 2008-02-16 11:09:25 +00:00
Neil Brown
3ce0eaf452 Made the first adjustment to the Pass system, ready to introduce properties and a dependency graph. For now passes are still executed in list order 2008-02-16 10:19:14 +00:00
Neil Brown
21a3619d81 Turned division by variables into a non-special expression rather than rejecting it straight out 2008-02-11 15:20:36 +00:00
Neil Brown
cfac57ea88 Added support for modulo and divide items that are multiplied by another variable (during equation flattening) 2008-02-11 14:59:01 +00:00
Neil Brown
c23c575f73 Added some more testcases for array usage checking that involve complicated expressions 2008-02-11 14:40:28 +00:00
Neil Brown
2ea7e15570 Changed the QuickCheck tests to test multiplied variables more thoroughly 2008-02-11 14:26:55 +00:00
Neil Brown
fdb2e8d45d Printed out more information when generateMapping fails (keys to VarMap not matching) 2008-02-11 12:02:20 +00:00
Neil Brown
04be245677 Adjusted the printing out of FlattenedExp; useful on test failure 2008-02-11 11:31:20 +00:00
Neil Brown
9cb191b64c Corrected some bugs related to constant-divisor modulo, especially with negative divisor 2008-02-11 11:05:01 +00:00
Neil Brown
f403a90ccf Adjusted the ArrayUsageCheckTest QuickCheck tests to allow expressions in the top and bottom of modulo, and the top of divides 2008-02-11 11:03:32 +00:00
Neil Brown
b83acaf7c5 Corrected a few comments in ArrayUsageCheckTest 2008-02-11 10:17:27 +00:00
Neil Brown
e76ab116cb Simplified the definition of mkPattern slightly 2008-02-15 17:16:20 +00:00
Neil Brown
cd6e2175f2 Added a new "dump AST" pass 2008-02-14 12:45:11 +00:00
Neil Brown
63af1381f2 Reordered the pass list so that the usage checking happens earlier 2008-02-11 01:16:27 +00:00
Neil Brown
1151fab5ad Changed the error reporting so that we at least print the meta tag if we can't open the file to find the line 2008-02-11 01:15:56 +00:00
Neil Brown
3b9d75d488 Passed the correct meta tags to the die call when unsafe parallel usage is found 2008-02-11 01:15:25 +00:00
Neil Brown
c3353d6025 Changed the uninitialised-variables notification from a fatal error down to a warning 2008-02-11 00:56:10 +00:00
Neil Brown
18cf66944a Modified the array usage checking to treat any unknown expressions (function calls, etc) like variables were treated before 2008-02-10 23:58:32 +00:00
Neil Brown
57833f7f26 Fixed the broken QuickCheck tests for node replacement 2008-02-10 21:21:03 +00:00
Neil Brown
94d9fedd0e Tweaked some of the probabilities in the ArrayUsageCheckTest QuickCheck tests 2008-02-10 21:20:30 +00:00
Neil Brown
5e87aa1e73 Refactored the way the flow-graph building handles the different Structured items, and tweaked some tests accordingly 2008-02-10 20:07:02 +00:00
Neil Brown
c4b7bd1745 Implemented handling of replicated IFs in flow-graphs 2008-02-10 15:16:46 +00:00
Neil Brown
df8f9429e0 Added some tests for building flow-graphs based on replicated IFs 2008-02-10 15:16:30 +00:00
Neil Brown
1ba2925b7a Added proper support for the Divide item in the array usage checking 2008-02-09 20:12:52 +00:00
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