summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-05-31Add SMT related things to libsail fileAlasdair Armstrong
2019-05-31Change specialization interface slightlyAlasdair Armstrong
2019-05-30Implement ones builtin in sail_lib and add to interpreter. However currently ↵Robert Norton
this is implemented in lib/vector_dec.sail as sail function that calls not_vec on sail_zeros.
2019-05-29SMT: Make bitvector equality work between vectors of different lengthsAlasdair Armstrong
2019-05-29SMT: Fix sail_truncate and sail_mask for unusual argument typesAlasdair Armstrong
2019-05-29Fix sail_truncate error message in SMTAlasdair Armstrong
2019-05-28Coq: don't output complex bool types at let expressionsBrian Campbell
2019-05-28SMT: Add min and max functionsAlasdair Armstrong
Allow conversion between int(n) and int in smt_conversion
2019-05-28Make sure single clause functions with top-level guards work correctlyAlasdair Armstrong
2019-05-24Add a :thin_slice command to isail to isolate a given set of functionsBrian Campbell
2019-05-24Coq: support if-then-throw typechecking special caseBrian Campbell
2019-05-23Coq: support loops which update richly typed variablesBrian Campbell
2019-05-22Coq: replace inferrable integer arguments with _ at more typesBrian Campbell
Previously we only checked at atom, now use destruct_atom_nexp to pick up implicit too.
2019-05-22Move Util.warn to Reporting, and make it take the location as a parameterAlasdair Armstrong
Also add a $suppress_warnings directive that ensures that no warnings are generated for a specific file.
2019-05-21SMT: Use a separate constructor for memory read variablesAlasdair Armstrong
We want to ensure simplication can treat these separately so we don't accidentally simplify away dependencies between reads and write addresses.
2019-05-21Fix: undefined_nat test for interpreterAlasdair Armstrong
2019-05-21SMT: Add control flow node numbers to memory events to track program orderAlasdair Armstrong
Add path conditions to memory events Allow simplication of generated SMT based on constructor kinds
2019-05-21Lem: Fix bug in generation of val-specsThomas Bauereiss
Used to output duplicate type variables in some cases.
2019-05-21Coq: introduce autocasts at variablesBrian Campbell
Usually we do this at function applications and casts, but occasionally a variable is used at a different type.
2019-05-20Revert "Add constraints to undefined vector functions to ensure that lengths ↵Brian Campbell
are" This reverts commit 8bed4e4ef414f93e02f28f0e5eb223a855ba3d14.
2019-05-20Filter termination measures during slicingBrian Campbell
2019-05-20Speed up graph construction by always keeping graph in normalized formBrian Campbell
Only checks the leaves that were added in each add_edge/add_edges call. Slicing bits of the 8.5 model went (for me) from intractable to about one second.
2019-05-20Coq: add some missing autocasts, avoid unnecessary patterns in letsBrian Campbell
The former is useful when a bitvector variable is cast to an equivalent length, and the latter is easier for Coq's unification to deal with.
2019-05-19Coq: remove unhelpful type printing restriction on early returnsBrian Campbell
2019-05-19Add constraints to undefined vector functions to ensure that lengths areBrian Campbell
sane, and an incomplete check on undefined literals.
2019-05-17SMT: Finish adding all memory builtins from lib/regfp.sailAlasdair Armstrong
2019-05-16Fix: Add a feature symbol for new constant type variable syntaxAlasdair Armstrong
2019-05-16SMT: Tweak SMT generation interfaceAlasdair Armstrong
Expose AST -> Jib compilation function for SMT, and smt_header function Functorise the optimiser so it can output the SMT definitions to any data structure
2019-05-16SMT: Improve simplification for generated SMTAlasdair Armstrong
Generate addresses, kinds, and values separately for read and write events. Add an mli interface for jib_smt.ml
2019-05-1594f445 introduced a new name for _ref_deref, add it to the effect rewritingBrian Campbell
2019-05-14SMT: Allow printing SMT with an optional variable prefixAlasdair Armstrong
Allows us to mix generated SMT for two separate threads without name clashes, however we do want to be able to share datatypes so they are not prefixed. Currently the pretty-printer adds the prefix but we may want a smt_def -> smt_def renaming function instead.
2019-05-14Various bugfixesAlasdair Armstrong
Since we have __deref to desugar *x in this file (as it's the one file everything includes) we might as well add a __bitfield_deref here too, for the bitfield setters. Make sure undefined_nat can be used in C Both -memo_z3 and -no_memo_z3 were listed as default options, now only -no_memo_z3 is listed as the default.
2019-05-14Merge branch 'smt_experiments' into sail2Alasdair Armstrong
2019-05-14SMT: Add comment explaining path conditionalsAlasdair Armstrong
2019-05-14Fix: Issue a warning for any unrecognised directiveAlasdair Armstrong
Fixes #46
2019-05-14Add feature that allows functions to require type variables are constantAlasdair Armstrong
can now write e.g. forall (constant 'n : Int) rather than forall ('n: Int) which requires 'n to be a constant integer value whenever the function is called. I added this to the 'addrsize variable on memory reads/writes to absolutely guarantee in the SMT generation that we don't have to worry about the address being a variable length bitvector.
2019-05-13Merge branch 'sail2' into smt_experimentsAlasdair
2019-05-13Parse dereferences in orderinary expressionsAlasdair
2019-05-13Interpreter: update memory intrinsics to include addrsize argumentJon French
2019-05-13Changes to toFromInterp backend to support aarch64_smallJon French
* Includes adding support for bitlist-Lem * Adds new command-line option -Ofast_undefined
2019-05-13don't emit cache_op_kind enum in LemJon French
2019-05-13add more primops for aarch64_small (sub_nat, append_list)Jon French
2019-05-13move simple_string_of_loc to Ast_utilJon French
2019-05-10SMT: Implement memory events for read_mem and write_memAlasdair
Generate SMT where the memory reads and writes are totally unconstrained, allowing additional constraints to be added that restrict the possible reads and writes based on some memory model.
2019-05-10SMT: Experiment with symbolic memory reads and writesAlasdair Armstrong
2019-05-10SMT: Fix error in get_pathcondAlasdair Armstrong
2019-05-10SMT: Lazily compute efficient path conditionalsAlasdair
Effectively reverts 7280e7b with a different method that isn't slow, although it's not totally clear that this is correct - it could just be more subtly wrong than before commit 7280e7b. Following is mostly so I can remember what I did to document & write up properly at some point: What we do is compute 'pi' conditions as before by traversing the dominator tree, we each node having a pi condition defined as the conjunction of all guards between it and the start node in the dominator tree. This is imprecise because we have situations like 1 / \ 2 3 | | | 4 | |\ 5 6 9 \ / | 7 10 | 8 where 8 = match_failure, 1 = start and 10 = return. 2, 3, 6 and 9 are guards as they come directly after a control flow split, which always follows a conditional jump. Here the path through the dominator tree for the match_failure is 1->7->8 which contains no guards so the pi condition would be empty. What we do now is walk backwards (CFG must be acyclic at this point) until we hit the join point prior to where we require a path condition. We then take the disjunction of the pi conditions for the join point's predecessors, so 5 and 6 in this case. Which gives us a path condition of 2 | (3 & 6) as the dominator chains are 1->2->5 and 1->3->4->6. I think this works as any split in the control flow must have been caused by a conditional jump followed by distinct guards, so each of the nodes immediately prior to a join point must be dominated by at least one unique guard. It also explains why the pi conditions seem sufficient to choose outcomes of phi functions. If we hit a guard before a join (such as 9 for return's path conditional) we just return the pi condition for that guard, i.e. (3 & 9) for 10. If we reach start then the path condition is simply true.
2019-05-09SMT: Add explicit terminators to SSA graphAlasdair Armstrong
Makes the graph slightly cleaner, and means we can represent conditionals in a way that shoud allow computing path conditions much easier. Essentially rather than a basic block being a list of instructions where the last instruction is a jump (or other terminator) it is now a list of instructions combined with an explict terminator, i.e. CF_block (instrs @ I_jump (cval, label) ==> CF_block (instrs, T_jump (n, label)) Rather than storing the cval in the T_jump it just has a number that links to a mapping from numbers to cvals, and we represent the negation of any cval in that table by negating its number. Therefore at any join point in the CFG, we can efficiently check when the joining path conditionals contain both n and minus n and remove both.
2019-05-09SMT: Make path conditionals more preciseAlasdair Armstrong
Previously path conditionals for a node were defined as the path conditional of the immediate dominator (+ a guard for explicit guard nodes after conditional branches), whereas now they are the path conditional of the immediate dominator plus an expression encapsulating all the guards between the immediate dominator and the node. This is needed as the previous method was incorrect for certain control flow graphs. This slows down the generated SMT massively, because it causes the path conditionals to become huge when the immediate dominator is far away from the node in question. It also changes computing path conditionals from O(n) to O(n^2) which is not ideal as our inlined graphs can become massive. Need to figure out a better way to generate minimal path conditionals between the immediate dominator and the node. I upped the timeout for the SMT tests from 20s to 300s each but this may still cause a failure in Jenkins because that machine is slow.
2019-05-08SMT: Add test for various real number propertiesAlasdair Armstrong