Commit Graph

803 Commits

Author SHA1 Message Date
Rafal Kolanski 289de4fef7 asmrefine: use a prefix for constant lookups
Add and carry around a `pfx` parameter indicating the prefix under which
constants should be found. Without this prefix, items such as
enumeration constant names are guessed at from unqualified names. If the
unqualified name is hidden for some reason, or clobbered with another
name, the wrong constant gets used and leads to exciting errors.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-02-22 18:24:02 +11:00
Gerwin Klein ffcaff6af9 c-parser: provide AARCH64 setup
The setup for L4V_ARCH=AARCH64 is identical to RISCV64, i.e. same word
length, encoding, and endianness. The setup includes the standalone
parser used for compile and preprocess checks in the seL4 repo.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-03 16:13:45 +11:00
Gerwin Klein ab358b835d autocorres: update release.py to python3
Apparently, we still did releases with python2 in the past. This commit
updates the script to work cleanly with python3 and with both of Linux
and Darwin.

For the latter, untarring and executing a downloaded tarball is not
easily supported on MacOS, so instead of the tarball, we take a path to
the already unpacked Isabelle release.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 2cf262f2b0 autocorres: release notes for autocorres-1.8
Includes some minor documentation updates.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 770e7a31b9 cparser: add release notes for c-parser-1.18
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein c8a5b00bbc cparpser: make release notes more readable
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 0c06287c19 cparser: adjust mkrelease for MacOS
Makes the release script more portable between BSD (MacOs etc) and
Linux. Assumes a `brew` install on MacOs instead of the older macports.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 71bbff2eca cparser: guard bash invocation
Standard bash on MacOS is very old; invoking it via /usr/bin/env allows
the user to put a newer version in the PATH.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein f18f5752ab trivial: remove trailing whitespace
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 1b6d1e9d3c isabelle-2021 c-parser: simp rules for word types
typ_name of word types was not simplifying fully, because a shorter
simp rule is taking precedence over the shortcut rules. The added
rules make the system confluent again.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein e3f50549c6 isabelle-2021 asmrefine: make 64 bit clean
The previous proof of unat_word32_less_2p_word_bits worked only for
word_bits = 32.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 956b2b85e5 isabelle-2021: CParser update for all L4V_ARCH
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 997adaf9f3 isabelle-2021: update AutoCorresQuickstart
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-09-30 16:53:17 +10:00
Gerwin Klein 953cc78732 isabelle-2021: update AsmRefine
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein ee8dbcb09c isabelle-2021: AutoCorres update
includes Word_Lib tweaks

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 90032b64b5 isabelle-2021 cparser: Word_Lib include
Word_Lib was included multiple times in the graph, leading to name
shadowing. This commit makes Addr_Type the single point of entry.

Includes some cleanup/warning reductions.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 9d7efd75e2 isabelle-2021: cparser+tests update
This includes a tweak to Word_Lib to simplify ucast(-1) which
is now a term that occurs more often.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +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
Gerwin Klein 411b4221b1 isabelle-2021: sync Simpl with AFP
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 28bc26c925 isabelle-2021: HOL-Word now in HOL-Library
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2021-09-30 16:53:17 +10:00
Gerwin Klein 512f62858a autocorres: update project link
Moved from D61 to https://trustworthy.systems

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 11:22:05 +10:00
Gerwin Klein 06e83ccff5 READMEs: update software links
These have also moved to https://trustworthy.systems

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 11:22:05 +10:00
Gerwin Klein 81b95eb6bf READMEs: fix publication links
PDFs and abstracts have moved to trustworthy.systems/

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-25 11:22:05 +10:00
Matthew Brecknell 4278e99aa4 riscv crefine: generalise and move some lemmas
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-23 22:40:46 +11:00
Corey Lewis dd6529f520 trivial: fix c-parser link
This reverts commit 985ce0d28a.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-03-12 10:48:55 +11:00
vjackson725 f6009f8531 c-parser: rewrite functional-record-update fN defs
Loading the FunctionaRecordUpdate file in Isabelle is slow.
This change expands the fN family of functions, which fixes the problem.

