-
Notifications
You must be signed in to change notification settings - Fork 7
/
process_indexes.py
733 lines (684 loc) · 8.88 KB
/
process_indexes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
# TODO find a better way to do this
# This script parses coq tactics\commands index pages and outputs relevant
# keywords to be used in CodeMirror coq mode
# X_data variables are taken from Coq 8.18.0 documentation (Command/Tactic index)
commands_data = """
a
Abort
About
Add
Add Field
Add Morphism
Add Parametric Morphism
Add Parametric Relation
Add Parametric Setoid
Add Relation
Add Ring
Add Setoid
Add Zify
Admit Obligations
Admitted
Arguments
Axiom
Axioms
b
Back
BackTo
Bind Scope
c
Canonical Structure
Cd
Check
Class
Close Scope
Coercion
CoFixpoint
CoInductive
Collection
Combined Scheme
Comments
Compute
Conjecture
Conjectures
Constraint
Context
Corollary
Create HintDb
d
Debug
Declare Custom Entry
Declare Equivalent Keys
Declare Instance
Declare Left Step
Declare ML Module
Declare Module
Declare Morphism
Declare Reduction
Declare Right Step
Declare Scope
Defined
Definition
Delimit Scope
Derive
Derive Dependent Inversion
Derive Dependent Inversion_clear
Derive Inversion
Derive Inversion_clear
Disable Notation
Drop
e
Enable Notation
End
Eval
Example
Existing Class
Existing Instance
Existing Instances
Export
Extract Constant
Extract Inductive
Extract Inlined Constant
Extraction
Extraction Blacklist
Extraction Implicit
Extraction Inline
Extraction Language
Extraction Library
Extraction NoInline
Extraction TestCompile
f
Fact
Fail
Final Obligation
Fixpoint
Focus
From … Dependency
From … Require
Function
Functional Case
Functional Scheme
g
Generalizable
Generate graph for
Goal
Guarded
h
Hint Constants
Hint Constructors
Hint Cut
Hint Extern
Hint Immediate
Hint Mode
Hint Opaque
Hint Resolve
Hint Rewrite
Hint Transparent
Hint Unfold
Hint Variables
Hint View for
Hint View for apply
Hint View for move
Hypotheses
Hypothesis
i
Identity Coercion
Implicit Type
Implicit Types
Import
Include
Include Type
Inductive
Infix
Info
infoH
Inspect
Instance
l
Lemma
Let
Let CoFixpoint
Let Fixpoint
Load
Locate
Locate File
Locate Library
Locate Ltac
Locate Ltac2
Locate Module
Locate Term
Ltac
Ltac2
Ltac2 Eval
Ltac2 external
Ltac2 Notation
Ltac2 Notation (abbreviation)
Ltac2 Set
Ltac2 Type
m
Module
Module Type
n
Next Obligation
Notation
Notation (abbreviation)
Number Notation
o
Obligation
Obligation Tactic
Obligations
Opaque
Open Scope
Optimize Heap
Optimize Proof
p
Parameter
Parameters
Prenex Implicits
Preterm
Primitive
Print
Print All
Print All Dependencies
Print Assumptions
Print Canonical Projections
Print Classes
Print Coercion Paths
Print Coercions
Print Custom Grammar
Print Debug GC
Print Equivalent Keys
Print Extraction Blacklist
Print Extraction Inline
Print Fields
Print Firstorder Solver
Print Grammar
Print Graph
Print Hint
Print HintDb
Print Implicit
Print Instances
Print Keywords
Print Libraries
Print LoadPath
Print Ltac
Print Ltac Signatures
Print Ltac2
Print Ltac2 Signatures
Print ML Modules
Print ML Path
Print Module
Print Module Type
Print Namespace
Print Notation
Print Opaque Dependencies
Print Options
Print Registered
Print Rewrite HintDb
Print Rings
Print Scope
Print Scopes
Print Section
Print Strategies
Print Strategy
Print Table
Print Tables
Print Transparent Dependencies
Print Typeclasses
Print Typing Flags
Print Universes
Print Visibility
Proof
Proof `term`
Proof Mode
Proof using
Proof with
Property
Proposition
Pwd
q
Qed
Quit
r
Record
Recursive Extraction
Recursive Extraction Library
Redirect
Register
Register Inline
Remark
Remove
Remove Hints
Require
Require Export
Require Import
Reserved Infix
Reserved Notation
Reset
Reset Extraction Blacklist
Reset Extraction Inline
Reset Initial
Reset Ltac Profile
Restart
s
Save
Scheme
Scheme Boolean Equality
Scheme Equality
Search
SearchPattern
SearchRewrite
Section
Separate Extraction
Set
Show
Show Conjectures
Show Existentials
Show Extraction
Show Goal
Show Intro
Show Intros
Show Lia Profile
Show Ltac Profile
Show Match
Show Obligation Tactic
Show Proof
Show Universes
Show Zify
Solve All Obligations
Solve Obligations
Strategy
String Notation
Structure
SubClass
Succeed
t
Tactic Notation
Test
Theorem
Time
Timeout
Transparent
Type
Typeclasses eauto
Typeclasses Opaque
Typeclasses Transparent
u
Undelimit Scope
Undo
Unfocus
Unfocused
Universe
Universes
Unset
Unshelve
v
Validate Proof
Variable
Variables
Variant
"""
tactics_data = """
+
+ (backtracking branching)
=
=>
[
[ … | … | … ] (dispatch)
[> … | … | … ] (dispatch)
a
abstract
abstract (ssreflect)
absurd
admit
apply
apply (ssreflect)
assert
assert_fails
assert_succeeds
assumption
auto
autoapply
autorewrite
autounfold
autounfold_one
b
btauto
bullet (- + *)
by
c
case
case (ssreflect)
case_eq
casetype
cbn
cbv
change
change_no_check
classical_left
classical_right
clear
clear dependent
clearbody
cofix
compare
compute
congr
congruence
constr_eq
constr_eq_nounivs
constr_eq_strict
constructor
context
contradict
contradiction
cut
cutrewrite
cycle
d
debug auto
debug eauto
debug trivial
decide
decide equality
decompose
decompose record
decompose sum
dependent destruction
dependent generalize_eqs
dependent generalize_eqs_vars
dependent induction
dependent inversion
dependent inversion_clear
dependent rewrite
dependent simple inversion
destauto
destruct
dfs eauto
dintuition
discriminate
discrR
do
do (ssreflect)
done
dtauto
e
eapply
eassert
eassumption
easy
eauto
ecase
econstructor
edestruct
ediscriminate
eelim
eenough
eexact
eexists
einduction
einjection
eintros
eleft
elim
elim (ssreflect)
elimtype
enough
epose
epose proof
eremember
erewrite
eright
eset
esimplify_eq
esplit
etransitivity
eval
evar
exact
exact (ssreflect)
exact_no_check
exactly_once
exfalso
exists
f
f_equal
fail
field
field_lookup
field_simplify
field_simplify_eq
finish_timing
first
first (ssreflect)
first last
firstorder
fix
fold
fresh
fun
functional induction
functional inversion
g
generalize
generalize dependent
generalize_eqs
generalize_eqs_vars
generally have
gfail
gintuition
give_up
guard
h
has_evar
have
head_of_constr
hnf
i
idtac
if-then-else (Ltac2)
in
induction
info_auto
info_eauto
info_trivial
injection
instantiate
intro
intros
intros until
intuition
inversion
inversion_clear
inversion_sigma
is_cofix
is_const
is_constructor
is_evar
is_fix
is_ground
is_ind
is_proj
is_var
l
lapply
last
last first
lazy
lazy_match!
lazy_match! goal
lazymatch
lazymatch goal
left
let
lia
lra
ltac-seq
m
match
match (Ltac2)
match goal
match!
match! goal
move
move (ssreflect)
multi_match!
multi_match! goal
multimatch
multimatch goal
n
native_cast_no_check
native_compute
nia
not_evar
now
now_show
nra
nsatz
nsatz_compute
numgoals
o
once
only
optimize_heap
over
p
pattern
pose
pose (ssreflect)
pose proof
progress
protect_fv
psatz
r
rapply
red
refine
reflexivity
remember
rename
repeat
replace
reset ltac profile
restart_timer
revert
revert dependent
revgoals
rewrite
rewrite (ssreflect)
rewrite *
rewrite_db
rewrite_strat
right
ring
ring_lookup
ring_simplify
rtauto
s
set
set (ssreflect)
setoid_etransitivity
setoid_reflexivity
setoid_replace
setoid_rewrite
setoid_symmetry
setoid_transitivity
shelve
shelve_unifiable
show ltac profile
simpl
simple apply
simple congruence
simple destruct
simple eapply
simple induction
simple injection
simple inversion
simple subst
simplify_eq
soft functional induction
solve
solve_constraints
specialize
specialize_eqs
split
split_Rabs
split_Rmult
start ltac profiling
stepl
stepr
stop ltac profiling
subst
substitute
suff
suffices
swap
symmetry
t
tauto
time
time_constr
timeout
transitivity
transparent_abstract
trivial
try
tryif
type of
type_term
typeclasses eauto
u
under
unfold
unify
unlock
unshelve
v
vm_cast_no_check
vm_compute
w
with_strategy
without loss
wlia
wlog
wlra_Q
wnia
wnra_Q
wpsatz_Q
wpsatz_Z
wsos_Q
wsos_Z
x
xlia
xlra_Q
xlra_R
xnia
xnra_Q
xnra_R
xpsatz_Q
xpsatz_R
xpsatz_Z
xsos_Q
xsos_R
xsos_Z
z
zify
zify_elim_let
zify_iter_let
zify_iter_specs
zify_op
zify_saturate
"""
def extract(data):
result = map(lambda l: l.strip("\t "), data.splitlines())
result = filter(lambda l: len(l) > 1, result)
result = map(lambda l: l.split(" ")[0], result)
result = filter(lambda l: l[0].isalpha(), result)
result = map(lambda l: l.rstrip(":"), result)
result = sorted(set(result))
return result
print("Commands:")
for command in extract(commands_data):
print('"{}",'.format(command))
print("Tactics:")
for tactic in extract(tactics_data):
print('"{}",'.format(tactic))