Commit Graph

115 Commits

Author SHA1 Message Date
Gerwin Klein 71e78ac126 isabelle2021-1 word_lib: make bit_simps [simp]
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein c9f8e023f4 isabelle2021-1 word_lib: tweak word_eqI method
More controlled simpset setup, so we don't get warnings if we have
bit_simps in the simpset already.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein a0bf14024e isabelle2021-1 word_lib: sync from AFP
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein bba7dd942b word_lib internal: update from definition tweaks
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 15d9167521 word_lib: provide more backwards compatible names
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 60126b5591 word_lib: use more general bit_simps in word_eqI
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 25d2da46e1 isabelle2021-1: Word_Lib adjustments for l4v
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 1b15714cbf isabelle2021-1: sync Word_Lib from afp
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein d3ecd0e451 aarch64 lib: add 64 bit word setup
This is equal to the setup for RISCV64 and X64.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-03 16:13:45 +11:00
Gerwin Klein 203af59e29 word_lib: make sure Word_Lib setup is not shadowed
The theory import order is important for name shadowing, including
default rules for induction and cases. This commit makes sure we
get the Word_Lib version by default, not the HOL.Word version.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein ac325266b8 Word_Lib: make word_and_max_simps 64bit clean
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 414eb5ce3d Word_Lib: simplify numeral + Suc 0 expressions
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein be4d042525 isabelle-2021: add no_0_dvd bundle
Terms of the form "of_nat x = 0" get rewritten into
"~x dvd 2^LENGTH('a)", which is almost never what you want for
concrete word sizes. This bundle makes it easy to remove those rules
locally.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 42e174ce1f isabelle-2021: additional word lemmas
These were needed in the rest of the Isabelle2021 update.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 0dba5d8331 word_lib: sync with AFP
This commit makes set_bit possible to instantiate for type nat.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein ee8dbcb09c isabelle-2021: AutoCorres update
includes Word_Lib tweaks

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 4afa4734a5 word_lib: remove unused theories
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 8715767431 word_lib: reduce warnings
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 84fc895f21 word_lib: Word_x shadow each other
Word_32 and Word_64 shouldn't be included at the same time, they
both define default word_size and other notions. This commit refactors
them to be usable independently and also makes the type names available
independently from all of the Word_x theories.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 9d7efd75e2 isabelle-2021: cparser+tests update
This includes a tweak to Word_Lib to simplify ucast(-1) which
is now a term that occurs more often.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein dadb0b9f0a isabelle-2021: sync Word_Lib from AFP
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Ryan Barry a99a2bf739 various: resolve some existing fixmes
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-07-22 10:44:43 +10:00
Mitchell Buckley 2cf89e20c8 Cleanup some FIXMEs in AInvs and related sessions
Mostly moving lemmas up into various lemma bucket theories. Also:
* replace cte_wp_at_eqD with cte_wp_at_norm (equal lemmas)
* pd_shifting_gen generalise pd_shifting' in 2 architectures
* remove some redundant crunch lemmas

Signed-off-by: Mitchell Buckley <Mitchell.Buckley@data61.csiro.au>
2021-07-16 14:13:07 +10:00
Mitchell Buckley 6386f753fa riscv: use `uint8_t` for `register_t`
`register_t` only needs to be able to index into the TCB user context
array, which has 35 entries on RISC-V. Therefore `uint8_t` is
sufficient.

Using the smallest possible type for `register_t` helps with binary
verification. This shrinks static read-only data, which in turn reduces
the complexity of binary verification proof search.

This commit verifies the corresponding C kernel patch.

Co-authored-by: Zoltan Kocsis <Zoltan.Kocsis@data61.csiro.au>
Signed-off-by: Mitchell Buckley <Mitchell.Buckley@data61.csiro.au>
Signed-off-by: Zoltan Kocsis <Zoltan.Kocsis@data61.csiro.au>
2021-03-24 08:47:19 +11:00
Matthew Brecknell 4278e99aa4 riscv crefine: generalise and move some lemmas
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-23 22:40:46 +11:00
Gerwin Klein a45adef66a all: remove theory import path references
In Isabelle2020, when isabelle jedit is started without a session
context, e.g. `isabelle jedit -l ASpec`, theory imports with path
references cause the isabelle process to hang.

Since sessions now declare directories, Isabelle can find those files
without path reference and we therefore remove all such path references
from import statements. With this, `jedit` and `build` should work with
and without explicit session context as before.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 10:16:17 +10:00
Gerwin Klein 600836ec7f word_lib: re-sync with AFP; fix broken document
Also switched on document generation so we don't miss these in the future.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
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