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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748

# 11 "plugins/ltac/coretactics.mlg"
 

open Util
open Locus
open Tactypes
open Genredexpr
open Stdarg
open Extraargs
open Tacarg
open Names
open Logic

let wit_hyp = wit_var



let __coq_plugin_name = "ltac_plugin"
let _ = Mltop.add_known_module __coq_plugin_name
let () = Tacentries.tactic_extend __coq_plugin_name "reflexivity" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("reflexivity", Tacentries.TyNil), 
           (fun ist -> 
# 32 "plugins/ltac/coretactics.mlg"
                         Tactics.intros_reflexivity 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "exact" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("exact", Tacentries.TyArg (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_casted_constr), 
                                                         Tacentries.TyNil)), 
           (fun c ist -> 
# 36 "plugins/ltac/coretactics.mlg"
                                    Tactics.exact_no_check c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "assumption" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("assumption", Tacentries.TyNil), 
           (fun ist -> 
# 40 "plugins/ltac/coretactics.mlg"
                        Tactics.assumption 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "etransitivity" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("etransitivity", Tacentries.TyNil), 
           (fun ist -> 
# 44 "plugins/ltac/coretactics.mlg"
                           Tactics.intros_transitivity None 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "cut" ~level:0 [(
                                                                   Tacentries.TyML (
                                                                   Tacentries.TyIdent ("cut", 
                                                                   Tacentries.TyArg (
                                                                   Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                                   Tacentries.TyNil)), 
                                                                   (fun c ist
                                                                   -> 
                                                                   
# 48 "plugins/ltac/coretactics.mlg"
                           Tactics.cut c 
                                                                   )))]

let () = Tacentries.tactic_extend __coq_plugin_name "exact_no_check" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("exact_no_check", Tacentries.TyArg (
                                                                  Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                                  Tacentries.TyNil)), 
           (fun c ist -> 
# 52 "plugins/ltac/coretactics.mlg"
                                      Tactics.exact_no_check c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "vm_cast_no_check" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("vm_cast_no_check", Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                                    Tacentries.TyNil)), 
           (fun c ist -> 
# 56 "plugins/ltac/coretactics.mlg"
                                        Tactics.vm_cast_no_check c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "native_cast_no_check" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("native_cast_no_check", 
                            Tacentries.TyArg (Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                            Tacentries.TyNil)), (fun c ist -> 
# 60 "plugins/ltac/coretactics.mlg"
                                            Tactics.native_cast_no_check c 
                                                )))]

let () = Tacentries.tactic_extend __coq_plugin_name "casetype" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("casetype", Tacentries.TyArg (
                                                            Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                            Tacentries.TyNil)), 
           (fun c ist -> 
# 64 "plugins/ltac/coretactics.mlg"
                                Tactics.case_type c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "elimtype" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("elimtype", Tacentries.TyArg (
                                                            Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                            Tacentries.TyNil)), 
           (fun c ist -> 
# 68 "plugins/ltac/coretactics.mlg"
                                Tactics.elim_type c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "lapply" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("lapply", Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                          Tacentries.TyNil)), 
           (fun c ist -> 
# 72 "plugins/ltac/coretactics.mlg"
                              Tactics.cut_and_apply c 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "transitivity" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("transitivity", Tacentries.TyArg (
                                                                Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                                Tacentries.TyNil)), 
           (fun c ist -> 
# 76 "plugins/ltac/coretactics.mlg"
                                    Tactics.intros_transitivity (Some c) 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "left" ~level:0 [(
                                                                    Tacentries.TyML (
                                                                    Tacentries.TyIdent ("left", 
                                                                    Tacentries.TyNil), 
                                                                    (fun ist
                                                                    -> 
                                                                    
# 82 "plugins/ltac/coretactics.mlg"
                  Tactics.left_with_bindings false NoBindings 
                                                                    )))]

let () = Tacentries.tactic_extend __coq_plugin_name "eleft" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("eleft", Tacentries.TyNil), 
           (fun ist -> 
# 86 "plugins/ltac/coretactics.mlg"
                   Tactics.left_with_bindings true NoBindings 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "left_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("left", Tacentries.TyIdent ("with", 
                                                        Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                        Tacentries.TyNil))), 
           (fun bl ist -> 
# 90 "plugins/ltac/coretactics.mlg"
                                     
    Tacticals.New.tclDELAYEDWITHHOLES false bl (fun bl -> Tactics.left_with_bindings false bl)
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "eleft_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("eleft", Tacentries.TyIdent ("with", 
                                                         Tacentries.TyArg (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                         Tacentries.TyNil))), 
           (fun bl ist -> 
# 96 "plugins/ltac/coretactics.mlg"
                                      
    Tacticals.New.tclDELAYEDWITHHOLES true bl (fun bl -> Tactics.left_with_bindings true bl)
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "right" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("right", Tacentries.TyNil), 
           (fun ist -> 
# 104 "plugins/ltac/coretactics.mlg"
                   Tactics.right_with_bindings false NoBindings 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "eright" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("eright", Tacentries.TyNil), 
           (fun ist -> 
# 108 "plugins/ltac/coretactics.mlg"
                    Tactics.right_with_bindings true NoBindings 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "right_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("right", Tacentries.TyIdent ("with", 
                                                         Tacentries.TyArg (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                         Tacentries.TyNil))), 
           (fun bl ist -> 
# 112 "plugins/ltac/coretactics.mlg"
                                      
    Tacticals.New.tclDELAYEDWITHHOLES false bl (fun bl -> Tactics.right_with_bindings false bl)
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "eright_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("eright", Tacentries.TyIdent ("with", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                          Tacentries.TyNil))), 
           (fun bl ist -> 
# 118 "plugins/ltac/coretactics.mlg"
                                       
    Tacticals.New.tclDELAYEDWITHHOLES true bl (fun bl -> Tactics.right_with_bindings true bl)
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "constructor" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("constructor", Tacentries.TyNil), 
           (fun ist -> 
# 126 "plugins/ltac/coretactics.mlg"
                         Tactics.any_constructor false None 
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("constructor", Tacentries.TyArg (
                                                              Extend.TUentry (Genarg.get_arg_tag wit_int_or_var), 
                                                              Tacentries.TyNil)), 
          (fun i ist -> 
# 127 "plugins/ltac/coretactics.mlg"
                                      
    Tactics.constructor_tac false None i NoBindings
  
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("constructor", Tacentries.TyArg (
                                                              Extend.TUentry (Genarg.get_arg_tag wit_int_or_var), 
                                                              Tacentries.TyIdent ("with", 
                                                              Tacentries.TyArg (
                                                              Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                              Tacentries.TyNil)))), 
          (fun i bl ist -> 
# 130 "plugins/ltac/coretactics.mlg"
                                                          
    let tac bl = Tactics.constructor_tac false None i bl in
    Tacticals.New.tclDELAYEDWITHHOLES false bl tac
  
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "econstructor" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("econstructor", Tacentries.TyNil), 
           (fun ist -> 
# 137 "plugins/ltac/coretactics.mlg"
                          Tactics.any_constructor true None 
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("econstructor", Tacentries.TyArg (
                                                               Extend.TUentry (Genarg.get_arg_tag wit_int_or_var), 
                                                               Tacentries.TyNil)), 
          (fun i ist -> 
# 138 "plugins/ltac/coretactics.mlg"
                                       
    Tactics.constructor_tac true None i NoBindings
  
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("econstructor", Tacentries.TyArg (
                                                               Extend.TUentry (Genarg.get_arg_tag wit_int_or_var), 
                                                               Tacentries.TyIdent ("with", 
                                                               Tacentries.TyArg (
                                                               Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                               Tacentries.TyNil)))), 
          (fun i bl ist -> 
# 141 "plugins/ltac/coretactics.mlg"
                                                           
    let tac bl = Tactics.constructor_tac true None i bl in
    Tacticals.New.tclDELAYEDWITHHOLES true bl tac
  
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "specialize" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("specialize", Tacentries.TyArg (
                                                              Extend.TUentry (Genarg.get_arg_tag wit_constr_with_bindings), 
                                                              Tacentries.TyNil)), 
           (fun c ist -> 
# 150 "plugins/ltac/coretactics.mlg"
                                               
    Tacticals.New.tclDELAYEDWITHHOLES false c (fun c -> Tactics.specialize c None)
  
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("specialize", Tacentries.TyArg (
                                                             Extend.TUentry (Genarg.get_arg_tag wit_constr_with_bindings), 
                                                             Tacentries.TyIdent ("as", 
                                                             Tacentries.TyArg (
                                                             Extend.TUentry (Genarg.get_arg_tag wit_simple_intropattern), 
                                                             Tacentries.TyNil)))), 
          (fun c ipat ist -> 
# 153 "plugins/ltac/coretactics.mlg"
                                                                              
    Tacticals.New.tclDELAYEDWITHHOLES false c (fun c -> Tactics.specialize c (Some ipat))
  
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "symmetry" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("symmetry", Tacentries.TyNil), 
           (fun ist -> 
# 159 "plugins/ltac/coretactics.mlg"
                      Tactics.intros_symmetry {onhyps=Some[];concl_occs=AllOccurrences} 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "symmetry_in" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("symmetry", Tacentries.TyIdent ("in", 
                                                            Tacentries.TyArg (
                                                            Extend.TUentry (Genarg.get_arg_tag wit_in_clause), 
                                                            Tacentries.TyNil))), 
           (fun cl ist -> 
# 163 "plugins/ltac/coretactics.mlg"
                                         Tactics.intros_symmetry cl 
           )))]


# 168 "plugins/ltac/coretactics.mlg"
 

let rec delayed_list = function
| [] -> fun _ sigma -> (sigma, [])
| x :: l ->
  fun env sigma ->
    let (sigma, x) = x env sigma in
    let (sigma, l) = delayed_list l env sigma in
    (sigma, x :: l)



let () = Tacentries.tactic_extend __coq_plugin_name "split" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("split", Tacentries.TyNil), 
           (fun ist -> 
# 181 "plugins/ltac/coretactics.mlg"
                   Tactics.split_with_bindings false [NoBindings] 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "esplit" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("esplit", Tacentries.TyNil), 
           (fun ist -> 
# 185 "plugins/ltac/coretactics.mlg"
                    Tactics.split_with_bindings true [NoBindings] 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "split_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("split", Tacentries.TyIdent ("with", 
                                                         Tacentries.TyArg (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                         Tacentries.TyNil))), 
           (fun bl ist -> 
# 189 "plugins/ltac/coretactics.mlg"
                                      
    Tacticals.New.tclDELAYEDWITHHOLES false bl (fun bl -> Tactics.split_with_bindings false [bl])
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "esplit_with" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("esplit", Tacentries.TyIdent ("with", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_bindings), 
                                                          Tacentries.TyNil))), 
           (fun bl ist -> 
# 195 "plugins/ltac/coretactics.mlg"
                                       
    Tacticals.New.tclDELAYEDWITHHOLES true bl (fun bl -> Tactics.split_with_bindings true [bl])
  
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "exists" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("exists", Tacentries.TyNil), 
           (fun ist -> 
# 201 "plugins/ltac/coretactics.mlg"
                    Tactics.split_with_bindings false [NoBindings] 
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("exists", Tacentries.TyArg (
                                                         Extend.TUlist1sep (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_bindings), ","), 
                                                         Tacentries.TyNil)), 
          (fun bll ist -> 
# 202 "plugins/ltac/coretactics.mlg"
                                                  
    Tacticals.New.tclDELAYEDWITHHOLES false (delayed_list bll) (fun bll -> Tactics.split_with_bindings false bll)
  
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "eexists" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("eexists", Tacentries.TyNil), 
           (fun ist -> 
# 208 "plugins/ltac/coretactics.mlg"
                     Tactics.split_with_bindings true [NoBindings] 
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("eexists", Tacentries.TyArg (
                                                          Extend.TUlist1sep (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_bindings), ","), 
                                                          Tacentries.TyNil)), 
          (fun bll ist -> 
# 209 "plugins/ltac/coretactics.mlg"
                                                   
    Tacticals.New.tclDELAYEDWITHHOLES true (delayed_list bll) (fun bll -> Tactics.split_with_bindings true bll)
  
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "intros_until" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("intros", Tacentries.TyIdent ("until", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_quantified_hypothesis), 
                                                          Tacentries.TyNil))), 
           (fun h ist -> 
# 217 "plugins/ltac/coretactics.mlg"
                                                     Tactics.intros_until h 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "intro" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyNil), 
           (fun ist -> 
# 221 "plugins/ltac/coretactics.mlg"
                   Tactics.intro_move None MoveLast 
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                        Tacentries.TyNil)), 
          (fun id ist -> 
# 222 "plugins/ltac/coretactics.mlg"
                             Tactics.intro_move (Some id) MoveLast 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                        Tacentries.TyIdent ("at", 
                                                        Tacentries.TyIdent ("top", 
                                                        Tacentries.TyNil)))), 
          (fun id ist -> 
# 223 "plugins/ltac/coretactics.mlg"
                                        Tactics.intro_move (Some id) MoveFirst 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                        Tacentries.TyIdent ("at", 
                                                        Tacentries.TyIdent ("bottom", 
                                                        Tacentries.TyNil)))), 
          (fun id ist -> 
# 224 "plugins/ltac/coretactics.mlg"
                                           Tactics.intro_move (Some id) MoveLast 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                        Tacentries.TyIdent ("after", 
                                                        Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                        Tacentries.TyNil)))), 
          (fun id h ist -> 
# 225 "plugins/ltac/coretactics.mlg"
                                            Tactics.intro_move (Some id) (MoveAfter h) 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                        Tacentries.TyIdent ("before", 
                                                        Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                        Tacentries.TyNil)))), 
          (fun id h ist -> 
# 226 "plugins/ltac/coretactics.mlg"
                                             Tactics.intro_move (Some id) (MoveBefore h) 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyIdent ("at", 
                                                        Tacentries.TyIdent ("top", 
                                                        Tacentries.TyNil))), 
          (fun ist -> 
# 227 "plugins/ltac/coretactics.mlg"
                              Tactics.intro_move None MoveFirst 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyIdent ("at", 
                                                        Tacentries.TyIdent ("bottom", 
                                                        Tacentries.TyNil))), 
          (fun ist -> 
# 228 "plugins/ltac/coretactics.mlg"
                                 Tactics.intro_move None MoveLast 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyIdent ("after", 
                                                        Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                        Tacentries.TyNil))), 
          (fun h ist -> 
# 229 "plugins/ltac/coretactics.mlg"
                                  Tactics.intro_move None (MoveAfter h) 
          )));
         (Tacentries.TyML (Tacentries.TyIdent ("intro", Tacentries.TyIdent ("before", 
                                                        Tacentries.TyArg (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                        Tacentries.TyNil))), 
          (fun h ist -> 
# 230 "plugins/ltac/coretactics.mlg"
                                   Tactics.intro_move None (MoveBefore h) 
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "move" ~level:0 [(
                                                                    Tacentries.TyML (
                                                                    Tacentries.TyIdent ("move", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyIdent ("at", 
                                                                    Tacentries.TyIdent ("top", 
                                                                    Tacentries.TyNil)))), 
                                                                    (fun id
                                                                    ist -> 
                                                                    
# 236 "plugins/ltac/coretactics.mlg"
                                     Tactics.move_hyp id MoveFirst 
                                                                    )));
                                                                    (
                                                                    Tacentries.TyML (
                                                                    Tacentries.TyIdent ("move", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyIdent ("at", 
                                                                    Tacentries.TyIdent ("bottom", 
                                                                    Tacentries.TyNil)))), 
                                                                    (fun id
                                                                    ist -> 
                                                                    
# 237 "plugins/ltac/coretactics.mlg"
                                        Tactics.move_hyp id MoveLast 
                                                                    )));
                                                                    (
                                                                    Tacentries.TyML (
                                                                    Tacentries.TyIdent ("move", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyIdent ("after", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyNil)))), 
                                                                    (fun id h
                                                                    ist -> 
                                                                    
# 238 "plugins/ltac/coretactics.mlg"
                                         Tactics.move_hyp id (MoveAfter h) 
                                                                    )));
                                                                    (
                                                                    Tacentries.TyML (
                                                                    Tacentries.TyIdent ("move", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyIdent ("before", 
                                                                    Tacentries.TyArg (
                                                                    Extend.TUentry (Genarg.get_arg_tag wit_hyp), 
                                                                    Tacentries.TyNil)))), 
                                                                    (fun id h
                                                                    ist -> 
                                                                    
# 239 "plugins/ltac/coretactics.mlg"
                                          Tactics.move_hyp id (MoveBefore h) 
                                                                    )))]

