Commit Graph

741 Commits

Author SHA1 Message Date
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
Japheth Lim 5409d88571 lib/FastMap: use simple locale instead of unnecessary qualify 2018-10-23 15:44:11 +11:00
Japheth Lim 1dfb962ad2 lib: add FastMap tool
Many issues remain (see TODO list), but it's now mature enough to be
used for proof automation and has a comprehensive test suite.
2018-10-23 15:44:11 +11:00
Japheth Lim 8d583a774a lib: remove reference to removed theories in ROOT 2018-10-23 15:44:11 +11:00
Gerwin Klein 15bfcdd98b reduce DRefine dependencies from Refine to AInvs
This needs (and includes) some deduplication and moving of lemmas formerly in
refine.
2018-10-22 13:21:11 +11:00
Edward Pierzchalski d3713d7990 lib: add some pure word lemmas found in proof/*
Preparation for removing duplicate word lemmas. These new lemmas
don't belong in the AFP word library, so we hook in to
`Word_Lemmas_Prefix` to expose them to our own theories.
2018-10-10 14:15:00 +11:00
Edward Pierzchalski b7d680a25e lib: speed up word8_exhaust 2018-10-10 14:15:00 +11:00
Japheth Lim 00fefcd700 lib: bump LibTests timeout to 1800s 2018-10-03 19:48:38 +10:00
Japheth Lim da6ccf7a8e lib: update qualified imports for LibTest theories 2018-10-03 19:48:38 +10:00
Japheth Lim f1c3f78838 lib: user-friendly commentary for Qualify_Test 2018-09-28 11:47:55 +10:00
Japheth Lim af81675fd8 lib: better description for TSubst 2018-09-28 11:46:54 +10:00
Japheth Lim f158751ba5 lib: add @{inline_tactic} and @{inline_method} ML antiquotations
This resurrects a useful part of the removed TacticAPI theory, with a
much more generic implementation.
2018-09-27 18:54:19 +10:00
Japheth Lim 6a4070bf01 lib: remove bitrotted TacticAPI
This was a fledgling framework that was never used.
2018-09-27 18:44:08 +10:00
Japheth Lim 918dc061f9 lib: remove bitrotted AdjustSchematic
While the concept of cleaning schematic parameters is useful, this code
is almost entirely plumbing, and we don't lose much by deleting it.
2018-09-27 15:03:25 +10:00
Japheth Lim 1a1e1f1562 lib: remove bitrotted Trace_Attribs
This tool was created to aid a once-off cleanup during AutoCorres
development. Its functionality is no longer needed.
2018-09-27 15:03:25 +10:00
Japheth Lim 862b0c84ba lib: remove ancient show_abbrevs.ML
This script was created early on for L4.verified development but is no
longer relevant.
2018-09-27 15:03:25 +10: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 0cb839c7da lib: remove bitrotted StringOrd
This has been superseded by the LexordList theory.
2018-09-27 15:03:25 +10:00
Japheth Lim b50c2b865c lib: move bitrotted asmrefine dependencies to internal/asmrefine 2018-09-27 15:03:25 +10:00
Japheth Lim 787e5a85c4 lib: maybe bitunrot TSubst 2018-09-27 15:03:24 +10:00
Japheth Lim a4878ccb2b lib: move crunch tests to LibTest session 2018-09-27 15:03:24 +10:00
Japheth Lim a8129d0695 lib: add license header text
These two files were @TAG-ged but without copyright header text.
2018-09-27 15:03:24 +10:00
Japheth Lim e968766e12 lib: test cases for Qualify tool 2018-09-27 15:03:24 +10:00
Japheth Lim f24db02c3b lib: test cases for Insulin and ShowTypes tools 2018-09-27 15:03:24 +10:00
Japheth Lim d43680fd43 lib: add Trace_Schematic_Insts_Test to LibTest 2018-09-27 15:03:24 +10:00
Edward Pierzchalski f8b7603d8a lib: TRY attribute: handle more errors
Widens the set of exceptions TRY ignores to anything that isn't
an interrupt.
2018-09-20 18:17:23 +10:00
Edward Pierzchalski d7fd868007 lib: Add attribute to ignore errors (VER-1007)
Adds the `TRY` attribute combinator, which applies the provided
inner attribute but ignores any failure by returning the original
theorem.
2018-09-19 11:57:19 +10:00
Callum Bannister 751480007b lib+sysinit: add extended separation algebra and forward reasoning tactics
Added Extended Separation Algebra, which contains septraction and
separating coimplication.
Added Sep_Forward which contains tactics for reasoning forwards in
separation logic, updated sep_cancel.
Updated SysInit proofs.
2018-09-18 12:01:52 +10:00
Edward Pierzchalski 91ab6007e8 lib: move test theories in Lib to LibTest
Leaves out crunch tests, which seem fragile to being moved.
2018-09-14 16:35:27 +10:00
Edward Pierzchalski e82cdd149c lib: add method to shorthand larger methods
Adds the `supply_local_method` command and `local_method` methods,
which store and apply methods as a way to shorten repeated
references to large or complicated methods.
2018-09-14 16:35:27 +10:00
Edward Pierzchalski 5af827b65e lib: time_methods: add flag to skip failure output
Adds a flag `skip_fail` to the method `time_methods`, to skip
output when a timed method fails.
2018-09-14 16:35:27 +10:00
Edward Pierzchalski 552ecb9dcd Eisbach: lib: add higher-order 'repeat' method.
repeat: Repeat a given inner method a given number of times.
2018-09-07 16:40:13 +10:00
Ilya Yanok 0044c57e14 lib: change runErrorT to runExceptT to match Haskell code 2018-09-04 14:59:45 +10:00
Rafal Kolanski df41be8092 lib: trivial: remove trailing whitespace in root.tex 2018-08-21 15:46:03 +10:00
Gerwin Klein 33c9712d0a Isabelle2018: record c-parser dependency for LibTest
A clean build complains about the generated grammar files missing from the C
parser even if the session itself does not depend on the CParser session.
2018-08-20 09:06:37 +10:00
Gerwin Klein c9f32225a4 Word_Lib: sync with AFP 2018-08-20 09:06:37 +10:00
Gerwin Klein 934ba36fd1 lib/clib: move DetWPLib from CLib to Lib
Doesn't have any C dependencies.
2018-08-20 09:06:37 +10:00
Gerwin Klein efe8d89a99 Word_Lib: record OTHER_BSD license for AFP contrib theory 2018-08-20 09:06:36 +10:00
Gerwin Klein 04f4336a5f Word_Lib: sync with AFP 2018-08-20 09:06:36 +10:00
Gerwin Klein 62b0ab207b Word_Lib: consolidate LemmaBucket and Lib lemmas into Word_Lib 2018-08-20 09:06:36 +10:00
Gerwin Klein 9850ae107c Isabelle2018 lib: requalify facts up to pattern equivalence
It looks like "interpretation" occasionally renames schematic variables.
Finding global facts up to pattern equivalence should give us the original
global version.
2018-08-20 09:06:36 +10:00
Gerwin Klein 52992889e5 Isabelle2018: Sep_Algebra 2018-08-20 09:06:36 +10:00
Gerwin Klein 1ae3a8d65b Isabelle2018: Lib update 2018-08-20 09:06:36 +10:00
Gerwin Klein cb49fa3b4b Isabelle2018: Extend_Locale update
The proof method "fact" no longer has access to thms produced by "interpret"
2018-08-20 09:06:36 +10:00
Gerwin Klein ccacaa46fc Isabelle2018: Subgoal_Methods update 2018-08-20 09:06:36 +10:00
Gerwin Klein 41316f1c4b Isabelle2018 lib: remove evaluator parameter for value_abbreviation
Unused and the name information you'd need is not visible in Isabelle2018 any more.
2018-08-20 09:06:36 +10:00
Gerwin Klein b02bf100dd lib/Word_Lib: import merge fixup from AFP
This commit keeps Word_Lib in sync with the AFP
2018-08-20 09:06:36 +10:00
Gerwin Klein 7f3fa50a32 lib/Word_Lib: sync with AFP 2018-08-20 09:06:35 +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 b1aa74d306 Isabelle2018 lib: Word_Lib 2018-08-20 09:06:34 +10:00
Gerwin Klein 84081d1206 Isabelle2018 lib: Apply_Trace 2018-08-20 09:06:34 +10:00
Gerwin Klein 349e8a0411 lib: repair WPTutorial and CorresTest
Parts of CorresTest don't work any more after changes to the underlying
example functions.
2018-08-20 09:06:34 +10:00
Gerwin Klein 0f1efbaa37 lib: add Lib test sessions 2018-08-20 09:06:34 +10:00
Gerwin Klein 9489b03ede lib: record AutoLevity session as broken 2018-08-20 09:06:34 +10:00
Gerwin Klein 6486bad264 lib: make Lib session a test dependency
Also ensure that the C parser is built before Lib, because it depends
on generated grammar files that need `make'.
2018-08-20 09:06:34 +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 6aa78c310a lib: fix unused/historical StateMonad theory 2018-08-20 09:05:52 +10:00
Gerwin Klein b66d26f7e6 lib/Word_Lib: use qualified session imports
This also makes the dependency on lib/Distinct_Prop and $L4V_ARCH/WordSetup
more explicit.
2018-08-20 09:05:52 +10:00
Japheth Lim f617dc60e7 lib/Trace_Schematic_Insts: refactor; improve ML style 2018-08-16 14:21:16 +10:00
Japheth Lim cd1d05165d lib/Trace_Schematic_Insts: refactor and add code comments 2018-08-16 14:21:16 +10:00
Japheth Lim fe5c9b846c lib/Trace_Schematic_Insts: some cleanup; add basic tests 2018-08-16 14:21:16 +10:00
Japheth Lim f62ca33408 lib: add trace_schematic_insts method combinator 2018-08-16 14:21:16 +10:00
Japheth Lim 6065d3e7b0 lib/Time_Methods_Cmd: small fixes
Add method description string; fix a theory import.
2018-08-16 14:21:16 +10:00
Corey Lewis 52ce1022c6 lib: Change Add_Locale_Code_Defs to filter out rules with sort hypotheses. 2018-08-14 11:32:31 +10:00
Gerwin Klein 53fde5e5ff lib/design: enable more Haskell-like list comprehension syntax
Accept "[f x | x \leftarrow t]" in addition to "[f x . x \leftarrow t]",
because the former is what naturally comes out of the Haskell translator, and
the regexps that would be necessary in the Haskell translator for this are
distasteful.

JIRA-VER 927
2018-08-06 11:22:54 +10:00
Gerwin Klein 24fbac1e67 lib: remove non-exhaustive pattern warning 2018-08-06 11:22:53 +10:00
Gerwin Klein 9a4d2677e3 lib+spec: move definition of machine_word to Word_Lib
JIRA VER-963
2018-08-06 11:22:52 +10:00
Thomas Sewell 955b2ca8b2 lib: add non-cond-simplification, use in wpsimp.
Adds "non-conditional simplification" method simp_no_cond, and
various equivalents.

This is done by setting the simplifier depth limit to 0, which seems
to be a useful case. It prevents expensive conditional simplification
attempts but leaves the simplifier strategy otherwise unchanged.

This is easy to set up, and link to wpsimp.
2018-08-03 18:25:30 +10:00
Thomas Sewell ea7c58bf13 lib/crunch: use induct package.
Discard some magic that was done to instantiate an induction rule,
and instead use the existing Induct_Tacs package to apply induction
rules, which seems to be successful more often.
2018-08-03 12:20:49 +10:00
Thomas Sewell 9ba41a20ce lib: Improve documentation of Strengthen_Demo.
Clarify that the second proof is essentially a forward reference to
concepts that will be explained later in the file.
2018-08-03 12:20:49 +10:00
Thomas Sewell bfce624b2b lib: adjust some congruence rules for strengthen.
Adjusting the strengthen congruence rules for conjunction
and disjunction makes other conjuncts available as assumptions
in strengthening a conjunction. This may be useful occasionally.
2018-08-03 12:20:49 +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
Michael Sproul 19d9085b15 lib: word lemma about mask and shiftl 2018-07-05 16:23:15 +10:00
Michael Sproul df9c791a3f lib: add some word lemmas about sless, word_bits 2018-07-05 16:23:15 +10:00
Michael Sproul 4bc5fad560 lib: add ccorres_disj_division 2018-07-05 16:23:15 +10:00
Thibaut Perami 0335855e4e x64 crefine: partially remove unmapPageTable_ccorres sorry 2018-07-05 16:23:15 +10:00
Matthew Brecknell b9efd5f7b2 clib: infrastructure for using AutoCorres in CRefine 2018-07-05 16:23:15 +10:00
Matthew Brecknell 0a6c6f50f3 lib: ccorres_rewrite support for creturn_void 2018-07-05 16:23:15 +10:00
Matthew Brecknell 1ec4a8b12c lib: miscellaneous word lemmas 2018-07-05 16:23:15 +10:00
Matthew Brecknell bcac2c8492 x64: clear some sorry proofs from CSpace_C
Also update some Haskell and abstract specs relating to IO ports.
2018-07-05 16:23:14 +10:00
Rafal Kolanski d99efd0dd5 lib: Word_Lemmas: sign_extended addition and ~~mask lemmas 2018-07-05 16:23:14 +10:00
Joel Beeren e8c14602c5 lib: change Corres_C to use machine_word rather than word32 for the error case 2018-07-05 16:23:14 +10:00
Japheth Lim 46ccc2ba60 lib: change where temp file for AutoLevity tracing is created
We need to create the temp file on the same file system as the output
file in order for atomic renaming to work properly.
2018-07-04 19:24:36 +10:00
Japheth Lim a4b0287e9a lib: log exceptions from AutoLevity trace writer 2018-07-04 19:24:36 +10:00
Japheth Lim da86625580 lib: fail gracefully if AutoLevity can't install hooks in unpatched Isabelle 2018-07-04 19:24:36 +10:00
Japheth Lim 791f6ea3c6 lib: write autolevity traces on session shutdown
This commit depends on patching Isabelle to add a session shutdown hook.
2018-07-04 19:24:36 +10:00
Japheth Lim 00cab83c23 lib: fix AutoLevity JSON string encoding 2018-07-04 19:24:36 +10:00
Japheth Lim 301db83d2c lib: write one combined output file from AutoLevity_Run
The output file is still placed in Lib for now. Needs further adjustment.
2018-07-04 19:24:36 +10:00
Gerwin Klein 38242af44a lib: fundef termination rule for unlessE .. $ throwError ,, 2018-06-27 10:06:48 +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
Corey Lewis d77d31a77c lib: Refactor crunch so that it can be used for both the nondet monad and the trace monad 2018-06-26 14:45:28 +10:00
Rafal Kolanski d4996217b3 lib: add generic lemmas from SELFOUR-584 updates
Mainly concerning word_ctz and enumeration_both.
2018-06-15 18:48:47 +10:00
Corey Lewis c686d6e776 lib: Make Crunch more effective at applying supplied rules 2018-06-08 15:48:32 +10:00
Japheth Lim 3e51484a9b lib/time_methods: add subseq example 2018-06-06 14:39:03 +10:00
Corey Lewis dceb2692e2 lib: Add a warning to crunch if it does not do anything 2018-06-06 10:41:17 +10:00
Thomas Sewell c4f43fd8dc lib: two examples of concurrency reasoning.
Two different simple examples which make use of the prefix refinement
framework and the rely-guarantee VCG.
2018-05-28 16:53:01 +10:00
Thomas Sewell 64efe07ff7 lib: refinement theories related to concurrency.
These theories supply the interference trace monad with a useful notion of
simulation/refinement, which could be used to prove functional correctness
(similar to corres) in the presence of concurrency.
2018-05-28 15:56:48 +10:00
Thomas Sewell 891ae7cfa4 lib: some simple rules about rtrancl/rtranclp.
These generalise trancl_id from HOL to cover rtrancl and rtranclp.

Also improve one minor proof.
2018-05-28 15:39:39 +10:00
Thomas Sewell 5deb58a997 lib: add the Interference Trace Monad.
Adds another style of monad to the existing ones in lib/Monad_WP.

The Interference Trace monad is an extension of the nondeterministic
state monad to record interactions between the task and its environment.
It supports a parallel composition operator.

The VCG for this monad includes the same Hoare triple style as for the
state monads, and also includes a rely-guarantee quintuple which can be
used to verify a parallel composition of programs.
2018-05-28 15:39:39 +10:00
Japheth Lim b3e8155f73 lib: refactor time_methods and test cases 2018-05-21 14:30:00 +10:00
Japheth Lim f224e2392d lib: add time_methods method for comparing proof tactic speeds 2018-05-21 14:30:00 +10:00
Japheth Lim 0e780ace82 lib: add theory LexordList, for lexicographical string comparison
By default, strings (and other lists) cannot be lexicographically
ordered because our theories pull in a conflicting instance of the
"order" class for lists. This theory adds a "lexord_list" wrapper type
that provides lexicographical order.
2018-05-21 14:22:54 +10:00
Japheth Lim 1209dc4f2d lib: remove unused Etanercept tool 2018-05-18 14:59:09 +10:00
Thomas Sewell 26df0c04dd lib: Replace subseq->match abbreviation.
The subseq_abbreviation mechanism was a useful way of quoting some of a
definition or term, specialised to the case of left-associated sequences.

Lambda abstractions are now handled better.

The previous subseq mechanism required some generalisations. It is now replaced
by match_abbreviation, which is a more general approach.

The match mechanism picks a term, can select a matching subterm, and can
rewrite the selected term based on pattern matching also. The new mechanism
can cover all the cases of the previous one, as shown in examples.
2018-05-10 15:00:22 +10:00
Joel Beeren 4dcd4df2b6 lib: add foldl lemma to LemmaBucket 2018-04-19 05:27:05 +10:00
Thomas Sewell 10bf84a02c lib: Subseq_Abbreviation: also save a reassoc thm.
In the cases where the sequence constructor is associative, it can
be handy to immediately save a 'reassociate' theorem, that can be used
to parenthesise out the abbreviated subsequence from any sequence it
appears in.

This can be done by supplying the association rule.
2018-04-17 17:43:00 +10:00
Thomas Sewell 9cef82ebe3 lib: Subseq_Abbreviation, quote subsequence terms.
It's annoying that, given automatic definitions (such as we have
with the Haskell translator and C parser), there's no way to capture
a few lines of them.

This mechanism allows you to add an abbreviation for some subsequence of
elements, found somewhere in a theorem, where a sequence is defined by its
constructor and the start and end points are matched by pattern matching.
2018-04-17 15:02:12 +10:00
Corey Lewis 55d20591b4 lib: improved crunch
The main aim of this is for crunch to make consistent decisions about
whether to prove new rules. If any rules in the wp set can be used to
directly solve the goal crunch is working on, then crunch will just
use it.

Other changes include:
  - crunch_ignore works properly inside locales again.
  - if a rule already exists with the specific name crunch is going
    to use, but that rule does not solve the goal crunch is working on
    then crunch will now error.
  - if crunch fails to prove a goal it will now output a warning if
    adding crunch_simps or crunch_wps would allow it to make more
    progess.
2018-04-04 12:09:47 +10:00
Gerwin Klein b421aa70bb clib: use proper context under FOCUS_PREMS
removes the harmless but annoying "Bad Simplifier Context" warnings in cinit
2018-03-26 14:37:22 +11: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 587972d40e lib/wp: Standard when/unless/whenE/unlessE rules.
The rules for these conditional monadic operators have been a bit
ad-hoc until now, with frequent headaches around the whenE/throwError
pattern.

Adding standard split rules ensures these operators are treated uniformly.
2018-03-16 14:56:11 +11:00
Thomas Sewell a70aeda39b lib: Datatype_Schematic and WPFix.
Add two new tactics/methods which can fix common painful problems with
schematic variables.

Method datatype_schem improves unification outcomes, by making judicious use of
selectors like fst/snd/the/hd to bring variables into scope, and also using a
wrapper to avoid singleton constants like True being captured needlessly by
unification.

Method wpfix uses strengthen machinery to instantiate rogue postcondition
schematics to True and to split precondition schematics that are shared across
different sites.
2018-03-16 14:55:33 +11:00
Thomas Sewell 23088c3c18 lib/wp: More aggressive version of wp_pre.
The previous wp_pre would apply a rule (from the named theorems wp_pre) unless
there was already a schematic in the goal. This is frequently prevented by an
irrelevant schematic.

This implementation applies a wp_pre rule unless one of the resulting goals
can be solved by "erule FalseE", that is, unless we would promote a schematic
into the assumption position (or, more rarely, there was already an assumption
schematic or False as an assumption).
2018-03-16 14:54:37 +11:00
Thomas Sewell 7bff086fef lib/wp: Slight cleanup in WP-method.ML 2018-03-16 14:54:29 +11:00
Thomas Sewell be45b71fd7 lib/wp: Bundle to restore classic combinators.
The previous combinator change is desirable, but some proofs are too
difficult to fix. This bundle restores the classic behaviour.
2018-03-16 14:53:23 +11:00
Thomas Sewell 652cbb966e Initial proof updates for combinator changes. 2018-03-16 14:53:22 +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
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
Matthew Brecknell 6ee106571a lib ccorres_rewrite: discard everything sequenced after a Throw
Also introduce simple conditional rewriting.
2018-02-18 12:39:16 +11:00
Thomas Sewell d2f38a0a80 lib: Add multi-crunch command 'crunches'.
It's just a parser tweak for crunch, and runs multiple crunch commands
with the same sections (wps, ignores, etc).

Also update the comments a little, and move them closer to the anchor of
command clicks (the @{command_keyword} antiquotation).
2018-02-02 10:26:15 +11:00
Thomas Sewell 5152952abb lib: Cleanup in crunch-cmd.ML
Mostly syntactic. Ensure less debug messages are generated
unconditionally.
2018-02-02 10:26:09 +11:00
Matthew Brecknell d108e3edee lib: a more intuitive definition of sign_extend for words
Also includes some supporting lemmas useful in bitfield proofs.
2017-12-21 21:41:01 +11:00
Matthew Brecknell edb30fa752 lib: faster simplification for common cases of word_and_max_word
In particular, this speeds up some bitfield proofs.
2017-12-21 21:41:01 +11:00
Matthew Brecknell a6d245b83f trivial lib: quote identifiers in text blocks for document builds 2017-12-21 16:19:23 +11:00
Thomas Sewell 00bc13d7ce Demo theory for strengthen. 2017-12-19 16:40:14 +11:00
Matthew Brecknell 09b793855b word-lib: add some lemmas about sign extension 2017-12-18 12:48:10 +11:00
Thomas Sewell d88c6e567b Upgrade strengthen for assumptions, methods.
The strengthen implementation can now do a bit more.

The new method strengthen_asm also adjusts assumptions.

The new method strengthen_meth takes a method as a parameter,
e.g. apply (strengthen_meth \<open> rule order.trans \<close>)
does the same thing as apply (strengthen order.trans)
with scope for other exciting applications I haven't thought of.
2017-12-13 17:40:06 +11:00
Matthew Brecknell d27f84767a lib: add methods for extracting conjuncts from the conclusion 2017-11-28 19:02:49 +11:00
Rafal Kolanski 877312f080 lib: generic/word/monad/hoare lemmas from SELFOUR-242 verification
Notably useful is hoare_vcg_lift_imp' which generates an implication
rather than a disjunction.

Monadic rewrite rules should be modified to preserve bound variable
names, as demonstrated by monadic_rewrite_symb_exec_l'_preserve_names.
Addressing this more comprehensively is left as a TODO item for the
future (see VER-554).
2017-11-27 21:00:04 +11:00
Matthew Brecknell 210465edf3 autocorres-crefine: make AutoCorres more compatible with existing CRefine proofs 2017-11-22 15:37:36 +11:00
Matthew Brecknell 0570943ee8 lib: make some elimination rules safer
Elimination against the pattern "P v", where both "P" and "v" are free,
can loop, if the rule is marked as a safe elimination rule. In the rules
modified in this commit, variable "v" provides no real benefit, so we
replace the pattern with "P".
2017-11-22 12:18:16 +11:00
Matthew Brecknell 079d5dec23 autocorres-crefine: make AutoCorres tools available in CRefine 2017-11-22 12:18:16 +11:00
Matthew Brecknell 919d0f4137 autocorres-crefine: update modifies proofs for Isabelle2017 2017-11-22 10:59:57 +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
Matthew Brecknell 281fa6931b autocorres-crefine: fix modifies proofs after wp changes 2017-11-22 10:59:57 +11:00
Matthew Brecknell bd44bab6c6 autocorres-crefine: update for Isabelle2016-1 2017-11-22 10:59:57 +11:00
Gerwin Klein 30c812854a lib: prettier monad type printing 2017-11-21 11:00:42 +11:00
Gerwin Klein 68ae97454e lib: more modifiers for wpsimp (wp_del, simp_del) 2017-11-03 08:09:29 +11:00
Thomas Sewell 8753c05b20 Expand eval_bool; add a method word_eqI_solve.
A number of proofs begin with word_eqI followed by some similar steps,
suggesting a 'word_eqI_solve' proof method, which is implemented here.

Many of these steps are standard, however a tricky part is that constants of
type 'nat' which encode a particular number of bits must often be unfolded.
This was done by expanding the eval_bool machinery to add eval_int_nat, which
tries to evaluate ints and nats.

Testing eval_int_nat revealed the need to improve the code generator setup
somewhat. The Arch locale contains many of the relevant constants, and they are
given global names via requalify_const, but the code generator doesn't know
about them. Some tweaks make them available. I *think* this is safe for
arch_split, as long as the proofs that derive from them are true in each
architecture.
2017-11-01 17:30:46 +11:00
Alejandro Gomez-Londono 7da301cfc3 Isabelle2017: update CRefine (ARM) for RC0 2017-10-30 12:23:26 +11:00
Matthew Brecknell 0d3325ee68 Isabelle2017: update lib for RC0
* ML Proof_Context.fact_alias renamed to alias_fact.

  * Named_Target.init removed redundant parameter.

  * Simplified Greatest, removed GreatestM.

  * Introduced thm_node type in proofterm.ML.
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 b41f67ac51 Isabelle2017: update Word_Lib for RC0
* Various equalities from underlying HOL-Word have been reoriented.

  * word_eqI is no longer rule_format.

  * zdiff_zmod_* were renamed to mod_diff_*_eq.
2017-10-30 12:23:26 +11:00
Thomas Sewell 619aae2184 Add some methods to trym. 2017-10-27 13:39:32 +11:00
Thomas Sewell 3e720455a3 Spring cleaning in strengthen.
Make the tactic steps more explicit, especially involving the -oblig-
premises for which I've seen a bug in the past.
2017-10-27 13:39:32 +11:00