Commit Graph

435 Commits

Author SHA1 Message Date
Neil Brown
c68aa42277 Added a sub-type to Timers, to support multiple types 2008-03-23 22:20:16 +00:00
Neil Brown
7830d82c51 Fixed the display of names in ShowCode for Rain 2008-03-23 12:13:55 +00:00
Neil Brown
1bf3f6f0f1 Fixed the type of a function name in buildExpr to fix the tests 2008-03-23 12:08:08 +00:00
Neil Brown
6f76f6385e Added to an error message in Types to help determine the problem 2008-03-23 00:07:48 +00:00
Neil Brown
e767e33190 Added support for some intrinsic (time-related) functions in Rain 2008-03-22 18:58:10 +00:00
Neil Brown
7f28d3dbe3 Added a warnPC function (like diePC) for use with formatCode 2008-03-22 18:34:40 +00:00
Neil Brown
710abd7019 Added support for function calls to the Rain parser 2008-03-22 17:49:21 +00:00
Adam Sampson
60ca26128c More occam typechecks: input/output items, replicators, choices.
Various infrastructure too to support these.

Doing A.ForEach raised an interesting question: what does it work over?  In
plain occam it'd just be arrays, but it should obviously work for lists too.
This suggests that Size and Subscript should work on lists as well, since
ForEach will be implemented in terms of them. I've therefore introduced the
idea of a "sequence" class of types.
2008-03-22 23:47:29 +00:00
Adam Sampson
388f2f38a6 plainSubscriptType doesn't really need to know what the subscript is. 2008-03-22 00:53:46 +00:00
Adam Sampson
56de093739 Add isScalarType. 2008-03-22 00:53:13 +00:00
Adam Sampson
8b2568264d Add more utility functions along the lines of defineConst.
These let you define various sorts of name in the initial state of a pass test.
2008-03-22 00:44:57 +00:00
Adam Sampson
8b5233ba47 Add ShowCode instances for A.Name. 2008-03-22 00:42:00 +00:00
Adam Sampson
cfc5b18e3e Don't show the state when a pass unexpectedly succeeds.
This used not to be a problem, but there's now quite a lot of stuff predefined
in the state when testing the typechecker, so it tends to obscure the real
error...
2008-03-20 23:56:13 +00:00
Neil Brown
025eebf61d Added support for giving ranges an explicit type in Rain 2008-03-21 21:10:47 +00:00
Neil Brown
2189a6c28a Added support for list literals to the Rain parser 2008-03-21 20:03:47 +00:00
Neil Brown
33b04e7646 Tidied up a few unused functions and module imports 2008-03-21 15:16:36 +00:00
Neil Brown
0e3465afc0 Corrected some Rain tests to avoid using the Int type 2008-03-20 16:42:25 +00:00
Neil Brown
a6452f93df Added a ShowOccam and ShowRain instance for lists of things 2008-03-20 16:34:11 +00:00
Neil Brown
ecb82d13a8 Revamped the ShowCode module, transforming it to use the writer monad 2008-03-20 16:20:14 +00:00
Neil Brown
bd26f758b4 Added tests for annotating the types of list literals and ranges in Rain 2008-03-20 14:44:19 +00:00
Neil Brown
123936e71c Changed addOne to use Add not Plus (we can always define a plusOne...) 2008-03-20 12:30:07 +00:00
Neil Brown
713b5c3e5c Added a subExprs helper function to match the rest 2008-03-19 17:52:01 +00:00
Neil Brown
b496912c51 Fixed conflicts with Adam's dimension changes 2008-03-19 17:49:32 +00:00
Neil Brown
35ebd43f79 Fixed some error messages in the Types module 2008-03-19 17:02:45 +00:00
Neil Brown
45c2619307 Changed the rain parser to use ListLiteral for strings 2008-03-19 15:59:23 +00:00
Neil Brown
7baeb318f2 Adjusted the Types module to use the new types in array constructors 2008-03-19 13:21:42 +00:00
Adam Sampson
eb29e65bad Smarter tree traversals: "Scrap Your Uniplate".
This provides gmapMFor and gmapMFor2, which are like gmapM, but know what
they're looking for, and can therefore avoid going down branches of the tree
that won't contain any interesting types.