let () = Tacentries.tactic_extend __coq_plugin_name "rename" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("rename", Tacentries.TyArg (
                                                          Extend.TUlist1sep (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_rename), ","), 
                                                          Tacentries.TyNil)), 
           (fun ids ist -> 
# 245 "plugins/ltac/coretactics.mlg"
                                                 Tactics.rename_hyp ids 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "revert" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("revert", Tacentries.TyArg (
                                                          Extend.TUlist1 (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_hyp)), 
                                                          Tacentries.TyNil)), 
           (fun hl ist -> 
# 251 "plugins/ltac/coretactics.mlg"
                                    Tactics.revert hl 
           )))]


# 256 "plugins/ltac/coretactics.mlg"
 

let simple_induct h =
  Tacticals.New.tclTHEN (Tactics.intros_until h)
    (Tacticals.New.onLastHyp Tactics.simplest_elim)



let () = Tacentries.tactic_extend __coq_plugin_name "simple_induction" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("simple", Tacentries.TyIdent ("induction", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_quantified_hypothesis), 
                                                          Tacentries.TyNil))), 
           (fun h ist -> 
# 265 "plugins/ltac/coretactics.mlg"
                                                         simple_induct h 
           )))]


# 268 "plugins/ltac/coretactics.mlg"
 

let simple_destruct h =
  Tacticals.New.tclTHEN (Tactics.intros_until h)
    (Tacticals.New.onLastHyp Tactics.simplest_case)



