Commit Graph

686 Commits

Author SHA1 Message Date
Michael McInerney 6ff1a38f65 lib: update for Isabelle 2019 2019-06-13 16:22:33 +10:00
Gerwin Klein c409f85ec9 lib: remove obsolete theory import 2019-06-13 16:22:33 +10:00
Gerwin Klein 21f9a86dd9 lib: sync Word_Lib with AFP 2019-06-13 16:22:33 +10:00
Michael McInerney 81dab3dcec lib: add unit_dc_is_eq 2019-06-13 11:43:50 +10:00
Edward Pierzchalski e8e40a572c lib: Use `datatype_schem` arguments in `wpfix`.
`wpfix` delegates to `datatype_schem`, so we include the option to add
new accessor lemmas.
2019-06-12 10:35:48 +10:00
Edward Pierzchalski 02dcb099ff lib: Allow additional rules for `datatype_schem`.
Previously, the method `datatype_schem` used a specific list of
hard-coded rules to "fix" datatypes in schematics. This adds an
attribute so users can add new datatype "lenses"/"accessors" as needed.
2019-06-12 10:35:37 +10:00
Edward Pierzchalski 7ac89448a1 lib: Add `find_index`. 2019-06-12 10:35:32 +10:00
Edward Pierzchalski c1e9a09e26 lib: move "tl_nat_list_simp" up. 2019-05-28 10:00:10 +10:00
Japheth Lim c397b16f42 lib: license header for RangeMap 2019-05-20 00:15:31 +10:00
Japheth Lim 071ebbd398 lib: move @{mk_term} antiquotation from AutoCorres; add examples 2019-05-17 18:07:59 +10:00
Japheth Lim c96444b7d4 lib/RangeMap: cleanup; strengthen range lookup thms; add testsuite 2019-05-17 18:07:59 +10:00
Japheth Lim 4f1c452bd2 lib: add RangeMap data structure (no tests yet) 2019-05-17 13:58:50 +10:00
Japheth Lim 9cbf5e6ab5 lib: use `@{term_pat}` in FP_Eval; refactor term_pat testsuite 2019-05-17 13:58:13 +10:00
Japheth Lim 4c18e1f156 lib/FP_Eval: add license headers 2019-05-17 13:58:13 +10:00
Japheth Lim c94d3285df lib/FP_Eval: move let_weak_cong' to main tool; improve docs 2019-05-17 13:58:13 +10:00
Japheth Lim 450f83ffeb lib: initial version of FP_Eval tool
FP_Eval is an Isabelle/ML tool for functional program rewriting.
It has similarities with the Isabelle simplifier, but is simpler and
more scalable for performing computations in the logic.

See FP_Eval_Tests for basic tests and examples.
2019-05-17 13:58:13 +10:00
Edward Pierzchalski 9809f4001f lib tutorial: Add `SELECT_GOAL` example. 2019-05-08 10:42:33 +10:00
Edward Pierzchalski ea06b8b708 lib: Add tutorial on tactic basics.
This is an explicit walkthrough about how one goes about doing a proof
in Isabelle/ML. The goal is that someone can run into such a proof, look
at this tutorial, and then at least be equipped to ask the right
questions about fixing the proof.
2019-05-03 11:38:56 +10:00
Edward Pierzchalski ea31a344c7 libtest: Fixes after new Ptr syntax changes. 2019-05-03 11:14:12 +10:00
Victor Phan c9094ccbb3 ainvs: update for new definition of set_object
Added set_object_wp_strong, which infers from a given hoare triple with
command set_object that the object of same type already exists in the
heap, and hoare_set_object_weaken_pre which does the same thing, but can
be applied on top of existing lemmas about set_object.

ainvs: improve proof of set_thread_state_runnable_valid_blocked

ainvs: change return value to a more general one

in_set_object has a return value that is empty '()', but the theorem
still holds true when replaced with a generic parameter 'rv' making it
easier to use this lemma.

ainvs: trivial - updated style of proof

ainvs: strengthen set_object_idle lemma

Add conditions imposed by valid_idle into precondition.
Thank you to Matt Brecknell for the help.

ainvs: abbreviated Hoare triples and proof fix

ainvs: restated set_object_wp_strong with auxiliary lemmas

ainvs: update for new definition of set_object

ainvs: update for new definition of set_object

Move in a few set_object and set_aobject theorems from x64 theory files
as these theorems were architecture generic.

ainvs: update for new definition of set_object

