Commit Graph

803 Commits

Author SHA1 Message Date
Gerwin Klein e89813ecf2
proofs: updates for monad refactor
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-02-09 11:46:55 +11:00
Michael McInerney 3c322eab1d cparser+crefine: move h_t_array_valid_array_assertion to cparser session
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-01-30 18:00:42 +10:30
Gerwin Klein e3c2e878b9
lib+proof+autocorres: consolidate when[E]/unless[E]_wp naming
wp rules for most operators such as return, get, gets are named
return_wp, get_wp, etc. Then when, whenE, unless, unlessE operators had
an additional hoare_.. prefix that this commit removes for more
consistency.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 11:48:39 +11:00
Gerwin Klein 40dc7eaa01
lib+autocorres: remove last AutoCorres Lib dependency
Moving `Monad_Equations.thy` and `More_NonDetMonadVCG.thy` into Monads
session enables us to remove the Lib and CLib session dependencies in
AutoCorres.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:19:03 +11:00
Gerwin Klein 2d2cadb86b
lib+proof+tools: move LemmaBucket_C into CParser
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:18:11 +11:00
Gerwin Klein 2c4c22ccdf
autocorres: reduce Lib dependencies
Remove dependency on Lib.thy. Theory imports of AutoCorres are now
reduced to theories that can be moved out of the Lib session.

The proof context changes a bit, but impact on test cases is minimal.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:13:46 +11:00
Gerwin Klein f6dbf4ab09
tools: proof fixups for LemmaBucket_C changes
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:13:46 +11:00
Gerwin Klein 0f71104ca9
lib+autocorres: move NatBitwise to AutoCorres
Since most bitwise operations are now available by default for nat,
only word abstraction in AutoCorres depends on NatBitwise.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:13:45 +11:00
Gerwin Klein a9fd0142be
all: adjust theory imports for TypHeapLib change
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:13:45 +11:00
Gerwin Klein 1ea235c152
lib+c-parser: move TypHeapLib into CParser
It has no other lib dependencies and over time should probably be
merged directly into umm theories. For now, move the entire file
and keep dependency structure.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-25 10:13:44 +11:00
Gerwin Klein 6dcbd4f09f
spec+proofs+autocorres: theory import fixes
Adjust theory imports for new sessions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-24 11:30:06 +11:00
Gerwin Klein 238acb46bb
lib+tools: MLUtils -> ML_Utils for consistency
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-20 13:43:39 +11:00
Gerwin Klein 9092a0f115
c-parser+autocorres: use ML_Utils session
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-20 13:43:39 +11:00
Gerwin Klein 79eccd3c10
lib+spec+proofs: proof fixes for NonDetMonadLemmaBucket split
Very minor changes, but in many modules.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-19 17:01:34 +11:00
Michael McInerney 619e941631 c-parser+crefine+clib: move is_aligned_c_guard to c-parser session
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-01-12 11:48:59 +10:30
Michael McInerney 640d352148 c-parser+crefine: move h_t_array_valid_field to c-parser session
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-01-11 14:39:57 +10:30
Gerwin Klein 5305090cdc
autocorres: fix AutoCorresDoc ROOT
Fix missing quotes. It looks like this ROOT file worked with `isabelle
build` before, but it did not work interactively.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-09 14:54:11 +11:00
Gerwin Klein 3960115459
lib+proofs+sys-init+tools: proof updates for Fun_Pred_Syntax
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-01-09 14:54:11 +11:00
Gerwin Klein 5ff1ac1346 c-parser: fix default target for standalone parser
The default (=first) Makefile target for the standalone parser was
`all`, which gains additional dependencies in the included Makefile.
We want `make` in this directory to just build the standalone parser,
so we set `stp_all` as the default.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-11-30 10:27:59 +11:00
Corey Lewis 5cd111a61e isabelle2022 autocorres: update Autocorres
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-11-09 11:45:46 +11:00
Corey Lewis 821f9ed0c7 isabelle2022 c-parser: update CParser
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2022-11-09 11:45:46 +11:00
Gerwin Klein 1ecfd4f90e autocorres: include AARCH64 in release
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-31 11:45:05 +11:00
Gerwin Klein 91c135d440 autocorres: changelog+README for 1.9 release
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-31 11:45:05 +11:00
Gerwin Klein 76ee4634e6 c-parser: update release notes
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-10-31 11:45:05 +11: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 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
Gerwin Klein 98bb90e0c3 Makefiles: remove unused report-regression target
This target was used in the regression test setup before this repo
switched to `run_tests` and has been unused for some time.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Gerwin Klein 8ff19483a8 aarch64 design: ExecSpec with PT types
adjusting caseconvs and pulling in the type at the right place for
sharing with ASpec.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Gerwin Klein 7eb5f0004a haskell-translator: enable _ in record field names
The pattern syntax in Isabelle that is generated for record field names
needs to escape _ in the name with ' to distinguish the _ from a dummy
pattern.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-06-03 09:36:43 +10:00
Rafal Kolanski 6095e9ecb2 cparser: annotate AST printing for top-level decls
In order to compare ASTs for appearance/disappearance/modification of
declarations, it is easier to have the annotations obvious to any
external tool for ease of parsing.

