summaryrefslogtreecommitdiff
path: root/src/monomorphise.ml
AgeCommit message (Collapse)Author
2018-01-29Set maximum split size to work with aarch64 no vectorBrian Campbell
2018-01-29Turn off constraint substitution in monoBrian Campbell
(Type checker doesn't seem to use false aggressively enough for this)
2018-01-29Turn off warnings when rechecking after monoBrian Campbell
2018-01-29Avoid generating (_ as n) in mono, broke atom type rewritingBrian Campbell
2018-01-26One more mono rewriteBrian Campbell
2018-01-26Add replacement of complex nexp sizes by equivalent variables in monoBrian Campbell
2018-01-26Preserve more typing info in monomorphisation for later stagesBrian Campbell
2018-01-25Use set asserts as case splits in monomorphisationBrian Campbell
2018-01-25Missing type expansionBrian Campbell
2018-01-25Handle bound variables properly with precise case splittingBrian Campbell
2018-01-25Basic support for match x[5 .. 2] with case splitsBrian Campbell
2018-01-25Implement basic case splitting based on found case expressionsBrian Campbell
(makes some of the monomorphisation case splits smaller)
2018-01-19Update monomorphisation for sail2Brian Campbell
(no vector type start position, comment syntax)
2018-01-18Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-16Fix problem with let-bindings in pattern guardsThomas Bauereiss
Monomorphisation sometimes produces pattern guard with let-bindings, e.g. | ... if (let regsize = size_itself(regsize) in eq(regsize, 32)) -> ... Previously, the rewriting pass for let-bindings (and pattern guards) pulled these out of the guard condition and into the same scope as the case expression, which potentially clashed with let-bindings for the same variables in that case expression. The rewriter now leaves let-bindings in place within pure if-conditions, solving this problem.
2018-01-16Handle for loops correctly when rewriting size parametersBrian Campbell
2018-01-16Another useful monomorphisation rewriteBrian Campbell
2018-01-15Check monomorphisation case split size once for each patternBrian Campbell
(rather than for each argument separately)
2018-01-12Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-12Try to keep types for undefined around during monomorphisationBrian Campbell
Otherwise the type checker can't figure it out when we substitute
2018-01-12Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-12Remove generic comparisonBrian Campbell
2018-01-12Support constant propagation on casts in monomorphisationBrian Campbell
2018-01-10Add an all_split_errors optionBrian Campbell
2018-01-10Fix control dependencies in monomorphisation analysisBrian Campbell
2018-01-09More monomorphisation rewrites for aarch64Brian Campbell
2018-01-09Tidy up monomorphisation interfaceBrian Campbell
2018-01-09Proper location for no set constraint errorsBrian Campbell
2018-01-09Add some optional experimental rewrites to help with monomorphisationBrian Campbell
2018-01-02Experimenting with power specAlasdair Armstrong
2017-12-19Support user-defined exceptions in Lem shallow embeddingThomas Bauereiss
The type-checker already supports a user-defined "exception" type that can be used in throw and try-catch expressions. This patch adds support for that to the Lem shallow embedding by adapting the existing exception mechanisms of the state and prompt monads. User-defined exceptions are distinguished from builtin exception cases. For example, the state monad uses type ex 'e = | Exit | Assert of string | Throw of 'e to distinguish between calls to "exit", failed assertions, and user-defined exceptions, respectively. Early return is also handled using the exception mechanism, by lifting to a monad with "either 'r exception" as the exception type, where 'r is the expected return type and "exception" is the user-defined exception type.
2017-12-14Make sequential and mwords global variables in Lem pretty-printerThomas Bauereiss
2017-12-14Merge remote-tracking branch 'origin/experiments' into interactiveAlasdair Armstrong
2017-12-13Use big_nums from LemAlasdair Armstrong
2017-12-12Make mono analysis fail properly on effectful functionsBrian Campbell
2017-12-11Remove some duplication from monomorphisation analysis failure reportsBrian Campbell
2017-12-07Support monomorphisation with set constrained integersBrian Campbell
Also, to support this, constant propagation for integer multiply, fix substitution of concrete values for nvars, size parameters in single argument functions, fix kind for itself, add eq_atom to prelude
2017-12-06Remove filename mangling in monomorphisationBrian Campbell
Broke analysis a little
2017-12-06Add top-level pattern match guards internallyBrian Campbell
Also fix bug in mono analysis with generated variables Breaks lots of typechecking tests because it generates unnecessary equality tests on units (and the tests don't have generic equality), which I'll fix next.
2017-12-05Update license headers for Sail sourceAlasdair Armstrong
2017-11-27Replace bad generic comparisons in monoBrian Campbell
2017-11-27Case splitting on boolsBrian Campbell
(mostly to make test cases easier)
2017-11-24Use unbound precision big_ints throughout sail.Alasdair Armstrong
Alastair's test cases revealed that using regular ints causes issues throughout sail, where all kinds of things can internally overflow in edge cases. This either causes crashes (e.g. int_of_string fails for big ints) or bizarre inexplicable behaviour. This patch switches the sail AST to use big_int rather than int, and updates everything accordingly. This touches everything and there may be bugs where I mistranslated things, and also n = m will still typecheck with big_ints but fail at runtime (ocaml seems to have decided that static typing is unnecessary for equality...), as it needs to be changed to eq_big_int. I also got rid of the old unused ocaml backend while I was updating things, so as to not have to fix it.
2017-11-21Merge Thomas' suggested changesBrian Campbell
Use overloading to find eq/neq Track range/atom split Missing type expansion
2017-11-20Tidy last upBrian Campbell
2017-11-20Constant propagation in guardsBrian Campbell
2017-11-20Basic handling of recursive calls in monomorphisation analysisBrian Campbell
2017-11-20Look up the right type variables in monomorphisation analysisBrian Campbell
2017-11-20Support new nexp in monoBrian Campbell
2017-11-16Remove unused Typ_wild constructorAlasdair Armstrong