aboutsummaryrefslogtreecommitdiff
path: root/doc/tools/docgram/orderedGrammar
blob: 545ccde03a1cefdf7d28edf0a7e3fb332a4db467 (plain)
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
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
(* Defines the order to apply to editedGrammar to get productionlistGrammar.
doc_grammar will modify this file to add/remove nonterminals and productions
to match editedGrammar, which will remove comments.  Not compiled into Coq *)
DOC_GRAMMAR

vernac_toplevel: [
| "Drop" "."
| "Quit" "."
| "BackTo" num "."
| "Show" "Goal" num "at" num "."
| "Show" "Proof" "Diffs" removed_opt "."
| vernac_control
]

removed_opt: [
| "removed"
| empty
]

tactic_mode: [
| toplevel_selector_opt query_command
| toplevel_selector_opt "{"
| toplevel_selector_opt ltac_info_opt ltac_expr ltac_use_default
| "par" ":" ltac_info_opt ltac_expr ltac_use_default
]

toplevel_selector_opt: [
| toplevel_selector
| empty
]

ltac_info_opt: [
| "Info" num
| empty
]

ltac_use_default: [
| "."
| "..."
]

vernac_control: [
| "Time" vernac_control
| "Redirect" string vernac_control
| "Timeout" num vernac_control
| "Fail" vernac_control
| quoted_attributes_list_opt vernac
]

term: [
| "forall" open_binders "," term
| "fun" open_binders "=>" term
| term_let
| "if" term as_return_type_opt "then" term "else" term
| term_fix
| term100
]

term100: [
| term_cast
| term10
]

term10: [
| term1 args
| "@" qualid universe_annot_opt term1_list_opt
| term1
]

args: [
| args arg
| arg
]

arg: [
| "(" ident ":=" term ")"
| term1
]

term1_list_opt: [
| term1_list_opt term1
| empty
]

empty: [
|
]

term1: [
| term_projection
| term0 "%" ident
| term0
]

args_opt: [
| args
| empty
]

term0: [
| qualid universe_annot_opt
| sort
| numeral
| string
| "_"
| term_evar
| term_match
| "(" term ")"
| "{|" fields_def "|}"
| "`{" term "}"
| "`(" term ")"
| "ltac" ":" "(" ltac_expr ")"
]

fields_def: [
| field_def ";" fields_def
| field_def
| empty
]

field_def: [
| qualid binders_opt ":=" term
]

binders_opt: [
| binders
| empty
]

term_projection: [
| term0 ".(" qualid args_opt ")"
| term0 ".(" "@" qualid term1_list_opt ")"
]

term_evar: [
| "?[" ident "]"
| "?[" "?" ident "]"
| "?" ident evar_bindings_opt
]

evar_bindings_opt: [
| "@{" evar_bindings_semi "}"
| empty
]

evar_bindings_semi: [
| evar_bindings_semi ";" evar_binding
| evar_binding
]

evar_binding: [
| ident ":=" term
]

dangling_pattern_extension_rule: [
| "@" "?" ident ident_list
]

ident_list: [
| ident_list ident
| ident
]

record_fields: [
| record_field ";" record_fields
| record_field ";"
| record_field
| empty
]

record_field: [
| quoted_attributes_list_opt record_binder num_opt2 decl_notation
]

decl_notation: [
| "where" one_decl_notation_list
| empty
]

one_decl_notation_list: [
| one_decl_notation_list "and" one_decl_notation
| one_decl_notation
]

one_decl_notation: [
| string ":=" term1_extended ident_opt3
]

ident_opt3: [
| ":" ident
| empty
]

record_binder: [
| name
| name record_binder_body
]

record_binder_body: [
| binders_opt of_type_with_opt_coercion term
| binders_opt of_type_with_opt_coercion term ":=" term
| binders_opt ":=" term
]

of_type_with_opt_coercion: [
| ":>>"
| ":>"
| ":"
]

num_opt2: [
| "|" num
| empty
]

quoted_attributes_list_opt: [
| quoted_attributes_list_opt "#[" attribute_list_comma_opt "]"
| empty
]

attribute_list_comma_opt: [
| attribute_list_comma
| empty
]

attribute_list_comma: [
| attribute_list_comma "," attribute
| attribute
]

attribute: [
| ident attribute_value
]

attribute_value: [
| "=" string
| "(" attribute_list_comma_opt ")"
| empty
]

qualid: [
| qualid field
| ident
]

field: [
| "." ident
]

sort: [
| "Set"
| "Prop"
| "SProp"
| "Type"
| "Type" "@{" "_" "}"
| "Type" "@{" universe "}"
]

universe: [
| "max" "(" universe_exprs_comma ")"
| universe_expr
]

universe_exprs_comma: [
| universe_exprs_comma "," universe_expr
| universe_expr
]

universe_expr: [
| universe_name universe_increment_opt
]

universe_name: [
| qualid
| "Set"
| "Prop"
]

universe_increment_opt: [
| "+" num
| empty
]

universe_annot_opt: [
| "@{" universe_levels_opt "}"
| empty
]

universe_levels_opt: [
| universe_levels_opt universe_level
| empty
]

universe_level: [
| "Set"
| "Prop"
| "Type"
| "_"
| qualid
]

term_fix: [
| single_fix
| single_fix "with" fix_bodies "for" ident
]

single_fix: [
| "fix" fix_body
| "cofix" fix_body
]

fix_bodies: [
| fix_bodies "with" fix_body
| fix_body
]

fix_body: [
| ident binders_opt fixannot_opt colon_term_opt ":=" term
]

fixannot_opt: [
| fixannot
| empty
]

fixannot: [
| "{" "struct" ident "}"
| "{" "wf" term1_extended ident "}"
| "{" "measure" term1_extended ident_opt term1_extended_opt "}"
]

term1_extended: [
| term1
| "@" qualid universe_annot_opt
]

ident_opt: [
| ident
| empty
]

term1_extended_opt: [
| term1_extended
| empty
]

term_let: [
| "let" name colon_term_opt ":=" term "in" term
| "let" name binders colon_term_opt ":=" term "in" term
| "let" single_fix "in" term
| "let" names_tuple as_return_type_opt ":=" term "in" term
| "let" "'" pattern ":=" term return_type_opt "in" term
| "let" "'" pattern "in" pattern ":=" term return_type "in" term
]

colon_term_opt: [
| ":" term
| empty
]

names_tuple: [
| "(" names_comma ")"
| "()"
]

names_comma: [
| names_comma "," name
| name
]

open_binders: [
| names ":" term
| binders
]

names: [
| names name
| name
]

name: [
| "_"
| ident
]

binders: [
| binders binder
| binder
]

binder: [
| name
| "(" names ":" term ")"
| "(" name colon_term_opt ":=" term ")"
| "{" name "}"
| "{" names colon_term_opt "}"
| "`(" typeclass_constraints_comma ")"
| "`{" typeclass_constraints_comma "}"
| "'" pattern0
| "(" name ":" term "|" term ")"
]

typeclass_constraints_comma: [
| typeclass_constraints_comma "," typeclass_constraint
| typeclass_constraint
]

typeclass_constraint: [
| exclam_opt term
| "{" name "}" ":" exclam_opt term
| name ":" exclam_opt term
]

exclam_opt: [
| "!"
| empty
]

term_cast: [
| term10 "<:" term
| term10 "<<:" term
| term10 ":" term
| term10 ":>"
]

term_match: [
| "match" case_items_comma return_type_opt "with" or_opt eqns_or_opt "end"
]

case_items_comma: [
| case_items_comma "," case_item
| case_item
]

return_type_opt: [
| return_type
| empty
]

as_return_type_opt: [
| as_name_opt return_type
| empty
]

return_type: [
| "return" term100
]

case_item: [
| term100 as_name_opt in_opt
]

as_name_opt: [
| "as" name
| empty
]

in_opt: [
| "in" pattern
| empty
]

or_opt: [
| "|"
| empty
]

eqns_or_opt: [
| eqns_or
| empty
]

eqns_or: [
| eqns_or "|" eqn
| eqn
]

eqn: [
| patterns_comma_list_or "=>" term
]

patterns_comma_list_or: [
| patterns_comma_list_or "|" patterns_comma
| patterns_comma
]

patterns_comma: [
| patterns_comma "," pattern
| pattern
]

pattern: [
| pattern10 ":" term
| pattern10
]

pattern10: [
| pattern1 "as" name
| pattern1_list
| "@" qualid pattern1_list_opt
| pattern1
]

pattern1_list: [
| pattern1_list pattern1
| pattern1
]

pattern1_list_opt: [
| pattern1_list
| empty
]

pattern1: [
| pattern0 "%" ident
| pattern0
]

pattern0: [
| qualid
| "{|" record_patterns_opt "|}"
| "_"
| "(" patterns_or ")"
| numeral
| string
]

patterns_or: [
| patterns_or "|" pattern
| pattern
]

record_patterns_opt: [
| record_patterns_opt ";" record_pattern
| record_pattern
| empty
]

record_pattern: [
| qualid ":=" pattern
]