The basic approach is quite similar to Uniplate's PlateData: there's a function
(containsType) that'll tell you whether one type is contained somewhere within
another. However, unlike Uniplate, we build a static IntMap IntSet of the types
we need to know about, which allows rather quicker lookups. (I did try using
PlateData first.)

The result is that applyDepthM is now much quicker than it was before.
applyDepthM2 is a bit less impressive, which I assume is because it can't
really prune the tree much if it's looking for two types.

Future enhancements:
- convert more passes to use applyDepthM*;
- make gmapMFor* aware of constructors rather than just types, which should
  allow a bit more pruning.
2008-03-20 16:49:24 +00:00
Adam Sampson
e08aac59d3 Move Retypes checking from the occam parser into a pass.
This also fixes a bug in the original algorithm: it used to let you retype
[]INT to BYTE.
2008-03-19 19:38:56 +00:00
Adam Sampson
7f6cb6e0c3 Evaluate "(MOSTNEG INT) \ -1" correctly when evaluating constants.
This actually crashes older versions of GHC:
  Prelude Data.Int> (minBound :: Int32) `div` (-1)
  Floating point exception
2008-03-19 11:12:57 +00:00
Adam Sampson
b1416bb0cf Change A.Dimension to take an Expression, not an Int.
This touches an awful lot of code, but cgtest07/17 (arrays and retyping) pass.

This is useful because there are going to be places in the future where we'll
want to represent dimensions that are known at runtime but not at compile time
-- for example, mobile allocations, or dynamically-sized arrays. It simplifies
the code in a number of places.

However, we do now need to be careful that expressions containing variables do
not leak into the State, since they won't be affected by later passes.

Two caveats (marked as FIXMEs in the source):

- Retypes checking in the occam parser is disabled, since the plan is to move
  it out to a pass anyway.
- There's some (now very obvious) duplication, particularly in the backend, of
  bits of code that construct expressions for the total size of an array
  (either in bytes or elements); this should be moved to a couple of helper
  functions that everything can use.
2008-03-18 16:45:38 +00:00
Adam Sampson
54668d3ba2 Implement the RESCHEDULE intrinsic. 2008-03-15 11:00:11 +00:00
Adam Sampson
6df110dce4 Wrap QuickCheck tests into HUnit tests.
This means all the tests now get run as part of one list, and HUnit keeps track
of the number of failures for us. (The reason I was doing this was so that
tocktest will exit non-zero on QuickCheck test failure too.)

As part of this, I've reworked TestMain's main function quite a bit. It'll now
filter QuickCheck tests into response to options too.
2008-03-12 19:38:02 +00:00
Adam Sampson
8120a75186 Clean up TestUtils.
Reorder functions in categories, and add some folds so it's easier to navigate.
2008-03-12 18:27:30 +00:00
Adam Sampson
808277ca84 Remove now-unused code for running timed tests. 2008-03-12 18:21:22 +00:00
Neil Brown
c778ff0031 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Neil Brown
9f18b348e8 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +00:00
Neil Brown
5c43172e46 Added an annotation to array subscripts to indicate whether they should have a run-time check added or not 2008-03-09 14:30:19 +00:00
Neil Brown
ba75f5b06c Removed the initialiser expression on the Declaration item in the AST 2008-03-09 00:23:13 +00:00
Neil Brown
8030161a90 Changed bytesInType to use the new module for getting the size of the bool and int types 2008-03-07 21:24:20 +00:00
Neil Brown
256ce80ccb Moved all the testPass* functions into the TestMonad, using unsafePerformIO for running them inside QuickCheck 2008-03-05 16:06:14 +00:00
Neil Brown
03eab6c142 Fixed some typing relating to QuickCheck and the TestMonad to avoid type ambiguities in future 2008-03-05 16:04:30 +00:00
Adam Sampson
2f7539bcdb Convert the C backend to the new CIF API (mostly).
Most of this is mechanical: changing function names, and carrying the "wptr"
argument around. I've made the code for computing Expressions from Structureds
a bit more generic too.

