Commit Graph

3418 Commits

Author SHA1 Message Date
Corey Lewis 88c5850462 lib: add an implementation of the sum type 2019-04-16 15:18:49 +10:00
Edward Pierzchalski 19155b7b35 lib: Add utility method for introducing subgoals.
A pattern that occurs occasionally (for some proofs, by some authors) is
something like:
```
apply (subgoal_tac "my_cool_fact x y z")
 prefer 2
 subgoal by magic
apply method_that_uses_my_cool_fact
```
The command `prefer 2` is noisy, and proving the introduced fact subgoal
later is disorienting, so we provide the method `prop_tac` to introduce
a fact and make proving that fact the current subgoal.
2019-04-09 16:47:56 +10:00
IlmariReissumies 0fe3a4c17f sys-init: fix proofs for a changed lemma name
The previous lemma name collided with List.sorted_filter, which
became shadowed; thus we broke AInvs.

Thanks to Victor Phan for bringing this breakage to my attention.
2019-04-05 12:13:45 +11:00
IlmariReissumies 0eefa4b6b6 lib: rename lemma to prevent collision with List.sorted_filter 2019-04-05 12:12:49 +11:00
IlmariReissumies 7637422a10 sys-init: use executable variant of used_irq_list
This alternative formulation determines the set of used_irqs in
a way that is less roundabout and closer to the C implementation:
instead of  "every irq such that some object has an irqhandler cap
for it", it's "every irq such that there is an irq node for it".

For the proofs, we prove that the two formulations agree on well-formed
specs. Beyond using this fact, the old proofs need not change at all.

Incorporates some proof improvements suggested by @jalim and
shamelessly stolen.
2019-04-05 10:43:34 +11:00
IlmariReissumies bed1ee9b5e lib: add two lemmas about the sorted predicate
Courtesy of @jalim.
2019-04-05 10:41:42 +11:00
Matthew Brecknell 8a13759deb haskell: update to GHC 8.6.4 and Cabal 2.4
Cabal 2.4 deprecates the default behaviours of previous versions, and
issues warnings whenever the usual cabal-install commands are used. This
is in preparation for future versions of Cabal where the usual commands
will have entirely new default behaviours. More work would be required
to update our SEL4.cabal configuration to these new behaviours. For now,
we avoid the warnings given by Cabal 2.4 by using the `v1-` versions of
cabal-install commands, which should continue to have the old behaviours
until they are removed from Cabal.
2019-04-02 18:14:37 +11:00
Amirreza Zarrabi 51cfddab32 crefine: update for increased capIRQ field bits on 64-bit platforms (VER-1047) 2019-03-25 07:47:45 +11:00
Japheth Lim 22f2a1c08c CSpec: update KernelInc_C imports to match seL4 build system changes
This fixes import breakage due to seL4 commit f85774e36f.
2019-03-21 19:54:16 +11:00
Edward Pierzchalski 642399ca01 proof: increase SimplExportAndRefine timeout.
VER-1072: Something in the recent C parser changes has increased the
time taken by SimplExportAndRefine by around 30%. This is a quick fix
for the regression timeouts while we take a closer look.

Increased to 8 hours.
2019-03-19 14:55:15 +11:00
Luke Mondy 89372de534 Update to new toolchain 2019-03-18 16:35:18 +11:00
Edward Pierzchalski 7cea1ad1b4 lib: don't extend core signatures.
Just because we *can* extend the core SML `List` signature, that doesn't
mean we *should*. It's a neat trick, but it makes it harder to find uses
of the new modules, and obfuscates definitions for very little gain.
2019-03-07 15:29:13 +11:00
Edward Pierzchalski caf2d2cfef autocorres: use c-parser name demangler
The C parser tracks what short names a given long name corresponds to.
Change AutoCorres to use that information, instead of trying to demangle
the names 'manually'.
2019-03-07 13:34:32 +11:00
Edward Pierzchalski 7ec43436ba c-parser: update test files.
Short-name constants don't exist any more, so we change the (single)
explicit reference to a short name into a long name.
2019-03-07 13:34:32 +11:00
Edward Pierzchalski e039ecc6a1 crefine: shorten long c-parser names.
Previously, tactics like `ctac` and `csymbr` would use definition names
to produce new bound variables. Now that the C parser always emits long
name *definitions* and short name *aliases*, we adjust these tactics to
try and shorten any new names they produce.
2019-03-07 13:34:32 +11:00
Edward Pierzchalski 5beef4b4e6 c-parser: always emit long names.
Previously, the C parser would define locals differently depending on
the order they appear in the source (the first instance got a short
name, the second etc. got a longer one). This would sometimes make
things break when source was reordered.