vernac: [
| "Local" vernac_poly
| "Global" vernac_poly
| vernac_poly
]

vernac_poly: [
| "Polymorphic" vernac_aux
| "Monomorphic" vernac_aux
| vernac_aux
]

vernac_aux: [
| "Program" gallina "."
| "Program" gallina_ext "."
| gallina "."
| gallina_ext "."
| command "."
| tactic_mode "."
| syntax "."
| subprf
| query_command
]

subprf: [
| bullet
| "{"
| "}"
]

gallina: [
| thm_token ident_decl binders_opt ":" term with_list_opt
| assumption_token inline assum_list
| assumptions_token inline assum_list
| def_token ident_decl def_body
| "Let" ident def_body
| cumulativity_token_opt private_token finite_token inductive_definition_list
| "Fixpoint" fix_definition_list
| "Let" "Fixpoint" fix_definition_list
| "CoFixpoint" cofix_definition_list
| "Let" "CoFixpoint" cofix_definition_list
| "Scheme" scheme_list
| "Combined" "Scheme" ident "from" ident_list_comma
| "Register" qualid "as" qualid
| "Register" "Inline" qualid
| "Primitive" ident term_opt ":=" register_token
| "Universe" ident_list
| "Universes" ident_list
| "Constraint" univ_constraint_list_comma
]

term_opt: [
| ":" term
| empty
]

univ_constraint_list_comma: [
| univ_constraint_list_comma "," univ_constraint
| univ_constraint
]

with_list_opt: [
| with_list_opt "with" ident_decl binders_opt ":" term
| empty
]

cumulativity_token_opt: [
| cumulativity_token
| empty
]

inductive_definition_list: [
| inductive_definition_list "with" inductive_definition
| inductive_definition
]

fix_definition_list: [
| fix_definition_list "with" fix_definition
| fix_definition
]

fix_definition: [
| ident_decl binders_opt fixannot_opt colon_term_opt term_opt2 decl_notation
]

term_opt2: [
| ":=" term
| empty
]

cofix_definition_list: [
| cofix_definition_list "with" cofix_definition
| cofix_definition
]

scheme_list: [
| scheme_list "with" scheme
| scheme
]

ident_list_comma: [
| ident_list_comma "," ident
| ident
]

register_token: [
| register_prim_token
| "#int63_type"
| "#float64_type"
]

register_prim_token: [
| "#int63_head0"
| "#int63_tail0"
| "#int63_add"
| "#int63_sub"
| "#int63_mul"
| "#int63_div"
| "#int63_mod"
| "#int63_lsr"
| "#int63_lsl"
| "#int63_land"
| "#int63_lor"
| "#int63_lxor"
| "#int63_addc"
| "#int63_subc"
| "#int63_addcarryc"
| "#int63_subcarryc"
| "#int63_mulc"
| "#int63_diveucl"
| "#int63_div21"
| "#int63_addmuldiv"
| "#int63_eq"
| "#int63_lt"
| "#int63_le"
| "#int63_compare"
| "#float64_opp"
| "#float64_abs"
| "#float64_eq"
| "#float64_lt"
| "#float64_le"
| "#float64_compare"
| "#float64_classify"
| "#float64_add"
| "#float64_sub"
| "#float64_mul"
| "#float64_div"
| "#float64_sqrt"
| "#float64_of_int63"
| "#float64_normfr_mantissa"
| "#float64_frshiftexp"
| "#float64_ldshiftexp"
| "#float64_next_up"
| "#float64_next_down"
]

thm_token: [
| "Theorem"
| "Lemma"
| "Fact"
| "Remark"
| "Corollary"
| "Proposition"
| "Property"
]

def_token: [
| "Definition"
| "Example"
| "SubClass"
]

assumption_token: [
| "Hypothesis"
| "Variable"
| "Axiom"
| "Parameter"
| "Conjecture"
]

assumptions_token: [
| "Hypotheses"
| "Variables"
| "Axioms"
| "Parameters"
| "Conjectures"
]

inline: [
| "Inline" "(" num ")"
| "Inline"
| empty
]

univ_constraint: [
| universe_name lt_alt universe_name
]

lt_alt: [
| "<"
| "="
| "<="
]

ident_decl: [
| ident univ_decl_opt
]

finite_token: [
| "Inductive"
| "CoInductive"
| "Variant"
| "Record"
| "Structure"
| "Class"
]

cumulativity_token: [
| "Cumulative"
| "NonCumulative"
]

private_token: [
| "Private"
| empty
]

def_body: [
| binders_opt ":=" reduce term
| binders_opt ":" term ":=" reduce term
| binders_opt ":" term
]

reduce: [
| "Eval" red_expr "in"
| empty
]

red_expr: [
| "red"
| "hnf"
| "simpl" delta_flag ref_or_pattern_occ_opt
| "cbv" strategy_flag
| "cbn" strategy_flag
| "lazy" strategy_flag
| "compute" delta_flag
| "vm_compute" ref_or_pattern_occ_opt
| "native_compute" ref_or_pattern_occ_opt
| "unfold" unfold_occ_list_comma
| "fold" term1_extended_list
| "pattern" pattern_occ_list_comma
| ident
]

strategy_flag: [
| red_flags_list
| delta_flag
]

red_flags_list: [
| red_flags_list red_flags
| red_flags
]

red_flags: [
| "beta"
| "iota"
| "match"
| "fix"
| "cofix"
| "zeta"
| "delta" delta_flag
]

delta_flag: [
| "-" "[" smart_global_list "]"
| "[" smart_global_list "]"
| empty
]

ref_or_pattern_occ_opt: [
| ref_or_pattern_occ
| empty
]

ref_or_pattern_occ: [
| smart_global occs
| term1_extended occs
]

unfold_occ_list_comma: [
| unfold_occ_list_comma "," unfold_occ
| unfold_occ
]

unfold_occ: [
| smart_global occs
]

pattern_occ_list_comma: [
| pattern_occ_list_comma "," pattern_occ
| pattern_occ
]

opt_constructors_or_fields: [
| ":=" constructor_list_or_record_decl
| empty
]

inductive_definition: [
| opt_coercion ident_decl binders_opt term_opt opt_constructors_or_fields decl_notation
]

opt_coercion: [
| ">"
| empty
]

constructor_list_or_record_decl: [
| "|" constructor_list_or
| ident constructor_type "|" constructor_list_or_opt
| ident constructor_type
| ident "{" record_fields "}"
| "{" record_fields "}"
| empty
]

constructor_list_or: [
| constructor_list_or "|" constructor
| constructor
]

constructor_list_or_opt: [
| constructor_list_or
| empty
]

assum_list: [
| assum_coe_list
| simple_assum_coe
]

assum_coe_list: [
| assum_coe_list assum_coe
| assum_coe
]

assum_coe: [
| "(" simple_assum_coe ")"
]

simple_assum_coe: [
| ident_decl_list of_type_with_opt_coercion term
]

ident_decl_list: [
| ident_decl_list ident_decl
| ident_decl
]

constructor_type: [
| binders_opt of_type_with_opt_coercion_opt
]

of_type_with_opt_coercion_opt: [
| of_type_with_opt_coercion term
| empty
]

constructor: [
| ident constructor_type
]

cofix_definition: [
| ident_decl binders_opt colon_term_opt term_opt2 decl_notation
]

scheme: [
| scheme_kind
| ident ":=" scheme_kind
]

scheme_kind: [
| "Induction" "for" smart_global "Sort" sort_family
| "Minimality" "for" smart_global "Sort" sort_family
| "Elimination" "for" smart_global "Sort" sort_family
| "Case" "for" smart_global "Sort" sort_family
| "Equality" "for" smart_global
]

sort_family: [
| "Set"
| "Prop"
| "SProp"
| "Type"
]

smart_global: [
| qualid
| by_notation
]

by_notation: [
| string ident_opt2
]

ident_opt2: [
| "%" ident
| empty
]

gallina_ext: [
| "Module" export_token ident module_binder_list_opt of_module_type is_module_expr
| "Module" "Type" ident module_binder_list_opt module_type_inl_list_opt is_module_type
| "Declare" "Module" export_token ident module_binder_list_opt ":" module_type_inl
| "Section" ident
| "Chapter" ident
| "End" ident
| "Collection" ident ":=" section_subset_expr
| "Require" export_token qualid_list
| "From" qualid "Require" export_token qualid_list
| "Import" qualid_list
| "Export" qualid_list
| "Include" module_type_inl module_expr_inl_list_opt
| "Include" "Type" module_type_inl module_type_inl_list_opt
| "Transparent" smart_global_list
| "Opaque" smart_global_list
| "Strategy" strategy_level_list
| "Canonical" Structure_opt qualid univ_decl_opt2
| "Canonical" Structure_opt by_notation
| "Coercion" qualid univ_decl_opt def_body
| "Identity" "Coercion" ident ":" class_rawexpr ">->" class_rawexpr
| "Coercion" qualid ":" class_rawexpr ">->" class_rawexpr
| "Coercion" by_notation ":" class_rawexpr ">->" class_rawexpr
| "Context" binders
| "Instance" instance_name ":" term hint_info fields_def_opt
| "Existing" "Instance" qualid hint_info
| "Existing" "Instances" qualid_list num_opt2
| "Existing" "Class" qualid
| "Arguments" smart_global argument_spec_block_list_opt more_implicits_block_opt arguments_modifier_opt
| "Implicit" "Type" reserv_list
| "Implicit" "Types" reserv_list
| "Generalizable" All_alt
| "Export" "Set" ident_list option_setting
| "Export" "Unset" ident_list
]

