Commit Graph

918 Commits

Author SHA1 Message Date
Ryan Barry 72ab7cc180 various: resolve some new fixmes
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Corey Lewis f28ce0b310 lib: notify if crunch generates side-conditions
Signed-off-by: Corey Lewis <corey.lewis@unsw.edu.au>
2021-11-10 16:39:23 +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 c5a3917a6d lib: retire OR syntax for monads
The syntax OR for nondeterministic choice between two executions now
conflicts with the OR bit operation from the Isabelle distribution.
Since it was almost unused anyway, we remove it entirely and use only
the \<sqinter> symbol instead.

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 c0294c5fa2 isabelle-2021: update EVTutorial
Isabelle2021 uses lualatex by default, which chokes on the pdfglyph
setup. On the upside, it seems to be supporting the correct code for
searchable ligatures already by default, so we can remove this setup.

Signed-off-by: Gerwin Klein <kleing@unsw.edu.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein ade042b0bd isabelle-2021: update Sep_Algebra
Signed-off-by: Gerwin Klein <kleing@unsw.edu.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 993eb87a4b isabelle-2021 arm: AInvs update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 77b4881697 autolevity: avoid overlapping position info
The @{here} antiquotation position leads to overlapping position
information which confuses the Isabelle session manager.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 4bf1635b2f cleanup: reduce warnings
This mostly refactors ML code to avoid non-exhaustive matches, restore
the (op infix) syntax that got lost in a previous Isabelle update, and
removes some unused functions/parameters.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
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 0bc533943b isabelle-2021: update CSpec
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 7f94f3d8cb isabelle-2021: clib update
Mostly related to Word_Lib changes.

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 f2fc2345fe isabelle-2021: update Lib
This includes the removal of the theory Extend_Locale, which was an
(unused) experiment.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Florian Haftmann ea9a25950d isabelle-2021: ad-hoc adjustions to preview
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 83710a1d81 isabelle-2021: Lib update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 28bc26c925 isabelle-2021: HOL-Word now in HOL-Library
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
Gerwin Klein 81b95eb6bf READMEs: fix publication links
PDFs and abstracts have moved to trustworthy.systems/

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 11:22:05 +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
Ryan Barry 0d53d6909f lib+ainvs+access+refine: resolve most of the new 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
Corey Lewis 284ef78ae9 lib: support crunching lifted monadic functions
This also changes crunch to collect preconditions one at a time.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-07-12 15:09:50 +10:00
Mitchell Buckley e617e179fb lib: Standard corres lemmas to match refine
Signed-off-by: Mitchell Buckley <mitchell.alan.buckley@gmail.com>
Co-authored-by: Victor Phan <Victor.Phan@data61.csiro.au>
2021-06-21 10:30:04 +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
Matthew Brecknell 337c0d62ea crefine: generalise `ccorres_tmp_lift2`
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-19 13:01:44 +11:00
Matthew Brecknell 62f5fa0c4f clib: document some predicates used in `ceqv` and related automation
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-19 13:01:44 +11:00
Matthew Brecknell 9fda5fc5f5 clib: respect exceptional control flow in `cinit` variable lifting
`cinit` and related methods are able to automatically abstract accesses
of Simpl state variables to Isabelle variables, provided they can prove
that the Simpl variable has not been modified up to the point it is
accessed. However, previously, the automation was unaware of exceptional
control flow. This limits the effectiveness of variable lifting in
situations like the following:

    // `var` has not yet been modified.
    if (condition) {
        var = new_value;
        // Here, `var` has been modified.
        return;
    }
    // Has `var` been modified before the following access?
    do_something(var);

Prior to this commit, the answer would be "yes": `cinit` would conclude
that `var` has been modified prior to the access for `do_something`, so
the variable access would not be abstracted.

With this commit, the answer is "no": `cinit` recognises the `return` in
the `if` block, and can abstract the variable access for `do_something`.

The new automation is enabled for `cinit`, `clift` and `ctac`. It is
currently disabled for `csymbr`, since the new behaviour breaks some
existing proofs.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-19 13:01:44 +11:00
Matthew Brecknell d8240dbbda clib: add support for lifting global variables in `cinit`
The `cinit` and `clift` methods already provided a way to abstract
accesses to specified local variables to Isabelle variables that do not
depend on the state, provided that the procedure does not write to those
variables. The proof methods included automation of proofs that the
values of variables being abstracted remain constant throughout the
procedure.

This commit adds support for abstracting accesses to *global* variables.
The additional challenge here is that calls to other procedures might
modify global variables. We use the `modifies` facts produced by the C
parser to determine (and prove) when variables of interest are preserved
across procedure calls.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-19 13:01:44 +11:00
Corey Lewis 008969fc02 lib proof: reorder the assumptions of corres_split
Currently this just modifies the rule but not any of the proofs that use
it. The old version is kept for now but should be removed once all of
the proofs are updated.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-02-19 11:37:12 +11:00
Gerwin Klein bb90c7541e lib: avoid internal index names
The lemma set `exception_set_finite` contained the members
`exception_set_finite_1` and `exception_set_finite_2`. The `_1`/`_2`
suffix clashes with the internal `(1)` suffix for lemma set references,
which in some code paths is internally represented as `_1`, leading to
an error message.