Signed-off-by: vjackson725 <v.jackson@unsw.edu.au>
2021-03-05 18:32:43 +11:00
Matthew Brecknell 96545a8312 c-parser: use fresh names for temporaries
Prior to rendering an expression to SIMPL, the C parser extracts
function calls from the expression and reinserts them as new statements
placed just before the statement containing the expression. The result
of each such function call is assigned to a temporary variable which
takes the place of the function call in the original expression.

Prior to this commit, the C parser would not always generate fresh
temporary variable names when multiple temporaries were needed. In
particular, when the left-hand side of an assignment contained a
function call returning the same type as a function call in the
right-hand side expression, the extracted function calls would be
assigned to the *same* temporary variable.

This commit addresses the issue by carrying name generation state across
all expressions in each statement. It implements a state monad as an
abstract data type for this purpose.

Fixes https://sel4.atlassian.net/browse/VER-1389.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-03-02 19:39:12 +11:00
Gerwin Klein 985ce0d28a trivial: fix c-parser link
Signed-off-by: Gerwin Klein <kleing@unsw.edu.au>
2021-03-02 11:44:22 +11:00
Gerwin Klein bf5b97500a trivial: fix links to papers
The TS website has settled on no `.pml` postfix

Signed-off-by: Gerwin Klein <kleing@unsw.edu.au>
2021-03-02 11:44:22 +11:00
Matthew Brecknell 13ca552d67 autocorres: fix code inclusion in quickstart doc
The AutoCorres quickstart document includes code from `*.c` files from a
given line number, to avoid including license headers and other details
that aren't useful in the document. This updates the line numbers for
the current license headers.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-11-24 10:17:37 +11:00
Gerwin Klein ba38ae33ab update publications links
The links to nicta.com.au have stopped working, so the publication links
now point to the TS publication pages.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-23 17:06:46 +11:00
Matthew Brecknell 898e5afc63 c-parser: improve asm support in modifies proofs
This commit adds support for inline assembly whose `lhs` updates a
global variable (such as the heap).

Prior to this commit, the modifies prover assumed that the `lhs` update
of an `asm_spec` only updated local variables. Specifically, the use of
`asm_store_eq_helper[OF globals.surjective globals.surjective]` as a
rewrite rule assumes that `globals (lhs v s)` simplifies to `globals s`,
exposing the `asm_store` inside `s` to the rewrite rule.

This commit avoids the assumption by using `globals.equality` as an
introduction rule. This produces more subgoals, but the subgoals are
relatively simple, so the perfomance is essentially unchanged.

This also slightly refactors `modifies_tactic` slightly:
- `asm_spec` is handled without the `vcg`, using a new rule
  `asm_spec_preserves`. This avoids having to deal with
  `asm_spec_enabled` separately in `modifies_tactic`.
- `seq_all_new`, which chains `THEN_ALL_NEW`, avoid the need to
  repeatedly use `ALLGOALS`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-11-23 15:32:23 +11:00
Gerwin Klein e51ea95427 autocorres: README update for Isabelle2020 and RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein aff203786c c-parser: now Isabelle2020; mention RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein be78194fee c-parser: RELASES was renamed
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 3ab83bb94a c-parser: also release RISCV64 arch
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 40d9783ef2 c-parser: use markdown extension
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 0451a27648 autocorres: update ChangeLog
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 54224efbc5 autocorres: Isabelle2020 update for release ROOT file
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein cf34401420 autocorres: use LICENSES directory in the release
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein c64590f39b autocorres: include RISCV64 in supported architectures
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 7437943fa8 c-parser: release script update for Isabelle2020
Adjust ROOT file generation and add an explicit Lib session in
the release.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10:00
Gerwin Klein 2b6b4c6bb5 c-parser: update release info
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 17:16:46 +10: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 0e9943e3a3 autocorres: fix session reference in AutoCorresSEL4
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-28 14:06:36 +10:00
Gerwin Klein 12615092de asmrefine: comment out failing test
This should not be ignored longer term. The test itself is failing anyway,
but the code now throws an exception, which it shouldn't do.