let () = Tacentries.tactic_extend __coq_plugin_name "simple_destruct" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("simple", Tacentries.TyIdent ("destruct", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_quantified_hypothesis), 
                                                          Tacentries.TyNil))), 
           (fun h ist -> 
# 277 "plugins/ltac/coretactics.mlg"
                                                        simple_destruct h 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "double_induction" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("double", Tacentries.TyIdent ("induction", 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_quantified_hypothesis), 
                                                          Tacentries.TyArg (
                                                          Extend.TUentry (Genarg.get_arg_tag wit_quantified_hypothesis), 
                                                          Tacentries.TyNil)))), 
           (fun h1 h2 ist -> 
# 284 "plugins/ltac/coretactics.mlg"
    Elim.h_double_induction h1 h2 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "admit" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("admit", Tacentries.TyNil), 
           (fun ist -> 
# 290 "plugins/ltac/coretactics.mlg"
                  Proofview.give_up 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "fix" ~level:0 [(
                                                                   Tacentries.TyML (
                                                                   Tacentries.TyIdent ("fix", 
                                                                   Tacentries.TyArg (
                                                                   Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                                   Tacentries.TyArg (
                                                                   Extend.TUentry (Genarg.get_arg_tag wit_natural), 
                                                                   Tacentries.TyNil))), 
                                                                   (fun id n
                                                                   ist -> 
                                                                   
# 296 "plugins/ltac/coretactics.mlg"
                                      Tactics.fix id n 
                                                                   )))]

let () = Tacentries.tactic_extend __coq_plugin_name "cofix" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("cofix", Tacentries.TyArg (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_ident), 
                                                         Tacentries.TyNil)), 
           (fun id ist -> 
# 302 "plugins/ltac/coretactics.mlg"
                             Tactics.cofix id 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "clear" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("clear", Tacentries.TyArg (
                                                         Extend.TUlist0 (
                                                         Extend.TUentry (Genarg.get_arg_tag wit_hyp)), 
                                                         Tacentries.TyNil)), 
           (fun ids ist -> 
# 308 "plugins/ltac/coretactics.mlg"
                                
    if List.is_empty ids then Tactics.keep []
    else Tactics.clear ids
  
           )));
         (Tacentries.TyML (Tacentries.TyIdent ("clear", Tacentries.TyIdent ("-", 
                                                        Tacentries.TyArg (
                                                        Extend.TUlist1 (
                                                        Extend.TUentry (Genarg.get_arg_tag wit_hyp)), 
                                                        Tacentries.TyNil))), 
          (fun ids ist -> 
# 312 "plugins/ltac/coretactics.mlg"
                                        Tactics.keep ids 
          )))]

