Commit Graph

217 Commits

Author SHA1 Message Date
Neil Brown
741a01de5a Removed various tab characters and replaced them with spaces 2008-01-26 19:38:24 +00:00
Neil Brown
ff37613498 Fixed the code so that each PAR groups properly (by edge identifier) but the tests still fail 2008-01-25 18:12:32 +00:00
Neil Brown
8a39eb597c Removed an old comment in ArrayUsageCheck 2008-01-25 17:54:35 +00:00
Neil Brown
90bc9b7033 Implemented checkPar using a graph search, and removed the need for giving it a start node 2008-01-25 17:36:16 +00:00
Neil Brown
f46cabdb22 Cannibalised code from the RainUsageCheck module to implement the labelling functions in the UsageCheck module 2008-01-25 16:34:54 +00:00
Neil Brown
64a9292b75 Moved customVarCompare from ArrayUsageCheck to UsageCheck and used it to derive Ord for the Var type 2008-01-25 16:34:18 +00:00
Neil Brown
c2c761ab7d Added an export list to the UsageCheck module 2008-01-25 16:33:57 +00:00
Neil Brown
178af1ca24 Changed the array usage checking to distinguish between read-from and written-to indexes, while also beginning to overhaul the system to make a more general usage-checking framework that operates on the control flow graph 2008-01-25 16:17:17 +00:00
Neil Brown
10493717aa Added tests with multi-dimensional arrays 2008-01-25 16:16:16 +00:00
Neil Brown
330405f983 Added more usage-checking tests 2008-01-25 11:50:57 +00:00
Neil Brown
0d6e06607b Added a couple more tests 2008-01-25 11:19:58 +00:00
Neil Brown
6f4146a4f3 Altered the name of the exported ArrayUsageCheckTest function to match the new convention 2008-01-23 13:59:38 +00:00
Neil Brown
dc0d9b16d4 Altered the array usage checker to deal with replication properly, and pass the makeEquations test 2008-01-22 22:16:16 +00:00
Neil Brown
0dd6a852bd Altered the other two tests according to the new way replicated variables are handled 2008-01-22 22:08:01 +00:00
Neil Brown
b6912651db Added sorting of problems to make comparing two problem lists straightforward (for testing the array usage checker) 2008-01-22 21:47:21 +00:00
Neil Brown
fca070e1bc Changed the way replicated variables are handled and altered one of the tests accordingly 2008-01-20 17:02:05 +00:00
Neil Brown
01783071a8 Added a large chunk of documentation about replicated variables and cleaned up the squareAndPair function to remove an unused portion of the arguments 2008-01-20 15:31:23 +00:00
Neil Brown
bc820e87ce Fixed the bounds for replicated variables; two of the three tests now pass 2008-01-20 15:01:45 +00:00
Neil Brown
c0105b1491 Put a scheme in place for adding replicated variable bounds, but it is incorrect 2008-01-20 14:34:56 +00:00
Neil Brown
0e35f5cd38 Changed ArrayUsageCheck to only insert the one inequality between the two versions of a replicated variable, but now missing the replication-bounds on both 2008-01-19 15:40:57 +00:00
Neil Brown
fb0d2fe6a2 Changed test 200 in ArrayUsageCheckTest to match the new arrangement I have in mind 2008-01-19 15:38:13 +00:00
Neil Brown
ed8033833b Added the code and tests for forming problems involving replication, but currently one of the two (or both) is buggy 2008-01-16 19:31:56 +00:00
Neil Brown
663cbaeaa1 Added support to the squareAndPair function for adding in extra inequalities 2008-01-16 19:23:58 +00:00
Neil Brown
ee102c10a3 Moved makeSize to the top-level of ArrayUsageCheck 2008-01-16 18:41:02 +00:00
Neil Brown
312719088a Added a helper function to ArrayUsageCheck 2008-01-16 18:40:21 +00:00
Neil Brown
fde2d8dc17 Changed the assertEquivalentProblems so that the sizes are displayed alongside the zipped lists 2008-01-16 16:25:57 +00:00
Neil Brown
2edeb1bb7b Added a new helper function in ArrayUsageCheck 2008-01-16 15:34:42 +00:00
Neil Brown
ec804649e8 Moved lots of functions to the top-level in ArrayUsageCheck 2008-01-16 15:34:03 +00:00
Neil Brown
6e28d3e3db Moved the flatten function to the top level of the ArrayUsageCheck module 2008-01-16 15:09:26 +00:00
Neil Brown
5f2158531b Added an export list to the ArrayUsageCheck module 2008-01-16 12:57:05 +00:00
Neil Brown
143c3b1994 Split out the ArrayUsageCheck module into ArrayUsageCheck (for formulating problems from code) and Omega (just the Omega Test) 2008-01-16 12:53:17 +00:00
Neil Brown
6d45352819 Added support for distinct versions of the same variable, ready to support replication 2008-01-16 12:43:39 +00:00
Neil Brown
af130291fc Added some tests for replicated indexes in parallel 2008-01-16 12:14:09 +00:00
Neil Brown
bc2ffc59be Corrected the bounds checking so that (size - 1) is used as the maximum index (not size, as before) 2008-01-16 11:52:32 +00:00
Neil Brown
0df68e53e5 Moved addConstant to the top level of ArrayUsageCheck 2008-01-16 11:52:11 +00:00
Neil Brown
0e57c7af55 Removed a piece of dead code from ArrayUsageCheck 2008-01-16 11:51:54 +00:00
Neil Brown
4b0d29d987 Added support for actually bounds-checking the array based on its declared size 2008-01-16 11:47:54 +00:00
Neil Brown
183e68ee59 Corrected the display of variables relating to REM 2008-01-16 11:34:56 +00:00
Neil Brown
a14a866502 Changed the test harness to get some tests inside the IO monad. This allows all the tests to be run, not just until the first failure 2008-01-16 11:15:05 +00:00
Neil Brown
90fb5e2182 Fixed a bug where multiple problems would be deemed safe as long as one didn't have a solution (as opposed to all not having solutions) 2008-01-16 10:52:51 +00:00
Neil Brown
b5606eb7a9 Tidied up the error messages given when the array usage checker finds a problem 2008-01-16 03:37:53 +00:00
Neil Brown
1c0434cc47 Corrected a small omission in the cases for testing array indices (if there are no problems to work with) 2008-01-16 03:29:13 +00:00
Neil Brown
b3216c4870 Added a test-source-file for testing the array usage checker, and added it to the appropriate test list 2008-01-16 03:28:26 +00:00
Neil Brown
64a9fcf2dd Added the functionality for variable divisors with REM 2008-01-16 01:49:02 +00:00
Neil Brown
bd998a5b95 Added a test for REM with a variable divisor 2008-01-16 01:48:39 +00:00
Neil Brown
612893bd0c Corrected a bug from using zip where an "actual" list of size N would only match the first N elements of the expected, even if expected had more than N items 2008-01-16 00:39:05 +00:00
Neil Brown
f7503ac58c Added a further test involving two REM operations (both still with constant divisors) 2008-01-15 21:22:46 +00:00
Neil Brown
43d0098f99 Added another test for formulating a problem involving the REM operator 2008-01-15 19:14:34 +00:00
Neil Brown
a00b1ea602 Fixed the existing test for modulo items (it now also passes) 2008-01-15 18:50:22 +00:00
Neil Brown
3e674e3773 Fixed the pairing of indices so that two parts of a modulo triplicate-possibility are never paired with each other, and removed the filtering of all-zero equations (primarily to aid in the testing) 2008-01-15 18:48:00 +00:00
Neil Brown
bc7c5072b8 Fixed the display of equations such as 0 = 0 after test failure 2008-01-15 18:47:28 +00:00
Neil Brown
2cb0610d83 Added custom, much more readable display of problems when the assertEquivalentProblems function fails 2008-01-15 18:12:04 +00:00
Neil Brown
d3fca1d610 Moved showMaybe to the Utils module and added a similar showListCustom function 2008-01-15 18:08:56 +00:00
Neil Brown
05e2678cf6 Corrected a bug in the comparison function for FlattenedExp 2008-01-15 17:44:35 +00:00
Neil Brown
f6ba7be173 Changed various uses of the maximum function to make sure they always succeed 2008-01-15 17:33:19 +00:00
Neil Brown
918b9e7af7 Changed the array usage checking and all the tests to support modulo and division
This patch is unavoidably large (no easy way to split it down).  The code compiles, but the modulo test (which is currently wrong anyway) fails at the moment
2008-01-15 17:08:15 +00:00
Neil Brown
421cff1017 Removed the useless (and wrong) scaling aspect of makeEquations 2008-01-12 11:59:55 +00:00
Neil Brown
97fc225bf3 Added some more comments to the Omega Test code 2008-01-09 17:24:56 +00:00
Neil Brown
26bd792e61 Fixed a bug where the non-pruned version of the inequalities were being used in fmElimination; the Omega Test now functions properly 2008-01-09 17:14:15 +00:00
Neil Brown
524275cd9f Added the ability to print out the variable mapping and inequalities in a more readable format when tests fail 2008-01-09 17:14:02 +00:00
Neil Brown
d5a9829b0f Fixed the brute-force problems function so that it properly uses all inequalities not just the left-overs 2008-01-09 14:56:26 +00:00
Neil Brown
4ef97ed8b4 Changed the solveAndPrune test function to always have a valid mapping, even if there are no equalities 2008-01-09 14:55:59 +00:00
Neil Brown
4ee25b62ca Added some more comments to the fmElimination function 2008-01-09 12:46:50 +00:00
Neil Brown
8ec4832a03 Removed the unused half of VariableMapping 2008-01-09 12:27:02 +00:00
Neil Brown
57f18e5b18 Finished implementing the Omega Test - but a few tests are failing and I cannot yet see why 2008-01-09 12:05:09 +00:00
Neil Brown
d23baf719b Added support for multiplication to the usage checking 2007-12-17 11:56:51 +00:00
Neil Brown
337d339641 Added comments to the makeEquations function 2007-12-17 11:43:18 +00:00
Neil Brown
218a1bd22c Rearranged the tests for makeEquations to use a helper function, and added a couple of cases (one of which doesn't yet pass) 2007-12-17 02:38:05 +00:00
Neil Brown
8f1d1368af Stopped makeEquations unnecessarily producing duplicate equations 2007-12-17 02:22:09 +00:00
Neil Brown
5a721fb428 Fixed the processing of expressions to equations to properly square the equations 2007-12-17 02:13:40 +00:00
Neil Brown
dc76d00085 Added better helper functions for testing the processing of expressions into equations 2007-12-17 02:13:17 +00:00
Neil Brown
1733869afd Tidied up the tests and amended SolveEq to allow you to provide the answers, which are then checked 2007-12-16 19:20:53 +00:00
Neil Brown
02aa63ffda Fixed the QuickCheck equality-equation generater so that it can no longer produce unsolveable equations 2007-12-16 19:05:32 +00:00
Neil Brown
70ce98021a Added a few more HUnit tests for the equality solver 2007-12-16 19:05:01 +00:00
Neil Brown
3965babaff Tidied up the testing framework for the HUnit Omega Test tests 2007-12-16 15:27:07 +00:00
Neil Brown
7403588aea Fixed a situation where QuickCheck could occasionally generate duplicate equalities (where one was the negation of the other) 2007-12-16 14:12:29 +00:00
Neil Brown
423d22fa13 Moved the ArrayUsageCheck tests to their own new file (ArrayUsageCheckTest) 2007-12-16 14:02:45 +00:00
Neil Brown
4f88a1e4a1 Added negative coefficients to the QuickCheck tests 2007-12-16 13:43:45 +00:00
Neil Brown
a0203ff971 Corrected a haddock comment 2007-12-16 13:38:23 +00:00
Neil Brown
6320bfdffb Tidied up some of the QuickCheck tests for the Omega Test pruning 2007-12-16 13:35:51 +00:00
Neil Brown
cc7d32ffeb Corrected a mistake in a comment 2007-12-16 12:51:41 +00:00
Neil Brown
3a65651885 Added a really hacky initial implementation of a pass that checks that parallel array usage is safe 2007-12-16 02:07:02 +00:00
Neil Brown
b4ccc9f8de Changed the representation of the exact (constant) solutions to equations to be a simple Map 2007-12-16 00:55:38 +00:00
Neil Brown
a1d3501313 Changed the QuickCheck tests to test that we can get the exact answer from a full equality set, and rather ham-fistedly fixed a bug where substitutions were being applied multiple times to the variable mapping 2007-12-16 00:33:27 +00:00
Neil Brown
d5461bb10b Moved the norm helper to be a top-level function in the tests 2007-12-15 03:19:25 +00:00
Neil Brown
3e4e5355ff Changed the VariableMapping mess into a more correct mess 2007-12-15 02:58:08 +00:00
Neil Brown
c0d06ce173 Added a first attempt at recording the variable mappings during equation manipulation, and changed all the current tests to ignore it 2007-12-15 00:34:50 +00:00
Neil Brown
2df97f813f Removed some unused old code from the ArrayUsageCheck module 2007-12-14 23:22:25 +00:00
Neil Brown
74490c005e Added some (fairly messy) code for taking a list of A.Expression and generating a list of equations 2007-12-14 23:15:39 +00:00
Neil Brown
d674a2fdd0 Added inequality elimination to the Omega Test, but need to also add the code for checking for integer solutions 2007-12-14 16:48:13 +00:00
Neil Brown
9d562c0b12 Corrected checkConstantEq to actually remove the constant equations, rather than only checking them for consistency 2007-12-14 16:45:34 +00:00
Neil Brown
d9b606143e Fixed a Haddock comment 2007-12-14 15:27:51 +00:00
Neil Brown
3814a039d5 Refactored the use of mygcd with foldl into one function 2007-12-14 15:17:19 +00:00
Neil Brown
1dabdfef9d Added some tests for the Omega Test that are not "easily" solved 2007-12-14 12:25:29 +00:00
Neil Brown
97c670b2ff Fixed and documented the checkOpposite function so that it works properly and the tests pass 2007-12-14 04:13:01 +00:00
Neil Brown
3380596ef0 Added more tests for the usage checker, and a helper function for testing parallel items 2007-12-14 04:12:29 +00:00
Neil Brown
2050124658 Added tests for solving equalities and inequalities, and an easy way of writing those tests using user-defined operators 2007-12-14 02:41:15 +00:00
Neil Brown
57311d8d1e Added consistency checking for constant-only inequalities and also added a few more useful functions 2007-12-14 01:11:29 +00:00
Neil Brown
22b09ad95c Changed the tests to also test pruning inconsistent equations 2007-12-14 00:41:06 +00:00
Neil Brown
c7fe0f1515 Added equation pruning and tested most of it using QuickCheck 2007-12-14 00:02:15 +00:00