Commit Graph

5400 Commits

Author SHA1 Message Date
Gerwin Klein c1718b29eb aarch64 ainvs: prove vs_lookup_non_PageTablePTE
This includes a few hopefully useful lemmas about page table type
uniqueness.

Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 89b746ee06 aarch64 ainvs: minor progress in ArchAcc
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 86c497a144 aarch64 ainvs: prove all easy sorries in ArchKHeap
The remaining interesting lemma (which is not proved) is
vs_lookup_non_PageTablePTE which needed two statement adjustments, one
to adjust the ptes_of update (certain that this is correct), and one to
add a new precondition valid_vspace_objs (speculative, but hopefully
enough to solve the lemma).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 639ebf7eed lib: introduce fun_upd2
fun_upd for functions with two arguments.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 30ba342a20 aarch64 ainvs: basic storePTE/ptes_of lemmas
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 2098719494 aarch64 aspec: align storePTE with ptes_of
Check that the type of the page table that is present is the type we
are requested to update. The same assert is already present for ptes_of.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein d314fc7c77 aarch64 ainvs: vspace_objs_of instead of aobjs_of
- use vspace_objs_of instead of aobjs_of where possible to reduce
  scope and make lifting rules stronger
- prove remaining lifting rules in ArchKHeap_AI

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein da6f0c2d13 aarch64 ainvs: vspace_objs_of lifting rules
- provides case split rules for vspace_objs_of lifting

- proves the provable vspace_objs_of/vspace_obj_pred lifting rules. The
  other lifting rules will need rephrasing for AARCH64 since
  vspace_objs_of does not cover all arch objects.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein f2b53b6bf0 aarch64 ainvs: vspace_obs_of and vspace_obj_pred
Shows the relationship between vspace_obs_of and vspace_obj_pred.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein ff1688e753 lib: better automation of dom equality
Domain equality is nice to state and sometimes nice to prove, but it is
hard to use in automation (fastforce/auto). The new phrasing here is not
as nice to read, but useful in automation.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 53e724808f lib: collect if_option lemmas in one place
Carefully not disturbing the simpset, because too many things break
otherwise.

