Commit Graph

138 Commits

Author SHA1 Message Date
Matthew Brecknell d108e3edee lib: a more intuitive definition of sign_extend for words
Also includes some supporting lemmas useful in bitfield proofs.
2017-12-21 21:41:01 +11:00
Matthew Brecknell edb30fa752 lib: faster simplification for common cases of word_and_max_word
In particular, this speeds up some bitfield proofs.
2017-12-21 21:41:01 +11:00
Matthew Brecknell 09b793855b word-lib: add some lemmas about sign extension 2017-12-18 12:48:10 +11:00
Rafal Kolanski 877312f080 lib: generic/word/monad/hoare lemmas from SELFOUR-242 verification
Notably useful is hoare_vcg_lift_imp' which generates an implication
rather than a disjunction.

Monadic rewrite rules should be modified to preserve bound variable
names, as demonstrated by monadic_rewrite_symb_exec_l'_preserve_names.
Addressing this more comprehensively is left as a TODO item for the
future (see VER-554).
2017-11-27 21:00:04 +11:00
Thomas Sewell 8753c05b20 Expand eval_bool; add a method word_eqI_solve.
A number of proofs begin with word_eqI followed by some similar steps,
suggesting a 'word_eqI_solve' proof method, which is implemented here.

Many of these steps are standard, however a tricky part is that constants of
type 'nat' which encode a particular number of bits must often be unfolded.
This was done by expanding the eval_bool machinery to add eval_int_nat, which
tries to evaluate ints and nats.

Testing eval_int_nat revealed the need to improve the code generator setup
somewhat. The Arch locale contains many of the relevant constants, and they are
given global names via requalify_const, but the code generator doesn't know
about them. Some tweaks make them available. I *think* this is safe for
arch_split, as long as the proofs that derive from them are true in each
architecture.
2017-11-01 17:30:46 +11:00
Matthew Brecknell b41f67ac51 Isabelle2017: update Word_Lib for RC0
* Various equalities from underlying HOL-Word have been reoriented.

  * word_eqI is no longer rule_format.

  * zdiff_zmod_* were renamed to mod_diff_*_eq.
2017-10-30 12:23:26 +11:00
Matthew Brecknell 27ae2ca752 lib: move some lemmas from bitfield proofs to word-lib 2017-08-11 11:24:25 +10:00
Alejandro Gomez-Londono 796887d9b1 Removes all trailing whitespaces 2017-07-12 15:13:51 +10:00
Gerwin Klein 18a7a76715 wordlib: show type for ucast/scast/revcast
Idea and initial code by Simon Winwood.
2017-06-19 14:32:44 +10:00
Matthew Brecknell 9ea2232d11 Word_Lib: miscellaneous conditional injectivity rules 2017-06-19 14:32:39 +10:00
Matthew Brecknell 0bbfb85d85 Word_Lib: add le_mask_shiftl_le_mask 2017-06-19 14:32:39 +10:00
Rafal Kolanski 1758666208 lib: add definition for word_ctz (count trailing zeros)
Nothing proved about this so far. Stated as most obvious formulation.
Needed for CParser to take in spec of __builtin_ctzl wrapper.
2017-02-22 06:54:59 +11:00
Rafal Kolanski a40d6986fd lib: word and misc lemmas from SELFOUR-242 proofs
These precipitated out during cleanup.
2017-02-09 15:05:52 +11:00
Joel Beeren 3dafec7d46 backport changes to ARM proofs from X64 work in progress
- replace ARM-specific constants and types with aliases which can be
  instantiated separately for each architecture.
- expand lib with lemmas used in X64 proofs.
- simplify some proofs.

Also-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2017-01-27 08:31:07 +11:00
Matthew Brecknell 1a590fbbb2 Isabelle2016-1: update Word_Lib
Word_Lib now looks more like the current AFP entry, though there are
still some local modifications.
2017-01-05 14:21:06 +11:00
Rafal Kolanski 72349f81fd Revert SELFOUR-242: invert bitfield scheduler and optimise fast path
This reverts:
- a67b443ca5
    "SELFOUR-242: update goal number based indentation in Fastpath_C"
