Commit Graph

2051 Commits

Author SHA1 Message Date
Neil Brown
d81810e506 Tidied up some of the code in the CheckFramework module 2008-11-15 00:23:45 +00:00
Neil Brown
5e909affbb Corrected the traversal mechanism to continually iterate the function until a fixpoint is reached (indicated by an Either mechanism, rather than an equality test, since the user must substitute explicitly) 2008-11-15 00:04:51 +00:00
Neil Brown
0340fae4ad Simplified the monad, modification and restart mechanism to both modify the state and modify in place 2008-11-14 23:20:43 +00:00
Neil Brown
fec7510f3a Stopped warning about the _sizes variables being unused (but do remove them) 2008-11-14 19:30:11 +00:00
Neil Brown
bf2409d311 Got the unused variables pass working, but only by restarting from the root of the AST every time, rather than by navigating to the right spot 2008-11-14 19:23:12 +00:00
Neil Brown
c055b35d68 Simplified the code slightly, since I was wrapping some things in a Maybe that didn't really need to be 2008-11-14 16:45:50 +00:00
Neil Brown
e5ed7e07b7 Fixed the apply function, which (mainly due to having the wrong type signature, but also its use of extTransformRoute) was not as polymorphic as it should have been, which was breaking the traversal (I think it would only work on one Structured type) 2008-11-14 15:30:02 +00:00
Neil Brown
9be287f157 Fixed the C++CSP backend's use of channels (this fixes occam but probably breaks Rain, but I can come back to it later) 2008-11-13 21:00:56 +00:00
Neil Brown
377233b4b0 Switched checkUnusedVar over to use forAnyASTStruct 2008-11-13 20:12:45 +00:00
Neil Brown
16a2be40b4 Made the doTree and similar functions more polymorphic, and added forAnyASTStruct 2008-11-13 20:10:43 +00:00
Neil Brown
048bd26be3 Moved the holding of the route out from RestartT (which now just deals with restarting) and into CheckOptM' (which was previously a fairly needless wrapper) 2008-11-13 19:59:41 +00:00
Neil Brown
594cb6faf3 Changed from giving a full Route as the restart point to just the identifier, since that's all we were using anyway 2008-11-13 19:16:26 +00:00
Neil Brown
6f5c007f18 Fixed the problem, which was that I didn't really want a continuation for restarting, I just wanted to apply the original function at the same point, so I'd been needlessly complicating things 2008-11-13 18:28:47 +00:00
Neil Brown
046ac4a75b Added a testcase (triple directly nested unused vars) that is failing, presumably due to not restarting the search at the right point 2008-11-13 18:08:36 +00:00
Neil Brown
265181d3c3 Moved all of the sub-functions of forAnyAST to the top-level 2008-11-13 16:43:01 +00:00
Neil Brown
6fc4ac9550 Added a warning when we removed an unused variable 2008-11-13 15:37:02 +00:00
Neil Brown
0d486f108f Added a value to indicate what type a warning is (to support future configurability) and streamlined the warning functions 2008-11-13 15:36:22 +00:00
Neil Brown
95f6ef2889 Slightly refactored (and commented) the checks framework 2008-11-13 14:55:55 +00:00
Neil Brown
cd41124003 Added another test for unused variables 2008-11-13 14:55:37 +00:00
Neil Brown
713011534f Corrected the nodes searched during the flow analysis
I was searching starting at the current node, but I actually should have started at the terminal node connected to the current node as I need to process all the nodes ahead of me -- but in a backwards flow
2008-11-13 13:02:46 +00:00
Neil Brown
1cf9dfff0e Implemented getDecl, although it returns a name for all specifications (including typedefs and processes) 2008-11-13 13:02:09 +00:00
Neil Brown
2673ace2d5 Changed the lambda in checkUnusedVar to be an inner function, now that I've removed my code that used to ignore pattern-match failures 2008-11-13 13:01:22 +00:00
Neil Brown
01caa4d9f5 Improved the cached analysis stuff to work with nodes better, allowing the programmer to specify a test for the node label so that the right node is picked based on the route identifier 2008-11-12 18:51:05 +00:00
Neil Brown
44e2699089 Improved the Show instance for UsageLabel 2008-11-12 18:50:25 +00:00
Neil Brown
2a15f4ef5f Filled in all the gaps such that the CheckTest tests now run (including some debug output, for now)
One of the tests fails at the moment because the specification node has two entries associated with it in the flowgraph.  One is the scope-in and one is the scope-out.  I think the analysis is currently picking the scope-out node and looking beyond that, where -- surprise, surprise -- the variable is not used again.  So I need some easy way of telling the flow analyses which of the two nodes I want to start from, in this case and other ones where I also add two nodes related to the same point in the AST.
2008-11-12 16:54:00 +00:00
Neil Brown
76cfb4d8f5 Added route-identifiers for blank AST modifiers in the flow graph 2008-11-12 16:47:15 +00:00
Neil Brown
4d10930f78 Corrected a test (Only is not valid at the top-level of an AST) 2008-11-12 15:56:19 +00:00
Neil Brown
98122211ad Got all the new analysis stuff compiling, but with several parts unimplemented 2008-11-12 12:34:32 +00:00
Neil Brown
8f691c057e Fixed one of the tests that had the actual and expected reversed 2008-11-12 12:33:46 +00:00
Neil Brown
3a6b432c77 Recording some information about my failed attempts to fiddle with the GHC flags 2008-11-10 16:46:38 +00:00
Neil Brown
3d576b7ff3 Removed my pattern-match magic before I start relying on it, since it is probably a hack too far 2008-11-10 15:58:58 +00:00
Neil Brown
dc030acabe Changed the FlowGraph stuff to use the new Route type (that includes identifiers) rather than the bare functions as it used to 2008-11-10 14:01:30 +00:00
Neil Brown
8405c646e3 Added a file for testcases for checks that use the new framework 2008-11-10 13:08:14 +00:00
Neil Brown
99ddca4a0f Added a function to execute the CheckOptM monad on an AST 2008-11-08 16:01:08 +00:00
Neil Brown
a764031068 Added the support for glossing over pattern-match failures 2008-11-08 16:00:29 +00:00
Neil Brown
a4c2196f3c Removed the ErrorT now that we are on top of PassM anyway 2008-11-08 15:59:40 +00:00
Neil Brown
893fd542d6 Tidied up and comment some of the checking framework 2008-11-08 12:58:57 +00:00
Neil Brown
e2cd70bf30 Implemented the substitute and restart methods 2008-11-08 12:29:50 +00:00
Neil Brown
f9d6a9aa8d Added the new module to the Makefile (forgot to do so in the last patch) 2008-11-08 12:02:13 +00:00
Neil Brown
d0e2cd7b03 Finally wrestled the Haskell typechecker into submission to add my CheckFramework and its monads, which will hopefully do all that I need 2008-11-08 00:00:09 +00:00
Neil Brown
d6b102838a Added a Route data type that packages up the routing function and an identifier (to provide equality) 2008-11-07 10:08:16 +00:00
Neil Brown
d12b2178de Added an augmented version of Adam's gmapMFor that uses the same generics techniques, but also gives a route to the node to the transformation function 2008-11-06 18:32:35 +00:00
Neil Brown
31091a5795 Moved the ExSet type (used for the checks) out to its own module 2008-11-05 21:40:24 +00:00
Adam Sampson
16fee9c9eb Add the Tock hacker's guide to the repository.
This used to be in a CSProjects Subversion repo, but I figure if we keep it
with the code it's more likely to stay up-to-date.
2008-11-20 13:41:06 +00:00
Neil Brown
bcad0c225f Converted the other pullRepCounts test over to the new system 2008-11-16 19:40:27 +00:00
Neil Brown
fe3dd78db3 Realised that pullRepCounts should pull the counts for PAR and ALT after all, and adjusted one test to reflect this 2008-11-16 18:43:34 +00:00
Neil Brown
bfacb526fb Converted one of the tests for pullRepCounts to use the new mechanism, which in turn exposed that the pass was not altering the definition in the state (which it may as well) 2008-11-16 18:25:53 +00:00
Neil Brown
771297632d Finished converting all the cases in testInputCase to use the new occam EDSL 2008-11-16 16:57:52 +00:00
Neil Brown
9ac861ac93 Fixed the map ordering problem by matching against any permutation 2008-11-16 13:06:08 +00:00
Neil Brown
b82395dc81 Tried changing an existing test from using oZ to oA which revealed a problem with the csNames comparison (and matching the map orderings) 2008-11-16 13:05:30 +00:00