Similarly, if_option_Some2 is not included with if_option_Some, because
the latter is being declared globally [simp] at some stage and then
breaks things in too many random places.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein a45d32e574 word-lib: remove unused if/option lemma
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Gerwin Klein 8c796c5240 lib: opt_map equation for negative projection case
We so far have unfolded opt_map in these ... = None situations. Using
the new rule directly eliminates one of the cases (the Some case), so
is slightly more efficient when we stack them and get many of these.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-20 17:51:27 +11:00
Corey Lewis 59529d4522 infoflow: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis a52c73ad0b crefine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis c51d812de7 riscv refine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis b614d7ec9c arm-hyp refine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis e23c379720 x64 refine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis 7289575cc7 arm refine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis f9295d6a97 drefine: update for changed corres split rules
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis 73a52be413 proof: change more simple corres split cases
perl -0777 -pi -e "s/corres_split_nor([\w'-]*) *\[ *OF +_ +([^_][\w'-]+) +([\w'-]+)/corres_split_nor\1\[OF \2 _ \3/g" **/*.thy
perl -0777 -pi -e 's/corres_split_nor([\w]?) *\[ *OF +_ +(?!_)/corres_split_nor\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_eqr([\w]?) *\[ *OF +_ +(?!_)/corres_split_eqr\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_mapr([\w]?) *\[ *OF +_ +(?!_)/corres_split_mapr\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_noop_rhs([\w]?) *\[ *OF +_ +(?!_)/corres_split_noop_rhs\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_dc([\w]?) *\[ *OF +_ +(?!_)/corres_split_dc\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_handle([\w]?) *\[ *OF +_ +(?!_)/corres_split_handle\1\[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_catch([\w]?) *\[ *OF +_ +(?!_)/corres_split_catch\1\[OF /g' **/*.thy
perl -0777 -pi -e "s/corres_split_eqr(\w?) *\[ *OF +([^\W_][\w'-]+) +([^\W_][\w'-]*)/corres_split_eqr\1\[OF \3 \2/g" **/*.thy
perl -0777 -pi -e 's/corres_split_nor(\w?) *(.*)\)\n\s*prefer +2/corres_split_nor\1\2\)/g' **/*.thy

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis 8ffdb5eb76 proof: change simple corres_splitEE cases
perl -0777 -pi -e 's/corres_splitEE *\[ *OF +_ +([^_]\w+) +(\w+)/corres_splitEE[OF \1 _ \2/g' **/*.thy
perl -0777 -pi -e 's/corres_splitEE *\[ *OF +_ +(?!_)/corres_splitEE[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_splitEE *\[ *OF +([^_]\w+) +([^_]\w+)/corres_splitEE[OF \2 \1/g' **/*.thy
perl -0777 -pi -e 's/corres_splitEE *(.*)\)\n\s*prefer +2/corres_splitEE\1\)/g' **/*.thy

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis f4e9295424 proof: change simple corres_split_deprecated cases
perl -0777 -pi -e 's/corres_split_deprecated *\[ *OF +_ +([^_].*)\)\n\s*prefer 2/corres_split[OF \1\)/g' **/*.thy
perl -0777 -pi -e 's/corres_split_deprecated *\[ *OF +_ +(?!_)/corres_split[OF /g' **/*.thy
perl -0777 -pi -e 's/corres_split_deprecated *\[ *OF +([^_]\w+) +([^_]\w+) +(.*)\)\n\s*prefer +2/corres_split[OF \2 \1 \3\)/g' **/*.thy
perl -0777 -pi -e 's/corres_split_deprecated *\[ *OF +([^_]\w+) +([^_]\w+)/corres_split[OF \2 \1/g' **/*.thy
perl -0777 -pi -e 's/corres_split_deprecated *(.*)\)\n\s*prefer +2/corres_split\1\)/g' **/*.thy

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis 6d37587b0b proof: rename corres_split' to corres_underlying_split
sed -E -i "s/\bcorres_split'\b/corres_underlying_split/g" proof/**/*.thy

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Corey Lewis 17ed8b9f25 proof: rename corres_underlying_split to corres_split_forwards
sed -E -i "s/\bcorres_underlying_split\b/corres_split_forwards'/g" proof/**/*.thy

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +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
Corey Lewis 2cf7c367f2 arm-hyp crefine: simplify getActiveIRQ_ccorres
This rewrites the extraction function to a simpler form, which is
consistent with how the lemma is written on the other architectures.

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-10-20 08:59:52 +11:00
Michael McInerney d0b835fbb1 docs: style for ccorres statements
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-10-06 22:41:56 +10:30
Rafal Kolanski 02448cc3fb lib: add fwd_all + fwd_all_new methods, combinators
fwd_all and ALLGOALS_FWD act like `all`, but supplied method is applied
to goals in first-to-last order, taking into account goals solved and
generated.

fwd_all_new and FWD_ALL_NEW act like `;` and THEN_ALL_NEW, but with the
second method is applied to the results of the first in the order they
were produced, making it safe for WP reasoning.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-09-26 15:24:46 +10:00
Rafal Kolanski 120181631b lib: add rules_tac and related multi-thm instantiators
In `Rules_Tac`, add a `rules_tac` which is `rule_tac` but with the
ability to instantiate the same variable name in multiple theorems.

Also add the specialised `single_instantiate_tac` which allows using the
above mechanism to instantiate a specific variable name in a specific
set of theorems (e.g. "rv" in a set of symbolic-execution lemmas).

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-09-10 06:29:19 +10:00
Rafal Kolanski aa78eb08c7 lib: add if_then_else, has_concl, case_concl Eisbach_Methods
These allow for pattern-matching on the conclusion and reacting to
whether the match succeeded.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-09-10 01:22:32 +10:00
Rafal Kolanski c0b29108d0 docs: update Haskell stack link
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-09-09 11:28:37 +02:00
Rafal Kolanski ce995b4e28 lib: add named_eta and no_name_eta methods
These allow selective eta-contraction in the goal based on the bound
variable's name. The `no_name_eta` method speficially targets
abstractions where the variable has no name, which can come up in
complicated unification scenarios.

