Commit Graph

678 Commits

Author SHA1 Message Date
Gerwin Klein e95d1691e1 c-parser: cleanup of horribly old CTypes.thy
Purging old sins, remove all non-terminal auto, indent, etc.
2019-06-13 16:22:33 +10:00
Gerwin Klein 14589157b1 c-parser cleanup: eliminate typ_struct_splits 2019-06-13 16:22:33 +10:00
Gerwin Klein 3ebeaeffab c-parser: more pair-like setup for DTPair (splitting, collapsing) 2019-06-13 16:22:33 +10:00
Gerwin Klein 512c134761 c-parser cleanup: remove warnings, avoid Local_Theory.reset 2019-06-13 16:22:33 +10:00
Gerwin Klein dadcd8f65b c-parser: update to cartouches 2019-06-13 16:22:33 +10:00
Gerwin Klein 081742b738 c-parser: sync Simpl with AFP 2019-06-13 16:22:33 +10:00
Japheth Lim 211fbe6d28 asmrefine: print running time for each function's graph proof
These summary statistics should be useful while not being too verbose.
2019-05-29 14:23:29 +10:00
Japheth Lim f21e440c15 asmrefine: add some rules to help array-of-struct subgoals
This handles the new implementation of `init_freemem` in seL4, and thus
the workaround of seL4 d0d97779cb is no longer required.
2019-05-29 14:23:29 +10:00
Japheth Lim 071ebbd398 lib: move @{mk_term} antiquotation from AutoCorres; add examples 2019-05-17 18:07:59 +10:00
Matthew Brecknell e9ac64ba2d binary: improve support for array access via pointer addition 2019-05-15 14:49:20 +10:00
Matthew Brecknell 976eca1a28 binary: improve support for array access via pointer addition 2019-05-03 13:52:52 +10:00
Edward Pierzchalski 85ec1a61cb c-parser: add type syntax for Ptr and ptr_coerce
A common frustration is seeing a term `Ptr x :: foo ptr` and not being
able to inspect the inferred type `foo` (this is especially true when
`Ptr` occurs within another expression).

