Commit Graph

4879 Commits

Author SHA1 Message Date
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
Gerwin Klein 0d344f0c2e haskell: update for seL4/seL4#846
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-17 15:32:16 +10:00
Gerwin Klein 8effcb0e42 aspec: generate proper kernel reply for PageGetAddr
The previous spec was trying to set message registers manually
when instead it should have just returned the list of data words
that forms the reply. This correctly modeled the currently wrong
behaviour in C, which seL4/seL4#243 fixes.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-17 15:32:16 +10: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
Rafal Kolanski 2a37c5cea3 lib: clean up MonadicRewrite
Pull in generic lemmas from theories in repository.
Re-order lemmas into sections.
Shorten proofs where possible and uninteresting.
Attempt to conform to more modern style, and remain consistent within
this theory.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-09 08:56:37 +10:00
Rafal Kolanski 02a9ecaf00 proof: remove generic monadic_rewrite lemmas
Lemmas not relying on any specifications or more local concepts will be
moved into MonadicRewrite.thy

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-09 08:56:37 +10:00
Rafal Kolanski 6c2e8fc4eb arm-hyp+aarch64: update for stage 1 translation changes
C code changed to drop stage 1 translation from constructing VM fault
messages when in a hypervisor context.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-06 10:11:40 +10:00
Rafal Kolanski f04a6319cc arm-hyp: rename addressTranslateS1CPR
renamed to: addressTranslateS1

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-06 10:11:40 +10:00
Gerwin Klein 08a6e13892 haskell-translator: no warning about X64 CPP setup
Suppress warning about missing (unused) X64 preprocessor setup for
Haskell.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 17:21:31 +10:00
Gerwin Klein aa77b3e8a9 haskell-translator: use warning/error in pars_skl
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 17:21:31 +10:00
Gerwin Klein 87f052f6e9 haskell-translator: report file in warnings+errors
Explicitly provide file information for errors and warnings (where not
already present in the message).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 17:21:31 +10:00
Gerwin Klein 484ecf10e7 haskell-translator: factor out status printing
- Make message printing available to pars_skl.py as well, not only
  lhs_pars.py.

- Add potential file/line number information printing (so far unused).

- Print status messages in a status line in the terminal (and stdout
  without terminal).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 17:21:31 +10:00
Gerwin Klein 0138ce959a haskell-translator: no warnings for known types
Suppress parameterised-type warnings for types we know have been
defined in Isabelle already.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 17:21:31 +10:00
Gerwin Klein ddfa7bd1fe haskell-translator: highlight warnings and errors
Use ANSI yellow + red to make warnings/errors stand out from output.
Suppress colours if output is not a tty, apart from on GitHub, where
they do get rendered by the interface even though it is not a tty.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 12:03:20 +10:00
Gerwin Klein 178ae6c7b7 haskel-translator: unify error+warning printing
Use functions for uniform error reporting, so we can later introduce
terminal colours, verbosity options etc.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 12:03:20 +10:00
Rafal Kolanski fe3a4a2287 aarch64 ainvs: clean up after Machine_AI overhaul
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Rafal Kolanski 6f757d901b aarch64 ainvs: overhaul Machine_AI
Handle abstract machine ops in large crunch passes.
Clean up some proofs, standardise others, and rearrange into topical
areas.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Gerwin Klein 420937301d aarch64 ainvs: vspace_obj_pred_aobjs lifting rule
- the lifting rule now needs an additional vcpus_of assumption
- this makes the rule not applicable any more for the proof of other
  lifting rules that are for vspace objs only; these will now need
  different proofs
- add FIXME suggestion for equivalence of projection and vspace_obj_pred

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Gerwin Klein 7a8461d286 aarch64 ainvs: define vspace_objs_of projection
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Rafal Kolanski 997883e364 aarch64 ainvs: adapt hyp lemmas/consts from ARM_HYP
This is a rough pass over all the vcpu|vppi|vgic items found in ARM_HYP
abstract invariants. Broken items and issues tagged with FIXMEs,
lemmas sorried when possible.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Rafal Kolanski 3f85320012 aarch64 ainvs: hyp pass over ArchKHeap_AI
Some definitions needed to change to take VCPUs into account, breaking
some lifting lemmas that assumed vspace objects and arch objects were
the same thing. FIXMEs added.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Rafal Kolanski a38a4a6411 aarch64 ainvs: update valid_vso_at to exclude VCPUs
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-06-03 09:36:43 +10:00