History log of /seL4-l4v-master/HOL4/src/1/Tactical.sml
Revision Date Author Comments
# b60b7b70 08-Jul-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix bug in PAT_ASSUM when use of variables from goal is not respected

In particular, the old code gave itself licence to instantiate type
variables in patterns when those were associated with variables from
the goal, thereby allowing it to pick completely different
assumptions that didn't even include the quoted variable. The test
case illustrates.

Where a proof breaks (as in io_onestepTheory), the fix is to remove
the use of goal-variables of the wrong type, perhaps replacing them
with underscores.


# b1ae06f2 07-Jul-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Improve propagation of error messages out of goal_assum


# e86e6d62 30-Apr-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Implement machinery to check that tactic results change acceptably

Used to implement checks that h.o. redexes don't remain, or have
decreased in count.

This is progress towards implementation of github issue #680.


# 185614a4 24-Oct-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Provide more information in exceptions raised by Tactical.VALID


# e90eab2d 03-Oct-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Correct typo in comment


# bc99bcfb 25-Jul-2018 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Another go at strengthening the (default) behaviour of Tactical.prove.

By default Tactical.prove now checks for the validity of the supplied tactic using VALID. This breaks a few proofs in which assumptions were surreptitiously being introduced.

It is expected that this commit will break some external proofs that relied on the old behaviour (e.g. under CakeML). A workaround is to selectively restore the old behaviour with

val () = set_prover (fn (t, tac) => TAC_PROOF (([], t), tac))

in places that contain non-valid tactic proofs.


# 37bf2ea8 23-Jul-2018 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Print a message when "prove" introduces hypotheses.


# 57e62af1 22-Jul-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Revert "Add hypotheses count check to TAC_PROOF."

This reverts commit 01930d56ce7a31c10ff7f422a0cf535a8c502a59.

I don't believe that changing this primitive is a good idea. I'd like
TAC_PROOF to stay as the base primitive that applies a tactic to a
goal state without checking for validity or similar.

This change is also causing breakages in CakeML and
examples/machine-code/lisp. If there is a need for this sort of
validity-style check (apart from what is done by expand), it could be
added to prove quite reasonably, possibly there under the control of
another trace variable, or just permanently on (as it is easy enough
to change the behaviour of prove by adjusting the reference it
consults).


# 01930d56 16-Jul-2018 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Add hypotheses count check to TAC_PROOF.

This helps guard against the following:

val lem = Q.prove(
`F`,
ACCEPT_TAC (ASSUME ``F``)
)

Before this returned the theorem [F] |-> F without complaint, despite an "Invalid tactic" exception being raised when using proofManagerLib.e. This proof will now fail. The new check falls short of requiring alpha equivalence of assumption lists, which would be safer.

This change has identified a few areas of imprecision within automation, namely within "dep_rewrite" and "Satisfy". There it may be the case that a subset of the stated assumptions appear in the final theorem.


# 69697709 19-Feb-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fixes for mp_then/drule bug found in previous commit

Provide more test-cases as well. Extend normalisation done by
goal_assum after a theorem is returned to it after "resolution".


# beec8de4 24-Oct-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Remove TABs in some source code, replacing them with spaces

Use Emacs's conception of how many spaces the TAB was
representing (and the M-x untabify command).

This may not line up with the author's original conception, but then,
using TABs makes it impossible to tell just what the original
conception was in the first place anyway.

Should probably script this over all of repository (excluding
makefiles of course), and use standard expand or col utilities rather
than emacs.


# 4888f523 15-Oct-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Remove eqtype declaration for term type


# 468179c5 06-Sep-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Implement line-number reporting for failing THEN1/>-

This relies on a somewhat disgusting quotation filter hack which
replaces occurrences of >-/THEN1 in line with the following pattern:

tac1 >- tac2 - - - > tac1 >>- linenumber ?? tac2

This relies on >>- and ?? being left-associative, which is how they
are defined. The definition of ?? is

fun f ?? x = f x

The linenumber is inserted by the quotation filter, which tracks this
naturally.


# c4baf6cc 17-Jul-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Provide access to more switches when parsing in context

In particular, allow setting of Feedback traces which will be used
when parsing of quotations occurs.

This allows Q.PAT_ASSUM to be made quiet about inventing type
variables. This is deemed desirable in github issue #425. (I'm not
100% sure now of this, but hey.)

Closes #425


# 2817e177 04-Dec-2016 Michael Norrish <michael.norrish@nicta.com.au>

Use cache Absyn to speed up QTY_TAC

Addressing github issue #383


# 81e27714 22-Aug-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Modify Q_TAC to try all possible parses

This makes a difference in the presence of overloads. Modify
implementations of Q.SPEC_THEN and Q.SPECL_THEN to use QTY_TAC (making
them simpler), and check that they seem to behave as desired with some
test-cases.


# 6ecffe26 29-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix pat_assum problem caused by use of H.O. match

As per the comment in Tactical.sml, ho_match_term is too clever at
times.


# 49bb6a02 28-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Provide "typed" parsing-in-context entry-points

This allows

QTY_TAC ty tac q

to parse q in the context of the goal and also require the resulting
term to have the provided type. The resulting term is then passed to
tac, as per Q_TAC>


# fa81d70b 28-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Rename pat_assum to pat_x_assum; provide pat_assum

To be consistent with naming conventions elsewhere, change the name of
qpat_assum (and PAT_ASSUM, and Q.PAT_ASSUM) to include an extra _x_ (or
_X_), indicating that the matching assumption is pulled out of the
assumption list.

Use the old names to provide a version that doesn't pull the assumption
out of the list.

Again, seeking consistency with other similar tactics, make variable
names that appear in the pattern and the goal be forced to have the type
that they have in the goal.