- f704cf0404
    "SELFOUR-242: invert bitfield scheduler and optimise fast path"

Verification confirmed functional correctness and refinement of the
system in this case. However, guarantees on thread scheduling and
fairness are not modeled in the current verification. Once this issue is
addressed, SELFOUR-242 will be re-examined.
2016-11-16 14:02:50 +11:00
Rafal Kolanski f704cf0404 SELFOUR-242: invert bitfield scheduler and optimise fast path
* Reverse the level 2 of the bitmap scheduler to move the highest priority
  threads' level 2 entries into the same cache line as the level 1.
* Use the bitfield scheduler to make the fast path a more common occurrence.
* Change possibleSwitchTo to not invoke scheduler when the fast path would not
  invoke it either (using implicit assumptions about the current thread being
  the highest priority schedulable thread)
2016-11-15 09:20:31 +11:00
Matthew Brecknell 92148ce8e7 Word_Lib: lemmas comparing different word sizes 2016-10-05 02:43:41 +11:00
Gerwin Klein 8db1458ca6 word_lib: author list = currently active people, everyone else in acks 2016-06-02 13:59:04 +10:00
Gerwin Klein 88d6590e9f Merge pull request #44 in SEL4/l4v from pr-10 to master
* commit 'aa50dc6858f5dbe2a2b643bcb18cc609afdee15f':
  Word_Lemmas: NOT_mask_shifted_lenword
2016-05-20 03:51:47 +00:00
Joel Beeren 75246170d3 Word_Lib: added 64-bit word instances 2016-05-19 16:25:08 +10:00
diekmann aa50dc6858 Word_Lemmas: NOT_mask_shifted_lenword
[rebased from https://github.com/seL4/l4v/pull/10]
2016-05-18 19:03:48 +10:00
Gerwin Klein cd930d2d2d word_lib: move unrelated lemmas out of Word_Lib into Lib 2016-05-16 21:11:40 +10:00
Gerwin Klein e2ae586af7 word_lib: AFP document setup 2016-05-16 21:11:40 +10:00
Gerwin Klein 09117a690b word_lib: run isabelle update_then for new style and fun 2016-05-16 21:11:40 +10:00
Gerwin Klein 323de3784f word_lib: use cartouches 2016-05-16 21:11:40 +10:00
Gerwin Klein dd78d1438c word_lib: prettify Enumeration.thy 2016-05-16 21:11:40 +10:00
Gerwin Klein f88c4184ff lib: move Distinct_Prop out of Word_Lib 2016-05-16 21:11:40 +10:00
Gerwin Klein 2d8f9596ec word_lib: Distinct_Prop cleanup 2016-05-16 21:11:40 +10:00
Gerwin Klein 2367dff983 word_lib: move out unused HOL_Lemmas 2016-05-16 21:11:40 +10:00
Gerwin Klein d162d8d01f word_lib: normalise negative signed words as well. 2016-05-16 21:11:40 +10:00
Gerwin Klein 0ced46820b manual levity into Word_Lemmas 2016-05-16 21:11:40 +10:00
Gerwin Klein 322f1023f5 word_lib: adjust theory dependencies 2016-05-16 21:11:40 +10:00
Gerwin Klein 445efb7c29 lib: closure for Word_Lib and own session 2016-05-16 21:11:40 +10:00
Gerwin Klein f0faa90f8a lib/spec/proof/tools: fix word change fallout 2016-05-16 21:11:40 +10:00
Gerwin Klein 1359602ffb word_lib: AFP naming conventions 2016-05-16 21:11:40 +10:00
Gerwin Klein 8b78d18d97 lib: missing copyright headers; mark untested thys 2016-05-16 21:11:40 +10:00
Gerwin Klein 84b923a677 lib: start disentangling spaghetti word dependencies 2016-05-16 21:11:40 +10:00