Skip to content

Commit a52d06e

Browse files
committed
Merge branch 'v8.6'
2 parents 30a908b + a321074 commit a52d06e

File tree

30 files changed

+159
-93
lines changed

30 files changed

+159
-93
lines changed

CHANGES

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ Tactics
5050
- Every generic argument type declares a tactic scope of the form "name:(...)"
5151
where name is the name of the argument. This generalizes the constr: and ltac:
5252
instances.
53-
- When in strict mode (i.e. in a Ltac definition) the "intro" tactic cannot use
54-
a locally free identifier anymore. It must use e.g. the "fresh" primitive
55-
instead (potential source of incompatibilities).
53+
- When in strict mode (i.e. in a Ltac definition), if the "intro" tactic is
54+
given a free identifier, it is not bound in subsequent tactics anymore.
55+
In order to introduce a binding, use e.g. the "fresh" primitive instead
56+
(potential source of incompatibilities).
5657
- New tactics is_ind, is_const, is_proj, is_constructor for use in Ltac (DOC TODO).
5758
- New goal selectors. Sets of goals can be selected by select by listing
5859
integers ranges. Example: "1,4-7,24: tac" focuses "tac" on goals 1,4,5,6,7,24.
@@ -61,6 +62,10 @@ Tactics
6162
"Structural Injection". In this case, hypotheses are also put in the
6263
context in the natural left-to-right order and the hypothesis on
6364
which injection applies is cleared.
65+
- Tactic "contradiction" (hence "easy") now also solve goals with
66+
hypotheses of the form "~True" or "t<>t" (possible source of
67+
incompatibilities because of more successes in automation, but
68+
generally a more intuitive strategy).
6469

6570
Hints
6671

doc/refman/RefMan-tac.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,10 +1491,10 @@ \subsection{\tt contradiction}
14911491
\tacindex{contradiction}
14921492

14931493
This tactic applies to any goal. The {\tt contradiction} tactic
1494-
attempts to find in the current context (after all {\tt intros}) one
1495-
hypothesis that is equivalent to {\tt False}. It permits to prune
1496-
irrelevant cases. This tactic is a macro for the tactics sequence
1497-
{\tt intros; elimtype False; assumption}.
1494+
attempts to find in the current context (after all {\tt intros}) an
1495+
hypothesis that is equivalent to an empty inductive type (e.g. {\tt
1496+
False}), to the negation of a singleton inductive type (e.g. {\tt
1497+
True} or {\tt x=x}), or two contradictory hypotheses.
14981498

14991499
\begin{ErrMsgs}
15001500
\item \errindex{No such assumption}

doc/refman/RefMan-uti.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
This command generates a file \texttt{Makefile} that can be used to
104104
compile all the sources of the current project. It follows the
105-
syntax described by the output of \texttt{\% coq\_makefile ----help}.
105+
syntax described by the output of \texttt{\% coq\_makefile -{}-help}.
106106
Once the \texttt{Makefile} file has been generated a first time, it
107107
can be used by the \texttt{make} command to compile part or all of
108108
the project. Note that once it has been generated once, as soon as
@@ -112,8 +112,8 @@
112112
The following command generates a minimal example of
113113
\texttt{\_CoqProject} file:
114114
\begin{quotation}
115-
\texttt{\% \{ echo '-R .} \textit{MyFancyLib} \texttt{' ; find . -name
116-
'*.v' -print \} > \_CoqProject}
115+
\texttt{\% ( echo "-R .\ }\textit{MyFancyLib}\texttt{" ; find .\ -name
116+
"*.v" -print ) > \_CoqProject}
117117
\end{quotation}
118118
when executed at the root of the directory containing the
119119
project. Here the \texttt{\_CoqProject} lists all the \texttt{.v} files

engine/proofview.ml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,26 @@ module Goal = struct
10581058
end
10591059
end
10601060