smart_global_list: [
| smart_global_list smart_global
| smart_global
]

num_opt: [
| num
| empty
]

qualid_list: [
| qualid_list qualid
| qualid
]

option_setting: [
| empty
| int
| string
]

class_rawexpr: [
| "Funclass"
| "Sortclass"
| smart_global
]

hint_info: [
| "|" num_opt term1_extended_opt
| empty
]

module_binder_list_opt: [
| module_binder_list_opt "(" export_token ident_list ":" module_type_inl ")"
| empty
]

module_type_inl_list_opt: [
| module_type_inl_list_opt module_type_inl
| empty
]

module_expr_inl_list_opt: [
| module_expr_inl_list_opt module_expr_inl
| empty
]

strategy_level_list: [
| strategy_level_list strategy_level "[" smart_global_list "]"
| strategy_level "[" smart_global_list "]"
]

fields_def_opt: [
| ":=" "{" fields_def "}"
| ":=" term
| empty
]

argument_spec_block_list_opt: [
| argument_spec_block_list_opt argument_spec_block
| empty
]

more_implicits_block_opt: [
| "," more_implicits_block_list_comma
| empty
]

more_implicits_block_list_comma: [
| more_implicits_block_list_comma "," more_implicits_block_list_opt
| more_implicits_block_list_opt
]

arguments_modifier_opt: [
| ":" arguments_modifier_list_comma
| empty
]

arguments_modifier_list_comma: [
| arguments_modifier_list_comma "," arguments_modifier
| arguments_modifier
]

All_alt: [
| "All" "Variables"
| "No" "Variables"
| Variable_alt ident_list
]

Variable_alt: [
| "Variable"
| "Variables"
]

more_implicits_block_list_opt: [
| more_implicits_block_list_opt more_implicits_block
| empty
]

univ_decl_opt2: [
| univ_decl_opt def_body
| empty
]

univ_decl_opt: [
| "@{" ident_list_opt plus_opt univ_constraint_alt
| empty
]

plus_opt: [
| "+"
| empty
]

univ_constraint_alt: [
| "|" univ_constraint_list_comma_opt plus_opt "}"
| rbrace_alt
]

univ_constraint_list_comma_opt: [
| univ_constraint_list_comma
| empty
]

rbrace_alt: [
| "}"
| "|}"
]

export_token: [
| "Import"
| "Export"
| empty
]

of_module_type: [
| ":" module_type_inl
| module_type_inl_list_opt
]

is_module_type: [
| ":=" module_type_inl module_type_inl_list_opt
| empty
]

is_module_expr: [
| ":=" module_expr_inl module_expr_inl_list_opt
| empty
]

functor_app_annot: [
| "[" "inline" "at" "level" num "]"
| "[" "no" "inline" "]"
| empty
]

module_expr_inl: [
| "!" module_expr
| module_expr functor_app_annot
]

module_type_inl: [
| "!" module_type
| module_type functor_app_annot
]

module_expr: [
| module_expr_atom
| module_expr module_expr_atom
]

module_expr_atom: [
| qualid
| "(" module_expr ")"
]

module_type: [
| qualid
| "(" module_type ")"
| module_type module_expr_atom
| module_type "with" with_declaration
]

with_declaration: [
| "Definition" qualid univ_decl_opt ":=" term
| "Module" qualid ":=" qualid
]

argument_spec_block: [
| exclam_opt name scope_delimiter_opt
| "/"
| "&"
| "(" scope_delimiter_list ")" scope_delimiter_opt
| "[" scope_delimiter_list "]" scope_delimiter_opt
| "{" scope_delimiter_list "}" scope_delimiter_opt
]

scope_delimiter_opt: [
| "%" ident
| empty
]

scope_delimiter_list: [
| scope_delimiter_list scope_delimiter_opt
| scope_delimiter_opt
]

more_implicits_block: [
| name
| "[" names "]"
| "{" names "}"
]

strategy_level: [
| "expand"
| "opaque"
| int
| "transparent"
]

instance_name: [
| ident_decl binders_opt
| empty
]

reserv_list: [
| reserv_tuple_list
| simple_reserv
]

reserv_tuple_list: [
| reserv_tuple_list reserv_tuple
| reserv_tuple
]

reserv_tuple: [
| "(" simple_reserv ")"
]

simple_reserv: [
| ident_list ":" term
]

arguments_modifier: [
| "simpl" "nomatch"
| "simpl" "never"
| "default" "implicits"
| "clear" "implicits"
| "clear" "scopes"
| "clear" "bidirectionality" "hint"
| "rename"
| "assert"
| "extra" "scopes"
| "clear" "scopes" "and" "implicits"
| "clear" "implicits" "and" "scopes"
]

Structure_opt: [
| "Structure"
| empty
]