See VER-1295

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 91cc9d8521 tools/asmrefine: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 78717650f6 autocorres: do not store images of test sessions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 82e116ef6c autocorres: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 18428256f0 c-parser: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein adc22ae58f c-parser: sync Simpl with AFP-2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein e7fb36b7e2 ROOT files: file reorg for new ROOT requirements
Isabelle2020 requires each session to declare it own set of directories that
may not overlap with other session's directories. This commit reorganises
files to comply with that requirement.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Matthew Brecknell 64a597d574 asmrefine: support small array index types
This adds support for indexing into user contexts when `register_t` is
smaller than a word type, e.g. `uint8_t`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-09 21:33:35 +10:00
Edward Pierzchalski 87de976c9b asmrefine: (fixup) use `debug_config` in tests
Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-09-04 22:07:17 +10:00
Edward Pierzchalski 074689730f asmrefine: add timeouts for debugging
Also cleans up some of the debug config setup and makes result reporting
more useful.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-09-04 22:07:17 +10:00
Matthew Brecknell 6f23d50ea9 c-parser: avoid cleaning `umm_heap/ARM_HYP`
Initially the `Makefile` copied `umm_heap/ARM_HYP` from `umm_heap/ARM`,
and deleted `umm_heap/ARM_HYP` during `make clean`. However, the
contents of `umm_heap/ARM_HYP` have since been committed, so this is no
longer appropriate.

Reported-by: Michael Norrish <Michael.Norrish@data61.csiro.au>
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-26 14:58:15 +10:00
Gerwin Klein fb18ca7095 haskell-translator: use datatype selectors
This commit replaces separately generated selector functions with Isabelle's
built-in datatype selectors of the new datatype package (which is not that
new any more).

It currently does not touch discriminators yet, because they have a different
naming scheme and would require larger proof updates.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-09 10:06:27 +08:00
Edward Pierzchalski 55d9f5741f c-parser: include alias info in mungedb
Changes the mungedb to also indicate whether a given munged name has an
alias.

In the Distant Past, the C parser emitted long and short names, and the
mungedb output recorded those names. When definitions were reordered in
a C file, different C variables might get the short name; this could
break proofs, but the mungedb output would indicate the change ahead of
time.

Now, the C parser emits long names for every C variable, but it also
emits a short abbreviation to replicate the behaviour of the C parser in
the Distant Past. However, the mungedb only displayed *definitions*, not
*abbreviations*, so if the variable abbreviated by a short name changed
then the mungedb wouldn't pick up on the change.

This commit changes the output to include an "alias status", indicating
whether the short C name has been exported as an alias for the indicated
Isabelle name. It also adds a test to confirm that the mungedb output
tracks aliasing correctly.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-03 10:22:36 +10:00
Brian Huffman 3c3514fe99 c-parser: Faster automation for proving packed_type class instances.
Co-authored-by: Simon Winwood <simonjwinwood@gmail.com>

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-25 11:22:56 +10:00
Brian Huffman 2ae97d8b38 c-parser: Remove unused assumptions from field_lookup rules.
This gives a significant speedup to the install_C_file command
when it generates field_lookup lemmas for struct types.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-25 11:22:56 +10:00
Gerwin Klein 0aafe8bf80 autocorres: pull out SPDX tag
Turns out the reuse tool will get confused by the addition SPDX tag
in the file, even though it is not in a comment. This commit pulls
out the tag such that string matching will not trigger on it.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-24 11:27:03 +08:00
Matthew Brecknell 306fe017c3 autocorres: more specific Makefile pattern rule
A rule to generate `%.thy` from `%.c` was previously too general, such
that it could fire for `%.thy` files that were not intended to be
generated, overwriting existing `%.thy` files.

This recently became an intermittent problem, when several `%.c` files
were updated to comply with style checks. Depending on how an `l4v`
checkout was updated, this sometimes made those `%.c` files newer than
the corresponding `%.thy` files.

