Commit Graph

48 Commits

Author SHA1 Message Date
Michael McInerney 375b19261a lib: add corres_if_strong
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-01-22 19:09:44 +00:00
Michael McInerney 7493e71298 lib+refine: strengthen corres_assert_assume_l and move to Lib
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-01-22 19:09:44 +00:00
Gerwin Klein de50741ec0
lib+aarch64 refine: move lemmas to lib
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-09-27 14:28:36 +10:00
Gerwin Klein fe3ebf03b9
lib: lemmas moved from aarch64 refine
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-09-27 14:28:35 +10:00
Gerwin Klein f80d7f8b37 lib: on the use of corres_liftM_simp rules
Explain that these are not nice simp rules, what one should do instead,
and why we leave them as is despite all that.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-08-30 21:59:37 +02:00
Corey Lewis 2c8f9eeff1 lib+spec+proof+autocorres: consistent Nondet filename prefix
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-08-09 12:07:06 +10:00
Gerwin Klein 445a8e4f12
lib: cleanup in Corres_UL and around liftM in Monads
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-06-30 15:56:43 +10:00
Gerwin Klein 865df5554a
lib: add new corres method
The new corres method is similar to the corresK method and calculus,
but much less ambitious. Its main purpose is to automate boilerplate
proof steps in corres proofs and is specifically not trying to fully
automate corres proofs (although some few might be solved).

The idea is that the method will make some progress with obvious steps
and leave over a proof state the user can operate on further.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-06-30 15:56:42 +10:00
Gerwin Klein 29873da877
lib: split out WP_Pre.pre_tac for wp_pre
Factor out pre_tac such that we can have separate theorem sets and
methods for wp_pre, monadic_rewrite_pre, corres_pre, and potentially
others in the future.

Leave everything in wp_pre that we expect to use wp or wpsimp on, in
particular no_fail.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-06-15 10:46:39 +10:00
Gerwin Klein bd449a071d
lib: theory imports + proof updates for monad refactor
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-02-09 11:46:51 +11:00
Gerwin Klein b92974d93f
lib: theory import fixes for new sessions
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 9c3a7faefd
lib+proofs: s/non_fail_/no_fail/
Some of the no_fail lemmas had he wrong name (non_fail instead of
no_fail).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:02:10 +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
Corey Lewis d7938b80b0 lib: reorder the assumptions of corres_split rules
This also removes corres_split_deprecated

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Rafal Kolanski 94da7bca1b lib: move corres_underlyingI/E to Corres_UL
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-09 08:56:37 +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
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 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 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
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
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08: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
Gerwin Klein a5e27933a5 riscv: cleanup; resolve remaining FIXMEs 2019-11-12 18:28:40 +11:00
Gerwin Klein c34840d09b global: isabelle update_cartouches 2019-06-14 11:41:21 +10:00
Michael McInerney 81dab3dcec lib: add unit_dc_is_eq 2019-06-13 11:43:50 +10:00
Gerwin Klein 15bfcdd98b reduce DRefine dependencies from Refine to AInvs
This needs (and includes) some deduplication and moving of lemmas formerly in
refine.
2018-10-22 13:21:11 +11:00
Gerwin Klein 1ae3a8d65b Isabelle2018: Lib update 2018-08-20 09:06:36 +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
Corey Lewis d77d31a77c lib: Refactor crunch so that it can be used for both the nondet monad and the trace monad 2018-06-26 14:45:28 +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
Thomas Sewell a70aeda39b lib: Datatype_Schematic and WPFix.
Add two new tactics/methods which can fix common painful problems with
schematic variables.

Method datatype_schem improves unification outcomes, by making judicious use of
selectors like fst/snd/the/hd to bring variables into scope, and also using a
wrapper to avoid singleton constants like True being captured needlessly by
unification.

Method wpfix uses strengthen machinery to instantiate rogue postcondition
schematics to True and to split precondition schematics that are shared across
different sites.
2018-03-16 14:55:33 +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
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
Japheth Lim 26a7907c95 Merge pull request #43 in SEL4/l4v from ~JALIM/l4v:autocorres-seL4 to master
* commit 'ecbb860532b4c576fc4726a805802f16bcf5302c': (29 commits)
  autocorres-crefine: specialise corres_no_failI for compatibility with Refine
  Add license tags for autocorres-crefine files
  crefine: refactor AutoCorresTest a bit
  autocorres-crefine: remove local debugging imports
  Fix InfoFlowC to accommodate corres_underlying changes.
  Fix DRefine to accommodate corres_underlying changes.
  autocorres-crefine: experiment with manually translating a function (clzl).
  autocorres-crefine: experiment with translating bitfield_gen specs.
  autocorres-crefine: start a test case for function calls.
  autocorres-crefine: update example proofs to work with no_c_termination, which does not require proving termination for the C spec.
  autocorres: add user option "no_c_termination" for previous patch.
  Making termination proof optional for AutoCorres.
  WIP: autocorres: hacky proof of concept for incremental translation.
  autocorres: add some missing WordAbstract rules.
  autocorres-crefine: fix some comments in work theory.
  autocorres-crefine: prove modifies and (simple) terminates specs.
  autocorres-crefine: experiment with generating modifies proofs
  autocorres-crefine: run autocorres in kernel_all_substitute locale
  autocorres-crefine: update another corres_UL that snuck in before rebasing.
  autocorres-crefine: working ccorres for handleYield (modulo some white lies).
  ...
2016-05-19 01:19:58 +00:00
Japheth Lim ecbb860532 autocorres-crefine: specialise corres_no_failI for compatibility with Refine
The generic rule is now named corres_no_failI_base.
2016-05-18 15:28:43 +10:00
Gerwin Klein 84b923a677 lib: start disentangling spaghetti word dependencies 2016-05-16 21:11:40 +10:00
Japheth Lim 1b14082291 autocorres-crefine: add pre-no-fail flag to corres. Updated AI+Refine. 2016-01-22 15:08:14 +11:00
Gerwin Klein 12fa86863a fewer warnings 2015-05-16 19:52:49 +10:00
David Greenaway a58bdf0576 Trace_Attribs: Remove hooks in "Corres_UL" to allow "lib/" to build once more. 2014-11-05 18:16:23 +11:00
David Greenaway e0b7e21d56 attribute tracing: Mechanism to work out changes in simpsets across revisions.
The idea of this file is to allow users to determine how the simpset,
cong set, intro set, wp sets, etc. have changed from an old version of
the repository to a new version.

The process is as follows:

  1. A user runs "save_attributes" on an old, working version of the
     theory.

  2. This tool will write out a ".foo.attrib_trace" file for each
     theory processed.

  3. The user modifies imports statements as required, possibly
     breaking the proof.

  4. The user can now run "diff_attributes" to determine what
     commands they should run to restore the simpset / congset /etc
     to something closer to the old version.

The tool is not complete, in that it won't always suggest the full set
of "simp add", "simp del", etc commands. Nor does it know that a rule
added to the simpset is causing a problem. It merely lists
a hopefully-sensible set of differences.
2014-10-13 11:05:31 +11:00
Gerwin Klein e8d1ed6ded ported lib/* theories to Isabelle2014-RC0 2014-08-09 21:08:47 +10: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
Gerwin Klein 84595f4233 release cleanup 2014-07-17 18:22:50 +02:00
Gerwin Klein 2a03e81df4 Import release snapshot. 2014-07-14 21:32:44 +02:00