let () = Tacentries.tactic_extend __coq_plugin_name "clearbody" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("clearbody", Tacentries.TyArg (
                                                             Extend.TUlist1 (
                                                             Extend.TUentry (Genarg.get_arg_tag wit_hyp)), 
                                                             Tacentries.TyNil)), 
           (fun ids ist -> 
# 318 "plugins/ltac/coretactics.mlg"
                                        Tactics.clear_body ids 
           )))]

let () = Tacentries.tactic_extend __coq_plugin_name "generalize_dependent" ~level:0 
         [(Tacentries.TyML (Tacentries.TyIdent ("generalize", Tacentries.TyIdent ("dependent", 
                                                              Tacentries.TyArg (
                                                              Extend.TUentry (Genarg.get_arg_tag wit_constr), 
                                                              Tacentries.TyNil))), 
           (fun c ist -> 
# 324 "plugins/ltac/coretactics.mlg"
                                              Tactics.generalize_dep c 
           )))]


# 329 "plugins/ltac/coretactics.mlg"
 

open Tacexpr

let initial_atomic () =
  let nocl = {onhyps=Some[];concl_occs=AllOccurrences} in
  let iter (s, t) =
    let body = TacAtom (CAst.make t) in
    Tacenv.register_ltac false false (Names.Id.of_string s) body
  in
  let () = List.iter iter
      [ "red", TacReduce(Red false,nocl);
        "hnf", TacReduce(Hnf,nocl);
        "simpl", TacReduce(Simpl (Redops.all_flags,None),nocl);
        "compute", TacReduce(Cbv Redops.all_flags,nocl);
        "intros", TacIntroPattern (false,[]);
      ]
  in
  let iter (s, t) = Tacenv.register_ltac false false (Names.Id.of_string s) t in
  List.iter iter
      [ "idtac",TacId [];
        "fail", TacFail(TacLocal,ArgArg 0,[]);
        "fresh", TacArg(CAst.make @@ TacFreshId [])
      ]