Copying the style of `UCAST`, this adds syntax rules for displaying `Ptr
x :: foo ptr` as `PTR(foo) x` and `ptr_coerce (bar :: a ptr) :: b ptr`
as `PTR_COERCE(a -> b) bar`.
2019-05-02 10:34:25 +10: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 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
Thibaut Perami ddf222700f haskell: Update for GrantReply (SELFOUR-6) 2018-12-10 20:01:37 +11:00
Gerwin Klein c53f7850d7 Base ASpec + machine on OptionMonad_ND; fix proof fallout 2018-10-25 12:54:02 +11:00
Edward Pierzchalski d75740201c Remove pure word lemmas from proof/*
Removes redundant lemmas after moving them up to Word_Lib.
2018-10-10 14:15:00 +11:00
Japheth Lim dc626e99d3 autocorres, crefine: remove early AutoCorres–CRefine experiment
This has been superseded by actual AutoCorres integration with CRefine.
2018-09-27 15:03:25 +10:00
Japheth Lim 1b4c3d06cf autocorres: fix external_file declaration 2018-09-26 17:08:34 +10:00
Mitchell Buckley 8173a37c2d Updated specs and proofs for SELFOUR-1491: control IRQ triggering on ARM. 2018-09-19 16:18:09 +10:00
Japheth Lim 38d30a895a autocorres: record date of 1.5 release 2018-09-10 14:18:25 +10:00
Japheth Lim 1af23137f0 autocorres: update release tool for Isabelle2018
Note that we have removed the LIB_FILES manifest and no longer intend
to maintain it manually. Instead, we just extract the entire Lib and
CLib sessions from the L4.verified repository. This means that the
next AutoCorres release will have some unneeded theories and a couple
of files with GPL licenses.
2018-09-06 20:34:59 +10:00
Japheth Lim 703c43fa2b c-parser: update release script and README 2018-09-06 20:34:59 +10:00
Japheth Lim fc94ed7539 c-parser/doc: describe reality of evaluation order semantics (see VER-503) 2018-09-06 20:34:59 +10:00
Japheth Lim 0847265be3 c-parser/doc: better example for target arch files 2018-09-06 20:34:59 +10:00
Japheth Lim cb9492c4fb c-parser/doc: update with x64 array sizes; other minor fixes 2018-09-06 20:34:59 +10:00
Michael Norrish 423606ae60 c-parser: always attach GCC attributes to vars.
Some attributes attached to global variables weren't kept in
the AST if they appeared at the front of the declaration rather
than the back.

For instance, the aligned attribute was lost in this declaration:
   int __attribute__((aligned(16))) x;
but kept if it appeared last:
   int y __attribute__((aligned(16)));

Now fixed.
2018-08-23 18:57:09 +10:00
Gerwin Klein 3101eba8e7 remove trailing whitespace from ulem.sty 2018-08-21 15:15:08 +10:00
Gerwin Klein af056bc00d Isabelle2018 riscv: theory import for c-parser 2018-08-20 09:06:37 +10:00
Gerwin Klein 8af6b2ec1a Isabelle2018: add ulem.sty which is now required by isabelle.sty
(available by default in newer tetex installs, but not older ones)
2018-08-20 09:06:37 +10:00
Gerwin Klein 1383f4ceee Isabelle2018 autocorres: declare external files 2018-08-20 09:06:37 +10:00
Gerwin Klein d4738b079f Isabelle2018: AutoCorresTest 2018-08-20 09:06:36 +10:00
Gerwin Klein 7e29504194 Isabelle2018: AutoCorresDoc 2018-08-20 09:06:36 +10:00
Gerwin Klein 1c82254a3c Isabelle2018: AutoCorres 2018-08-20 09:06:36 +10:00
Gerwin Klein eea38b25c4 Isabelle2018: READMEs and docs 2018-08-20 09:06:36 +10:00
Gerwin Klein 75b38be012 Isabelle2018: new AsmRefine session + test 2018-08-20 09:06:36 +10:00
Gerwin Klein 1ae3a8d65b Isabelle2018: Lib update 2018-08-20 09:06:36 +10:00
Gerwin Klein 4dc3ffb1ba Isabelle2018 c-parser: declare external files 2018-08-20 09:06:36 +10:00
Gerwin Klein 86bad831e2 Isabelle2018: C parser tests 2018-08-20 09:06:36 +10:00
Gerwin Klein b213aa9ba0 Isabelle2018: CParser 2018-08-20 09:06:36 +10:00
Gerwin Klein 49eceeaf41 Isabelle2018: re-import Simpl from the AFP 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
Gerwin Klein 011e08458e Isabelle2018: new comment syntax
(result of "isabelle update_comments <dirs>")
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
Gerwin Klein 382b07dc20 c-parser: remove unused dependency on Lib 2018-08-20 09:05:52 +10:00
Gerwin Klein f2a8c3e07e c-parser: session qualified imports for parser tests 2018-08-20 09:05:52 +10:00
Gerwin Klein 5ae795c586 c-parser: qualified session imports; Word_Lib base image
Previously, everything was counted under session CParser, incl most of
Word_Lib. The dependency on Word_Lib thus revealed means Word_lib is the
better base image for session Simpl-VCG.
2018-08-20 09:05:52 +10:00
Gerwin Klein 20d0db1e7e autocorres: mark Auto_Separation_Algebra as unfinished
(uses cheat_tac for a few tactics that are not filled in yet)
2018-08-06 14:28:44 +10:00
Gerwin Klein 377caf0a86 c-parser: allow skipping modifies-proof in quick_and_dirty only 2018-08-06 14:28:44 +10:00
Gerwin Klein 2d8233bb76 cparser: set sorry_modifies_proofs conditionally on env var
This includes replacing the non-thread-safe ref sorry_modifies_proofs with a
proper Config option.
2018-08-06 14:28:44 +10:00
Matthew Brecknell c390013909 x64 crefine: prove several lemmas in Retype_C
To prove that retyping a TCB establishes the state relation for TCBs,
it is necessary to prove that the C FPU null state is always equal to
the Haskell FPU null state. This commit therefore includes some
machinery for maintaining the state relation for the FPU null state,
and repairs many proofs.
2018-07-05 16:23:15 +10:00
Gerwin Klein 05281b90fe c-parser: consolidate IsaMakefile into Makefile
resolves remaining part of github issue #22
2018-07-02 08:52:01 +02:00
Gerwin Klein 7741eaccab riscv c-parser: ignore generated standalone parser files 2018-07-02 08:52:01 +02:00
Gerwin Klein 47a7511941 c-parser: tweaks for mlton 20180207 in standalone C parser 2018-07-02 08:51:40 +02:00
Rafal Kolanski edd02390e1 c-parser: reinstate X64 target accidentally clobbered by RISCV64 2018-06-28 18:42:43 +10:00
Gerwin Klein 23a1bae103 riscv c-parser: RISCV64 test setup 2018-06-27 10:06:49 +02:00
Gerwin Klein 48531d2d67 riscv haskell-translator: caseconvs update 2018-06-27 10:06:48 +02:00
Gerwin Klein b3e1be7783 haskell-translator: enable RISCV64 target 2018-06-27 10:06:47 +02:00
Gerwin Klein 52b9f958aa haskell-translator: add parsing of .hs files
In addition to .lhs only.
2018-06-27 10:06:47 +02:00
Rafal Kolanski 31b635401d riscv: setup cspec build for L4V_ARCH=RISCV64
C parser and word setup copied from X64
2018-06-27 10:05:44 +02:00
Joel Beeren 25125763bd arm-hyp: ioportcontrol: fixes after adding IOPortControlCaps to x64 2018-04-19 05:27:06 +10:00
Joel Beeren f728dd25e8 x64: Add IOPortControlCaps to control IO port allocation
The previous implementation of IOPortCaps has problems with revocability
and determining parency etc. This commit adds IOPortControlCaps which
behave identically to IRQControlCaps -- invoking the IOPortControlCap
allows one to create IOPortCaps with the supplied range.

There now exist invariants to show that there is only one
IOPortControlCap and that all IOPortCaps in the system do not overlap.
Furthermore there is a global record of which IO ports have been
allocated to prevent reissuing the same ports.
2018-04-19 05:27:06 +10:00
Thomas Sewell d4d89922af lib/wp: Adjust some problematic attributes.
In particular, some intro! attributes for some wp rules are removed.
These previously caused auto/fastforce to play a really strange role
in some proofs.
2018-03-16 14:57:09 +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
Japheth Lim 26b45dc466 c-parser: automated testing for JIRA VER-881 2018-03-14 17:56:53 +11:00
Thomas Sewell 97a4e3753e Revert designs, fix with more processing.
Abandon post-processing. There's some fragility somewhere that requires
process_stmt to see exactly the statements that go out, so it needs to run
last.

To handle initialiser elements, re-run process_stmt over the initialiser
statements that are created by process_decl. That's repeating some steps,
but it seems to work.

Waiting on input from Michael N about how crazy this is, but for now we're
pushing it to testing.
2018-03-14 17:56:53 +11:00
Thomas Sewell 4b2c812323 c-parser: VER-881: process more function calls.
Two kinds of function calls were escaping the analysis. The first is simple,
the ReturnFnCall statement type, which was a silly omission from before.

Function calls inside initialiser statements are a more difficult problem.
The simplest solution was to move the VER-881 calculation into a
post-processing phase once those function calls have been moved to statement
positions.
2018-03-14 17:56:53 +11:00
Japheth Lim 055e8984b7 c-parser: fix release script 2018-03-02 15:04:52 +11:00
Japheth Lim d22a054262 c-parser: update install instructions 2018-03-02 13:08:16 +11:00
Japheth Lim 7144e380a8 autocorres: fixes for quickstart doc formatting; update bib entries 2018-03-02 13:07:49 +11:00
Japheth Lim 7c818daaea autocorres: fix C source formatting in quickstart doc 2018-03-02 11:34:54 +11:00
Japheth Lim 35eae1f0c1 autocorres: update for version 1.4 release 2018-03-02 11:13:21 +11:00
Gerwin Klein 561be5e196 autocorres: NICTA URLs -> D61 URLs 2018-03-01 16:54:05 +11:00
Thomas Sewell f35caa8dca JIRA VER-881: avoid complex call lvals.
This scans for statement-level function calls which will have complex
lvalue translations, either because their lvalues are compound
expressions or because their function return type will be promoted to
be stored. It treats them like expression-level function calls, with
an additional call statement added (saving to a ret_ variable) and
the complex lvalue step treated like an assignment.
2018-02-28 11:22:46 +11:00
Rafal Kolanski b749a23b87 lib: add find_names command to find other names of a theorem
When given a theorem, find_names finds other names the theorem appears
under, via matching on the whole proposition. It will not identify
unnamed theorems.
2018-02-25 21:47:35 +11:00
Joel Beeren 4601f2a1ab Genericise deletion actions that occur after empty_slot
This patch adds a generic "post_cap_deletion" step that is called by
finalise_slot. Previous to this, the only caps which had actions
required at this stage were IRQHandlerCaps -- it was required that the
IRQ bitmap be updated after the cap itself was removed (as the
invariants state that for any existing IRQHandlerCap, the corresponding
bit in the IRQ bitmap must be set).

By genericising this, we add the capacity for new, arch-specific post
cap deletion actions to occur in the future.
2018-02-23 09:12:55 +11:00
Matthew Brecknell 40f83c5637 autocorres-crefine: add tools for moving between ccorres and corres
This commit adds a method `ac_init`, which converts a ccorres goal into
a corres goal. It also adds an attribute `ac`, which converts a ccorres
fact into a corres fact, in a form suitable for solving goals produced
by `ac_init`.
2017-11-22 10:59:57 +11:00
Rafal Kolanski 452b4ea63d haskell translator: more explicit file checking for parse_skl.py
This should give saner error messages to debug regression builds.
2017-11-13 12:28:51 +11:00
Rafal Kolanski 8fa326b706 haskell translator: tune generic exception catch debugging 2017-11-09 16:38:31 +11:00
Luke Mondy 9311b325cb haskell translator: Add some exception handling to help identify issues 2017-11-09 15:48:58 +11:00
Alejandro Gomez-Londono 9dd70db323 haskell translator: Improve error handling of make_spec.sh
* make_spec.sh was generating a `version` file regardless of the
    outcome of the script, this was causing `make design` (in
    spec/design) to always succeed when ran a second time, which in
    was generating confusing (and semi-non-deterministic) error
    messages when called through `./run-test`

  tags: [NO_PROOF]
2017-11-02 18:32:19 +11:00
Matthew Brecknell f8bf97f4e3 Isabelle2017: update AutoCorresTest for RC1
Add a "sessions" section to the AutoCorresTest ROOT file, to allow
the IsPrime test to import from HOL-Number_Theory.
2017-10-30 12:23:26 +11:00
Matthew Brecknell e3d209eb24 Isabelle2017: update SimplExportAndRefine for RC0 2017-10-30 12:23:26 +11:00
Matthew Brecknell 5267e6f178 Isabelle2017: update AutoCorresTest for RC0 2017-10-30 12:23:26 +11:00
Matthew Brecknell 8f2f5df099 Isabelle2017: update AutoCorres for RC0
* Named_Target.init removed redundant parameter.
2017-10-30 12:23:26 +11:00
Matthew Brecknell dcbda6748e Isabelle2017: update c-parser for RC0
* Removed redundant parameter from Named_Target.init.

  * Adjusted ROOT file for session-qualified imports.
2017-10-30 12:23:26 +11:00
Matthew Brecknell 0102ef172a Isabelle2017: remove String_Compare
This was a workaround for an Isabelle2016-1 performace regression, and
is no longer required.
2017-10-30 12:23:26 +11:00
Matthew Brecknell f6c1907dfe Isabelle2017: re-import Simpl from the AFP 2017-10-30 12:23:26 +11:00
Pang Luo 6b9912c47a manually adjust non-obvious cases of tab to space replacement 2017-10-20 14:22:36 +11:00
Matthew Brecknell 184d6b70b7 remove most tab characters 2017-10-20 14:22:36 +11:00
Adrian Danis 49d6cf721b Munge test: Delete munge tests that have been moved to a new repository
tags: [NO_PROOF]
2017-09-28 15:21:11 +10:00
Adrian Danis 6e96015e32 Munge Test: Update for changes to cspec
The C kernel build in cspec was changed to have a different directory structure and
build targets. This updates the make_munge.sh script to reflect those changes

tags: [NO_PROOF]
2017-09-28 14:39:25 +10:00
Adrian Danis 38057504aa Munge Test: Always produce expected kernel_all.txt
tags: [NO_PROOF]
2017-09-28 14:39:19 +10:00
Matthew Brecknell 3744c71a48 crefine autocorres: update c-kernel import paths for new kernel build system 2017-09-21 13:23:38 +10:00
Adrian Danis 8273ca818d cspec: Remove redundancy in build rules and theory files for c-kernel builds
Removes files that were duplicated in cspec/$L4V_ARCH directories to exist directly in
the cspec directory and contain $L4V_ARCH switches where needed. This allows for a single
Makefile for building the C kernel and the KernelInc_C theory, which is different between
architectures, to still exist per L4V_ARCH.

As the build location of the C kernel, and the resulting kernel_all.c_pp artifact, is
moved this change needs to be reflected in all the theory files that refer to it.
2017-09-21 13:23:04 +10:00
Joel Beeren 9593972d06 c-parser: add 64bit td_names lemma
This adds the lemma td_names_word64 to match existing lemmas
td_names_word32 and td_names_word8, allowing further simplification
using typ_heap_simps in CRefine.
2017-09-14 14:51:58 +10:00
Matthew Brecknell c36e2fe459 regression: remove CParserTestX64
We now routinely test CParserTest with L4V_ARCH=X64, so CParserTestX64
is no longer required.

tags: [NO_PROOF]
2017-09-07 15:04:14 +10:00
Michael Norrish cb5eaa2f9c Ensure asmblock expressions are "processed" by program_analysis
Failing to do this can result in variables that haven't been
appropriately "munged", resulting in the wrong or no var_info being
associated with them in the AST.

JIRA VER-808
2017-09-06 13:45:32 +10:00