Curiously this error message only occurs when the proof is run
single-threaded, so it has gone unnoticed for quite some time.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-24 08:34:29 +11:00
Robert Sison 98c2889f1b lib: A tutorial and some 'modify' monad rules for Lib.EquivValid
Thanks to Toby Murray (@tobycmurray) for early feedback.

Signed-off-by: Robert Sison <robert.sison@unimelb.edu.au>
2020-11-17 06:06:03 +11:00
Corey Lewis 26ea36104b lib: add attribute to repeatedly apply other attributes
Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2020-11-09 17:18:41 +11:00
Gerwin Klein b43139cc86 lib: include ML_Goal_Test in ROOT
The file was not included anywhere so far and is referenced in ML_Goal,
which is part of the AutoCorres release (but the dependency
ML_Goal_Test will be missed if it's not included elsewhere).

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10: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 1397b2206e lib: LibTest update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 8b57961bfd lib: session structure update for LibTest + Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein d9ff25ffce lib: update for 2020 Monad_Syntax
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 508e19d0ff lib: Isabelle2020 concurrency session
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 59140d268d lib/sep_algebra: Isabelle2020 ROOT update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 2e8cf15b2d lib + proof: Isabelle2020 Method.NO_CONTEXT_TACTIC rename
Method.NO_CONTEXT_TACTIC -> NO_CONTEXT_TACTIC

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 408bf41351 lib: Isabelle2020 update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +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 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
Corey Lewis 41b486365c lib: add a warning if crunch fails and top-level constant is being ignored 2019-10-15 15:07:50 +11:00
Corey Lewis b6689ba321 lib: restrict safe in core crunch tactic so that we can avoid passing around the index 2019-10-14 17:23:42 +11:00
Corey Lewis 8c3e7aa103 lib: make wp_cases_tac subgoal aware 2019-10-14 17:23:41 +11:00
Corey Lewis 96588daf92 lib: improve message printing for crunch and wp, and refactor common printing functions 2019-10-14 17:23:41 +11:00
Corey Lewis 9a9c6320be lib: various crunch improvements
The main one is that crunch now uses wpsimp when determining whether a goal
can already be solved, instead of just wp. Crunch can also now use wps
when proving a goal and will now always ignore a constant if told to, even
if it is the top-level constant being crunched.
2019-10-14 17:12:29 +11:00
Corey Lewis 36e7fe3e50 lib: update for wp changes 2019-10-12 16:22:24 +11:00
Corey Lewis f757e0ca5b lib: wp cleanup and parser improvements
The main visible change is from wp_trace', 'wp_once' and 'wp_once_trace' to
'wp (trace)', 'wp (once)' and 'wp (once, trace)'. The option for printing a
warning for unused supplied wp rules has also been removed.
2019-10-12 16:22:24 +11:00
Victor Phan bbfd9e2a82 lib: add helper lemmas 2019-10-10 11:27:17 +11:00
Victor Phan ccb5174b94 lib: add lemma hoare_vcg_disj_lift_R
Lifts a Hoare triple with disjunctions in the pre and post-conditions
into two separate Hoare triples.
2019-10-10 11:27:01 +11:00
MiladKetabi 1a49aacc31 lib: three lemmas moved from refine theories 2019-10-06 18:31:19 +11:00
Japheth Lim 26f450f2f4 lib: change @{file} antiquote to @{path}
When extracting files for C parser and AutoCorres standalone releases,
we don't want Isabelle to fail a build when files referred to in
`@{file}` antiquotations no longer exist. Using `@{path}` avoids this
problem.
2019-09-05 14:19:14 +10:00
Edward Pierzchalski ba5983d22e lib: extend schematic instantiation tracer
Adds a combinator, `trace_schematic_insts_tac`, which wraps a rule-using
tactic and reports any schematic instantiations.
2019-08-27 16:12:06 +10:00
Edward Pierzchalski 8ffebe8f94 lib: add utilities for using options. 2019-08-27 16:12:06 +10:00
Edward Pierzchalski b0cf5638fd lib: trivial: use cartouches for ML comments.
Useful for antiquotations.
2019-08-27 16:12:06 +10:00
Japheth Lim 2c3b4c24fc CamkesCdlRefine, Lib: add debug tag for integrity policy
This tags each generated policy goal with the object and cap that
led to that goal.

We create a new constant `generic_tag` in Lib for this purpose.
2019-08-21 14:23:22 +10:00
Gerwin Klein f29e73bc58 lib: move more facts on Numeral_Type from invariant proofs into lib 2019-07-31 16:56:29 +10:00
Rafal Kolanski d804b7a8d1 Word_Lib: add ucast_shiftl_eq_0 2019-07-31 16:55:32 +10:00
Rafal Kolanski e46f2d7af0 lib: add graph_of_SomeD 2019-07-31 16:55:32 +10:00
Rafal Kolanski 212ea6724a lib: add obind_eqI_full to OptionMonad
Sometimes after showing equality of the heads of the obind, we need this
result in proof of equality of the tails.
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 7a4d5b1ea9 lib: general update lemmas for opt_map 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
Rafal Kolanski 4cc9a1fb19 lib: add option_Some_value_independent 2019-07-31 16:55:31 +10:00
Rafal Kolanski 66d87cd550 lib: OptionMonad: add more obind decomposition, oassert simps 2019-07-31 16:55:31 +10:00
Gerwin Klein b5cb85de96 lib: complete/full induction for Numeral_Type 2019-07-31 14:13:56 +10:00
Gerwin Klein 39e7b65aad lib: additional library lemmas for Numeral_Type 2019-07-31 14:13:56 +10:00
Gerwin Klein bd7a6113ae lib: more library lemmas for OptionMonad 2019-07-31 14:13:56 +10:00
Japheth Lim 18a40abd44 lib: move int bitwise lemmas from NatBitwise to Lib
NB: this now imports HOL-Word into Lib and Lib in turn
into NatBitwise.
2019-07-24 11:00:13 +10:00
Japheth Lim 44bdf90ae8 autocorres, lib: refactor `nat :: bit_operations` instance
This refactors the instances in HaskellLib and AutoCorres into a new
theory, Lib.NatBitwise.
2019-07-24 11:00:02 +10:00
Gerwin Klein c34840d09b global: isabelle update_cartouches 2019-06-14 11:41:21 +10:00
Michael McInerney c13432b0c4 misc updates for Isabelle2019 2019-06-14 11:41:20 +10:00
Michael McInerney 6ff1a38f65 lib: update for Isabelle 2019 2019-06-13 16:22:33 +10:00
Gerwin Klein c409f85ec9 lib: remove obsolete theory import 2019-06-13 16:22:33 +10:00
Gerwin Klein 21f9a86dd9 lib: sync Word_Lib with AFP 2019-06-13 16:22:33 +10:00
Michael McInerney 81dab3dcec lib: add unit_dc_is_eq 2019-06-13 11:43:50 +10:00
Edward Pierzchalski e8e40a572c lib: Use `datatype_schem` arguments in `wpfix`.
`wpfix` delegates to `datatype_schem`, so we include the option to add
new accessor lemmas.
2019-06-12 10:35:48 +10:00
Edward Pierzchalski 02dcb099ff lib: Allow additional rules for `datatype_schem`.
Previously, the method `datatype_schem` used a specific list of
hard-coded rules to "fix" datatypes in schematics. This adds an
attribute so users can add new datatype "lenses"/"accessors" as needed.
2019-06-12 10:35:37 +10:00
Edward Pierzchalski 7ac89448a1 lib: Add `find_index`. 2019-06-12 10:35:32 +10:00
Edward Pierzchalski c1e9a09e26 lib: move "tl_nat_list_simp" up. 2019-05-28 10:00:10 +10:00
Japheth Lim c397b16f42 lib: license header for RangeMap 2019-05-20 00:15:31 +10:00
Japheth Lim 071ebbd398 lib: move @{mk_term} antiquotation from AutoCorres; add examples 2019-05-17 18:07:59 +10:00
Japheth Lim c96444b7d4 lib/RangeMap: cleanup; strengthen range lookup thms; add testsuite 2019-05-17 18:07:59 +10:00
Japheth Lim 4f1c452bd2 lib: add RangeMap data structure (no tests yet) 2019-05-17 13:58:50 +10:00
Japheth Lim 9cbf5e6ab5 lib: use `@{term_pat}` in FP_Eval; refactor term_pat testsuite 2019-05-17 13:58:13 +10:00
Japheth Lim 4c18e1f156 lib/FP_Eval: add license headers 2019-05-17 13:58:13 +10:00
Japheth Lim c94d3285df lib/FP_Eval: move let_weak_cong' to main tool; improve docs 2019-05-17 13:58:13 +10:00
Japheth Lim 450f83ffeb lib: initial version of FP_Eval tool
FP_Eval is an Isabelle/ML tool for functional program rewriting.
It has similarities with the Isabelle simplifier, but is simpler and
more scalable for performing computations in the logic.

See FP_Eval_Tests for basic tests and examples.
2019-05-17 13:58:13 +10:00
Edward Pierzchalski 9809f4001f lib tutorial: Add `SELECT_GOAL` example. 2019-05-08 10:42:33 +10:00
Edward Pierzchalski ea06b8b708 lib: Add tutorial on tactic basics.
This is an explicit walkthrough about how one goes about doing a proof
in Isabelle/ML. The goal is that someone can run into such a proof, look
at this tutorial, and then at least be equipped to ask the right
questions about fixing the proof.
2019-05-03 11:38:56 +10:00