command: [
| "Goal" term
| "Comments" comment_list_opt
| "Declare" "Instance" ident_decl binders_opt ":" term hint_info
| "Declare" "Scope" ident
| "Pwd"
| "Cd"
| "Cd" string
| "Load" Verbose_opt string_alt
| "Declare" "ML" "Module" string_list
| "Locate" locatable
| "Add" "LoadPath" string as_dirpath
| "Add" "Rec" "LoadPath" string as_dirpath
| "Remove" "LoadPath" string
| "AddPath" string "as" as_dirpath
| "AddRecPath" string "as" as_dirpath
| "DelPath" string
| "Type" term
| "Print" printable
| "Print" smart_global univ_name_list_opt
| "Print" "Module" "Type" qualid
| "Print" "Module" qualid
| "Print" "Namespace" dirpath
| "Inspect" num
| "Add" "ML" "Path" string
| "Add" "Rec" "ML" "Path" string
| "Set" ident_list option_setting
| "Unset" ident_list
| "Print" "Table" ident_list
| "Add" ident ident option_ref_value_list
| "Add" ident option_ref_value_list
| "Test" ident_list "for" option_ref_value_list
| "Test" ident_list
| "Remove" ident ident option_ref_value_list
| "Remove" ident option_ref_value_list
| "Write" "State" ident
| "Write" "State" string
| "Restore" "State" ident
| "Restore" "State" string
| "Reset" "Initial"
| "Reset" ident
| "Back"
| "Back" num
| "Debug" "On"
| "Debug" "Off"
| "Declare" "Reduction" ident ":=" red_expr
| "Declare" "Custom" "Entry" ident
| "Derive" ident "SuchThat" term1_extended "As" ident      (* derive plugin *)
| "Proof"
| "Proof" "Mode" string
| "Proof" term
| "Abort"
| "Abort" "All"
| "Abort" ident
| "Existential" num constr_body
| "Admitted"
| "Qed"
| "Save" ident
| "Defined"
| "Defined" ident
| "Restart"
| "Undo"
| "Undo" num
| "Undo" "To" num
| "Focus"
| "Focus" num
| "Unfocus"
| "Unfocused"
| "Show"
| "Show" num
| "Show" ident
| "Show" "Existentials"
| "Show" "Universes"
| "Show" "Conjectures"
| "Show" "Proof"
| "Show" "Intro"
| "Show" "Intros"
| "Show" "Match" qualid
| "Guarded"
| "Create" "HintDb" ident discriminated_opt
| "Remove" "Hints" qualid_list opt_hintbases
| "Hint" hint opt_hintbases
| "Obligation" int "of" ident ":" term withtac
| "Obligation" int "of" ident withtac
| "Obligation" int ":" term withtac
| "Obligation" int withtac
| "Next" "Obligation" "of" ident withtac
| "Next" "Obligation" withtac
| "Solve" "Obligation" int "of" ident "with" ltac_expr
| "Solve" "Obligation" int "with" ltac_expr
| "Solve" "Obligations" "of" ident "with" ltac_expr
| "Solve" "Obligations" "with" ltac_expr
| "Solve" "Obligations"
| "Solve" "All" "Obligations" "with" ltac_expr
| "Solve" "All" "Obligations"
| "Admit" "Obligations" "of" ident
| "Admit" "Obligations"
| "Obligation" "Tactic" ":=" ltac_expr
| "Show" "Obligation" "Tactic"
| "Obligations" "of" ident
| "Obligations"
| "Preterm" "of" ident
| "Preterm"
| "Add" "Relation" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "symmetry" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "symmetry" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "symmetry" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "symmetry" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Relation" term1_extended term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "symmetry" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "symmetry" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "symmetry" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "reflexivity" "proved" "by" term1_extended "symmetry" "proved" "by" term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Parametric" "Relation" binders_opt ":" term1_extended term1_extended "transitivity" "proved" "by" term1_extended "as" ident
| "Add" "Setoid" term1_extended term1_extended term1_extended "as" ident
| "Add" "Parametric" "Setoid" binders_opt ":" term1_extended term1_extended term1_extended "as" ident
| "Add" "Morphism" term1_extended ":" ident
| "Declare" "Morphism" term1_extended ":" ident
| "Add" "Morphism" term1_extended "with" "signature" term "as" ident
| "Add" "Parametric" "Morphism" binders_opt ":" term1_extended "with" "signature" term "as" ident
| "Grab" "Existential" "Variables"
| "Unshelve"
| "Declare" "Equivalent" "Keys" term1_extended term1_extended
| "Print" "Equivalent" "Keys"
| "Optimize" "Proof"
| "Optimize" "Heap"
| "Reset" "Ltac" "Profile"
| "Show" "Ltac" "Profile"
| "Show" "Ltac" "Profile" "CutOff" int
| "Show" "Ltac" "Profile" string
| "Add" "InjTyp" term1_extended      (* micromega plugin *)
| "Add" "BinOp" term1_extended      (* micromega plugin *)
| "Add" "UnOp" term1_extended      (* micromega plugin *)
| "Add" "CstOp" term1_extended      (* micromega plugin *)
| "Add" "BinRel" term1_extended      (* micromega plugin *)
| "Add" "PropOp" term1_extended      (* micromega plugin *)
| "Add" "PropUOp" term1_extended      (* micromega plugin *)
| "Add" "Spec" term1_extended      (* micromega plugin *)
| "Add" "BinOpSpec" term1_extended      (* micromega plugin *)
| "Add" "UnOpSpec" term1_extended      (* micromega plugin *)
| "Add" "Saturate" term1_extended      (* micromega plugin *)
| "Show" "Zify" "InjTyp"      (* micromega plugin *)
| "Show" "Zify" "BinOp"      (* micromega plugin *)
| "Show" "Zify" "UnOp"      (* micromega plugin *)
| "Show" "Zify" "CstOp"      (* micromega plugin *)
| "Show" "Zify" "BinRel"      (* micromega plugin *)
| "Show" "Zify" "Spec"      (* micromega plugin *)
| "Add" "Ring" ident ":" term1_extended ring_mods_opt      (* setoid_ring plugin *)
| "Hint" "Cut" "[" hints_path "]" opthints
| "Typeclasses" "Transparent" qualid_list_opt
| "Typeclasses" "Opaque" qualid_list_opt
| "Typeclasses" "eauto" ":=" debug eauto_search_strategy int_opt
| "Print" "Rewrite" "HintDb" ident
| "Proof" "with" ltac_expr using_opt
| "Proof" "using" section_subset_expr with_opt
| "Tactic" "Notation" ltac_tactic_level_opt ltac_production_item_list ":=" ltac_expr
| "Print" "Ltac" qualid
| "Locate" "Ltac" qualid
| "Ltac" tacdef_body_list
| "Print" "Ltac" "Signatures"
| "Set" "Firstorder" "Solver" ltac_expr
| "Print" "Firstorder" "Solver"
| "Extraction" qualid      (* extraction plugin *)
| "Recursive" "Extraction" qualid_list      (* extraction plugin *)
| "Extraction" string qualid_list      (* extraction plugin *)
| "Extraction" "TestCompile" qualid_list      (* extraction plugin *)
| "Separate" "Extraction" qualid_list      (* extraction plugin *)
| "Extraction" "Library" ident      (* extraction plugin *)
| "Recursive" "Extraction" "Library" ident      (* extraction plugin *)
| "Extraction" "Language" language      (* extraction plugin *)
| "Extraction" "Inline" qualid_list      (* extraction plugin *)
| "Extraction" "NoInline" qualid_list      (* extraction plugin *)
| "Print" "Extraction" "Inline"      (* extraction plugin *)
| "Reset" "Extraction" "Inline"      (* extraction plugin *)
| "Extraction" "Implicit" qualid "[" int_or_id_list_opt "]"      (* extraction plugin *)
| "Extraction" "Blacklist" ident_list      (* extraction plugin *)
| "Print" "Extraction" "Blacklist"      (* extraction plugin *)
| "Reset" "Extraction" "Blacklist"      (* extraction plugin *)
| "Extract" "Constant" qualid string_list_opt "=>" mlname      (* extraction plugin *)
| "Extract" "Inlined" "Constant" qualid "=>" mlname      (* extraction plugin *)
| "Extract" "Inductive" qualid "=>" mlname "[" mlname_list_opt "]" string_opt      (* extraction plugin *)
| "Show" "Extraction"      (* extraction plugin *)
| "Function" fix_definition_list      (* funind plugin *)
| "Functional" "Scheme" fun_scheme_arg_list      (* funind plugin *)
| "Functional" "Case" fun_scheme_arg      (* funind plugin *)
| "Generate" "graph" "for" qualid      (* funind plugin *)
| "Hint" "Rewrite" orient term1_extended_list ":" ident_list_opt
| "Hint" "Rewrite" orient term1_extended_list "using" ltac_expr ":" ident_list_opt
| "Hint" "Rewrite" orient term1_extended_list
| "Hint" "Rewrite" orient term1_extended_list "using" ltac_expr
| "Derive" "Inversion_clear" ident "with" term1_extended "Sort" sort_family
| "Derive" "Inversion_clear" ident "with" term1_extended
| "Derive" "Inversion" ident "with" term1_extended "Sort" sort_family
| "Derive" "Inversion" ident "with" term1_extended
| "Derive" "Dependent" "Inversion" ident "with" term1_extended "Sort" sort_family
| "Derive" "Dependent" "Inversion_clear" ident "with" term1_extended "Sort" sort_family
| "Declare" "Left" "Step" term1_extended
| "Declare" "Right" "Step" term1_extended
| "Print" "Rings"      (* setoid_ring plugin *)
| "Add" "Field" ident ":" term1_extended field_mods_opt      (* setoid_ring plugin *)
| "Print" "Fields"      (* setoid_ring plugin *)
| "Numeral" "Notation" qualid qualid qualid ":" ident numnotoption
| "String" "Notation" qualid qualid qualid ":" ident
]

orient: [
| "->"
| "<-"
| empty
]

string_opt: [
| string
| empty
]

qualid_list_opt: [
| qualid_list_opt qualid
| empty
]

univ_name_list_opt: [
| "@{" name_list_opt "}"
| empty
]

name_list_opt: [
| name_list_opt name
| empty
]

section_subset_expr: [
| starredidentref_list_opt
| ssexpr
]

ssexpr: [
| "-" ssexpr50
| ssexpr50
]

ssexpr50: [
| ssexpr0 "-" ssexpr0
| ssexpr0 "+" ssexpr0
| ssexpr0
]

ssexpr0: [
| starredidentref
| "(" starredidentref_list_opt ")"
| "(" starredidentref_list_opt ")" "*"
| "(" ssexpr ")"
| "(" ssexpr ")" "*"
]

starredidentref_list_opt: [
| starredidentref_list_opt starredidentref
| empty
]

starredidentref: [
| ident
| ident "*"
| "Type"
| "Type" "*"
]

int_opt: [
| int
| empty
]

using_opt: [
| "using" section_subset_expr
| empty
]

with_opt: [
| "with" ltac_expr
| empty
]

ltac_tactic_level_opt: [
| "(" "at" "level" num ")"
| empty
]

ltac_production_item_list: [
| ltac_production_item_list ltac_production_item
| ltac_production_item
]

tacdef_body_list: [
| tacdef_body_list "with" tacdef_body
| tacdef_body
]

printable: [
| "Term" smart_global univ_name_list_opt
| "All"
| "Section" qualid
| "Grammar" ident
| "Custom" "Grammar" ident
| "LoadPath" dirpath_opt
| "Modules"
| "Libraries"
| "ML" "Path"
| "ML" "Modules"
| "Debug" "GC"
| "Graph"
| "Classes"
| "TypeClasses"
| "Instances" smart_global
| "Coercions"
| "Coercion" "Paths" class_rawexpr class_rawexpr
| "Canonical" "Projections"
| "Typing" "Flags"
| "Tables"
| "Options"
| "Hint"
| "Hint" smart_global
| "Hint" "*"
| "HintDb" ident
| "Scopes"
| "Scope" ident
| "Visibility" ident_opt
| "Implicit" smart_global
| Sorted_opt "Universes" printunivs_subgraph_opt string_opt
| "Assumptions" smart_global
| "Opaque" "Dependencies" smart_global
| "Transparent" "Dependencies" smart_global
| "All" "Dependencies" smart_global
| "Strategy" smart_global
| "Strategies"
| "Registered"
]

dirpath_opt: [
| dirpath
| empty
]

dirpath: [
| ident
| dirpath field
]

Sorted_opt: [
| "Sorted"
| empty
]

printunivs_subgraph_opt: [
| "Subgraph" "(" qualid_list_opt ")"
| empty
]

comment_list_opt: [
| comment_list_opt comment
| empty
]

Verbose_opt: [
| "Verbose"
| empty
]

string_alt: [
| string
| ident
]

string_list: [
| string_list string
| string
]