let () = Mltop.declare_cache_obj initial_atomic "ltac_plugin"

(* First-class Ltac access to primitive blocks *)

let initial_name s = { mltac_plugin = "ltac_plugin"; mltac_tactic = s; }
let initial_entry s = { mltac_name = initial_name s; mltac_index = 0; }

let register_list_tactical name f =
  let tac args ist = match args with
  | [v] ->
    begin match Tacinterp.Value.to_list v with
    | None -> Tacticals.New.tclZEROMSG (Pp.str "Expected a list")
    | Some tacs ->
      let tacs = List.map (fun tac -> Tacinterp.tactic_of_value ist tac) tacs in
      f tacs
    end
  | _ -> assert false
  in
  Tacenv.register_ml_tactic (initial_name name) [|tac|]

let () = register_list_tactical "first" Tacticals.New.tclFIRST
let () = register_list_tactical "solve" Tacticals.New.tclSOLVE

let initial_tacticals () =
  let idn n = Id.of_string (Printf.sprintf "_%i" n) in
  let varn n = Reference (ArgVar (CAst.make (idn n))) in
  let iter (s, t) = Tacenv.register_ltac false false (Id.of_string s) t in
  List.iter iter [
    "first", TacFun ([Name (idn 0)], TacML (CAst.make (initial_entry "first", [varn 0])));
    "solve", TacFun ([Name (idn 0)], TacML (CAst.make (initial_entry "solve", [varn 0])));
  ]

let () = Mltop.declare_cache_obj initial_tacticals "ltac_plugin"