Commit Graph

20 Commits

Author SHA1 Message Date
Japheth Lim 44bdf90ae8 autocorres, lib: refactor `nat :: bit_operations` instance
This refactors the instances in HaskellLib and AutoCorres into a new
theory, Lib.NatBitwise.
2019-07-24 11:00:02 +10:00
Japheth Lim 5685af2bcb autocorres: word abs for bitwise operators
This adds translation rules for bitwise operators, along with suitable
guards. Note that the guard for signed `shiftl` follows the C standard,
rather than the incorrect c-parser guard (see VER-509).

There was no standard instance of `nat :: bit_operations` for unsigned
abstraction, so we also add one. It should be merged with the
(incomplete) HaskellLib instance later.

Closes Jira VER-1122.
2019-07-24 10:41:55 +10:00
Japheth Lim ec74efcb9e autocorres: fix bug between heap abs and signed word abs
Jira VER-1112
2019-07-10 13:59:53 +10:00
Gerwin Klein 3b0699b656 autocorres: Isabelle2019 update 2019-06-13 16:22:33 +10:00
Gerwin Klein 6b9d9d24dd Isabelle2018: new "op x" syntax; now is "(x)"
(result of "isabelle update_op -m <dir>")
2018-08-20 09:06:35 +10:00
Matthew Brecknell 58efe0804f autocorres: support 64-bit platforms
* Consistently use the c-parser 'addr' type alias for pointer values.
* Include word abstraction and polish for 64-bit integral types.
* Include all current c-parser platforms in release packaging scripts.

More work is required to properly abstract AutoCorres tests across
architectures. The tests currently pass for both ARM and X64.  However,
in a number of tests, we exploit the coincidences that 'int' is the same
size on both platforms (32 bits), and that 'long' is the same as the
pointer size on each platform (32 bits and 64 bits, respectively).
2017-04-03 14:46:53 +10:00
Matthew Brecknell 7d0425dd3e Isabelle2016-1: fix proofs using lemmas now removed
Some lemmas that were specific instances of more general lemmas have
been removed from the library. In most cases, broken references could
simply be replaced with the more general fact.
2017-01-05 14:23:11 +11:00
Japheth Lim 4453635a8d autocorres: global context cleanup; minor tweaks to proofs
This removes some modifications that the theories make to the simpset
and other global context, which slightly reduces breakage when importing
AutoCorres into other theories.

Unfortunately, some of the tests/examples seem to rely on specific
modifications to simp and wp, so removing those will be harder.
Also some simplification stages still seem to use the global simpset
instead of AUTOCORRES_SIMPSET; need to debug later.
2016-06-02 16:50:03 +10:00
Japheth Lim 5b0f2ebbcd autocorres: upgrade from Named_Thm to named_theorems
This gets rid of the attribute setup boilerplate (but see Utils.get_rules).
Closes issue VER-293.
2016-06-02 16:50:03 +10:00
Japheth Lim 26a7907c95 Merge pull request #43 in SEL4/l4v from ~JALIM/l4v:autocorres-seL4 to master
* commit 'ecbb860532b4c576fc4726a805802f16bcf5302c': (29 commits)
  autocorres-crefine: specialise corres_no_failI for compatibility with Refine
  Add license tags for autocorres-crefine files
  crefine: refactor AutoCorresTest a bit
  autocorres-crefine: remove local debugging imports
  Fix InfoFlowC to accommodate corres_underlying changes.
  Fix DRefine to accommodate corres_underlying changes.
  autocorres-crefine: experiment with manually translating a function (clzl).
  autocorres-crefine: experiment with translating bitfield_gen specs.
  autocorres-crefine: start a test case for function calls.
  autocorres-crefine: update example proofs to work with no_c_termination, which does not require proving termination for the C spec.
  autocorres: add user option "no_c_termination" for previous patch.
  Making termination proof optional for AutoCorres.
  WIP: autocorres: hacky proof of concept for incremental translation.
  autocorres: add some missing WordAbstract rules.
  autocorres-crefine: fix some comments in work theory.
  autocorres-crefine: prove modifies and (simple) terminates specs.
  autocorres-crefine: experiment with generating modifies proofs
  autocorres-crefine: run autocorres in kernel_all_substitute locale
  autocorres-crefine: update another corres_UL that snuck in before rebasing.
  autocorres-crefine: working ccorres for handleYield (modulo some white lies).
  ...
2016-05-19 01:19:58 +00:00
Gerwin Klein 322f1023f5 word_lib: adjust theory dependencies 2016-05-16 21:11:40 +10:00
Japheth Lim 17ed76fc19 Merge branch 'master' into autocorres-seL4 2016-05-13 17:45:06 +10:00
Japheth Lim 05dd160007 autocorres: add Spec translation rules for heap and word abstraction.
Heap abstraction can now translate MODIFIES specs, but will probably
break on anything more exotic.
2016-05-12 15:20:10 +10:00
Japheth Lim a6f8332d60 autocorres: add some missing WordAbstract rules. 2016-04-28 17:01:13 +10:00
Japheth Lim 8954c3ca11 autocorres: use SIMPL semantics for un-translated functions.
Previously, these functions were unsatisfyingly translated to “fail”.
By default, functions are wrapped in the constructs AC_call_simpl
and L1_call_simpl.
2016-01-22 14:49:13 +11:00
Japheth Lim 36fc7f1dd7 autocorres: remove type restriction in WordAbstract rule.
The restriction in corresTA_L2_call (?ex was always unified to "id")
caused corresTA_L2_call' (which produces uglier output) to be used
in situations where the first rule should have sufficed.

Reported by Lars Noschinski.
2015-08-31 16:00:44 +10:00
Japheth Lim 26b389ae54 autocorres: add "no_opt" option to turn off some simplifications.
No guarantee that this will make autocorres produce the output you want, or produce output at all.

JIRA issue: VER-428
2014-11-24 11:39:21 +11:00
Gerwin Klein 1af1d2b67b some of the global Isabelle2014 renames
option_case -> case_option
sum_case -> case_sum
prod_case -> case_prod
Option.set -> set_option
Option.map -> map_option
option_rel -> rel_option
list_all2_def -> list_all2_iff
map.simps -> list.map
tl.simps -> list.sel(2-3)
the.simps -> option.sel
2014-08-09 15:39:20 +10:00
Lars Noschinski fe36a97b4d Port AutoCorres to Isabelle 2014-RC0 2014-08-08 17:29:54 +10:00
Gerwin Klein 2a03e81df4 Import release snapshot. 2014-07-14 21:32:44 +02:00