option_ref_value_list: [
| option_ref_value_list option_ref_value
| option_ref_value
]

discriminated_opt: [
| "discriminated"
| empty
]

string_list_opt: [
| string_list_opt string
| empty
]

mlname_list_opt: [
| mlname_list_opt mlname
| empty
]

fun_scheme_arg_list: [
| fun_scheme_arg_list "with" fun_scheme_arg
| fun_scheme_arg
]

term1_extended_list: [
| term1_extended_list term1_extended
| term1_extended
]

ring_mods_opt: [
| "(" ring_mod_list_comma ")"      (* setoid_ring plugin *)
| empty
]

field_mods_opt: [
| "(" field_mod_list_comma ")"      (* setoid_ring plugin *)
| empty
]

locatable: [
| smart_global
| "Term" smart_global
| "File" string
| "Library" qualid
| "Module" qualid
]

option_ref_value: [
| qualid
| string
]

as_dirpath: [
| "as" dirpath
| empty
]

comment: [
| term1_extended
| string
| num
]

reference_or_constr: [
| qualid
| term1_extended
]

hint: [
| "Resolve" reference_or_constr_list hint_info
| "Resolve" "->" qualid_list num_opt
| "Resolve" "<-" qualid_list num_opt
| "Immediate" reference_or_constr_list
| "Variables" "Transparent"
| "Variables" "Opaque"
| "Constants" "Transparent"
| "Constants" "Opaque"
| "Transparent" qualid_list
| "Opaque" qualid_list
| "Mode" qualid plus_list
| "Unfold" qualid_list
| "Constructors" qualid_list
| "Extern" num term1_extended_opt "=>" ltac_expr
]

reference_or_constr_list: [
| reference_or_constr_list reference_or_constr
| reference_or_constr
]

constr_body: [
| ":=" term
| ":" term ":=" term
]

plus_list: [
| plus_list plus_alt
| plus_alt
]

plus_alt: [
| "+"
| "!"
| "-"
]

withtac: [
| "with" ltac_expr
| empty
]

ltac_def_kind: [
| ":="
| "::="
]

tacdef_body: [
| qualid fun_var_list ltac_def_kind ltac_expr
| qualid ltac_def_kind ltac_expr
]

ltac_production_item: [
| string
| ident "(" ident ltac_production_sep_opt ")"
| ident
]

ltac_production_sep_opt: [
| "," string
| empty
]

numnotoption: [
| empty
| "(" "warning" "after" num ")"
| "(" "abstract" "after" num ")"
]

mlname: [
| ident      (* extraction plugin *)
| string      (* extraction plugin *)
]

int_or_id: [
| ident      (* extraction plugin *)
| int      (* extraction plugin *)
]

language: [
| "Ocaml"      (* extraction plugin *)
| "OCaml"      (* extraction plugin *)
| "Haskell"      (* extraction plugin *)
| "Scheme"      (* extraction plugin *)
| "JSON"      (* extraction plugin *)
]

fun_scheme_arg: [
| ident ":=" "Induction" "for" qualid "Sort" sort_family      (* funind plugin *)
]

ring_mod: [
| "decidable" term1_extended      (* setoid_ring plugin *)
| "abstract"      (* setoid_ring plugin *)
| "morphism" term1_extended      (* setoid_ring plugin *)
| "constants" "[" ltac_expr "]"      (* setoid_ring plugin *)
| "closed" "[" qualid_list "]"      (* setoid_ring plugin *)
| "preprocess" "[" ltac_expr "]"      (* setoid_ring plugin *)
| "postprocess" "[" ltac_expr "]"      (* setoid_ring plugin *)
| "setoid" term1_extended term1_extended      (* setoid_ring plugin *)
| "sign" term1_extended      (* setoid_ring plugin *)
| "power" term1_extended "[" qualid_list "]"      (* setoid_ring plugin *)
| "power_tac" term1_extended "[" ltac_expr "]"      (* setoid_ring plugin *)
| "div" term1_extended      (* setoid_ring plugin *)
]

ring_mod_list_comma: [
| ring_mod_list_comma "," ring_mod
| ring_mod
]

field_mod: [
| ring_mod      (* setoid_ring plugin *)
| "completeness" term1_extended      (* setoid_ring plugin *)
]

field_mod_list_comma: [
| field_mod_list_comma "," field_mod
| field_mod
]

debug: [
| "debug"
| empty
]

eauto_search_strategy: [
| "(bfs)"
| "(dfs)"
| empty
]

hints_path_atom: [
| qualid_list
| "_"
]

hints_path: [
| "(" hints_path ")"
| hints_path "*"
| "emp"
| "eps"
| hints_path "|" hints_path
| hints_path_atom
| hints_path hints_path
]

opthints: [
| ":" ident_list
| empty
]

opt_hintbases: [
| empty
| ":" ident_list
]

int_or_id_list_opt: [
| int_or_id_list_opt int_or_id
| empty
]

query_command: [
| "Eval" red_expr "in" term "."
| "Compute" term "."
| "Check" term "."
| "About" smart_global univ_name_list_opt "."
| "SearchHead" term1_extended in_or_out_modules "."
| "SearchPattern" term1_extended in_or_out_modules "."
| "SearchRewrite" term1_extended in_or_out_modules "."
| "Search" searchabout_query searchabout_queries "."
| "SearchAbout" searchabout_query searchabout_queries "."
| "SearchAbout" "[" searchabout_query_list "]" in_or_out_modules "."
]

ne_in_or_out_modules: [
| "inside" qualid_list
| "outside" qualid_list
]

in_or_out_modules: [
| ne_in_or_out_modules
| empty
]

positive_search_mark: [
| "-"
| empty
]

searchabout_query: [
| positive_search_mark string scope_delimiter_opt
| positive_search_mark term1_extended
]

searchabout_queries: [
| ne_in_or_out_modules
| searchabout_query searchabout_queries
| empty
]

searchabout_query_list: [
| searchabout_query_list searchabout_query
| searchabout_query
]

syntax: [
| "Open" "Scope" ident
| "Close" "Scope" ident
| "Delimit" "Scope" ident "with" ident
| "Undelimit" "Scope" ident
| "Bind" "Scope" ident "with" class_rawexpr_list
| "Infix" string ":=" term1_extended syntax_modifier_opt ident_opt3
| "Notation" ident ident_list_opt ":=" term1_extended only_parsing
| "Notation" string ":=" term1_extended syntax_modifier_opt ident_opt3
| "Format" "Notation" string string string
| "Reserved" "Infix" string syntax_modifier_opt
| "Reserved" "Notation" string syntax_modifier_opt
]

class_rawexpr_list: [
| class_rawexpr_list class_rawexpr
| class_rawexpr
]

syntax_modifier_opt: [
| "(" syntax_modifier_list_comma ")"
| empty
]

syntax_modifier_list_comma: [
| syntax_modifier_list_comma "," syntax_modifier
| syntax_modifier
]

only_parsing: [
| "(" "only" "parsing" ")"
| "(" "compat" string ")"
| empty
]

level: [
| "level" num
| "next" "level"
]

syntax_modifier: [
| "at" "level" num
| "in" "custom" ident
| "in" "custom" ident "at" "level" num
| "left" "associativity"
| "right" "associativity"
| "no" "associativity"
| "only" "printing"
| "only" "parsing"
| "compat" string
| "format" string string_opt
| ident "," ident_list_comma "at" level
| ident "at" level
| ident "at" level constr_as_binder_kind
| ident constr_as_binder_kind
| ident syntax_extension_type
]

syntax_extension_type: [
| "ident"
| "global"
| "bigint"
| "binder"
| "constr"
| "constr" level_opt constr_as_binder_kind_opt
| "pattern"
| "pattern" "at" "level" num
| "strict" "pattern"
| "strict" "pattern" "at" "level" num
| "closed" "binder"
| "custom" ident level_opt constr_as_binder_kind_opt
]

level_opt: [
| level
| empty
]

constr_as_binder_kind_opt: [
| constr_as_binder_kind
| empty
]

constr_as_binder_kind: [
| "as" "ident"
| "as" "pattern"
| "as" "strict" "pattern"
]

