Commit Graph

70 Commits

Author SHA1 Message Date
Gerwin Klein e5ce178f1e word_lib: add mask_range 2019-11-15 12:08:20 +11:00
Gerwin Klein 3cffac8415 word_lib: word_eqI and word_eqI_solve methods
Improvements on initial version by Thomas Sewell
2019-11-15 12:08:20 +11:00
Victor Phan 67b8237e61 lib: add word lemma
Add of_nat_unat_le_mask_ucast: equality of words where one is wrapped with
of_nat (unat _).
2019-11-12 18:28:40 +11:00
Gerwin Klein d2584a3692 cleanup: collect word lemmas 2019-11-12 18:28:40 +11:00
Victor Phan 67bba7edc3 lib, x64 crefine: remove word lemma unat_ucast_8_64
unat_ucast_8_64 states that upcasting an 8 word to a 64 word does not
changes its value. We have a generic lemma for this which can be
specialised to this lemma: unat_ucast_up_simp[where 'a=8 and 'b=64,
simplified].
2019-10-30 19:09:39 +11:00
Victor Phan bbfd9e2a82 lib: add helper lemmas 2019-10-10 11:27:17 +11:00
Rafal Kolanski d804b7a8d1 Word_Lib: add ucast_shiftl_eq_0 2019-07-31 16:55:32 +10:00
Rafal Kolanski f3d95dbb8f Word_Lib: add masking lemmas from RISCV64 lookup proofs 2019-07-31 16:55:31 +10:00
Gerwin Klein 65cc19c172 lib: move up library lemmas from RISCV64 and X64 2019-07-31 16:55:31 +10:00
Gerwin Klein 21f9a86dd9 lib: sync Word_Lib with AFP 2019-06-13 16:22:33 +10:00
Japheth Lim aba4051957 lib: fix mixfix syntax for upto_enum
The previous version didn't have whitespace around the “.e.”, which
caused printed terms to be misparsed as qualified names.
2019-02-04 13:26:21 +11:00
Gerwin Klein 69f00fd7f7 word_lib: cleaning up some old proofs 2018-10-25 12:54:01 +11:00
Edward Pierzchalski d3713d7990 lib: add some pure word lemmas found in proof/*
Preparation for removing duplicate word lemmas. These new lemmas
don't belong in the AFP word library, so we hook in to
`Word_Lemmas_Prefix` to expose them to our own theories.
2018-10-10 14:15:00 +11:00
Edward Pierzchalski b7d680a25e lib: speed up word8_exhaust 2018-10-10 14:15:00 +11:00
Rafal Kolanski df41be8092 lib: trivial: remove trailing whitespace in root.tex 2018-08-21 15:46:03 +10:00
Gerwin Klein c9f32225a4 Word_Lib: sync with AFP 2018-08-20 09:06:37 +10:00
Gerwin Klein efe8d89a99 Word_Lib: record OTHER_BSD license for AFP contrib theory 2018-08-20 09:06:36 +10:00
Gerwin Klein 04f4336a5f Word_Lib: sync with AFP 2018-08-20 09:06:36 +10:00
Gerwin Klein 62b0ab207b Word_Lib: consolidate LemmaBucket and Lib lemmas into Word_Lib 2018-08-20 09:06:36 +10:00
Gerwin Klein b02bf100dd lib/Word_Lib: import merge fixup from AFP
This commit keeps Word_Lib in sync with the AFP
2018-08-20 09:06:36 +10:00
Gerwin Klein 7f3fa50a32 lib/Word_Lib: sync with AFP 2018-08-20 09:06:35 +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
Gerwin Klein b1aa74d306 Isabelle2018 lib: Word_Lib 2018-08-20 09:06:34 +10:00
Gerwin Klein b66d26f7e6 lib/Word_Lib: use qualified session imports
This also makes the dependency on lib/Distinct_Prop and $L4V_ARCH/WordSetup
more explicit.
2018-08-20 09:05:52 +10:00
Gerwin Klein 9a4d2677e3 lib+spec: move definition of machine_word to Word_Lib
JIRA VER-963
2018-08-06 11:22:52 +10:00
Matthew Brecknell c390013909 x64 crefine: prove several lemmas in Retype_C
To prove that retyping a TCB establishes the state relation for TCBs,
it is necessary to prove that the C FPU null state is always equal to
the Haskell FPU null state. This commit therefore includes some
machinery for maintaining the state relation for the FPU null state,
and repairs many proofs.
2018-07-05 16:23:15 +10:00
Michael Sproul 19d9085b15 lib: word lemma about mask and shiftl 2018-07-05 16:23:15 +10:00
Michael Sproul df9c791a3f lib: add some word lemmas about sless, word_bits 2018-07-05 16:23:15 +10:00
Matthew Brecknell 1ec4a8b12c lib: miscellaneous word lemmas 2018-07-05 16:23:15 +10:00
Matthew Brecknell bcac2c8492 x64: clear some sorry proofs from CSpace_C
Also update some Haskell and abstract specs relating to IO ports.
2018-07-05 16:23:14 +10:00
Rafal Kolanski d99efd0dd5 lib: Word_Lemmas: sign_extended addition and ~~mask lemmas 2018-07-05 16:23:14 +10:00
Rafal Kolanski d4996217b3 lib: add generic lemmas from SELFOUR-584 updates
Mainly concerning word_ctz and enumeration_both.
2018-06-15 18:48:47 +10:00
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