Commit Graph

767 Commits

Author SHA1 Message Date
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 98e122935c clib: add a `hoarep_rewrite` method
This is like `ccorres_rewrite`, but for `hoarep`, and uses the same
infrastructure.

The interaction between the `simpl_rewrite` locale and the
`simpl_rewrite` method was confusing, and didn't work well with multiple
interpretations. We replace the locale with a simple anonymous context
block. Since that puts more things in the global namespace, we rename
many of them. The `simpl_rewrite` method is now parameterised by a `hom`
fact which determines the predicate under which we are rewriting.

This also includes a slight generalisation of `exec_eq_is_valid_eq`,
which allows a similar generalisation of `hoarep_rewrite`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-13 12:11:58 +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
Gerwin Klein 4782dc369b
lib/riscv refine: move lemma (#33)
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 09:14:27 +08:00
Corey Lewis a6ffe216e3 lib: improve crunch warning message
Refactor crunch to separately specify whether crunch_simps or
crunch_wps might be useful instead of printing one combined message.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2020-07-24 11:55:50 +10:00
Corey Lewis dad926df45 lib: improve crunch warning message
Change crunch to only warn when crunch_simps or crunch_wps can make
progress on the first goal. Previously it would try on all remaining
subgoals, which led to spurious warnings when schematic postconditions
could be unified incorrectly.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2020-07-23 17:35:52 +10:00
Gerwin Klein b356f65969 lib: in_case and find_case methods
We already have find_goal, but the interface is a bit too unwieldy to
casually use frequently. This commit introduces (or moves from RISCV)
two methods on top of find_goal:

 - `in_case x`: asserts the goal has an assumption `?t = x`
 - `find_case x`: finds a goal such that `in_case x`

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-13 11:59:43 +08:00
Gerwin Klein 6ffa80e032 lib: avoid some syntax warnings
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-08 12:29:25 +08:00
Gerwin Klein d3945f4cab lib: cong rules for corres
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-08 12:29:25 +08:00
Gerwin Klein 640f5654d5 lib: corres rules for abstract-side failure
Treatment of fail/assert/stateAssert when you don't have to prove non-failure
of the concrete side, and lemmas for switching between nf and ¬nf for the
abstract side when no_fail is already proved separately.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-02 11:30:56 +08:00
Rafal Kolanski 0cc971f491 lib: add lemmas from RISCV64 theories
Some improved ccorres lemmas, dealing with throw and catch, and usual
assortment of misc list/set/map lemmas.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08: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
Edward Pierzchalski bd4392d132 lib: add ML_goal command
Sometimes we want to prove a fact, but the fact is painful or
error-prone to type out manually. In these cases, we'd like to construct
the goal fact using ML and then immediately enter a proof block.

Previously, we could achieve something like this through careful use of
`Thm.trivial` and `schematic_goal`, but this would clutter up the ML
namespace and wouln't handle meta conjuncts (`&&&`). The new `ML_goal`
command addresses both of these issues.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-13 11:53:50 +08:00
Edward Pierzchalski b153cb9571 lib: add some list utilities
Adds `unfold` for constructing a list from a generating function, and
adds `range` for constructing a range of numbers.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-13 11:53:35 +08:00
Gerwin Klein 77067c2462 lib AddUpdSimps: cleanup + remove old debugging code
The command produced warnings as debug output.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-04 17:02:58 +08:00
Gerwin Klein 3aa849daea lib: remove infix warning
The (=) syntax is Isabelle, not ML, and was updated accidentally.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-04 16:08:51 +08:00
Victor Phan 51ff27cce6 lib: remove eq_restrict_map_None from the simp set
Hotfix for a7ed68e75d, which moved some lemmas from X64 Move_C.thy into
Lib. `eq_restrict_map_None` being in the simp set caused several
breakages across other arches.

Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-04-23 11:40:38 +10: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
Corey Lewis 170e8109ec lib: refactor crunch warning messages to handle functions with multiple patterns
Crunch would print spurious warning messages when using a rule with multiple
premises. By default, crunch generates a rule like that when applied to
functions with multiple non-trivial patterns.
2020-02-28 13:46:25 +11:00
Victor Phan 966734c69b Collect abstract lemmas in Refine
Create ArchMove_R.thy for transporting arch specific lemmas (and generic
lemmas that are used somewhat specifically by one architecture) to theory
files before Refine.

Create Move_R.thy as an arch generic Refine theory file for transporting
generic lemmas to theory files before Refine.

Also delete some lemmas that have existed earlier already or are not
needed.

Rename Move.thy in CRefine to Move_C.thy for consistency.
2020-02-21 11:49:25 +11:00
Rafal Kolanski 8c42173a70 Word_Lib: add from_bool_eqI 2020-02-13 12:29:52 +11:00
Rafal Kolanski 327bed748d lib: migrate distinct_map_enum into Lib 2020-02-13 12:29:52 +11:00
Rafal Kolanski 88e6737337 lib: add corres_cases'
This version augments the schematic preconditions with the knowledge of
which case we are in. It should replace corres_cases eventually.
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
Corey Lewis d21ea9da41 lib: reimplement crunch call stack feature so that it works when proofs fail.
This stopped working when crunch was changed to fork proofs.
2020-01-30 15:09:44 +11:00
Corey Lewis 5120e351b3 lib: improve wp tracing
When tracing wp can now print the instantiated version of the rules being used.
It also says which set each used rule is from.
2020-01-29 09:26:18 +11:00
Corey Lewis 7107f9abaf lib: implement instantiate_thm for Trace_Schematic_Insts
This is a function that instantiates a thm with the instantiations provided by
trace_schematic_insts.
2020-01-29 09:26:16 +11:00
Corey Lewis 9b9ae104fc lib: restructure the instantiations type of Trace_Schematic_Insts
This allows us to explicitly record the bound variables from the subgoal so that
they can be more easily handled. We also now drop binders when constructing typ
instantiations.
2020-01-29 09:26:15 +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
Gerwin Klein 16c15920a8 lib: move word_eqI_solve out of HaskellLemmaBucket 2019-11-15 12:08:20 +11:00
Gerwin Klein 59818de68e lib: avoid ambiguous syntax 2019-11-15 12:04:50 +11:00
Gerwin Klein bdd882d17e lib: more lifting rules for validE_R and validE_E 2019-11-15 12:04:50 +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 a5e27933a5 riscv: cleanup; resolve remaining FIXMEs 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