Now, the C parser emits the long name for _every_ local, and emits an
abbreviation for backwards-compatibility and convenience for common
variables (like loop indexes `int i`).

Adjusts the Simpl syntax modifiers to work with abbreviations.

Modifies the VCG tactic to try and convert long-name bound variables in
the goal to their abbreviated names.
2019-03-07 13:34:32 +11:00
Edward Pierzchalski 9e2a04f2b6 lib: add ML utilties 'bucket' file.
The SML standard library is pretty bare-bones compared to that of other
functional languages, so in a large enough SML project you end up with a
bunch of reimplementations of basic combinators scattered all over the
place. We'd be able to collect them if we had somewhere to collect them,
so here it is.
2019-03-07 13:34:32 +11:00
Michael Sproul 934386e97d dpolicy: remove opt_object_def 2019-02-28 15:58:11 +11:00
Michael Sproul c44fd87594 capdl: remove redundant definition `opt_object`
A lot of the proofs in SysInit and DRefine previously had to unfold opt_object,
which was really just an alias for cdl_objects with the arguments in the
opposite order! This commit deletes opt_object in favour of using cdl_objects
directly, which should slightly reduce the burden of unfolding.
2019-02-28 14:34:01 +11:00
Callum Bannister bba5bfd905 lib + sysinit: whitespace cleanup; renamed lookup_obj 2019-02-19 15:43:10 +11:00
Callum Bannister 2eeecb417c sys-init: Added rule to transform sep_map_set_conj using precise predicates 2019-02-19 15:42:55 +11:00
Callum Bannister 8c683ce6fa lib: Fixed guess_exI to filter out multiple matches, added guess_spec 2019-02-19 15:42:49 +11:00
Callum Bannister dacc97c5d7 lib: sep_tactics cleanup; session cleanup + organisation 2019-02-19 15:38:37 +11:00
Callum Bannister 4c79675879 sysinit: implement support for shared frames
Co-authored-by: Michael Sproul <michael.sproul@data61.csiro.au>
2019-02-19 14:47:00 +11:00
Callum Bannister 02c19be141 lib: guess_exI tactic 2019-02-19 14:46:48 +11:00
Callum Bannister 436eae28c2 lib: automation for separation logic & folds 2019-02-19 14:46:35 +11:00
Michael Sproul 01fb050e42 sep-capDL: delete sep_state_irq_map print transl
The print translation triggered over-eagerly and would abbreviate all mappings
from words to word options (sizes were ignored).
2019-02-19 14:25:10 +11:00
Michael Sproul 045683cd9c ainvs: Rights_AI theory with facts about VM rights
SysInit requires some facts about VM rights that are shared with AInvs, so this
commit introduces a new theory to contain the shared lemmas.
2019-02-19 14:24:41 +11:00
Japheth Lim aba4051957 lib: fix mixfix syntax for upto_enum
The previous version didn't have whitespace around the “.e.”, which
caused printed terms to be misparsed as qualified names.
2019-02-04 13:26:21 +11:00
Japheth Lim 3fc4166e7e AInvs: cleaner way to express ARM page table alignment 2019-02-01 14:11:37 +11:00
Japheth Lim 016a5d33ac AInvs: adjust pointer alignment invariants for PTEs, PDEs, etc.
Addresses issue VER-1036.

Previously, there were pointer alignment invariants in valid_pte, etc.
However, these had two problems:
1. valid_pte was conditioned on the PTE being mapped, so we couldn't
   rely on PTE pointers being aligned unconditionally (see VER-1036).
2. The existing alignments were actually incorrect for large pages.
   Proofs that needed the true alignments, obtained them from other
   parts of invs (e.g. valid_objs).