# 4a68817b 15-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix build errors prompted by goal_assum


# f78b66e5 15-Jul-2016 Ramana Kumar <ramana@member.fsf.org>

Implement goal_assum

Like first_assum, but uses the negation of the goal.


# e648a40a 07-Apr-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix HDTM_{X_,}ASSUM implementation

can (same_const t) is the same as fn _ => true, and so not at all
helpful.


# e28c677a 20-Mar-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Define special backtracking cases of pat_assum

In particular, the "pattern" is a single term or quotation that has to
either be the head constant of the assumption or the head of the lhs of
the assumption. Unlike pat_assum as it stands currently, the behaviour
backtracks (à la first_assum) if the theorem-tactic doesn't succeed with
the first assumption found.

Versions come in "copy assumption" and "cut assumption" versions, just
like first_assum and first_x_assum.


# 5b282aae 06-Dec-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

More moving lcsymtacs implementations elsewhere

Eventually lcsymtacs will just be a bunch of 'open' declarations, and
then people won't bother to include it at all.


# 48bce6f2 04-Dec-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Move some tactics from lcsymtacs to Tactic{,al}

As per Github issue #274


# e7f4d74a 16-Nov-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Move lcsymtacs functions to natural homes

For example, we do not need to have >> in lcsymtacs; it might as be in
Tactical. The ultimate aim is to do away with lcsymtacs entirely.

This is work towards github issue #274


# bd77b8fb 20-Oct-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Delete trailing whitespace


# b54e6e27 02-May-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

new irule, order of new subgoals is consistent,

regardless of how the substitution may change the internal
order of hypothesis in the argument theorem

also new tactical ADD_SGS_TAC - like VALIDATE
but new terms to be proved need to be specified


# 1c6d68e0 30-Apr-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

fix construction of error value in NTH_GOAL


# 003bd6a3 29-Apr-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

trivial change to comment in source file

purpose is to trigger another attempt at buiding on github


# 480ae0bf 29-Apr-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

fix garbled comment in source code

only the comment is changed


# 904bab9d 07-Jan-2015 Michael Norrish <michael.norrish@nicta.com.au>

Move useful apnth function to Lib

Also make it raise a HOL_ERR rather than a Bind error if the index is
negative or greater than the length of the list.


# 3118e6a7 07-Jan-2015 Michael Norrish <michael.norrish@nicta.com.au>

Remove trailing whitespace in Tactical.sml


# 597f0957 07-Jan-2015 Michael Norrish <michael.norrish@nicta.com.au>

Remove non-exhaustive match warning by slight code rewrite


# ca5c8d49 31-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

new list-tactic USE_SG_THEN

makes one subgoal available in the proof of another


# 79fc3d40 31-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

relaxing type constraint for THEN and THENL

to permit
val THEN : list_tactic * tactic -> list_tactic
val THENL : list_tactic * tactic list -> list_tactic
as well as the usual types


# e8e1f70e 20-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

GEN_VALIDATE(_LT) - flag for adding new subgoals in any event

GEN_VALIDATE false is like VALIDATE, but adds subgoals for the assumptions
of the theorem produced by the justification, regardless of whether they
are among the assumptions of the goal. Advantage of this is that
GEN_VALIDATE false (ACCEPT_TAC th) produces predictable subgoals,
which may help in coding compound tactics


# 621c1ebb 13-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

VALIDATE and VALIDATE_LT

If tac (ltac) is invalid due to proving theorems with extra assumptions,
VALIDATE tac and VALIDATE_LT ltac make the tactic valid by returning extra
subgoals to prove the extra assumptions


# 876ff199 11-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

expand_list to interactively work on a list of subgoals

also Tactical.VALID_LT, to check that a list-tactical is valid
(expand_list checks validity, expand_listf doesn't)

also abbreviations elt, eall, eta, enth to apply (list-)tactic to subgoal(s)


# 8d315d0c 09-Dec-2014 Michael Norrish <michael.norrish@nicta.com.au>

Delete trailing whitespace in src/

This needs doing periodically, and is best done to a whole bunch of files
at once.


# 279c6472 01-Dec-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

replacing code for THEN and THENL using ALLGOALS and TACS_TO_LT

also defines NULL_OK_LT to implement change to THENL
(see https://github.com/HOL-Theorem-Prover/HOL/issues/214 )


# 8230d99e 29-Nov-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

some new doc files to do with list_tactics


# 7e336374 17-Nov-2014 Jeremy Dawson <jeremy@cecs.anu.edu.au>

list_tactic concept

introduce list_tactic - works on a list of goals, not a single goal
THEN_LT (tac1, ltac2 : list_tactic),
A tactical that applies ltac2 to the list of subgoals resulting from tac1
TACS_TO_LT (tac2l: tactic list) : list_tactic
ALLGOALS - A list_tactic which applies a given tactic to all goals
ALL_LT - always succeeds
NTH_GOAL - applies tactic to nth goal of list
REVERSE_LT - A list_tactic that reverses a list of subgoals
SPLIT_LT - apply two list-tactics, one to first n subgoals,
the other to the rest
ROTATE_LT - rotate the list of subgoals by n positions


# d5f20b85 12-Aug-2013 Ramana Kumar <ramana@member.fsf.org>

Add LAST_ASSUM and LAST_X_ASSUM tactics

like first_assum and first_x_assum, but work from the other end of the
assumption list


# fd4c62c8 14-Sep-2012 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Provide more feedback when proofs fail.


# a0f6912c 13-Jul-2012 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Tidy up some code under src/1. See commit ad9b041.


# 1bc9f344 13-Jan-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Change src/bool to src/1 as a prelude to experimentation!