simple_tactic: [
| "reflexivity"
| "exact" term1_extended
| "assumption"
| "etransitivity"
| "cut" term1_extended
| "exact_no_check" term1_extended
| "vm_cast_no_check" term1_extended
| "native_cast_no_check" term1_extended
| "casetype" term1_extended
| "elimtype" term1_extended
| "lapply" term1_extended
| "transitivity" term1_extended
| "left"
| "eleft"
| "left" "with" bindings
| "eleft" "with" bindings
| "right"
| "eright"
| "right" "with" bindings
| "eright" "with" bindings
| "constructor"
| "constructor" int_or_var
| "constructor" int_or_var "with" bindings
| "econstructor"
| "econstructor" int_or_var
| "econstructor" int_or_var "with" bindings
| "specialize" constr_with_bindings
| "specialize" constr_with_bindings "as" simple_intropattern
| "symmetry"
| "symmetry" "in" in_clause
| "split"
| "esplit"
| "split" "with" bindings
| "esplit" "with" bindings
| "exists"
| "exists" bindings_list_comma
| "eexists"
| "eexists" bindings_list_comma
| "intros" "until" quantified_hypothesis
| "intro"
| "intro" ident
| "intro" ident "at" "top"
| "intro" ident "at" "bottom"
| "intro" ident "after" ident
| "intro" ident "before" ident
| "intro" "at" "top"
| "intro" "at" "bottom"
| "intro" "after" ident
| "intro" "before" ident
| "move" ident "at" "top"
| "move" ident "at" "bottom"
| "move" ident "after" ident
| "move" ident "before" ident
| "rename" rename_list_comma
| "revert" ident_list
| "simple" "induction" quantified_hypothesis
| "simple" "destruct" quantified_hypothesis
| "double" "induction" quantified_hypothesis quantified_hypothesis
| "admit"
| "fix" ident num
| "cofix" ident
| "clear" ident_list_opt
| "clear" "-" ident_list
| "clearbody" ident_list
| "generalize" "dependent" term1_extended
| "replace" term1_extended "with" term1_extended clause_dft_concl by_arg_tac
| "replace" "->" term1_extended clause_dft_concl
| "replace" "<-" term1_extended clause_dft_concl
| "replace" term1_extended clause_dft_concl
| "simplify_eq"
| "simplify_eq" destruction_arg
| "esimplify_eq"
| "esimplify_eq" destruction_arg
| "discriminate"
| "discriminate" destruction_arg
| "ediscriminate"
| "ediscriminate" destruction_arg
| "injection"
| "injection" destruction_arg
| "einjection"
| "einjection" destruction_arg
| "injection" "as" simple_intropattern_list_opt
| "injection" destruction_arg "as" simple_intropattern_list_opt
| "einjection" "as" simple_intropattern_list_opt
| "einjection" destruction_arg "as" simple_intropattern_list_opt
| "simple" "injection"
| "simple" "injection" destruction_arg
| "dependent" "rewrite" orient term1_extended
| "dependent" "rewrite" orient term1_extended "in" ident
| "cutrewrite" orient term1_extended
| "cutrewrite" orient term1_extended "in" ident
| "decompose" "sum" term1_extended
| "decompose" "record" term1_extended
| "absurd" term1_extended
| "contradiction" constr_with_bindings_opt
| "autorewrite" "with" ident_list clause_dft_concl
| "autorewrite" "with" ident_list clause_dft_concl "using" ltac_expr
| "autorewrite" "*" "with" ident_list clause_dft_concl
| "autorewrite" "*" "with" ident_list clause_dft_concl "using" ltac_expr
| "rewrite" "*" orient term1_extended "in" ident "at" occurrences by_arg_tac
| "rewrite" "*" orient term1_extended "at" occurrences "in" ident by_arg_tac
| "rewrite" "*" orient term1_extended "in" ident by_arg_tac
| "rewrite" "*" orient term1_extended "at" occurrences by_arg_tac
| "rewrite" "*" orient term1_extended by_arg_tac
| "refine" term1_extended
| "simple" "refine" term1_extended
| "notypeclasses" "refine" term1_extended
| "simple" "notypeclasses" "refine" term1_extended
| "solve_constraints"
| "subst" ident_list
| "subst"
| "simple" "subst"
| "evar" "(" ident ":" term ")"
| "evar" term1_extended
| "instantiate" "(" ident ":=" term ")"
| "instantiate" "(" int ":=" term ")" hloc
| "instantiate"
| "stepl" term1_extended "by" ltac_expr
| "stepl" term1_extended
| "stepr" term1_extended "by" ltac_expr
| "stepr" term1_extended
| "generalize_eqs" ident
| "dependent" "generalize_eqs" ident
| "generalize_eqs_vars" ident
| "dependent" "generalize_eqs_vars" ident
| "specialize_eqs" ident
| "hresolve_core" "(" ident ":=" term1_extended ")" "at" int_or_var "in" term1_extended
| "hresolve_core" "(" ident ":=" term1_extended ")" "in" term1_extended
| "hget_evar" int_or_var
| "destauto"
| "destauto" "in" ident
| "transparent_abstract" ltac_expr3
| "transparent_abstract" ltac_expr3 "using" ident
| "constr_eq" term1_extended term1_extended
| "constr_eq_strict" term1_extended term1_extended
| "constr_eq_nounivs" term1_extended term1_extended
| "is_evar" term1_extended
| "has_evar" term1_extended
| "is_var" term1_extended
| "is_fix" term1_extended
| "is_cofix" term1_extended
| "is_ind" term1_extended
| "is_constructor" term1_extended
| "is_proj" term1_extended
| "is_const" term1_extended
| "shelve"
| "shelve_unifiable"
| "unshelve" ltac_expr1
| "give_up"
| "cycle" int_or_var
| "swap" int_or_var int_or_var
| "revgoals"
| "guard" int_or_var comparison int_or_var
| "decompose" "[" term1_extended_list "]" term1_extended
| "optimize_heap"
| "start" "ltac" "profiling"
| "stop" "ltac" "profiling"
| "reset" "ltac" "profile"
| "show" "ltac" "profile"
| "show" "ltac" "profile" "cutoff" int
| "show" "ltac" "profile" string
| "restart_timer" string_opt
| "finish_timing" string_opt
| "finish_timing" "(" string ")" string_opt
| "eassumption"
| "eexact" term1_extended
| "trivial" auto_using hintbases
| "info_trivial" auto_using hintbases
| "debug" "trivial" auto_using hintbases
| "auto" int_or_var_opt auto_using hintbases
| "info_auto" int_or_var_opt auto_using hintbases
| "debug" "auto" int_or_var_opt auto_using hintbases
| "prolog" "[" term1_extended_list_opt "]" int_or_var
| "eauto" int_or_var_opt int_or_var_opt auto_using hintbases
| "new" "auto" int_or_var_opt auto_using hintbases
| "debug" "eauto" int_or_var_opt int_or_var_opt auto_using hintbases
| "info_eauto" int_or_var_opt int_or_var_opt auto_using hintbases
| "dfs" "eauto" int_or_var_opt auto_using hintbases
| "autounfold" hintbases clause_dft_concl
| "autounfold_one" hintbases "in" ident
| "autounfold_one" hintbases
| "unify" term1_extended term1_extended
| "unify" term1_extended term1_extended "with" ident
| "convert_concl_no_check" term1_extended
| "typeclasses" "eauto" "bfs" int_or_var_opt "with" ident_list
| "typeclasses" "eauto" int_or_var_opt "with" ident_list
| "typeclasses" "eauto" int_or_var_opt
| "head_of_constr" ident term1_extended
| "not_evar" term1_extended
| "is_ground" term1_extended
| "autoapply" term1_extended "using" ident
| "autoapply" term1_extended "with" ident
| "progress_evars" ltac_expr
| "rewrite_strat" rewstrategy
| "rewrite_db" ident "in" ident
| "rewrite_db" ident
| "substitute" orient constr_with_bindings
| "setoid_rewrite" orient constr_with_bindings
| "setoid_rewrite" orient constr_with_bindings "in" ident
| "setoid_rewrite" orient constr_with_bindings "at" occurrences
| "setoid_rewrite" orient constr_with_bindings "at" occurrences "in" ident
| "setoid_rewrite" orient constr_with_bindings "in" ident "at" occurrences
| "setoid_symmetry"
| "setoid_symmetry" "in" ident
| "setoid_reflexivity"
| "setoid_transitivity" term1_extended
| "setoid_etransitivity"
| "decide" "equality"
| "compare" term1_extended term1_extended
| "rewrite_strat" rewstrategy "in" ident
| "intros" intropattern_list_opt
| "eintros" intropattern_list_opt
| "apply" constr_with_bindings_arg_list_comma in_hyp_as
| "eapply" constr_with_bindings_arg_list_comma in_hyp_as
| "simple" "apply" constr_with_bindings_arg_list_comma in_hyp_as
| "simple" "eapply" constr_with_bindings_arg_list_comma in_hyp_as
| "elim" constr_with_bindings_arg eliminator_opt
| "eelim" constr_with_bindings_arg eliminator_opt
| "case" induction_clause_list
| "ecase" induction_clause_list
| "fix" ident num "with" fixdecl_list
| "cofix" ident "with" cofixdecl_list
| "pose" bindings_with_parameters
| "pose" term1_extended as_name
| "epose" bindings_with_parameters
| "epose" term1_extended as_name
| "set" bindings_with_parameters clause_dft_concl
| "set" term1_extended as_name clause_dft_concl
| "eset" bindings_with_parameters clause_dft_concl
| "eset" term1_extended as_name clause_dft_concl
| "remember" term1_extended as_name eqn_ipat clause_dft_all
| "eremember" term1_extended as_name eqn_ipat clause_dft_all
| "assert" "(" ident ":=" term ")"
| "eassert" "(" ident ":=" term ")"
| "assert" "(" ident ":" term ")" by_tactic
| "eassert" "(" ident ":" term ")" by_tactic
| "enough" "(" ident ":" term ")" by_tactic
| "eenough" "(" ident ":" term ")" by_tactic
| "assert" term1_extended as_ipat by_tactic
| "eassert" term1_extended as_ipat by_tactic
| "pose" "proof" term as_ipat
| "epose" "proof" term as_ipat
| "enough" term1_extended as_ipat by_tactic
| "eenough" term1_extended as_ipat by_tactic
| "generalize" term1_extended
| "generalize" term1_extended term1_extended_list
| "generalize" term1_extended occs as_name pattern_occ_list_opt
| "induction" induction_clause_list
| "einduction" induction_clause_list
| "destruct" induction_clause_list
| "edestruct" induction_clause_list
| "rewrite" oriented_rewriter_list_comma clause_dft_concl by_tactic
| "erewrite" oriented_rewriter_list_comma clause_dft_concl by_tactic
| "dependent" simple_alt quantified_hypothesis as_or_and_ipat with_opt2
| "simple" "inversion" quantified_hypothesis as_or_and_ipat in_hyp_list
| "inversion" quantified_hypothesis as_or_and_ipat in_hyp_list
| "inversion_clear" quantified_hypothesis as_or_and_ipat in_hyp_list
| "inversion" quantified_hypothesis "using" term1_extended in_hyp_list
| "red" clause_dft_concl
| "hnf" clause_dft_concl
| "simpl" delta_flag ref_or_pattern_occ_opt clause_dft_concl
| "cbv" strategy_flag clause_dft_concl
| "cbn" strategy_flag clause_dft_concl
| "lazy" strategy_flag clause_dft_concl
| "compute" delta_flag clause_dft_concl
| "vm_compute" ref_or_pattern_occ_opt clause_dft_concl
| "native_compute" ref_or_pattern_occ_opt clause_dft_concl
| "unfold" unfold_occ_list_comma clause_dft_concl
| "fold" term1_extended_list clause_dft_concl
| "pattern" pattern_occ_list_comma clause_dft_concl
| "change" conversion clause_dft_concl
| "change_no_check" conversion clause_dft_concl
| "btauto"
| "rtauto"
| "congruence"
| "congruence" int
| "congruence" "with" term1_extended_list
| "congruence" int "with" term1_extended_list
| "f_equal"
| "firstorder" ltac_expr_opt firstorder_using
| "firstorder" ltac_expr_opt "with" ident_list
| "firstorder" ltac_expr_opt firstorder_using "with" ident_list
| "gintuition" ltac_expr_opt
| "functional" "inversion" quantified_hypothesis qualid_opt      (* funind plugin *)
| "functional" "induction" term1_extended_list fun_ind_using with_names      (* funind plugin *)
| "soft" "functional" "induction" term1_extended_list fun_ind_using with_names      (* funind plugin *)
| "myred"      (* micromega plugin *)
| "psatz_Z" int_or_var ltac_expr      (* micromega plugin *)
| "psatz_Z" ltac_expr      (* micromega plugin *)
| "xlia" ltac_expr      (* micromega plugin *)
| "xnlia" ltac_expr      (* micromega plugin *)
| "xnra" ltac_expr      (* micromega plugin *)
| "xnqa" ltac_expr      (* micromega plugin *)
| "sos_Z" ltac_expr      (* micromega plugin *)
| "sos_Q" ltac_expr      (* micromega plugin *)
| "sos_R" ltac_expr      (* micromega plugin *)
| "lra_Q" ltac_expr      (* micromega plugin *)
| "lra_R" ltac_expr      (* micromega plugin *)
| "psatz_R" int_or_var ltac_expr      (* micromega plugin *)
| "psatz_R" ltac_expr      (* micromega plugin *)
| "psatz_Q" int_or_var ltac_expr      (* micromega plugin *)
| "psatz_Q" ltac_expr      (* micromega plugin *)
| "iter_specs" ltac_expr      (* micromega plugin *)
| "zify_op"      (* micromega plugin *)
| "saturate"      (* micromega plugin *)
| "nsatz_compute" term1_extended      (* nsatz plugin *)
| "omega"      (* omega plugin *)
| "omega" "with" ident_list      (* omega plugin *)
| "omega" "with" "*"      (* omega plugin *)
| "protect_fv" string "in" ident      (* setoid_ring plugin *)
| "protect_fv" string      (* setoid_ring plugin *)
| "ring_lookup" ltac_expr0 "[" term1_extended_list_opt "]" term1_extended_list      (* setoid_ring plugin *)
| "field_lookup" ltac_expr "[" term1_extended_list_opt "]" term1_extended_list      (* setoid_ring plugin *)
]