ainvs: update for new definition of set_object
2019-04-18 14:32:08 +10:00
Corey Lewis 410eb275f4 lib: add a comb parameter to wpsimp, along with two new comb rules 2019-04-16 15:29:48 +10:00
Corey Lewis 95ddba3da5 lib: improve the parser for crunch.
The main benefit of this is that everything in crunch is now ctrl clickable.
As an added benefit, supplied rules can now be modified by attributes when
needed.
2019-04-16 15:18:49 +10:00
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 0eefa4b6b6 lib: rename lemma to prevent collision with List.sorted_filter 2019-04-05 12:12:49 +11:00
IlmariReissumies bed1ee9b5e lib: add two lemmas about the sorted predicate
Courtesy of @jalim.
2019-04-05 10:41:42 +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 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
Callum Bannister bba5bfd905 lib + sysinit: whitespace cleanup; renamed lookup_obj 2019-02-19 15:43:10 +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 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
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
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
Gerwin Klein 5e51fa05d7 lib: tag correctly as BSD
(Two library files were incorrectly tagged as GPL).
2018-12-10 15:58:03 +11:00
Edward Pierzchalski 21cc25f131 lib: Add stray lemmas and methods.
These were unused items in ARM CRefine, now kept for potential future
usefulness.
2018-11-21 17:12:23 +11:00
Edward Pierzchalski e7fa23ab2c lib: fix up Levity dependency tracking
Uses proof body terms to disambiguate the names encoutered in
dependency extraction, rather than using (for example)
Thm.full_prop_of.

The result is that this catches a few more missing dependencies,
enough to correctly identify unused lemmas large sessions
like CRefine.
2018-11-16 15:15:55 +11:00
Gerwin Klein b8a99035dc lib: an abbreviation command with pretty printing inside locales
Normal abbreviations are not contracted on pretty printing when defined
inside a locale. This commit provide the command locale_abbrev which does
contract on pretty print even when defined inside a locale. It cannot be
used with abbreviations that mention fixed locale variables (whereas the
standard abbreviations can).

Co-authored-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2018-11-15 22:56:01 +11:00
Edward Pierzchalski ecc84ffc6e lib: fix up Levity JSON output
- Previously printed `~` for negative numbers, which is invalid
  JSON. Now prints `-`.

- Previously the outpout would unconditionally trim
  'underscore-number' suffixes. Now uses theory context to determine
  if it's likely to be an index into a theory list or an existing
  fact name.

- Changed JSON structure to avoid using dynamic names for keys, i.e.
  from this:

    {
      "my_theory_name": {...}
    }

  to this:

    {
      "theory": "my_theory_name",
      "content": {...}
    }

  This should make processing the output slightly nicer by matching
  what other tools expect.

- Changed JSON structure to consolidate dependencies. Lemmas are no
  longer special-cased.
2018-11-02 15:40:30 +11:00
Gerwin Klein c53f7850d7 Base ASpec + machine on OptionMonad_ND; fix proof fallout 2018-10-25 12:54:02 +11:00
Gerwin Klein a74b7b4079 lib: clean up BCorres_UL 2018-10-25 12:54:02 +11:00
Gerwin Klein f3dca6865c lib: option (reader) monad syntax and gets_map operator 2018-10-25 12:54:02 +11:00
Gerwin Klein f2613b2853 lib: additional setup for numeral types
In particular: instantiate to the size class so one can use bounded types
for automatic termination measures in fun.
2018-10-25 12:54:01 +11:00
Gerwin Klein 69f00fd7f7 word_lib: cleaning up some old proofs 2018-10-25 12:54:01 +11:00
Japheth Lim 0ab8491add lib/FastMap: add FIXME for conv_at hack 2018-10-23 15:44:11 +11:00
Japheth Lim 7a38ef6331 lib: move FastMap lemma to LemmaBucket 2018-10-23 15:44:11 +11:00
Japheth Lim 65956bea3f lib/FastMap: fix primrec style 2018-10-23 15:44:11 +11:00
Japheth Lim c0d6e8c40f lib/FastMap: test cases for small inputs 2018-10-23 15:44:11 +11:00
Japheth Lim 5ea3f54547 lib/FastMap: refactor convs; renaming; juggle function arguments
Complex conversions have been refactored to the new utility conv_at,
which is easier to use and has better error detection.

Name changes: “*_to_map” naming scheme changed to more descriptive
“*_to_lookup_list”.

Key transformer argument is now the first argument to tree_lookup and
friends, which matches functional programming conventions.
2018-10-23 15:44:11 +11:00