summaryrefslogtreecommitdiff
path: root/src/rewriter.ml
AgeCommit message (Collapse)Author
2017-08-10Add support for early return to Lem backendThomas Bauereiss
Implemented using the exception monad, by throwing and catching the return value
2017-08-08Various fixes and improvements for the Lem pretty-printingThomas Bauereiss
- Add some missing "wreg" effect annotations in the type checker - Improve pretty-printing of register type definitions: In addition to a "build" function, output an actual type definition, and some getter/setter functions for register fields - Fix a bug in sizeof rewriting that caused it to fail when rewriting nested calls of functions that contained sizeof expressions - Fix pretty-printing of user-defined union types with type variables (cf. test case option_either.sail) - Simplify nexps, e.g. "(8 * 8) - 1" becomes "63", in order to be able to output more type annotations with bitvector lengths - Add (back) some support for specifying Lem bindings in val specs using "val extern ... foo = bar" - Misc bug fixes
2017-08-02Improve pretty-printing of register declaration and assignmentThomas Bauereiss
2017-08-02Add debugging option to dump AST after rewriting stepsThomas Bauereiss
2017-08-01Fix some effect propagation bugs in rewriterThomas Bauereiss
2017-07-27Rewrite guarded patterns for Lem backendThomas Bauereiss
2017-07-27Add cons patterns to pretty-printersThomas Bauereiss
2017-07-26Improve rewriting of sizeof expressionsThomas Bauereiss
If some type-level variables in a sizeof expression in a function body cannot be directly extracted from the parameters of the function, add a new parameter for each unresolved parameter, and rewrite calls to the function accordingly
2017-07-25Add partial support for rewriting of sizeof expressionsThomas Bauereiss
Tries to extract values of nexps from the (type annotations of) parameters passed to the function. This seems to correspond to the behaviour of the previous typechecker.
2017-07-24Added cons patterns to sailAlasdair Armstrong
See test/typecheck/pass/cons_pattern.sail for an example. Also cleaned up the propagating effects code by making some of the variable names less verbose
2017-07-21Everything moved to new typecheckerAlasdair Armstrong
Modified initial_check.ml so it no longer requires type_internal. It's still needs cleaned up in a few ways. Most of the things it's trying to do could be done nicer if we took some time to re-factor it, and some of the things should just be handled by the main typechecker, leaving it as a think layer between the parse_ast and the ast. Now that's done everything can be switched to the new typechecker and the _new suffixes were deleted from everything except the monomorphisation pass because I don't know the status of that.
2017-07-21Switch to new typechecker (almost)Thomas Bauereiss
Initial typecheck still uses previous typechecker
2017-07-12Add checks for variable identifiers in pattern subsumptionThomas Bauereiss
2017-07-03Cleanup, and add support for variable bindings in bitvector patternsThomas Bauereiss
2017-06-29Rewrite bitvector patternsThomas Bauereiss
Seems to work for CHERI-MIPS, but still a few things to be done, e.g. collecting let bindings for variables bound in bitvector patterns
2017-03-24Checkpoint work-in-progress mips sequential interpreter using ocaml shallow ↵Robert Norton
embedding.
2017-03-24changes to ocaml pp to allow mips->ocaml to compileRobert Norton
2017-02-03fix headersPeter Sewell
2016-11-08fixesChristopher Pulte
2016-10-27more shallow embedding fixesChristopher Pulte
2016-10-26shallow embedding fixesChristopher Pulte
2016-10-13make sail-to-lem rewriting passes use dependency analysis, make dependency ↵Christopher Pulte
analysis include type information, small pp fix
2016-10-10changed the way registers/register fields work, fixes, nicer names for new ↵Christopher Pulte
letbound variables
2016-09-26nicer lem output: fewer unnecessary letbinds, monad binds and returnsChristopher Pulte
2016-09-25nicer lem output: no more unecessary 'unit' returns if if-expressions, ↵Christopher Pulte
for-loops or case-expressions also return updated variables
2016-09-24nicer lem output: fewer unecessary 'return'sChristopher Pulte
2016-09-19sail-to-lem progressChristopher Pulte
2016-09-16fixChristopher Pulte
2016-09-16make vector concatenation pattern removal deal with vector patterns of ↵Christopher Pulte
unknown length (in the last item)
2016-09-07push some lem pp changesChristopher Pulte
2016-08-14Start adding form for (a,b,c) := foo()Kathy Gray
Not working yet
2016-08-10Fix sizeof code generation to look at parameter boundsKathy Gray
2016-07-23Add a return exp form to Sail, supported in type checker and in interpreter.Kathy Gray
TODO: add an event for a return so that rewriters can find and remove them as needed for OCaml and Lem
2016-07-20Make rewriter understand type abbreviations for removing internal_exp instancesKathy Gray
2016-05-27Add sizeof to sail. Documentation to followKathy Gray
2016-03-02Add new language feature to permit definitions of items of kind Nat, etc as ↵Kathy Gray
well as items of kind Type. Syntax for the feature is: def Nat id = nexp Note: some useful nexps may not parse properly. All typedef forms can also be used as def Type ... if desired, but this is not required.
2016-01-26move closer to power.sail -> power.ml outputKathy Gray
2016-01-21Start splitting values/etc into int/big_int for ocaml generationKathy Gray
2016-01-14small edit to previous commitKathy Gray
2016-01-14Fix cumulative effects for circumstance when lifting variable introductions ↵Kathy Gray
out of an if Note: this fixes the local cumulative effects for the e_assign and e_if, it may not properly propagate them to the context of the surrounding block
2016-01-12Fix undefined nvar occurrences that were impacting ARMKathy Gray
2016-01-07Add E_assert to basic rewritersKathy Gray
2015-12-21fixes, pp progressChristopher
2015-12-16rewriter and pp changes for generating ARM outputChristopher
2015-12-15better location informationChristopher
2015-12-10fixChristopher
2015-12-09adapted for Kathy's lexp effect typing changes: register writes should be ↵Christopher
correct now, fixes, pp
2015-11-25fixes, ppChristopher Pulte
2015-11-22do effect annotation updates more systematically, fix dedupChristopher Pulte
2015-11-20no more unecessary variables from removing vector-concatenation pattern ↵Christopher Pulte
matches, reset variable name counter for each function clause, fixes