This commit moves the alignment invariants to wellformed_pte, etc.
and changes them to use the correct values.
2019-02-01 14:11:37 +11:00
Gerwin Klein 9489640367 lib: avoid use of Local_Theory.reset
Local_Theory.reset is about to be discontinued in the next Isabelle release
2019-01-31 15:20:44 +11:00
Matthew Brecknell 8272f79c0f arm-hyp crefine: remove named interrupt identifiers
Recent changes to the C kernel mean that various structures and
constants are generated from DTS files. In particular, verification now
sees interrupt identifiers as integer literals instead of defined
constants.
2019-01-30 17:13:03 +11:00
Gerwin Klein 04f1254cb8 arm/arm-hyp abstract: remove outdated comment about globals_frame 2019-01-14 13:37:52 +11:00
Japheth Lim 252991e9a7 CamkesCdlRefine: update policy_of to work with GrantReply 2019-01-11 14:39:11 +11:00
Japheth Lim 9792798c1b CamkesAdlSpec: avoid hardcoding C types; better wellformed_* automation
Instead of hardcoding basic C types, this passes most of them along as
uninterpreted strings. This allows typedefs such as time_t or ssize_t
to be used, without requiring the formal model to recognise them.
2019-01-11 14:39:11 +11:00
Japheth Lim 10b5bab0f4 aspec: avoid manual proof for rec_del definition 2018-12-18 14:50:54 +11:00
Japheth Lim 5516fea8a0 capDL-api, sys-init: fix for GrantReply (SELFOUR-6)
The badge condition for the CNode_Mint lemmas was incorrect and ought
to be untangled. This commit patches up the specs, but with ad-hoc
proof fixes.
2018-12-11 14:54:42 +11:00
Japheth Lim bd6b934613 infoflow: clearer comment for the subjectAffects case for Reply 2018-12-10 20:01:38 +11:00
Japheth Lim c0fac42147 InfoflowC: fix for GrantReply (SELFOUR-6) 2018-12-10 20:01:38 +11:00
Japheth Lim 186d610db7 DPolicy: fix for GrantReply (SELFOUR-6) 2018-12-10 20:01:38 +11:00
Japheth Lim 3758df05df dspec, drefine: fix for GrantReply (SELFOUR-6)
Nothing too exciting here, just duplicating the new GrantReply logic
from ASpec and repairing the proofs.
2018-12-10 20:01:38 +11:00
Japheth Lim 4d4de9098b infoflow: delete commented-out sections 2018-12-10 20:01:38 +11:00
Japheth Lim 2735ad42a1 access: proof cleanup for tro_alt_trans_spec
The proof structure still largely follows Thibaut's scheme; this commit
merely adds some speedup, style cleanup, and documentation.

Unfortunately, the proof state seems to be just large enough that the
built-in record update ruleset runs into limitations, and the standard
clasimp tactics start to fail on subgoals in an unpredictable way.
2018-12-10 20:01:38 +11:00
Japheth Lim ab2e097e60 infoflow: proof style cleanup (for GrantReply patch)
As the title says, this commit introduces general formatting and style
cleanup, but only for the parts touched by the recent GrantReply patch.
2018-12-10 20:01:38 +11:00
Japheth Lim 9eaf630e48 infoflow: more minor FinalCaps cleanup 2018-12-10 20:01:38 +11:00
Japheth Lim f49aefd4a4 infoflow: style cleanup (for GrantReply patch): FinalCaps and Noninterference 2018-12-10 20:01:38 +11:00
Japheth Lim 6e2fbbe7f1 access: improve comments for policy_wellformed and integrity_obj 2018-12-10 20:01:38 +11:00
Japheth Lim 99bd4b0723 access, infoflow: replace "pi_cases" proofs with structured cases 2018-12-10 20:01:38 +11:00
Japheth Lim 6b48805ef1 access: use monad_commute to prove empty_slot commute lemma
This is ostensibly more principled than the earlier proof, which simply
unfolded all the monad combinators. However, there was also no existing
framework for using monad_commute, so we need to make one up just to
do this single proof.
2018-12-10 20:01:38 +11:00