Annotations take the form:
"##<decl_type>: <name>", e.g. "##Function: ctzl"

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-05-10 16:40:42 +10:00
Gerwin Klein daca9fbcb4 aarch64 haskell: validate InvocationLabels
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-04-20 09:16:19 +10:00
Gerwin Klein 5b77789f9d aarch64 haskell/design: sync names with C
The top-level object type is called `VSpaceObject` in C, so we use the
same name here. The top-level cap is `VSpaceCap` in C, but since we
want to keep it as a flag in the PT Cap in the specs, we call the flag
`capPTisVSpace` for consistency.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-04-20 09:16:19 +10:00
Rafal Kolanski 624ec70eb4 caseconvs: add AARCH64 design spec cases
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-04-20 09:16:19 +10:00
Rafal Kolanski cfd2990fa6 haskell translator: add AARCH64, platform TX2
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-04-20 09:16:19 +10:00
Rafal Kolanski 6052cb4bc0 haskell-translator: allow `\` to continue lines in input files
Haskell translator import statements in skeleton files can get very
long, and keeping them as one line is rather inconvenient. This change
allows a backslash (`\`) at end-of-line to indicate line continuation.

Note: the `\` acts like in shells, i.e. it must be exactly at EOL.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-04-20 09:16:19 +10:00
Gerwin Klein 52024490d5 asmrefine: remove obsolete simp rules
These are either not necessary any more or are now in the simpset by
default.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein a6c3ac2901 isabelle2021-1: AsmRefine
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 3196054268 isabelle2021-1: remove extend from TheoryData
No longer required in Isabelle2021-1 for TheoryData and GenericData

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein afb3c7291c isabelle2021-1 autocorres: context in convs
Conv.params_conv changes the context, and the inner conversion that
it runs needs to work on that inner context, otherwise information
is lost about which of the Free variables are former Bound.

Isabelle2021-1 has more thorough checking and fails when the wrong
context is provided.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein 0fbe82511d isabelle2021-1: AutoCorres
After these changes AutoCorres type checks and compiles, and the proofs
work, but for most test cases we still get runtime exceptions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein ed194a6bc4 isabelle2021-1 c-parser: update CParser + tests
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Gerwin Klein a235a0aec6 isabelle2021-1: sync Simpl from AFP
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-03-29 08:38:25 +11:00
Rafal Kolanski 6c7798d512 asmrefine: add prefixes for testfiles/*_gref.thy
These currently work with an empty prefix as well, but using the name of
the theory file containing the respective install_C_file is more stable.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2022-02-22 18:24:02 +11:00