These nameless abstractions can cause symbolic execution lemmas to no
longer pick up on the name of the bound variable in do-notation,
requiring multiple rename_tac invocations.

Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-09-06 02:50:23 +10:00
Gerwin Klein ba033cc300 riscv haskell+proofs: fix PageTablePTE encoding
According to the RISC-V spec, PageTablePTEs must have the access,
dirty, and user bits set to 0. This means that

- there is no user attribute that can be set on PageTablePTEs
  (removed from Haskell spec)
- the encoding for PageTablePTEs in C must have 0 in these fields
  instead of 1.

See PR seL4/seL4#880 for discussion and corresponding C changes.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-07-18 10:40:17 +10:00
Matthew Brecknell 81423c2200 ci: temporarily remove mcs-export from proof-deploy
This removes the mcs-export matrix job from the proof-deploy workflow,
as the first step towards solving seL4/l4v#497. This should unblock
verification manifest deployments.

The mcs-export job was added to the proof-deploy workflow to perform
SimplExportAndRefine for binary verification targets. It took a short
cut, using the master branch of l4v to perform SimplExportAndRefine for
MCS configurations, since there were no differences between rt and
master that were relevant to SimplExportAndRefine. This is no longer the
case, because MCS seL4 C code now contains C parser annotations that use
symbols only available in the rt branch of l4v.

We intend to add an equivalent job that uses the rt branch of l4v for
MCS SimplExportAndRefine, but are still working out the best way to do
that.

Signed-off-by: Matthew Brecknell <matt@kry10.com>
2022-07-06 18:58:04 +10:00
Gerwin Klein 8f758375c8 docs: add mlton for x86 Apple machines
mlton installation is only tricky on M1 currently.
Intel machines have a brew package.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-07-05 19:16:44 +10:00
Michael McInerney 28afa903ba docs: update Python installation instructions
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-07-05 15:06:45 +09:30
Michael McInerney e3262d7e7c docs: update setup instructions for macOS
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-07-05 15:06:45 +09:30
Michael McInerney 4f0bbd4fcb lib: add monadic_rewrite_drop_return and monadic_rewrite_add_return
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-07-04 16:04:10 +09:30
Michael McInerney 9d59fcc5a6 lib: add monadic_rewrite_sym and monadic_rewrite_corres'
These were originally in the rt branch

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-07-04 16:04:10 +09:30
Gerwin Klein 3e8114fd8f haskell: remove use of strict $ operator
The strict function application operator made sense when performance
mattered because the model was used from a simulator. Now it's just
noise.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-24 13:07:17 +10:00
Gerwin Klein 3079ff5763 haskell: ! operator needs space separation
GHC 9.0.2 requires a space between ! and the operand to distinguish
the expression from a bang pattern.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-24 13:07:17 +10:00
Gerwin Klein d5f36c023a haskell: no parentheses around @ patterns
GHC 9.0.2 is more strict in its pattern syntax and rejects @ patterns
that are surrounded by parentheses.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-24 13:07:17 +10:00
Gerwin Klein 68ee57a1b2 haskell: `fail` requires `MonadFail` in ghc-8.8.4
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-24 13:07:17 +10:00
Gerwin Klein 02cc37a0e3 haskell: use ghc-9.0.2 and cabal v2 commands
- switch to lts-19.12 (GHC 9.0.2)
- use cabal v2 commands, which build locally by default and don't
  need a separate sandbox
- update SEL4.cabal file to cabal spec version 3
- remove generated `cabal.project.local~*` backup files after configure
  to avoid flooding the directory

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-24 13:07:17 +10:00
Ryan Barry 800f3daecd x64 ainvs+refine+crefine: update proofs
Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2022-06-17 15:32:16 +10:00
Ryan Barry ac6cf91606 arm_hyp refine+crefine: update proofs
Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2022-06-17 15:32:16 +10:00
Ryan Barry 7aaaabf15b riscv refine+crefine+access+infoflow: update proofs
Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2022-06-17 15:32:16 +10:00
Ryan Barry 23b6184766 dspec+drefine+infoflow: update misc. proofs
Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2022-06-17 15:32:16 +10:00
Ryan Barry 9bf8cf35bb refine+crefine: update refinement proofs
Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2022-06-17 15:32:16 +10:00