1061+
exception NotExactlyOneSubgoal
1062+
let _ = CErrors.register_handler begin function
1063+
| NotExactlyOneSubgoal ->
1064+
CErrors.user_err (Pp.str"Not exactly one subgoal.")
1065+
| _ -> raise CErrors.Unhandled
1066+
end
1067+
1068+
let enter_one f =
1069+
let open Proof in
1070+
Comb.get >>= function
1071+
| [goal] -> begin
1072+
Env.get >>= fun env ->
1073+
tclEVARMAP >>= fun sigma ->
1074+
try f.enter (gmake env sigma goal)
1075+
with e when catchable_exception e ->
1076+
let (e, info) = CErrors.push e in
1077+
tclZERO ~info e
1078+
end
1079+
| _ -> tclZERO NotExactlyOneSubgoal
1080+
10611081
type ('a, 'b) s_enter =
10621082
{ s_enter : 'r. ('a, 'r) t -> ('b, 'r) Sigma.sigma }
10631083

engine/proofview.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ module Goal : sig
499499
(** Like {!nf_enter}, but does not normalize the goal beforehand. *)
500500
val enter : ([ `LZ ], unit tactic) enter -> unit tactic
501501

502+
(** Like {!enter}, but assumes exactly one goal under focus, raising *)
503+
(** an error otherwise. *)
504+
val enter_one : ([ `LZ ], 'a tactic) enter -> 'a tactic
505+
502506
type ('a, 'b) s_enter =
503507
{ s_enter : 'r. ('a, 'r) t -> ('b, 'r) Sigma.sigma }
504508

interp/constrintern.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ open Context.Rel.Declaration
3333

3434
(** constr_expr -> glob_constr translation:
3535
- it adds holes for implicit arguments
36-
- it remplaces notations by their value (scopes stuff are here)
36+
- it replaces notations by their value (scopes stuff are here)
3737
- it recognizes global vars from local ones
38-
- it prepares pattern maching problems (a pattern becomes a tree where nodes
39-
are constructor/variable pairs and leafs are variables)
38+
- it prepares pattern matching problems (a pattern becomes a tree
39+
where nodes are constructor/variable pairs and leafs are variables)
4040
4141
All that at once, fasten your seatbelt!
4242
*)

interp/dumpglob.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ let dump_string s =
4545
if dump () && !glob_output != Feedback then
4646
Pervasives.output_string !glob_file s
4747

48-
let start_dump_glob vfile =
48+
let start_dump_glob ~vfile ~vofile =
4949
match !glob_output with
5050
| MultFiles ->
51-
open_glob_file (Filename.chop_extension vfile ^ ".glob");
51+
open_glob_file (Filename.chop_extension vofile ^ ".glob");
5252
output_string !glob_file "DIGEST ";
5353
output_string !glob_file (Digest.to_hex (Digest.file vfile));
5454
output_char !glob_file '\n'

interp/dumpglob.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
val open_glob_file : string -> unit
1010
val close_glob_file : unit -> unit
1111

12-
val start_dump_glob : string -> unit
12+
val start_dump_glob : vfile:string -> vofile:string -> unit
1313
val end_dump_glob : unit -> unit
1414

1515
val dump : unit -> bool

interp/notation_ops.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let rec cases_pattern_fold_map loc g e = function
125125
e', PatCstr (loc,cstr,patl',na')
126126

127127
let subst_binder_type_vars l = function
128-
| Evar_kinds.BinderType (Name id) as e ->
128+
| Evar_kinds.BinderType (Name id) ->
129129
let id =
130130
try match Id.List.assoc id l with GVar(_,id') -> id' | _ -> id
131131
with Not_found -> id in

library/lib.ml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,6 @@ let section_instance = function
501501
let is_in_section ref =
502502
try ignore (section_instance ref); true with Not_found -> false
503503

504-
let full_replacement_context () = List.map pi2 !sectab
505-
let full_section_segment_of_constant con =
506-
List.map (fun (vars,_,(x,_)) -> fun hyps ->
507-
named_of_variable_context
508-
(try pi1 (Names.Cmap.find con x)
509-
with Not_found -> fst (extract_hyps (vars, hyps)))) !sectab
510-
511504
(*************)
512505
(* Sections. *)
513506

@@ -608,15 +601,6 @@ let rec dp_of_mp = function
608601
|Names.MPbound _ -> library_dp ()
609602
|Names.MPdot (mp,_) -> dp_of_mp mp
610603

611-
let rec split_mp = function
612-
|Names.MPfile dp -> dp, Names.DirPath.empty
613-
|Names.MPdot (prfx, lbl) ->
614-
let mprec, dprec = split_mp prfx in
615-
mprec, Libnames.add_dirpath_suffix dprec (Names.Label.to_id lbl)
616-
|Names.MPbound mbid ->
617-
let (_,id,dp) = Names.MBId.repr mbid in
618-
library_dp (), Names.DirPath.make [id]
619-
620604
let rec split_modpath = function
621605
|Names.MPfile dp -> dp, []
622606
|Names.MPbound mbid -> library_dp (), [Names.MBId.to_id mbid]
@@ -628,20 +612,6 @@ let library_part = function
628612
|VarRef id -> library_dp ()
629613
|ref -> dp_of_mp (mp_of_global ref)
630614

631-
let remove_section_part ref =
632-
let sp = Nametab.path_of_global ref in
633-
let dir,_ = repr_path sp in
634-
match ref with
635-
| VarRef id ->
636-
anomaly (Pp.str "remove_section_part not supported on local variables")
637-
| _ ->
638-
if is_dirpath_prefix_of dir (cwd ()) then
639-
(* Not yet (fully) discharged *)
640-
pop_dirpath_n (sections_depth ()) (cwd ())
641-
else
642-
(* Theorem/Lemma outside its outer section of definition *)
643-
dir
644-
645615
(************************)
646616
(* Discharging names *)
647617

0 commit comments

Comments
 (0)