summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-04-21Take kid synonyms into account when propagating constantsThomas Bauereiss
For example, in let datasize = e in ... the typechecker will generate a kid '_datasize if e has an existential type (with one kid), and in let 'datasize = e in ... the typechecker will bind both 'datasize and '_datasize. If we substitute one as part of constant propagation, this patch will make constant propagation also substitute the other.
2020-04-21Mono: Check for non-constant calls to make_the_valueThomas Bauereiss
... and try to resolve them using constant propagation.
2020-04-21Tweak types of loop combinators for prover combinatorsThomas Bauereiss
Split the variable (tuple) type into an input and output type. They are meant to be the same, but due to the way function types are instantiated, unification can fail in the case of existential types, as in the added test case (when trying to generate Lem definitions from it). The output of the loop will be checked against the expected type, though, due to a type annotation outside the loop added by the rewrite pass for variable updates.
2020-04-10Add test output to gitignoreThomas Bauereiss
2020-04-10Make bounds check for vector subrange assignments stricterThomas Bauereiss
Check that indices are within bounds, not just in the right (increasing/decreasing) order.
2020-04-10Update path for newer versions of BBV Coq libraryThomas Bauereiss
2020-04-10Be more careful when flow-typing loopsThomas Bauereiss
Asserting constraints from the loop condition in the body is fine for while-loops, but doesn't make sense for until-loops.
2020-03-19Improve a particularly unhelpful type errorAlasdair
From: No type variable 'ex14# to: Type error: [../and_let_bool.sail]:6:19-50 6 | and_bool(let y : bool = x in not_bool(y), x) | ^-----------------------------^ | The type variable 'ex14# would leak into an outer scope. | | Try adding a type annotation to this expression. | This error was caused by: | [../and_let_bool.sail]:6:23-24 | 6 | and_bool(let y : bool = x in not_bool(y), x) | | ^ | | Type variable 'ex14# was introduced here |
2020-03-18Expose details of failed lexp bounds checksThomas Bauereiss
Allows ASL-to-Sail translation to automatically patch lexp bounds check errors.
2020-02-24Allow overloading of subrange builtins for non-bitvectorsThomas Bauereiss
2020-02-21Make sure we test that struct literals have a complete set of fields. Fixes #60Alasdair Armstrong
2020-02-20More list C codegen fixes for issue #59Alasdair Armstrong
2020-02-20Fix missing code generation builtins for lists. Fixes #59Alasdair Armstrong
Also uncovered a few other issues w.r.t lists
2020-01-31Fix soundness bug found by MarkAlasdair
When returning a type from a letbinding we need to be careful that the type it returns does not refer to any type variable that only exists for the lifetime of the letbinding (because it was bound by it). Normally this fails because any type variable bound in the inner letbinding won't exist in the outer scope, but if it is shadowed this can cause an issue.
2020-01-17Merge scattered mapping fixesJames Clarke
2020-01-17Merge branch 'coq-bool-props' into sail2Brian Campbell
2020-01-16Allow effects on mappingsAlasdair Armstrong
2020-01-16Cleanup type-checking rule for LEXP_fieldAlasdair Armstrong
Was being overly conservative with nested structs and used an incorrect location for the error message
2019-12-10Introduce new bitfield syntax for ASL translationAlasdair Armstrong
Now we less desugared ASL we'd like to translate some notions more idiomatically, such as bitfields with names. However the current bitfield implementation in Sail is really ugly (entirely my fault) This commit introduces a new flag -new_bitfields which changes the behavior of bitfields as follows bitfield B : bits(32) = { Field: 7..0 } Is now treated as a struct with a single field called `bits` register R : B function main() -> unit = { R[Field] = 0xFF; assert(R[Field] == 0xFF) } then desugars as R.bits[7..0] = 0xFF and assert(R.bits[7..0] == 0xFF) which is much simpler, matches ASL and is probably how it should have worked all along
2019-12-06Don't introduce uneccesary control flow when compilingAlasdair Armstrong
2019-12-01Coq: remove last use and definition of doc_nc_propBrian Campbell
(plus test, as it wasn't covered before)
2019-11-22Add tests for monomorphisation improvement in eb0e17f2Brian Campbell
2019-11-11Make sure undefined_gen inserts enough type annotations for union constructorsAlasdair Armstrong
2019-11-07Make the world a slightly more sane and consistent placeAlasdair Armstrong
2019-11-07Backport fixes to SMT generation from poly_mapping branchAlasdair Armstrong
2019-11-05Forbid types declared after a scattered union being used in clausesAlasdair
The following is therefore always forbidden ``` scattered union U enum E = A | B | C union clause U = Ctor : E ``` We attempt to detect when this occurs and include a hint indicating the likely reason why a 'Undefined type E' error might occur in this circumstance
2019-11-05Improve type error for recursive types slightlyAlasdair Armstrong
2019-11-05Make sure we correctly forbid recursive datatypes that we don't want to supportAlasdair Armstrong
Ensure we give a nice error message that explains that recursive types are forbidden ``` Type error: [struct_rec.sail]:3:10-11 3 | field : S | ^ | Undefined type S | This error was caused by: | [struct_rec.sail]:2:0-4:1 | 2 |struct S = { | |^----------- | 4 |} | |^ | | Recursive types are not allowed ``` The theorem prover backends create a special register_value union that can be recursive, so we make sure to special case that.
2019-11-04Some almost-forgotten mono testsBrian Campbell
2019-11-01Add a missing well-formedness checkAlasdair
2019-10-02Coq: limited support for existentially-typed tuplesBrian Campbell
- in particular at monadic interfaces (i.e., sufficient for instruction ast types) - see commented out part of test/coq/pass/ast_with_dep_tuple.sail for an example that's not currently supported - generate definitions for type-level Bool definitions (i.e., predicates)
2019-09-02Enable part of a test that's been fixed recently.Brian Campbell
2019-08-30Add a couple of overlooked testsBrian Campbell
2019-08-29Clean up some mono testsBrian Campbell
2019-08-14Update testsThomas Bauereiss
2019-08-02Fix up some edge cases with the bitvector/polyvector splitBrian Campbell
Mostly in the Coq backend, plus a few testcases that use bitvector builtins on poly-vectors (which works on some backends, but not Coq). Also handle some additional list inclusion proofs in Coq.
2019-08-01Merge branch 'sail2' into separate_bvAlasdair Armstrong
2019-08-01Merge remote-tracking branch 'origin/rv_duopod_fix' into sail2Alasdair Armstrong
Fixes #53
2019-07-31Fix failing SMT testAlasdair Armstrong
2019-07-31Remove redundant ifdef and run SMT tests by defaultAlasdair Armstrong
2019-07-18Add a feature flag for barrier type changeAlasdair Armstrong
Fix SMT mem_builtin test case
2019-07-17Add another test caseAlasdair Armstrong
2019-07-16Fix all remaining tests for this branchAlasdair
2019-07-16Get monomorphisation tests working with separate bitvectorsAlasdair Armstrong
2019-07-16Merge remote-tracking branch 'origin/sail2' into separate_bvAlasdair Armstrong
2019-06-30Fix bug with toplevel pattern in RISC-V duopodAlasdair
Do this by making sure that generic pattern literal re-writing gets applied to top-level function clauses. This requires re-ordering the rewrites for most backends otherwise they break, which hopefully wo anything. After doing this re-ordering I had to turn off casting when rewriting bitvector patterns, otherwise insane things can happen.
2019-06-27SMT: Add a reverse endianness function and fix some bugsAlasdair Armstrong
2019-06-25SMT: Add another case to appendAlasdair Armstrong
2019-06-21Coq: add missing property derivation casts for effectful expressionsBrian Campbell
These don't appear much, but are now showing up in the sail-arm model due to an innocent change elsewhere.
2019-06-21Coq: be more careful when dealing with wildcard argument patternsBrian Campbell
If they're merged with a type variable then we still need to name the argument so that it can be used in other types.