Commit Graph

138 Commits

Author SHA1 Message Date
Gerwin Klein 9b2836ef53 word_lib: sync from AFP
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein e7fb36b7e2 ROOT files: file reorg for new ROOT requirements
Isabelle2020 requires each session to declare it own set of directories that
may not overlap with other session's directories. This commit reorganises
files to comply with that requirement.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Matthew Brecknell 91abdb5720 lib: add upcast_less_unat_less
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-09 21:33:35 +10:00
Rafal Kolanski 58866c624f Word_Lib: add mask/le/unat lemmas from RISCV64 theories
neq_0_unat
unat_and_mask_le
sign_extend_less_mask_idem
word_and_le
le_smaller_mask

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Victor Phan a7ed68e75d x64 crefine/lib: move word lemmas out of Move_C into Word_Lemmas_64_Internal
Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-04-21 14:42:22 +10:00
Edward Pierzchalski 62c8c799bc asmrefine: add missing signed cast rewrite
Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-03-28 11:17:28 +11:00
Gerwin Klein c68915b92b license: provide documentation under CC-BY-SA-4.0
Datat61 provides all docs under CC-BY-SA-4.0.
2020-03-16 14:19:15 +08:00
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08:00
Gerwin Klein 8d12d8e4be licenses: tag .md and document file 2020-03-02 18:52:15 +08:00
Rafal Kolanski 8c42173a70 Word_Lib: add from_bool_eqI 2020-02-13 12:29:52 +11:00
Zoltan Kocsis 72064236cd word-lib: strengthen ucast_less_ucast 2020-02-05 17:50:45 +11:00
Zoltan Kocsis 43fc7e26d8 word-lib: add upward cast monotonicity lemmata 2020-02-03 16:53:43 +11:00
Gerwin Klein 1970ed0ce0 word_lib internal + crefine: remove duplicate lemma 2019-11-15 12:08:22 +11:00
Gerwin Klein 3bce45dd25 word_lib: avoid shadowing existing lemma 2019-11-15 12:08:20 +11:00
Gerwin Klein 0fc9ab947d word_lib: add new material from l4v to AFP; cleanup 2019-11-15 12:08:20 +11:00
Gerwin Klein 9a1231bf97 word_lib internal: move up lemmas from Word_Lemmas_Internal
(non-AFP part)
2019-11-15 12:08:20 +11:00
Gerwin Klein 13143d7246 word_lib internal: cleanup 2019-11-15 12:08:20 +11:00
Gerwin Klein ad8923293e word_lib: shorter, more automatic proofs 2019-11-15 12:08:20 +11:00
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
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