Skip to content

Commit 63d8de6

Browse files
committed
Making the demo more self-explained.
1 parent 499e3c4 commit 63d8de6

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

Demo/demo.v

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11

2-
(* DEMO FILE FOR THE LIBHYPS LIBRARY FEATURES.
2+
(* DEMO FILE FOR THE LIBHYPS LIBRARY FEATURES. *)
33

4-
This acts as a documentation.
4+
(* This acts as a documentation for LibHyps. *)
55

6-
You can install LibHyps with opam with
6+
(* WARNING: You can play this file in any IDE but beware that it
7+
contains "Undo" at many places and that your IDE may not support it.
8+
In this case you can edit the script by commenting things instead of
9+
playing the Undos. *)
710

8-
opam install coq_libhyps
9-
*)
11+
(* You can install LibHyps with opam with:
12+
13+
opam install coq_libhyps *)
1014

11-
(* (set-face-attribute 'proof-declaration-name-face nil
12-
:bold nil :foreground "white") *)
1315
(*** Proof maintenance ***)
1416
Unset Printing Compact Contexts.
1517
Require Import Arith ZArith List.
@@ -107,29 +109,31 @@ Lemma foo: forall (x:nat) (b1:bool) (y:nat) (b2:bool),
107109
Proof.
108110
intros.
109111
(* BIG HYPS may clutter the goal. IDE solution. *)
110-
(* 1. Just hide it by clicking on its button, or hit "f"
111-
while cursor on its name. Persistent and simply based
112-
on hyp name. *)
112+
(* 1. ProofGeneral: just hide it by clicking on its button, or hit
113+
"f" while cursor on its name. Persistent and simply based on
114+
hyp name. *)
113115

114116
(* 2. Big hyps ask for "non verbose forward reasoning". *)
115-
(* Since a few years: "specialize" now re-quantifies. *)
117+
(* Since a few years coq allows "specialize" to re-quantifies
118+
non-unified premisses. *)
116119
specialize H3 with (1:= le_S _ _ (le_n 0)).
117120

118-
(* More of the same: new tactic "especialize" starts a goal
119-
to instantiate a dependent premiss of a hyp, and then
120-
re-quantifies everything non instantiated. *)
121+
(* Our tactic "especialize" starts a goal to instantiate a dependent
122+
premiss of a hyp, and then re-quantifies everything non
123+
instantiated. *)
121124
Undo.
122125
especialize H3 at 1.
123126
{ apply le_S.
124127
apply le_n. }
125128
Undo 5.
126-
129+
(* IDEs don't like Undo, replay the next ocommand twice will resync
130+
proofgeneral. *)
127131
(* It accepts several (up to 7) premisses numers. *)
128132
especialize H3 at 2,3.
129133
Undo.
130134

131135
(* you can ask a goal for all premisses, in the spirit of the
132-
"exploit" tactic from CompCert. *)
136+
"exploit" tactic from CompCert. *)
133137
especialize H3 at *.
134138
Undo.
135139

@@ -179,13 +183,7 @@ Proof.
179183
(* experimental: (setq coq-libhyps-intros t) *)
180184
Undo 2.
181185
Show.
182-
(* PG's "smart intros" adapts *)
183-
184-
(* company-coq "guess names" has the same back-end. *)
185-
186-
(* better with colors. *)
187-
(* (set-face-attribute 'proof-declaration-name-face nil :bold nil :foreground "white")
188-
(set-face-attribute 'proof-declaration-name-face nil :bold nil :foreground "orange") *)
186+
189187
Restart.
190188
Show.
191189
(* Again, better combine it with ";;". *)
@@ -201,8 +199,7 @@ Proof.
201199
(* Long names, this is configurable (next demo), but IDE provides
202200
easy ways to see them (highlight) and to input them:
203201
- middle-click on hyp's name.
204-
- completion (company-coq).
205-
demo. *)
202+
- completion (company-coq). *)
206203

207204
(* tactic that generate names can be easily tamed. *)
208205
decompose [ex and or] h_ex_and_neq_and_/sng.
@@ -280,6 +277,11 @@ Proof.
280277
Ltac rename_depth ::= constr:(3).
281278

282279
intros/n/g.
280+
Undo.
281+
(* Have shorter names: *)
282+
Ltac rename_depth ::= constr:(2).
283+
intros/n/g.
284+
283285

284286
Abort.
285287

0 commit comments

Comments
 (0)