Commit Graph

52 Commits

Author SHA1 Message Date
Michael McInerney 1c0ceba850 lib: several lemmas involving exs_valid and the reader monad
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-03-20 18:55:49 +10:30
Gerwin Klein 1893d00f83
lib: move general lemma to Lib
lifted_if_collapse has no dependencies that require it to be in
NonDetMonadLemmaBucket.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 11:48:39 +11:00
Gerwin Klein b1daf38dda
lib+crefine: eliminate list_case_return2
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 11:48:38 +11:00
Gerwin Klein 40dc7eaa01
lib+autocorres: remove last AutoCorres Lib dependency
Moving `Monad_Equations.thy` and `More_NonDetMonadVCG.thy` into Monads
session enables us to remove the Lib and CLib session dependencies in
AutoCorres.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:19:03 +11:00
Gerwin Klein cc0ca9118e
lib: introduce Monads session
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-24 11:30:05 +11:00
Gerwin Klein 7424005a66
lib: make theLeft/theRight/isLeft/isRight abbreviations
Since the creation of these constants the sum type has been updated to
come with its own discriminators and selectors. We use these, but keep
our longer names as abbreviations.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:41:11 +11:00
Gerwin Klein fc5af7e402
lib: rename More_Monad to Monad_Lists and fix style
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:01:25 +11:00
Gerwin Klein d86acc885a
lib: move wp lemmas for mapM et al into More_Monad
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:01:13 +11:00
Gerwin Klein d275068826
lib: move empty_fail lemmas up into NonDetMonadVCG
This enables a few more moves of remaining lemmas in
NonDetMonadLemmaBucket into the theories they belong thematically.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:01:12 +11:00
Gerwin Klein f19364a38b
lib: split NonDetMonadLemmaBucket into multiple theories
- organizes the material
- enables more concurrency
- allows us to pick and choose which parts to import

Currently NonDetMonadLemmaBucket still imports Lib to keep the overall
exports from this theory unchanged, but none of the factored-out
theories depend on Lib.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:01:12 +11:00
Gerwin Klein de9cb04a11
lib: factor out monad dependencies
Factors out definitions and lemmas that are used in monads from Lib.thy
into a separate theory Monad_Lib, which itself does not have further
dependencies.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:00:14 +11:00
Gerwin Klein 3960115459
lib+proofs+sys-init+tools: proof updates for Fun_Pred_Syntax
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-09 14:54:11 +11:00
Gerwin Klein 0f633ce387 isabelle2021-1 lib: update Lib session, retire wpx
The benefit of the wpx method is not worth the maintenance effort.
There are still a few instances of wpx left in AInvs, which will have
to be fixed later.

We are keeping the wps method from the same file (WPEx.thy), because
that is used more widely and does not break with Isabelle2021-1

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 7ce3ccb068 isabelle2021-1 lib: remove unused theories
In particular, retire the unused AutoLevity and TSubst

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11: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
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
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
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08: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
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 f3dca6865c lib: option (reader) monad syntax and gets_map operator 2018-10-25 12:54:02 +11: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 b5cdf4703f globally use session-qualified imports; add Lib session
Session-qualified imports will be required for Isabelle2018 and help clarify
the structure of sessions in the build tree.

This commit mainly adds a new set of sessions for lib/, including a Lib
session that includes most theories in lib/ and a few separate sessions for
parts that have dependencies beyond CParser or are separate AFP sessions.
The group "lib" collects all lib/ sessions.

As a consequence, other theories should use lib/ theories by session name,
not by path, which in turns means spec and proof sessions should also refer
to each other by session name, not path, to avoid duplicate theory errors in
theory merges later.
2018-08-20 09:06:34 +10:00
Thomas Sewell 587972d40e lib/wp: Standard when/unless/whenE/unlessE rules.
The rules for these conditional monadic operators have been a bit
ad-hoc until now, with frequent headaches around the whenE/throwError
pattern.

Adding standard split rules ensures these operators are treated uniformly.
2018-03-16 14:56:11 +11:00
Thomas Sewell b0f2217af4 lib/wp: Remove old wp combinator rules.
These combinator rules do something like what wp_pre does now.

