From bfbb9f063434623d7c3dac8aa4aaf64c4ec84373 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Sat, 22 Aug 2015 17:05:49 +0200 Subject: Documenting the Shrink Abstract option. --- CHANGES | 2 ++ doc/refman/RefMan-ltac.tex | 12 ++++++++++++ test-suite/success/shrink_abstract.v | 13 +++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 test-suite/success/shrink_abstract.v diff --git a/CHANGES b/CHANGES index 08484a4b9b..547ec8f9e3 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,8 @@ Tactics - New compatibility flag "Universal Lemma Under Conjunction" which let tactics working under conjunctions apply sublemmas of the form "forall A, ... -> A". +- New flag "Shrink Abstract" that minimalizes proofs generated by the abstract + tactical w.r.t. variables appearing in the body of the proof. API diff --git a/doc/refman/RefMan-ltac.tex b/doc/refman/RefMan-ltac.tex index d388840df5..7011f1ef89 100644 --- a/doc/refman/RefMan-ltac.tex +++ b/doc/refman/RefMan-ltac.tex @@ -1028,6 +1028,18 @@ This tactical is useful with tactics such as \texttt{omega} or the user can avoid the explosion at time of the \texttt{Save} command without having to cut manually the proof in smaller lemmas. +It may be useful to generate lemmas minimal w.r.t. the assumptions they depend +on. This can be obtained thanks to the option below. + +\begin{quote} +\optindex{Shrink Abstract} +{\tt Set Shrink Abstract} +\end{quote} + +When set, all lemmas generated through \texttt{abstract {\tacexpr}} are +quantified only over the variables that appear in the term constructed by +\texttt{\tacexpr}. + \begin{Variants} \item \texttt{abstract {\tacexpr} using {\ident}}.\\ Give explicitly the name of the auxiliary lemma. diff --git a/test-suite/success/shrink_abstract.v b/test-suite/success/shrink_abstract.v new file mode 100644 index 0000000000..3f6b9cb39f --- /dev/null +++ b/test-suite/success/shrink_abstract.v @@ -0,0 +1,13 @@ +Set Shrink Abstract. + +Definition foo : forall (n m : nat), bool. +Proof. +pose (p := 0). +intros n. +pose (q := n). +intros m. +pose (r := m). +abstract (destruct m; [left|right]). +Defined. + +Check (foo_subproof : nat -> bool). -- cgit v1.2.3