The only complex bit is the handling of PAR processes, which I'm not very happy
with at the moment; they used to use the normal C calling convention, but now
you need to pack the arguments into the workspace. I'm handling this at the
moment by generating wrapper functions that do the unpacking, but it would be
better in the future to make the wrapper PROCs that we already generate have
the right interface.

This won't work for programs that use any of the top-level channels yet, since
there are no handlers for them.
2008-03-07 17:50:10 +00:00
Neil Brown
f5022228ba Fixed typeOfSpec to use the recorded type rather than trying to dig it out of the inner expression/variable 2008-02-29 16:33:33 +00:00
Adam Sampson
8f2575819b Initial implementation of the occam-pi preprocessor.
This implements #DEFINE, #UNDEF, #IF, #ELSE and #ENDIF, macro expansion with
##, and TRUE, FALSE, AND, OR, NOT and DEFINED within #IF expressions, with the
same semantics as occ21.

The macro COMPILER.TOCK is always defined by default, so you can now say things
like "#IF NOT DEFINED (COMPILER.TOCK) ... #ENDIF".
2008-02-28 20:27:30 +00:00
Adam Sampson
62b9c9b105 Prefix pass test output with the pass name ++ ": " consistently. 2008-02-28 16:51:53 +00:00
Neil Brown
1afea6c62c Fixed underlyingType not recursing properly into the inner types in arrays 2008-02-27 18:23:53 +00:00
Neil Brown
245e4536bc Fixed signed hexed values in the constant folder 2008-02-27 14:00:28 +00:00
Neil Brown
93a3c81255 Fixed the right-shift in the constant folding to be an unsigned (logical, non sign-extending) shift 2008-02-27 12:45:29 +00:00
Neil Brown
5807c59edf Moved the three Flow modules out to a new flow directory 2008-02-26 15:07:07 +00:00
Neil Brown
decf249c51 Moved AST, CompState and Metadata out to a new data directory (along with the generated OrdAST and TagAST) 2008-02-26 15:02:13 +00:00
Neil Brown
bca3f89872 Adjusted the QuickCheck tests, now that Alt is handled properly 2008-02-26 14:34:46 +00:00
Neil Brown
b4ee07a3a7 Fixed a few comments in FlowAlgorithms 2008-02-26 14:24:33 +00:00
Neil Brown
9ba8d30aa0 Added the handling of ALTs to the control-flow graph 2008-02-26 14:20:45 +00:00
Neil Brown
4dbeabb5dc Added the first group of tests for handling ALTs in the control-flow graph building 2008-02-26 14:19:57 +00:00
Neil Brown
4f05f0126f Made decompN check the constructor, and added a short test accordingly 2008-02-25 13:39:28 +00:00
Neil Brown
1edaacae89 Altered the AST to allow a function to be either an ExpressionList (classical occam) or a Process (Rain/proposed new occam) 2008-02-24 19:29:31 +00:00
Neil Brown
74f3cb7fc2 Removed the export of "m" in TestUtils, instead moving the definition to each module that uses it (less confusing that way) 2008-02-24 18:55:44 +00:00
Neil Brown
caff04c548 Changed the use of everywhereM in underlyingType to use makeGeneric instead 2008-02-24 15:52:09 +00:00
Neil Brown
d5773ee4e0 Changed two uses of gmapQ (const undefined) to the similar glength function in the SYB library 2008-02-24 12:32:25 +00:00
Neil Brown
13c46d1fb2 Moved three pass-related modules out to their own directory 2008-02-24 12:32:21 +00:00
Neil Brown
6d9534f9b9 Made running the properties configurable by a --sanity-check command-line option 2008-02-24 12:15:02 +00:00
Neil Brown
ae49d236d6 Changed findMeta so that it would work even if the Meta data was not the first direct child of an item 2008-02-23 18:33:39 +00:00
Neil Brown
6a3452f8cd Added a useful function to Pass for applying a modification function to the Only parts of a Structured 2008-02-23 18:32:29 +00:00
Neil Brown
e8189e196b Removed the makePasses functions that did not deal with pre- and post- properties 2008-02-19 09:49:14 +00:00
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
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
57833f7f26 Fixed the broken QuickCheck tests for node replacement 2008-02-10 21:21:03 +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
534fbd8db1 Added a new helper function to Utils, and corrected a comment too 2008-02-09 14:50:56 +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
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
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
4299951511 Moved the makeSize function from ArrayUsageCheck into Utils 2008-02-06 23:49:17 +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
673d6a4f76 Reverted a change in the PrettyShow module because I'm no longer confident about it (original behaviour definitely worked) 2008-02-05 22:39:38 +00:00
Neil Brown
445d45752d Fixed the mode for printing out the flow-graph 2008-02-05 22:36:37 +00:00
Neil Brown
005ee78f03 Corrected a couple of bugs in the code for generating flow-graphs for quickcheck tests 2008-02-05 22:24:18 +00:00
Neil Brown
c001455fc2 Added a check for an empty list to oneofL 2008-02-05 22:18:22 +00:00
Neil Brown
416e385017 Added labels to all the QuickCheck tests to make it easier to see which one has failed 2008-02-05 22:15:17 +00:00
Neil Brown
fa1e9a6a08 Rearranged FlowGraph and fixed the tests
Previously, most of the flow-graph building functions were inside the where clause of buildFlowGraph.  They have been moved to the top-level (with only a few small changes to make this possible - the main one being to store the labelling functions in a reader monad, which only required changing a couple of lines) and used by an additional buildFlowGraphP function, that is now used by the tests to make them work simply.  None of the new top-level functions except buildFlowGraphP are exported from FlowGraph.
2008-02-05 22:04:49 +00:00
Neil Brown
acd57d74de Changed the A.Structured type to be parameterised
This patch is actually an amalgam of multiple (already large) patches.  Those patches conflicted (parameterised Structured vs. changes to usage checking and FlowGraph) and encountered a nasty bug in darcs 1 involving exponential time (see http://wiki.darcs.net/DarcsWiki/ConflictsFAQ for more details).  Reasoning that half an hour (of 100% CPU use) was too long to apply patches, I opted to re-record the parameterised Structured changes as this new large patch.  Here are the commit messages originally used for the patches (which, as mentioned, were already large patches):

A gigantic patch switching all the non-test modules over to using parameterised A.Structured
Changed the FlowGraph module again to handle any sort of Structured you want to pass to it (mainly for testing)
A further gigantic patch changing all the tests to work with the new parameterised Structured
Fixed a nasty bug involving functions being named incorrectly inside transformInputCase
Added a hand-written instance of Data for Structured that allows us to use ext1M properly
Fixed a few warnings in the code
2008-02-05 19:40:27 +00:00
Neil Brown
6c4e7ee713 Added a few more TestLabels 2008-02-05 16:19:16 +00:00
Neil Brown
093070454b Removed a use of the head function from PrettyShow 2008-02-05 16:19:00 +00:00
Neil Brown
c45b82be56 Removed the setting of csVerboseLevel in TestHarness that was accidentally committed 2008-02-04 08:05:16 +00:00
Neil Brown
1074407ef9 Added the ability to neatly print out a problem as a debug message 2008-02-03 15:41:29 +00:00
Neil Brown
1d9d47312a Implemented handling of replicators inside PARs in the control flow-graph building 2008-02-01 14:45:02 +00:00
Neil Brown
fdb612123c Added tests for parallel replicators in the flow-graph 2008-02-01 14:44:50 +00:00
Neil Brown
cb9aa03612 Fixed a nasty problem involving mixing the Meta tags while building the flow-graph, and added a comment about it 2008-02-01 14:34:17 +00:00
Neil Brown
30e890ef02 Corrected the bug involving replicated SEQs that are empty 2008-02-01 11:45:21 +00:00
Neil Brown
d3ad2e7af6 Added a couple more tests for empty replicated SEQs that show up a bug 2008-02-01 11:45:05 +00:00
Neil Brown
c663109378 Corrected how CASE options are handled in the flow-graph, and adjusted the accompanying tests 2008-02-01 11:34:03 +00:00
Neil Brown
2beda004b3 Corrected some more tests relating to the way empty A.Severals are handled 2008-02-01 11:21:43 +00:00
Neil Brown
e9a2143a28 Tweaked a slightly misleading error message when flow-graph tests fail 2008-02-01 11:14:54 +00:00
Neil Brown
5eb5a4c979 Corrected some tests to reflect the new way that empty A.Several items are handled when building the flow-graph 2008-02-01 11:12:31 +00:00
Neil Brown
0a22ebf34b Fixed up a couple of lines to properly handle the difference between Left False and Left True when building the flow-graph 2008-02-01 11:09:23 +00:00
Neil Brown
f8844edcb0 Corrected getNextParEdgeId in the flow-graph building to also actually increment the id ready for the next call 2008-02-01 11:08:53 +00:00
Neil Brown
83e04b92d4 Corrected the order the nodes are folded to match reality (rather than unintentionally reversing them) 2008-02-01 10:52:16 +00:00
Neil Brown
0672730894 Changed the way PARs are built up in the flow-graph, but haven't yet fixed the tests 2008-02-01 10:39:17 +00:00
Neil Brown
8fb60ff511 Added another test for PAR in FlowGraphTest 2008-01-30 20:47:27 +00:00
Neil Brown
5306e87463 Changed the tests for PAR in FlowGraphTest to match the intended new scheme 2008-01-30 20:37:47 +00:00
Neil Brown
a9427fe421 Corrected one test for SEQ in FlowGraphTest, and added another 2008-01-30 20:37:15 +00:00
Neil Brown
76e3a9b615 Corrected FlowGraphTest so it generates replicators inside IFs, not CASEs 2008-01-30 20:16:05 +00:00
Neil Brown
0dc94f9a32 Renamed the members of the OuterType data-type to be a little more distinctive 2008-01-30 19:58:20 +00:00
Neil Brown
b3cd170840 Fixed an oversight with duplicated Meta tags in testSeq in FlowGraphTest 2008-01-30 19:47:39 +00:00
Neil Brown
0f0be6e4a3 Added support for replicators to the quickcheck tests (actually applying the modification functions) 2008-01-30 19:14:33 +00:00
Neil Brown
c2c6bf24f8 Changed the QuickCheck flow-graph generators to generate a Process as the top level, rather than Structured, to make the test input more interesting 2008-01-30 18:57:00 +00:00
Neil Brown
0dc4b81be8 Corrected the item count for replicators in the QuickCheck FlowGraph tests 2008-01-30 18:56:33 +00:00
Neil Brown
45a8fa0b88 Added handling of sequential replicators when building the flow graph 2008-01-30 13:50:53 +00:00
Neil Brown
7c811f347c Added a couple of tests for sequential replicators 2008-01-30 13:50:28 +00:00
Neil Brown
b6132d6431 Added replicators to the flow graphs generated for the QuickCheck tests 2008-01-30 13:50:07 +00:00
Neil Brown
e94826c64e Added a function to GraphLabelFuncs for labelling replicators 2008-01-30 12:43:28 +00:00
Neil Brown
95d99706e3 Readjusted the parameters of flowAlgorithm so that the initial value for the starting node is passed in more obviously (since that was the only use of initVal, which has now been removed) 2008-01-29 21:05:37 +00:00
Neil Brown
28fd400d89 Adjusted the FlowGraph tests to check the roots of the graph, and added in the new root nodes where appropriate 2008-01-29 20:06:33 +00:00
Neil Brown
12b1617fec Added a new labelling function to FlowGraph for labelling the arguments of functions/processes 2008-01-29 20:05:38 +00:00
Neil Brown
5567d8cee0 Changed FlowGraph to keep a record of all the root nodes in the tree and return them in a list 2008-01-29 12:46:14 +00:00
Neil Brown
0a1270f109 Corrected a comment in FlowAlgorithms 2008-01-29 12:44:06 +00:00
Neil Brown
78a29de1d4 Added a couple of notes about replicators 2008-01-28 17:36:43 +00:00
Neil Brown
edc3a7e910 Removed the die function (that has no source position) and as far as possible replaced all its uses with dieP and a valid position 2008-01-28 17:21:13 +00:00
Neil Brown
f03702d937 Added an automatically-generated OrdAST module that provides an ordering for AST elements, ignoring Meta tags 2008-01-28 15:23:53 +00:00
Neil Brown
0f085b8d81 Added Ord instances for all simple types (all no-argument constructors) in the AST module 2008-01-28 15:22:58 +00:00
Neil Brown
7a30a2ceb5 Moved the usageCheckPass function into the new Check module 2008-01-28 13:15:36 +00:00
Neil Brown
4a8653cc41 Added the monads to the export list of ShowCode 2008-01-27 23:47:41 +00:00
Neil Brown
bc3ad29fed Added code to build the flow graph for procs and functions in specifications 2008-01-26 18:54:40 +00:00
Neil Brown
9dfa1611e0 Added various 4 and 5 parameter versions of the routing functions for building AST-modifying functions 2008-01-26 18:49:36 +00:00
Neil Brown
7c4b87e221 Added tests for proc specifications in FlowGraphTest and correctly an earlier test to not use an undefined specification 2008-01-26 18:48:49 +00:00
Neil Brown
3548167a83 Changed the testGraph function in FlowGraphTest to add a variant that takes an A.Structured directly 2008-01-26 18:48:09 +00:00
Neil Brown
41fb90dc33 Added labels to the tests in FlowGraphTest 2008-01-26 18:46:16 +00:00
Neil Brown
bdda623d7e Added types to all the cases where the monomorhpism restriction applied 2008-01-26 20:51:11 +00:00
Neil Brown
741a01de5a Removed various tab characters and replaced them with spaces 2008-01-26 19:38:24 +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
86b8185b1f Added a few more helper functions to the Utils module 2008-01-25 16:12:20 +00:00
Neil Brown
d2b427c268 Added some comments to the FlowGraph module 2008-01-25 15:58:32 +00:00
Neil Brown
75dd2afeb2 Added support for timing tests in the automatic test cases 2008-01-23 15:23:26 +00:00
Neil Brown
d1fa9fd71f Added a helper function for timing tasks in the TestUtils module 2008-01-23 15:23:00 +00:00
Neil Brown
9c9295fd74 Added the filename of an automatic test as its test-label 2008-01-22 22:42:29 +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
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
9edc9fea78 Added a TestHarness module that easily allows full-compilation tests from external source files 2008-01-16 03:27:47 +00:00
Neil Brown
5988684c00 Moved the Pass list from Main to its own module (PassList) and included the usage-checking pass (when the appropriate option is turned on) 2008-01-16 03:26:20 +00:00
Neil Brown
b8e4864d08 Added an option for usage-checking to the CompState; currently turned off by default 2008-01-16 03:24:25 +00:00
Neil Brown
fa7ec6d407 Added a helper function (assertEqualCustomShow) to the TestUtils module 2008-01-15 18:09:49 +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
8cfa9e3cb0 Added a new helper function to Utils (transformTriple) 2008-01-15 17:05:45 +00:00
Neil Brown
8f1d1368af Stopped makeEquations unnecessarily producing duplicate equations 2007-12-17 02:22:09 +00:00
Neil Brown
91bfa4ae54 Added more helper functions to the Utils module, for dealing with arrays and maps 2007-12-17 02:08:37 +00:00
Neil Brown
140bd94ce3 Added various (QuickCheck) Result helper functions to the TestUtils module 2007-12-13 23:51:49 +00:00
Neil Brown
8d89a88735 Added a couple more functions to the Utils module 2007-12-13 23:51:11 +00:00
Neil Brown
26dd2fa5c4 Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module 2007-12-13 19:05:29 +00:00
Neil Brown
337f189b8a Separated the QuickCheck tests from the HUnit tests and made the number of test-cases configurable for the QuickCheck tests 2007-12-13 18:21:53 +00:00
Neil Brown
54721cd19b Added some QuickCheck helper functions and types to TestUtil 2007-12-13 18:19:02 +00:00
Neil Brown
b39fa8053b Added two more monadic helper functions to the Utils module 2007-12-12 13:50:55 +00:00
Neil Brown
a196b53e9e Added more helper functions (mostly Array-related) to the Utils module 2007-12-11 16:49:50 +00:00
Neil Brown
905e110e86 Added a function to FlowGraph for joining two sets of graph labelling functions together 2007-12-10 15:45:06 +00:00
Neil Brown
7ea3d2a7f9 Added an @@ operator for Named patterns, like in the Tock presentation 2007-11-21 14:25:32 +00:00
Douglas Warren
1d83167c01 Fixed some haddock parsing problems in the documentation 2007-11-14 16:26:47 +00:00
Douglas Warren
d82a80639d Removed the dependency on Control.Monad.State.Class package, since that isn't in the older Debian versions 2007-11-14 16:24:03 +00:00
Neil Brown
01c7f25f46 Added much more documentation to the FlowGraphTest module 2007-11-12 15:19:12 +00:00
Neil Brown
a248f58201 Turned off generating ASTS with Specs inside Case statements until they have been properly implemented and tested 2007-11-10 23:29:49 +00:00
Neil Brown
185f515cf7 Improved the error message when the graph building fails for QuickCheck 2007-11-10 23:18:21 +00:00
Neil Brown
089091d59b Added a safety check when building the flow graph 2007-11-10 23:18:01 +00:00
Neil Brown
ff01b24efd Added more items to the AST QuickCheck generator 2007-11-10 21:13:55 +00:00
Neil Brown
19ba2a321c Fixed another misplaced Meta tag problem, this time with Specification 2007-11-10 21:13:16 +00:00
Neil Brown
2c33e1e499 Fixed some meta-tag confusion with the While statement when building a flowgraph 2007-11-10 20:28:12 +00:00
Neil Brown
ac2bee7b48 Added a generator for A.Case to the flow-graph testing 2007-11-10 19:17:01 +00:00
Neil Brown
f050dadaec Added a type specifier to FlowGraphTest to match the changes to the flow-graph builder 2007-11-10 19:16:20 +00:00
Neil Brown
53826fb405 Changed the flow-graph builder to allow the monad for AlterAST to be different from the monad for GraphLabelFuncs (they always were separate internally anyway) 2007-11-10 19:07:43 +00:00
Neil Brown
7168799784 Fixed the use of the wrong meta tag in the handling of A.Choice when building the FlowGraph, which was confusing the QuickCheck tests 2007-11-10 18:31:16 +00:00
Neil Brown
7929715594 Added support for printing printing the results of QuickCheck test failures 2007-11-10 18:23:04 +00:00
Neil Brown
2a7662e46e Added code to build an AST properly for testing (esp. A.Structured) and implemented enough tests to get a failure 2007-11-10 01:31:56 +00:00
Neil Brown
85375c3c6c Changed the flow-graph testing quickcheck functions to use a size parameter when recursively building the trees 2007-11-09 23:48:12 +00:00
Neil Brown
d60d70cf82 Changed the unique identifiers in FlowGraphTest to be their own type, to reduce confusion 2007-11-09 20:05:06 +00:00
Neil Brown
83ab0c16f5 Added a couple more helper functions/operators to the Utils module 2007-11-09 19:45:03 +00:00
Neil Brown
1554d5c7ba Added an initial (slightly clumsy) attempt at using quickcheck to generate ASTs and test the flow-graph-based tree-altering functions 2007-11-09 17:47:10 +00:00
Neil Brown
2141a7d6f2 Added AlterAST to FlowGraph's export list 2007-11-09 17:45:19 +00:00
Neil Brown
a46c7a6fe3 Added more functions to the Utils function, for uncurrying functions and forming cartesian products 2007-11-09 17:26:55 +00:00
Neil Brown
572b53c3b6 Added another helper function to Utils; a version of modify that returns the old state 2007-11-09 17:13:58 +00:00
Neil Brown
af1574643d Added two more helper functions to the Utils module 2007-11-09 11:19:09 +00:00
Neil Brown
47f5e36f9c Added another helper function, seqPair, to the Utils module 2007-11-09 01:23:46 +00:00
Neil Brown
bacc3115e9 Added various general helper functions to the Utils module 2007-11-09 01:18:42 +00:00
Neil Brown
a5c02f36ec Removed the Metadata hack (where emptyMeta was "equal" to every other Meta data tag) 2007-11-10 14:14:18 +00:00
Neil Brown
fbbe539bc0 Changed the types in FlowGraphTest to match the changes to FlowGraph 2007-11-07 13:30:44 +00:00