They were helpful in the ancient past, but now that wp_pre exists it is
much better to just use automation.
2018-03-16 14:51:31 +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
Alejandro Gomez-Londono 796887d9b1 Removes all trailing whitespaces 2017-07-12 15:13:51 +10:00
Joel Beeren 81064fdb55 idle-thread-pd: run idle thread with the global PD all the time.
This avoids the multicore scenario of the idle thread running in the
address space that has been deleted by a thread running on another core.
2017-07-11 11:29:34 +10:00
Matthew Brecknell 1d43c99acc Isabelle2016-1: fix Word_Miscellaneous import path
This was previously missed, because Isabelle ignores the import path
when the file is already part of a loaded image.

Reported-by: Daniel Matichuk <Daniel.Matichuk@data61.csiro.au>
2017-02-08 16:53:14 +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
Gerwin Klein 47119bf43e wp_cleanup: update proofs for new wp behaviour
The things that usually go wrong:
  - wp fall through: add +, e.g.
      apply (wp select_wp) -> apply (wp select_wp)+

  - precondition: you can remove most hoare_pre, but wpc still needs it, and
    sometimes the wp instance relies on being able to fit a rule to the
    current non-schematic precondition. In that case, use "including no_pre"
    to switch off the automatic hoare_pre application.

  - very rarely there is a schematic postcondition that interferes with the
    new trivial cleanup rules, because the rest of the script assumes some
    specific state afterwards (shouldn't happen in a reasonable proof, but
    not all proofs are reasonable..). In that case, (wp_once ...)+ should
    emulate the old behaviour precisely.
2017-01-13 14:04:15 +01:00
Matthew Brecknell b5158e31bc Isabelle2016-1: fix proofs involving UNION
SUPREMUM changed from a definition to an abbreviation.

A number of proofs that previously used blast, fastforce or auto to
solve goals involving UNION, now either fail or loop. This commit
includes various ad-hoc workarounds.
2017-01-05 14:27:33 +11:00
Matthew Brecknell 41d4aa4f1d Isabelle2016-1: update references to renamed constants and facts 2017-01-05 14:23:05 +11:00
Alejandro Gomez-Londono 879ac30249 Lib: Addition of auxiliary lemmas in basic theories to better support CRefine
* Generalized version of bind_inv_inv_comm for easier swapping inside
  the nondet monad

* New ccorres_symb_exec_r_known_rv

* New zip_take lemmas for handling `take n (zip x y)` situations

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:56 +11:00
Joel Beeren 2553371a14 SELFOUR-64: Remove general Recycle operation
This removes the RecycleCap CNodeInvocation, whilst
retaining recycle behaviour for Endpoints -- now renamed
CNodeCancelBadgedSends.
2016-11-18 14:11:12 +11:00
Daniel Matichuk 92139db60e autolevity: refine tracing apply everywhere to work via Proof module hooks
This avoids doing redundant tactic operations at the top-level and lets
us trace "by" statements easily.
2016-06-23 14:02:40 +10:00
Gerwin Klein 3813035970 lib: NonDetMonadLemmaBucket needs no words 2016-05-16 21:11:40 +10:00
Gerwin Klein 54581f1c9a lib/WordSetup: use the full Word_Lib entry 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 84b923a677 lib: start disentangling spaghetti word dependencies 2016-05-16 21:11:40 +10:00
Daniel Matichuk d37a344783 cleanup for prod and when keyword 2016-01-12 16:07:28 +11:00
Daniel Matichuk b7563eb788 fix lib for isabelle 2016 2016-01-12 14:58:16 +11:00
Gerwin Klein 12fa86863a fewer warnings 2015-05-16 19:52:49 +10:00
Matthew Fernandez 02c2f749b8 lib: Add a hoare_assume_pre variant for validNF. 2015-02-24 10:11:59 +11:00
Gerwin Klein 1af1d2b67b some of the global Isabelle2014 renames
option_case -> case_option
sum_case -> case_sum
prod_case -> case_prod
Option.set -> set_option
Option.map -> map_option
option_rel -> rel_option
list_all2_def -> list_all2_iff
map.simps -> list.map
tl.simps -> list.sel(2-3)
the.simps -> option.sel
2014-08-09 15:39:20 +10:00
Lars Noschinski fe36a97b4d Port AutoCorres to Isabelle 2014-RC0 2014-08-08 17:29:54 +10:00
Corey Lewis d52d8ad148 Fix previous commit. 2014-07-19 00:04:21 +10:00
Corey Lewis 07b85fe034 Move some more lemmas into lib. 2014-07-18 17:23:07 +10:00