Commit Graph

1916 Commits

Author SHA1 Message Date
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
Neil Brown
f2bac46655 Added a testPatternMatchOneOf function to check that something matches at least one of a list of given patterns 2008-11-16 13:03:28 +00:00
Neil Brown
6f54b89b38 Added a permutations function to the Utils module 2008-11-16 13:03:04 +00:00
Neil Brown
278b80932e Converted one of the input case tests to use the occam EDSL, making it much clearer 2008-11-16 12:24:41 +00:00
Neil Brown
42e4ca5c92 Adjusted an existing testcase for the changes in OccamEDSL 2008-11-16 12:24:24 +00:00
Neil Brown
559ba83c28 Developed the occam EDSL further, adding support for input CASE statements, more type-classes to allow easier use and various other improvements 2008-11-16 12:21:22 +00:00
Neil Brown
5fbbce6480 Adjusted the TAGS generation to include the tocktest source files 2008-11-16 11:35:57 +00:00
Neil Brown
02a28b7585 Made testOccamPass more general, so that it does not have to be applied at the top-level 2008-11-15 20:13:33 +00:00
Neil Brown
a570f2eff3 Renamed the variables in the occam EDSL to be less likely to clash in other modules 2008-11-15 20:11:52 +00:00
Neil Brown
f4d9c791ef Simplified the occam EDSL by removing the unnecessary monad in favour of plain lists, and added a way to separate expected output from input 2008-11-15 20:06:47 +00:00
Neil Brown
7764ed9326 Added a module for easily knocking up fragments of occam code to test, but need to remove some of the extravagance in the design (including an unnecessary monad) 2008-11-15 19:29:56 +00:00
Neil Brown
0c814c5378 Added a Makefile target for the TAGS file for emacs 2008-11-12 15:32:23 +00:00
Neil Brown
4e582d8c3a Quickly added poison to the C++ backend 2008-09-12 21:05:11 +00:00
Neil Brown
192ccd4e2c Extended the type unification for Rain to support type-checking things that are being poisoned (which could be either end of a channel) 2008-09-12 14:40:04 +00:00
Neil Brown
4c263dba7e Added support for poison to the lexer and parser (and associated tests) 2008-09-12 14:39:57 +00:00
Neil Brown
ec25ff9901 Added some tests for the type-checking of poison statements in Rain 2008-09-12 14:37:11 +00:00
Neil Brown
00a719a451 Added a new InjectPoison process to the AST 2008-09-11 22:16:52 +00:00
Neil Brown
e4b1c98dd6 Removed while loops from one of the quickcheck tests now that they behave in a more complex fashion 2008-09-11 21:53:40 +00:00
Neil Brown
73d1bdc711 Fixed the flow algorithms to discard nodes that should not feature (e.g. nodes with no onward path in backward data flow) 2008-09-11 21:46:03 +00:00
Neil Brown
f4fb8823ae Fixed some warnings in FlowGraphTest (by commenting out some unused functions) 2008-09-11 20:51:09 +00:00
Neil Brown
447a89eca5 Fixed up the tests for IF statements relating to the labelled sequential edges 2008-09-11 20:50:25 +00:00
Neil Brown
426064ba2d Fixed some failing tests due to a change in the sequential edge labels in the flow graph (just the while tests) 2008-09-11 16:10:30 +00:00
Adam Sampson
3eeda5d821 Add a unit tests file for SimplifyTypes.
The tests in there at the moment are pretty trivial, but I'm going to
want to add more stuff to SimplifyTypes later.
2008-06-11 15:56:24 +00:00
Adam Sampson
8545b08aee Tidy up resolveNamedTypes. 2008-06-11 15:46:11 +00:00
Adam Sampson
f102d8e7ef Make "PORT" work for "PORT OF". 2008-06-11 13:18:54 +00:00
Adam Sampson
87848ad7db Make the TypeSet representation a bit smarter.
It used to just be the list of target type keys. It's now a map from
all possible type keys to a precomputed hit/through/miss decision for
them. gmapMFor can therefore dig into "through" types without needing
to (fail to) apply the generic function first.

This makes less difference than I was expecting: it shaves the time
for cgtest24 from 2m30 down to 2m15.
2008-06-11 12:05:39 +00:00
Adam Sampson
7a11d0b2c3 Include TypeSet in OpsM.
This means the TypeSet is only rebuilt when the ops are extended, not
each time the operation is applied (curse the unpredictability of
Haskell CAF optimisation).
2008-06-11 12:04:06 +00:00
Adam Sampson
02c444be95 Update abbrevation types in the state too.
This makes cgtest82 work, although I'm not very happy with it as a fix. I'd
rather have a way of ensuring the state's definitions are kept up to date when
we change something in the AST.
2008-06-10 13:57:01 +00:00
Adam Sampson
638a3f3c22 Allow a directed channel array to be sliced.
This lets you write things like "[cs! FOR 5]", which is horrible; I
would prefer "[cs FOR 5]!", since then that doesn't imply that you can
do things like "cs![0] ! 0".

However, Tock now compiles and passes cgtest87 -- the first occam-pi
cgtest we've handled. :)
2008-06-09 21:42:34 +00:00
Adam Sampson
62a0873d3d Implement channel direction decorators.
This is mostly straightforward: modify the parser to allow direction
decorators in the right places, and extend the type checker to match.
There's some slight awkwardness in that some of the Types functions
have to perform the same checks as the type checker (e.g. directing a
non-channel), so I've tidied up their error messages a bit.

At the backend, I've just added a little pass to strip out all the
DirectedVariables, since the other backend passes don't handle them
gracefully. From the occam/C point of view this is fine, but I'm not
sure if it's going to cause problems for C++.
2008-06-09 21:35:20 +00:00
Adam Sampson
04f72a62db Handle IsChannelArray when adding _sizes.
This also refactors the sizes-array-declaring code, pulling the
declaration of static sizes out to a helper function, and does a
couple of other minor cleanups to match.
2008-06-09 21:32:04 +00:00
Adam Sampson
ad875bd477 Fix abbreviation of channel ends in the C backend.
I'm pretty sure this test used to fail and got fixed, but I think the
test was fixed to match the incorrect code rather than the other way
around. What it's testing is the abbreviation of a channel end as an
identically-typed channel end, which (since they're both pointers)
should look something like:

Channel *c;
Channel *d = c;

Instead it was generating "d = &c", which broke cgtest87.

The change made to GenerateC to fix this feels a bit awkward to me --
it's very simple, but it's yet another special case in genVariableAM.
All of the genVariable code could really use reworking (again),
perhaps to use some internal representation of the C expression...
2008-06-09 21:19:01 +00:00
Adam Sampson
19484ec72e Show channel attributes in occam code. 2008-06-09 12:36:26 +00:00
Adam Sampson
23e1ba2eec Remove an "in the future" comment that's been done. 2008-06-06 10:15:43 +00:00
Neil Brown
c711dcd7fe Filled in getVarSpec, to record the variables read from and written to in specifications 2008-06-07 20:30:24 +00:00
Neil Brown
e39ebf5962 Added support for using the constraints in the background knowledge for the usage checking 2008-06-07 20:29:48 +00:00