This commit converts the implicit pattern rule into a static pattern
rule that applies to exactly those `%.thy` files that are intended to be
generated.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-23 09:51:33 +10:00
Gerwin Klein 092b1207f7 run astyle on all C files in the repository
Leaves parse tests and generated files unchanged, and provides a style
filter for these.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 13:50:17 +08:00
Gerwin Klein 7e30711edf c-parser: AUXUPD modifies the heap
Previously AUXUPD did not contribute to modifies proofs, and the only
reason this worked was that there usually is some heap assignment
somewhere else in the function if there is an AUXUPD. This commit adds
a modifies clause for the heap if a function has an AUXUPD.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-10 17:53:29 +08:00
Matthew Brecknell cf48906b26 regression: force use of python3
Python 2 has passed its sunset date, and many distributions are
withdrawing support for Python 2.

PEP 394 recommends distributions always install versioned interpreter
commands (e.g. `python3`), but does not make a recommendation about
whether or not an unversioned command (`python`) should exist, or what
version it should run.

It therefore seems advisable to explicitly run scripts using the
`python3` command, for scripts that are compatible with Python 3.

Here, we do this for Python scripts used by `run_tests`. For this to
work, some scripts have been updated in ways that will break Python 2
compatibility. But for some other scripts which were already compatible
with both Python 2 and 3, we have not yet removed Python 2
compatibility. There are also miscellaneous scripts that are not used by
`run_tests`, and these have not yet been updated to Python 3.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-01 14:31:36 +11:00
Edward Pierzchalski ec93298afa asmrefine: handle THM failures during proofs
Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-03-28 11:17:29 +11:00
Edward Pierzchalski 62c8c799bc asmrefine: add missing signed cast rewrite
Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-03-28 11:17:28 +11:00
Gerwin Klein 75acf19dcd style: pep8 style for python files 2020-03-25 22:42:27 +11:00
Gerwin Klein c68915b92b license: provide documentation under CC-BY-SA-4.0
Datat61 provides all docs under CC-BY-SA-4.0.
2020-03-16 14:19:15 +08:00
Gerwin Klein d6953e2f0e spdx: provide copyright info for mllex/mlyacc 2020-03-16 14:19:15 +08:00
Gerwin Klein 86a941e7e7 spdx: review missing copyright & license info
Some files were missing machine-readable copyright info, others were tagged
incorrectly.
2020-03-16 14:19:15 +08:00
Gerwin Klein 8d1ec3e324 license: SMLNJ and MLTON licenses moved to LICENSES/
The MLton license is now HPND (see also http://mlton.org/License)
2020-03-16 14:19:15 +08:00
Gerwin Klein 2f32deb44a asmrefine: review license for $ARCH/ArchSetup.thy 2020-03-13 14:38:47 +08:00
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08:00
Gerwin Klein 8d12d8e4be licenses: tag .md and document file 2020-03-02 18:52:15 +08:00
Rafal Kolanski f9ea44ef89 arm-hyp: update spec+proofs for multi-VM support
Highlights:
- new reserved IRQ and associated handler: VPPIEvent
- VPPI events are virtual interrupts we can forward to VMs; currently there is
  only one event: virtual timer interrupt
- VGICMaintenance and VPPIEvent can both receive late interrupts from hardware,
  which are now discarded instead of being delivered to current thread
- given only one possible VPPI event, simplifier tends to mop up more than it
  should, making some proofs fragile w.r.t. adding a new VPPI event
- the order of some lemmas/specs needed shuffling, as now VCPU code needs some
  interrupt code, which uses VCPU code
2020-02-19 10:52:07 +11:00
Rafal Kolanski 504565e57d haskell: translator: handle datatype Enum with one constructor
There is a special case for deriving Enum for datatypes with a single
constructor, but it should only fire when that constructor has exactly
one argument. Previously, one constructor with any other argument count
that one resulted in assertion failed.
2020-02-13 12:29:52 +11:00
Zoltan Kocsis 788b4bd180 refactored irq_t structure (VER-1159) 2020-02-05 17:58:45 +11:00
Gerwin Klein 8356f303b6 haskell-translator: instance proofs for types without 0-arg constructors 2020-02-03 12:56:19 +08:00
Corey Lewis 5120e351b3 lib: improve wp tracing
When tracing wp can now print the instantiated version of the rules being used.
It also says which set each used rule is from.
2020-01-29 09:26:18 +11:00
Edward Pierzchalski 4a222d1189 asmrefine: add arch setup licenses 2019-12-19 17:05:10 +11:00
Edward Pierzchalski c1747628b1 asmrefine: Add support for 64-bit architectures. 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 94513392ac asmrefine: remove unused lemmas. 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 16f02df8b5 asmrefine: be more explicit when reporting results 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 437ae807c2 asmrefine: improve debugging
Splits parts of step 4 of the SimplExport proof process, in order to
expose them to the test theory. Add some instructions on how to use
them.

Tags subgoals so that the user can identify which ones caused the
failure.

Consolidates ML setup code, and demarcates it to let uses ignore it.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski d59ccc3fdf asmrefine: update tests
Includes some formatting changes.

Includes a comment explaining why `global_array_swap_gref` fails and is
commented out.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 708a62795e asmrefine: arch split CFunDump files
Now that asmrefine targets several arches, it's useful to separate out
any intermediate artefacts by L4V_ARCH. For instance, this lets us use
the same directory to test two arches at once.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 9ba1d498df asmrefine: remove globals_swap ref
Using a shared ref for configuration reduces the understandability of
code. It turns out the contents of the `globals_swap` ref:

1. Was always the same.
2. Was only used in one spot.
3. Could be recreated at that one spot.

So we do that instead.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski b4242a3ae8 asmrefine: arch-split for machine word size.
Arch-split memory operations used when translating graph-lang.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 89a53c0818 asmrefine: add field offset rewrite rules.
Currently unused, but these are useful for debugging proofs in SEAR
about struct access updates.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 36a26e23a5 c-parser: handle symbolic names in assembly
Previously the parser rejected symbolic names in assembly specifiers
(the `[foo]` in `[foo]"r"(bar)`). Since the SIMPL semantics ignores the
body content of assembly, and since these specifiers only affect the
meaning of the body, this rejection was overcautious.

Previously, the parser rejected rval `"i"` and `"rK"` specifiers (which
indicate that the expression is to be used in some kind of immediate
mode). Again, this is out of scope for the SIMPL semantics, so we allow
it.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 794dfb2f94 c-parser: fix register type to match ptr type 2019-12-18 12:04:48 +11:00
Edward Pierzchalski 31b779739e c-parser: add aliases for useful types 2019-12-18 12:04:48 +11:00
Victor Phan 79513ae604 riscv: update to HiFive platform from Spike
- Increase maxIRQ to 53
- Change keywords to build HiFive instead of Spike
2019-11-13 16:26:55 +11:00
Victor Phan 8bf03d45a0 riscv haskell/design: add and implement IRQ invocations
setIRQTrigger added but unimplemented because it's a machine op.
irqInvalid added, set to 0, since this is what's defined on the Spike
platform, may need to implement irqInvalid for other platforms if we
want generality for later proofs (Refine).
check, decode, perform IRQ control fully implemented to match the CSpec.
2019-11-12 18:28:40 +11:00
Gerwin Klein 09dbc34a0c riscv haskell/design: fix lookupPTSlotFromLevel and lookupPTFromLevel 2019-11-12 18:28:39 +11:00
Edward Pierzchalski f067068a88 asmrefine: improve initial debugging experience.
Adds a 'debug' configuration type to the main ProveSimplToGraphGoals
functions. Configuration lets the user control which functions will be
tested, and logs which functions fail testing.

Adds a 'single step' debug tactic for use in TestGraphRefine, and
demonstrates a few useful initial ML tactic for e.g. narrowing down
which subgoals are failing, and how to inspect a successful subgoal.
2019-11-12 14:25:58 +11:00
Corey Lewis dd48e0d899 proof: update for wp changes
Updated 'wp_once' to 'wp (once)' and removed several stray uses of 'wp_trace'.
2019-10-14 17:12:18 +11:00
Victor Phan dede199780 haskell-translator: remove PageRemap case conversion 2019-10-10 11:27:07 +11:00
Japheth Lim de9c069473 c-parser: update changelog for license change 2019-10-02 22:19:21 +10:00