int_or_var: [
| int
| ident
]

constr_with_bindings_opt: [
| constr_with_bindings
| empty
]

hloc: [
| empty
| "in" "|-" "*"
| "in" ident
| "in" "(" "Type" "of" ident ")"
| "in" "(" "Value" "of" ident ")"
| "in" "(" "type" "of" ident ")"
| "in" "(" "value" "of" ident ")"
]

rename: [
| ident "into" ident
]

by_arg_tac: [
| "by" ltac_expr3
| empty
]

in_clause: [
| in_clause
| "*" occs
| "*" "|-" concl_occ
| hypident_occ_list_comma_opt "|-" concl_occ
| hypident_occ_list_comma_opt
]

occs: [
| "at" occs_nums
| empty
]

hypident_occ_list_comma_opt: [
| hypident_occ_list_comma
| empty
]

as_ipat: [
| "as" simple_intropattern
| empty
]

or_and_intropattern_loc: [
| or_and_intropattern
| ident
]

as_or_and_ipat: [
| "as" or_and_intropattern_loc
| empty
]

eqn_ipat: [
| "eqn" ":" naming_intropattern
| "_eqn" ":" naming_intropattern
| "_eqn"
| empty
]

as_name: [
| "as" ident
| empty
]

by_tactic: [
| "by" ltac_expr3
| empty
]

rewriter: [
| "!" constr_with_bindings_arg
| qmark_alt constr_with_bindings_arg
| num "!" constr_with_bindings_arg
| num qmark_alt constr_with_bindings_arg
| num constr_with_bindings_arg
| constr_with_bindings_arg
]

qmark_alt: [
| "?"
| "?"
]

oriented_rewriter: [
| orient rewriter
]

induction_clause: [
| destruction_arg as_or_and_ipat eqn_ipat opt_clause
]

induction_clause_list: [
| induction_clause_list_comma eliminator_opt opt_clause
]

induction_clause_list_comma: [
| induction_clause_list_comma "," induction_clause
| induction_clause
]

eliminator_opt: [
| "using" constr_with_bindings
| empty
]

auto_using: [
| "using" term1_extended_list_comma
| empty
]

term1_extended_list_comma: [
| term1_extended_list_comma "," term1_extended
| term1_extended
]

intropattern_list_opt: [
| intropattern_list_opt intropattern
| empty
]

or_and_intropattern: [
| "[" intropattern_or_list_or "]"
| "(" simple_intropattern_list_comma_opt ")"
| "(" simple_intropattern "&" simple_intropattern_list_ ")"
]

simple_intropattern_list_comma_opt: [
| simple_intropattern_list_comma
| empty
]

simple_intropattern_list_comma: [
| simple_intropattern_list_comma "," simple_intropattern
| simple_intropattern
]

simple_intropattern_list_: [
| simple_intropattern_list_ "&" simple_intropattern
| simple_intropattern
]

intropattern_or_list_or: [
| intropattern_or_list_or "|" intropattern_list_opt
| intropattern_list_opt
]

simple_intropattern_list_opt: [
| simple_intropattern_list_opt simple_intropattern
| empty
]

equality_intropattern: [
| "->"
| "<-"
| "[=" intropattern_list_opt "]"
]

naming_intropattern: [
| "?" ident
| "?"
| ident
]

intropattern: [
| simple_intropattern
| "*"
| "**"
]

simple_intropattern: [
| simple_intropattern_closed term0_list_opt
]

term0_list_opt: [
| term0_list_opt "%" term0
| empty
]

simple_intropattern_closed: [
| or_and_intropattern
| equality_intropattern
| "_"
| naming_intropattern
]

simple_binding: [
| "(" ident ":=" term ")"
| "(" num ":=" term ")"
]

bindings: [
| simple_binding_list
| term1_extended_list
]

simple_binding_list: [
| simple_binding_list simple_binding
| simple_binding
]

constr_with_bindings_arg_list_comma: [
| constr_with_bindings_arg_list_comma "," constr_with_bindings_arg
| constr_with_bindings_arg
]

fixdecl_list: [
| fixdecl_list fixdecl
| fixdecl
]

cofixdecl_list: [
| cofixdecl_list cofixdecl
| cofixdecl
]

pattern_occ_list_opt: [
| pattern_occ_list_opt "," pattern_occ as_name
| empty
]

pattern_occ: [
| term1_extended occs
]

oriented_rewriter_list_comma: [
| oriented_rewriter_list_comma "," oriented_rewriter
| oriented_rewriter
]

simple_alt: [
| "simple" "inversion"
| "inversion"
| "inversion_clear"
]

with_opt2: [
| "with" term1_extended
| empty
]

bindings_list_comma: [
| bindings_list_comma "," bindings
| bindings
]

rename_list_comma: [
| rename_list_comma "," rename
| rename
]

comparison: [
| "="
| "<"
| "<="
| ">"
| ">="
]

hintbases: [
| "with" "*"
| "with" ident_list
| empty
]

qualid_opt: [
| qualid
| empty
]

bindings_with_parameters: [
| "(" ident simple_binder_list_opt ":=" term ")"
]

simple_binder_list_opt: [
| simple_binder_list_opt simple_binder
| empty
]

hypident: [
| ident
| "(" "type" "of" ident ")"
| "(" "value" "of" ident ")"
]

hypident_occ: [
| hypident occs
]

clause_dft_concl: [
| "in" in_clause
| occs
| empty
]

clause_dft_all: [
| "in" in_clause
| empty
]

opt_clause: [
| "in" in_clause
| "at" occs_nums
| empty
]

occs_nums: [
| num_or_var_list
| "-" num_or_var int_or_var_list_opt
]

num_or_var: [
| num
| ident
]

int_or_var_list_opt: [
| int_or_var_list_opt int_or_var
| empty
]

num_or_var_list: [
| num_or_var_list num_or_var
| num_or_var
]

concl_occ: [
| "*" occs
| empty
]

in_hyp_list: [
| "in" ident_list
| empty
]

in_hyp_as: [
| "in" ident as_ipat
| empty
]

simple_binder: [
| name
| "(" names ":" term ")"
]

fixdecl: [
| "(" ident simple_binder_list_opt struct_annot ":" term ")"
]

struct_annot: [
| "{" "struct" name "}"
| empty
]

cofixdecl: [
| "(" ident simple_binder_list_opt ":" term ")"
]

constr_with_bindings: [
| term1_extended with_bindings
]

with_bindings: [
| "with" bindings
| empty
]

destruction_arg: [
| num
| constr_with_bindings
| constr_with_bindings_arg
]

constr_with_bindings_arg: [
| ">" constr_with_bindings
| constr_with_bindings
]

quantified_hypothesis: [
| ident
| num
]

conversion: [
| term1_extended
| term1_extended "with" term1_extended
| term1_extended "at" occs_nums "with" term1_extended
]

firstorder_using: [
| "using" qualid
| "using" qualid "," qualid_list_comma
| "using" qualid qualid qualid_list_opt
| empty
]

qualid_list_comma: [
| qualid_list_comma "," qualid
| qualid
]

fun_ind_using: [
| "using" constr_with_bindings      (* funind plugin *)
| empty      (* funind plugin *)
]

with_names: [
| "as" simple_intropattern      (* funind plugin *)
| empty      (* funind plugin *)
]

occurrences: [
| int_list
| ident
]

int_list: [
| int_list int
| int
]

rewstrategy: [
| term1_extended
| "<-" term1_extended
| "subterms" rewstrategy
| "subterm" rewstrategy
| "innermost" rewstrategy
| "outermost" rewstrategy
| "bottomup" rewstrategy
| "topdown" rewstrategy
| "id"
| "fail"
| "refl"
| "progress" rewstrategy
| "try" rewstrategy
| "any" rewstrategy
| "repeat" rewstrategy
| rewstrategy ";" rewstrategy
| "(" rewstrategy ")"
| "choice" rewstrategy rewstrategy
| "old_hints" ident
| "hints" ident
| "terms" term1_extended_list_opt
| "eval" red_expr
| "fold" term1_extended
]

hypident_occ_list_comma: [
| hypident_occ_list_comma "," hypident_occ
| hypident_occ
]

ltac_expr: [
| binder_tactic
| ltac_expr4
]

binder_tactic: [
| "fun" fun_var_list "=>" ltac_expr
| "let" rec_opt let_clause_list "in" ltac_expr
| "info" ltac_expr
]

fun_var_list: [
| fun_var_list fun_var
| fun_var
]

fun_var: [
| ident
| "_"
]

rec_opt: [
| "rec"
| empty
]

let_clause_list: [
| let_clause_list "with" let_clause
| let_clause
]

let_clause: [
| ident ":=" ltac_expr
| "_" ":=" ltac_expr
| ident fun_var_list ":=" ltac_expr
]

ltac_expr4: [
| ltac_expr3 ";" binder_tactic
| ltac_expr3 ";" ltac_expr3
| ltac_expr3 ";" "[" multi_goal_tactics "]"
| ltac_expr3 ";" "[" ">" multi_goal_tactics "]"
| ltac_expr3
]

multi_goal_tactics: [
| ltac_expr_opt "|" multi_goal_tactics
| ltac_expr_opt ".." or_opt ltac_expr_opt_list_or
| ltac_expr
| empty
]

ltac_expr_opt: [
| ltac_expr
| empty
]

ltac_expr_opt_list_or: [
| ltac_expr_opt_list_or "|" ltac_expr_opt
| ltac_expr_opt
]

ltac_expr3: [
| "try" ltac_expr3
| "do" int_or_var ltac_expr3
| "timeout" int_or_var ltac_expr3
| "time" string_opt ltac_expr3
| "repeat" ltac_expr3
| "progress" ltac_expr3
| "once" ltac_expr3
| "exactly_once" ltac_expr3
| "infoH" ltac_expr3
| "abstract" ltac_expr2
| "abstract" ltac_expr2 "using" ident
| only_selector ltac_expr3
| ltac_expr2
]

ltac_expr2: [
| ltac_expr1 "+" binder_tactic
| ltac_expr1 "+" ltac_expr2
| "tryif" ltac_expr "then" ltac_expr "else" ltac_expr2
| ltac_expr1 "||" binder_tactic
| ltac_expr1 "||" ltac_expr2
| ltac_expr1
]

ltac_expr1: [
| ltac_match_term
| ltac_match_goal
| "first" "[" ltac_expr_list_or_opt "]"
| "solve" "[" ltac_expr_list_or_opt "]"
| "idtac" message_token_list_opt
| failkw int_or_var_opt message_token_list_opt
| simple_tactic
| tactic_arg
| qualid tactic_arg_compat_list_opt
| ltac_expr0
]

ltac_expr_list_or_opt: [
| ltac_expr_list_or
| empty
]

ltac_expr_list_or: [
| ltac_expr_list_or "|" ltac_expr
| ltac_expr
]

message_token_list_opt: [
| message_token_list_opt message_token
| empty
]

message_token: [
| ident
| string
| int
]

int_or_var_opt: [
| int_or_var
| empty
]

term1_extended_list_opt: [
| term1_extended_list_opt term1_extended
| empty
]

failkw: [
| "fail"
| "gfail"
]

tactic_arg: [
| "eval" red_expr "in" term
| "context" ident "[" term "]"
| "type" "of" term
| "fresh" fresh_id_list_opt
| "type_term" term1_extended
| "numgoals"
]

fresh_id_list_opt: [
| fresh_id_list_opt fresh_id
| empty
]

fresh_id: [
| string
| qualid
]

tactic_arg_compat_list_opt: [
| tactic_arg_compat_list_opt tactic_arg_compat
| empty
]

tactic_arg_compat: [
| tactic_arg
| term
| "()"
]

ltac_expr0: [
| "(" ltac_expr ")"
| "[>" multi_goal_tactics "]"
| tactic_atom
]

tactic_atom: [
| int
| qualid
| "()"
]

toplevel_selector: [
| selector ":"
| "all" ":"
| "!" ":"
]

only_selector: [
| "only" selector ":"
]

selector: [
| range_selector_list_comma
| "[" ident "]"
]

range_selector_list_comma: [
| range_selector_list_comma "," range_selector
| range_selector
]

range_selector: [
| num "-" num
| num
]

ltac_match_term: [
| match_key ltac_expr "with" or_opt match_rule_list_or "end"
]

match_key: [
| "match"
| "multimatch"
| "lazymatch"
]

match_rule_list_or: [
| match_rule_list_or "|" match_rule
| match_rule
]

match_rule: [
| match_pattern_alt "=>" ltac_expr
]

match_pattern_alt: [
| match_pattern
| "_"
]

match_pattern: [
| "context" ident_opt "[" term "]"
| term
]

ltac_match_goal: [
| match_key reverse_opt "goal" "with" or_opt match_context_rule_list_or "end"
]

reverse_opt: [
| "reverse"
| empty
]

match_context_rule_list_or: [
| match_context_rule_list_or "|" match_context_rule
| match_context_rule
]

match_context_rule: [
| match_hyp_list_comma_opt "|-" match_pattern "=>" ltac_expr
| "[" match_hyp_list_comma_opt "|-" match_pattern "]" "=>" ltac_expr
| "_" "=>" ltac_expr
]

match_hyp_list_comma_opt: [
| match_hyp_list_comma
| empty
]

match_hyp_list_comma: [
| match_hyp_list_comma "," match_hyp
| match_hyp
]

match_hyp: [
| name ":" match_pattern
| name ":=" match_pattern_opt match_pattern
]

match_pattern_opt: [
| "[" match_pattern "]" ":"
| empty
]

ident_list_opt: [
| ident_list_opt ident
| empty
]