summaryrefslogtreecommitdiff
path: root/test-suite/bugs/closed
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/bugs/closed')
-rw-r--r--test-suite/bugs/closed/1100.v (renamed from test-suite/bugs/closed/shouldsucceed/1100.v)0
-rw-r--r--test-suite/bugs/closed/121.v (renamed from test-suite/bugs/closed/shouldsucceed/121.v)0
-rw-r--r--test-suite/bugs/closed/1243.v (renamed from test-suite/bugs/closed/shouldsucceed/1243.v)0
-rw-r--r--test-suite/bugs/closed/1302.v (renamed from test-suite/bugs/closed/shouldsucceed/1302.v)0
-rw-r--r--test-suite/bugs/closed/1322.v (renamed from test-suite/bugs/closed/shouldsucceed/1322.v)0
-rw-r--r--test-suite/bugs/closed/1411.v (renamed from test-suite/bugs/closed/shouldsucceed/1411.v)0
-rw-r--r--test-suite/bugs/closed/1414.v (renamed from test-suite/bugs/closed/shouldsucceed/1414.v)0
-rw-r--r--test-suite/bugs/closed/1416.v (renamed from test-suite/bugs/closed/shouldsucceed/1416.v)0
-rw-r--r--test-suite/bugs/closed/1419.v (renamed from test-suite/bugs/closed/shouldsucceed/1419.v)0
-rw-r--r--test-suite/bugs/closed/1425.v (renamed from test-suite/bugs/closed/shouldsucceed/1425.v)0
-rw-r--r--test-suite/bugs/closed/1446.v (renamed from test-suite/bugs/closed/shouldsucceed/1446.v)0
-rw-r--r--test-suite/bugs/closed/1448.v (renamed from test-suite/bugs/closed/shouldsucceed/1448.v)0
-rw-r--r--test-suite/bugs/closed/1477.v (renamed from test-suite/bugs/closed/shouldsucceed/1477.v)0
-rw-r--r--test-suite/bugs/closed/1483.v (renamed from test-suite/bugs/closed/shouldsucceed/1483.v)0
-rw-r--r--test-suite/bugs/closed/1507.v (renamed from test-suite/bugs/closed/shouldsucceed/1507.v)0
-rw-r--r--test-suite/bugs/closed/1568.v (renamed from test-suite/bugs/closed/shouldsucceed/1568.v)0
-rw-r--r--test-suite/bugs/closed/1576.v (renamed from test-suite/bugs/closed/shouldsucceed/1576.v)0
-rw-r--r--test-suite/bugs/closed/1582.v (renamed from test-suite/bugs/closed/shouldsucceed/1582.v)0
-rw-r--r--test-suite/bugs/closed/1604.v (renamed from test-suite/bugs/closed/shouldsucceed/1604.v)0
-rw-r--r--test-suite/bugs/closed/1614.v (renamed from test-suite/bugs/closed/shouldsucceed/1614.v)0
-rw-r--r--test-suite/bugs/closed/1618.v (renamed from test-suite/bugs/closed/shouldsucceed/1618.v)0
-rw-r--r--test-suite/bugs/closed/1634.v (renamed from test-suite/bugs/closed/shouldsucceed/1634.v)0
-rw-r--r--test-suite/bugs/closed/1643.v (renamed from test-suite/bugs/closed/shouldsucceed/1643.v)0
-rw-r--r--test-suite/bugs/closed/1680.v (renamed from test-suite/bugs/closed/shouldsucceed/1680.v)0
-rw-r--r--test-suite/bugs/closed/1683.v (renamed from test-suite/bugs/closed/shouldsucceed/1683.v)0
-rw-r--r--test-suite/bugs/closed/1696.v (renamed from test-suite/bugs/closed/shouldsucceed/1696.v)0
-rw-r--r--test-suite/bugs/closed/1703.v (renamed from test-suite/bugs/closed/shouldfail/1703.v)3
-rw-r--r--test-suite/bugs/closed/1704.v (renamed from test-suite/bugs/closed/shouldsucceed/1704.v)0
-rw-r--r--test-suite/bugs/closed/1711.v (renamed from test-suite/bugs/closed/shouldsucceed/1711.v)0
-rw-r--r--test-suite/bugs/closed/1718.v (renamed from test-suite/bugs/closed/shouldsucceed/1718.v)0
-rw-r--r--test-suite/bugs/closed/1738.v (renamed from test-suite/bugs/closed/shouldsucceed/1738.v)0
-rw-r--r--test-suite/bugs/closed/1740.v (renamed from test-suite/bugs/closed/shouldsucceed/1740.v)0
-rw-r--r--test-suite/bugs/closed/1754.v (renamed from test-suite/bugs/closed/shouldsucceed/1754.v)0
-rw-r--r--test-suite/bugs/closed/1773.v (renamed from test-suite/bugs/closed/shouldsucceed/1773.v)0
-rw-r--r--test-suite/bugs/closed/1774.v (renamed from test-suite/bugs/closed/shouldsucceed/1774.v)0
-rw-r--r--test-suite/bugs/closed/1775.v (renamed from test-suite/bugs/closed/shouldsucceed/1775.v)0
-rw-r--r--test-suite/bugs/closed/1776.v (renamed from test-suite/bugs/closed/shouldsucceed/1776.v)0
-rw-r--r--test-suite/bugs/closed/1779.v (renamed from test-suite/bugs/closed/shouldsucceed/1779.v)0
-rw-r--r--test-suite/bugs/closed/1784.v (renamed from test-suite/bugs/closed/shouldsucceed/1784.v)2
-rw-r--r--test-suite/bugs/closed/1791.v (renamed from test-suite/bugs/closed/shouldsucceed/1791.v)0
-rw-r--r--test-suite/bugs/closed/1834.v (renamed from test-suite/bugs/closed/shouldsucceed/1834.v)8
-rw-r--r--test-suite/bugs/closed/1844.v (renamed from test-suite/bugs/closed/shouldsucceed/1844.v)0
-rw-r--r--test-suite/bugs/closed/1865.v (renamed from test-suite/bugs/closed/shouldsucceed/1865.v)0
-rw-r--r--test-suite/bugs/closed/1891.v (renamed from test-suite/bugs/closed/shouldsucceed/1891.v)2
-rw-r--r--test-suite/bugs/closed/1898.v (renamed from test-suite/bugs/closed/shouldfail/1898.v)3
-rw-r--r--test-suite/bugs/closed/1900.v (renamed from test-suite/bugs/closed/shouldsucceed/1900.v)0
-rw-r--r--test-suite/bugs/closed/1901.v (renamed from test-suite/bugs/closed/shouldsucceed/1901.v)0
-rw-r--r--test-suite/bugs/closed/1905.v (renamed from test-suite/bugs/closed/shouldsucceed/1905.v)0
-rw-r--r--test-suite/bugs/closed/1907.v (renamed from test-suite/bugs/closed/shouldsucceed/1907.v)0
-rw-r--r--test-suite/bugs/closed/1912.v (renamed from test-suite/bugs/closed/shouldsucceed/1912.v)0
-rw-r--r--test-suite/bugs/closed/1915.v6
-rw-r--r--test-suite/bugs/closed/1918.v (renamed from test-suite/bugs/closed/shouldsucceed/1918.v)0
-rw-r--r--test-suite/bugs/closed/1925.v (renamed from test-suite/bugs/closed/shouldsucceed/1925.v)0
-rw-r--r--test-suite/bugs/closed/1931.v (renamed from test-suite/bugs/closed/shouldsucceed/1931.v)0
-rw-r--r--test-suite/bugs/closed/1935.v (renamed from test-suite/bugs/closed/shouldsucceed/1935.v)0
-rw-r--r--test-suite/bugs/closed/1939.v (renamed from test-suite/bugs/closed/shouldsucceed/1939.v)0
-rw-r--r--test-suite/bugs/closed/1944.v (renamed from test-suite/bugs/closed/shouldsucceed/1944.v)0
-rw-r--r--test-suite/bugs/closed/1951.v (renamed from test-suite/bugs/closed/shouldsucceed/1951.v)10
-rw-r--r--test-suite/bugs/closed/1962.v (renamed from test-suite/bugs/closed/shouldsucceed/1962.v)0
-rw-r--r--test-suite/bugs/closed/1963.v (renamed from test-suite/bugs/closed/shouldsucceed/1963.v)0
-rw-r--r--test-suite/bugs/closed/1977.v (renamed from test-suite/bugs/closed/shouldsucceed/1977.v)0
-rw-r--r--test-suite/bugs/closed/1981.v (renamed from test-suite/bugs/closed/shouldsucceed/1981.v)0
-rw-r--r--test-suite/bugs/closed/2001.v (renamed from test-suite/bugs/closed/shouldsucceed/2001.v)0
-rw-r--r--test-suite/bugs/closed/2006.v (renamed from test-suite/bugs/closed/shouldfail/2006.v)2
-rw-r--r--test-suite/bugs/closed/2017.v (renamed from test-suite/bugs/closed/shouldsucceed/2017.v)0
-rw-r--r--test-suite/bugs/closed/2021.v (renamed from test-suite/bugs/closed/shouldsucceed/2021.v)0
-rw-r--r--test-suite/bugs/closed/2027.v (renamed from test-suite/bugs/closed/shouldsucceed/2027.v)0
-rw-r--r--test-suite/bugs/closed/2083.v (renamed from test-suite/bugs/closed/shouldsucceed/2083.v)2
-rw-r--r--test-suite/bugs/closed/2089.v (renamed from test-suite/bugs/closed/shouldsucceed/2089.v)0
-rw-r--r--test-suite/bugs/closed/2095.v (renamed from test-suite/bugs/closed/shouldsucceed/2095.v)0
-rw-r--r--test-suite/bugs/closed/2108.v (renamed from test-suite/bugs/closed/shouldsucceed/2108.v)0
-rw-r--r--test-suite/bugs/closed/2117.v (renamed from test-suite/bugs/closed/shouldsucceed/2117.v)0
-rw-r--r--test-suite/bugs/closed/2123.v (renamed from test-suite/bugs/closed/shouldsucceed/2123.v)0
-rw-r--r--test-suite/bugs/closed/2127.v (renamed from test-suite/bugs/closed/shouldsucceed/2127.v)0
-rw-r--r--test-suite/bugs/closed/2135.v (renamed from test-suite/bugs/closed/shouldsucceed/2135.v)0
-rw-r--r--test-suite/bugs/closed/2136.v (renamed from test-suite/bugs/closed/shouldsucceed/2136.v)0
-rw-r--r--test-suite/bugs/closed/2137.v (renamed from test-suite/bugs/closed/shouldsucceed/2137.v)0
-rw-r--r--test-suite/bugs/closed/2139.v (renamed from test-suite/bugs/closed/shouldsucceed/2139.v)0
-rw-r--r--test-suite/bugs/closed/2141.v (renamed from test-suite/bugs/closed/shouldsucceed/2141.v)0
-rw-r--r--test-suite/bugs/closed/2145.v (renamed from test-suite/bugs/closed/shouldsucceed/2145.v)0
-rw-r--r--test-suite/bugs/closed/2149.v7
-rw-r--r--test-suite/bugs/closed/2164.v334
-rw-r--r--test-suite/bugs/closed/2181.v (renamed from test-suite/bugs/closed/shouldsucceed/2181.v)0
-rw-r--r--test-suite/bugs/closed/2193.v (renamed from test-suite/bugs/closed/shouldsucceed/2193.v)0
-rw-r--r--test-suite/bugs/closed/2230.v (renamed from test-suite/bugs/closed/shouldsucceed/2230.v)0
-rw-r--r--test-suite/bugs/closed/2231.v (renamed from test-suite/bugs/closed/shouldsucceed/2231.v)0
-rw-r--r--test-suite/bugs/closed/2244.v (renamed from test-suite/bugs/closed/shouldsucceed/2244.v)0
-rw-r--r--test-suite/bugs/closed/2250.v3
-rw-r--r--test-suite/bugs/closed/2251.v (renamed from test-suite/bugs/closed/shouldfail/2251.v)3
-rw-r--r--test-suite/bugs/closed/2255.v (renamed from test-suite/bugs/closed/shouldsucceed/2255.v)0
-rw-r--r--test-suite/bugs/closed/2262.v (renamed from test-suite/bugs/closed/shouldsucceed/2262.v)0
-rw-r--r--test-suite/bugs/closed/2281.v (renamed from test-suite/bugs/closed/shouldsucceed/2281.v)0
-rw-r--r--test-suite/bugs/closed/2295.v (renamed from test-suite/bugs/closed/shouldsucceed/2295.v)0
-rw-r--r--test-suite/bugs/closed/2299.v (renamed from test-suite/bugs/closed/shouldsucceed/2299.v)0
-rw-r--r--test-suite/bugs/closed/2300.v (renamed from test-suite/bugs/closed/shouldsucceed/2300.v)0
-rw-r--r--test-suite/bugs/closed/2303.v (renamed from test-suite/bugs/closed/shouldsucceed/2303.v)0
-rw-r--r--test-suite/bugs/closed/2304.v (renamed from test-suite/bugs/closed/shouldsucceed/2304.v)0
-rw-r--r--test-suite/bugs/closed/2307.v (renamed from test-suite/bugs/closed/shouldsucceed/2307.v)0
-rw-r--r--test-suite/bugs/closed/2310.v17
-rw-r--r--test-suite/bugs/closed/2320.v (renamed from test-suite/bugs/closed/shouldsucceed/2320.v)0
-rw-r--r--test-suite/bugs/closed/2342.v (renamed from test-suite/bugs/closed/shouldsucceed/2342.v)2
-rw-r--r--test-suite/bugs/closed/2347.v (renamed from test-suite/bugs/closed/shouldsucceed/2347.v)0
-rw-r--r--test-suite/bugs/closed/2350.v (renamed from test-suite/bugs/closed/shouldsucceed/2350.v)0
-rw-r--r--test-suite/bugs/closed/2353.v (renamed from test-suite/bugs/closed/shouldsucceed/2353.v)4
-rw-r--r--test-suite/bugs/closed/2360.v (renamed from test-suite/bugs/closed/shouldsucceed/2360.v)0
-rw-r--r--test-suite/bugs/closed/2362.v (renamed from test-suite/bugs/closed/shouldsucceed/2362.v)0
-rw-r--r--test-suite/bugs/closed/2375.v (renamed from test-suite/bugs/closed/shouldsucceed/2375.v)0
-rw-r--r--test-suite/bugs/closed/2378.v (renamed from test-suite/bugs/closed/shouldsucceed/2378.v)9
-rw-r--r--test-suite/bugs/closed/2388.v (renamed from test-suite/bugs/closed/shouldsucceed/2388.v)0
-rw-r--r--test-suite/bugs/closed/2393.v (renamed from test-suite/bugs/closed/shouldsucceed/2393.v)0
-rw-r--r--test-suite/bugs/closed/2404.v (renamed from test-suite/bugs/closed/shouldsucceed/2404.v)4
-rw-r--r--test-suite/bugs/closed/2406.v6
-rw-r--r--test-suite/bugs/closed/2447.v7
-rw-r--r--test-suite/bugs/closed/2456.v (renamed from test-suite/bugs/closed/shouldsucceed/2456.v)0
-rw-r--r--test-suite/bugs/closed/2464.v (renamed from test-suite/bugs/closed/shouldsucceed/2464.v)0
-rw-r--r--test-suite/bugs/closed/2467.v (renamed from test-suite/bugs/closed/shouldsucceed/2467.v)0
-rw-r--r--test-suite/bugs/closed/2473.v (renamed from test-suite/bugs/closed/shouldsucceed/2473.v)0
-rw-r--r--test-suite/bugs/closed/2586.v (renamed from test-suite/bugs/closed/shouldfail/2586.v)3
-rw-r--r--test-suite/bugs/closed/2603.v (renamed from test-suite/bugs/closed/shouldsucceed/2603.v)0
-rw-r--r--test-suite/bugs/closed/2608.v (renamed from test-suite/bugs/closed/shouldsucceed/2608.v)0
-rw-r--r--test-suite/bugs/closed/2613.v (renamed from test-suite/bugs/closed/shouldsucceed/2613.v)0
-rw-r--r--test-suite/bugs/closed/2615.v (renamed from test-suite/bugs/closed/shouldsucceed/2615.v)2
-rw-r--r--test-suite/bugs/closed/2616.v (renamed from test-suite/bugs/closed/shouldsucceed/2616.v)0
-rw-r--r--test-suite/bugs/closed/2629.v (renamed from test-suite/bugs/closed/shouldsucceed/2629.v)0
-rw-r--r--test-suite/bugs/closed/2640.v (renamed from test-suite/bugs/closed/shouldsucceed/2640.v)0
-rw-r--r--test-suite/bugs/closed/2667.v11
-rw-r--r--test-suite/bugs/closed/2668.v (renamed from test-suite/bugs/closed/shouldsucceed/2668.v)0
-rw-r--r--test-suite/bugs/closed/2670.v21
-rw-r--r--test-suite/bugs/closed/2680.v17
-rw-r--r--test-suite/bugs/closed/2713.v17
-rw-r--r--test-suite/bugs/closed/2729.v115
-rw-r--r--test-suite/bugs/closed/2732.v (renamed from test-suite/bugs/closed/shouldsucceed/2732.v)0
-rw-r--r--test-suite/bugs/closed/2733.v (renamed from test-suite/bugs/closed/shouldsucceed/2733.v)8
-rw-r--r--test-suite/bugs/closed/2734.v (renamed from test-suite/bugs/closed/shouldsucceed/2734.v)0
-rw-r--r--test-suite/bugs/closed/2750.v (renamed from test-suite/bugs/closed/shouldsucceed/2750.v)0
-rw-r--r--test-suite/bugs/closed/2810.v10
-rw-r--r--test-suite/bugs/closed/2817.v (renamed from test-suite/bugs/closed/shouldsucceed/2817.v)0
-rw-r--r--test-suite/bugs/closed/2818.v11
-rw-r--r--test-suite/bugs/closed/2828.v4
-rw-r--r--test-suite/bugs/closed/2830.v226
-rw-r--r--test-suite/bugs/closed/2834.v4
-rw-r--r--test-suite/bugs/closed/2836.v (renamed from test-suite/bugs/closed/shouldsucceed/2836.v)0
-rw-r--r--test-suite/bugs/closed/2837.v (renamed from test-suite/bugs/closed/shouldsucceed/2837.v)0
-rw-r--r--test-suite/bugs/closed/2839.v10
-rw-r--r--test-suite/bugs/closed/2846.v3
-rw-r--r--test-suite/bugs/closed/2848.v9
-rw-r--r--test-suite/bugs/closed/2850.v2
-rw-r--r--test-suite/bugs/closed/2854.v7
-rw-r--r--test-suite/bugs/closed/2876.v11
-rw-r--r--test-suite/bugs/closed/2883.v34
-rw-r--r--test-suite/bugs/closed/2900.v28
-rw-r--r--test-suite/bugs/closed/2920.v2
-rw-r--r--test-suite/bugs/closed/2923.v12
-rw-r--r--test-suite/bugs/closed/2928.v (renamed from test-suite/bugs/closed/shouldsucceed/2928.v)0
-rw-r--r--test-suite/bugs/closed/2930.v12
-rw-r--r--test-suite/bugs/closed/2945.v5
-rw-r--r--test-suite/bugs/closed/2966.v79
-rw-r--r--test-suite/bugs/closed/2969.v25
-rw-r--r--test-suite/bugs/closed/2981.v15
-rw-r--r--test-suite/bugs/closed/2983.v (renamed from test-suite/bugs/closed/shouldsucceed/2983.v)0
-rw-r--r--test-suite/bugs/closed/2990.v8
-rw-r--r--test-suite/bugs/closed/2994.v2
-rw-r--r--test-suite/bugs/closed/2995.v (renamed from test-suite/bugs/closed/shouldsucceed/2995.v)0
-rw-r--r--test-suite/bugs/closed/2996.v30
-rw-r--r--test-suite/bugs/closed/3000.v (renamed from test-suite/bugs/closed/shouldsucceed/3000.v)0
-rw-r--r--test-suite/bugs/closed/3001.v21
-rw-r--r--test-suite/bugs/closed/3004.v (renamed from test-suite/bugs/closed/shouldsucceed/3004.v)0
-rw-r--r--test-suite/bugs/closed/3008.v (renamed from test-suite/bugs/closed/shouldsucceed/3008.v)0
-rw-r--r--test-suite/bugs/closed/3010b.v5
-rw-r--r--test-suite/bugs/closed/3016.v4
-rw-r--r--test-suite/bugs/closed/3017.v6
-rw-r--r--test-suite/bugs/closed/3022.v8
-rw-r--r--test-suite/bugs/closed/3023.v8
-rw-r--r--test-suite/bugs/closed/3036.v169
-rw-r--r--test-suite/bugs/closed/3037.v11
-rw-r--r--test-suite/bugs/closed/3043.v4
-rw-r--r--test-suite/bugs/closed/3045.v34
-rw-r--r--test-suite/bugs/closed/3050.v7
-rw-r--r--test-suite/bugs/closed/3054.v10
-rw-r--r--test-suite/bugs/closed/3062.v5
-rw-r--r--test-suite/bugs/closed/3068.v63
-rw-r--r--test-suite/bugs/closed/3088.v12
-rw-r--r--test-suite/bugs/closed/3093.v6
-rw-r--r--test-suite/bugs/closed/3142.v9
-rw-r--r--test-suite/bugs/closed/3164.v49
-rw-r--r--test-suite/bugs/closed/3188.v22
-rw-r--r--test-suite/bugs/closed/3205.v26
-rw-r--r--test-suite/bugs/closed/3212.v10
-rw-r--r--test-suite/bugs/closed/3217.v36
-rw-r--r--test-suite/bugs/closed/3228.v7
-rw-r--r--test-suite/bugs/closed/3242.v2
-rw-r--r--test-suite/bugs/closed/3251.v13
-rw-r--r--test-suite/bugs/closed/3258.v35
-rw-r--r--test-suite/bugs/closed/3259.v21
-rw-r--r--test-suite/bugs/closed/3260.v7
-rw-r--r--test-suite/bugs/closed/3262.v78
-rw-r--r--test-suite/bugs/closed/3264.v45
-rw-r--r--test-suite/bugs/closed/3265.v6
-rw-r--r--test-suite/bugs/closed/3266.v3
-rw-r--r--test-suite/bugs/closed/3267.v36
-rw-r--r--test-suite/bugs/closed/328.v40
-rw-r--r--test-suite/bugs/closed/3281.v5
-rw-r--r--test-suite/bugs/closed/3282.v7
-rw-r--r--test-suite/bugs/closed/3284.v23
-rw-r--r--test-suite/bugs/closed/3285.v7
-rw-r--r--test-suite/bugs/closed/3286.v41
-rw-r--r--test-suite/bugs/closed/3287.v20
-rw-r--r--test-suite/bugs/closed/3289.v27
-rw-r--r--test-suite/bugs/closed/329.v100
-rw-r--r--test-suite/bugs/closed/3291.v9
-rw-r--r--test-suite/bugs/closed/3294.v6
-rw-r--r--test-suite/bugs/closed/3297.v12
-rw-r--r--test-suite/bugs/closed/3300.v7
-rw-r--r--test-suite/bugs/closed/3305.v13
-rw-r--r--test-suite/bugs/closed/3306.v12
-rw-r--r--test-suite/bugs/closed/3309.v326
-rw-r--r--test-suite/bugs/closed/331.v20
-rw-r--r--test-suite/bugs/closed/3310.v11
-rw-r--r--test-suite/bugs/closed/3314.v147
-rw-r--r--test-suite/bugs/closed/3315.v37
-rw-r--r--test-suite/bugs/closed/3317.v94
-rw-r--r--test-suite/bugs/closed/3319.v25
-rw-r--r--test-suite/bugs/closed/3321.v18
-rw-r--r--test-suite/bugs/closed/3322.v23
-rw-r--r--test-suite/bugs/closed/3323.v77
-rw-r--r--test-suite/bugs/closed/3324.v47
-rw-r--r--test-suite/bugs/closed/3325.v48
-rw-r--r--test-suite/bugs/closed/3326.v19
-rw-r--r--test-suite/bugs/closed/3329.v93
-rw-r--r--test-suite/bugs/closed/3330.v1110
-rw-r--r--test-suite/bugs/closed/3331.v31
-rw-r--r--test-suite/bugs/closed/3332.v6
-rw-r--r--test-suite/bugs/closed/3336.v9
-rw-r--r--test-suite/bugs/closed/3337.v4
-rw-r--r--test-suite/bugs/closed/3338.v4
-rw-r--r--test-suite/bugs/closed/3344.v58
-rw-r--r--test-suite/bugs/closed/3346.v4
-rw-r--r--test-suite/bugs/closed/3347.v39
-rw-r--r--test-suite/bugs/closed/3348.v6
-rw-r--r--test-suite/bugs/closed/335.v (renamed from test-suite/bugs/closed/shouldsucceed/335.v)0
-rw-r--r--test-suite/bugs/closed/3350.v120
-rw-r--r--test-suite/bugs/closed/3352.v34
-rw-r--r--test-suite/bugs/closed/3354.v12
-rw-r--r--test-suite/bugs/closed/3355.v6
-rw-r--r--test-suite/bugs/closed/3368.v16
-rw-r--r--test-suite/bugs/closed/3372.v7
-rw-r--r--test-suite/bugs/closed/3373.v33
-rw-r--r--test-suite/bugs/closed/3374.v51
-rw-r--r--test-suite/bugs/closed/3375.v48
-rw-r--r--test-suite/bugs/closed/3377.v17
-rw-r--r--test-suite/bugs/closed/3382.v63
-rw-r--r--test-suite/bugs/closed/3386.v16
-rw-r--r--test-suite/bugs/closed/3387.v21
-rw-r--r--test-suite/bugs/closed/3388.v57
-rw-r--r--test-suite/bugs/closed/3390.v9
-rw-r--r--test-suite/bugs/closed/3392.v40
-rw-r--r--test-suite/bugs/closed/3393.v152
-rw-r--r--test-suite/bugs/closed/3402.v7
-rw-r--r--test-suite/bugs/closed/3408.v163
-rw-r--r--test-suite/bugs/closed/3416.v12
-rw-r--r--test-suite/bugs/closed/3417.v7
-rw-r--r--test-suite/bugs/closed/3422.v208
-rw-r--r--test-suite/bugs/closed/3424.v23
-rw-r--r--test-suite/bugs/closed/3427.v195
-rw-r--r--test-suite/bugs/closed/3428.v35
-rw-r--r--test-suite/bugs/closed/3439.v43
-rw-r--r--test-suite/bugs/closed/3453.v10
-rw-r--r--test-suite/bugs/closed/3454.v63
-rw-r--r--test-suite/bugs/closed/3469.v29
-rw-r--r--test-suite/bugs/closed/3477.v9
-rw-r--r--test-suite/bugs/closed/348.v (renamed from test-suite/bugs/closed/shouldsucceed/348.v)0
-rw-r--r--test-suite/bugs/closed/3480.v47
-rw-r--r--test-suite/bugs/closed/3481.v70
-rw-r--r--test-suite/bugs/closed/3482.v11
-rw-r--r--test-suite/bugs/closed/3483.v5
-rw-r--r--test-suite/bugs/closed/3484.v30
-rw-r--r--test-suite/bugs/closed/3485.v133
-rw-r--r--test-suite/bugs/closed/3487.v8
-rw-r--r--test-suite/bugs/closed/3505.v44
-rw-r--r--test-suite/bugs/closed/3520.v12
-rw-r--r--test-suite/bugs/closed/3531.v53
-rw-r--r--test-suite/bugs/closed/3537.v12
-rw-r--r--test-suite/bugs/closed/3539.v66
-rw-r--r--test-suite/bugs/closed/3542.v6
-rw-r--r--test-suite/bugs/closed/3546.v17
-rw-r--r--test-suite/bugs/closed/3559.v86
-rw-r--r--test-suite/bugs/closed/3561.v23
-rw-r--r--test-suite/bugs/closed/3562.v6
-rw-r--r--test-suite/bugs/closed/3563.v38
-rw-r--r--test-suite/bugs/closed/3566.v22
-rw-r--r--test-suite/bugs/closed/3567.v68
-rw-r--r--test-suite/bugs/closed/3584.v16
-rw-r--r--test-suite/bugs/closed/3593.v10
-rw-r--r--test-suite/bugs/closed/3594.v51
-rw-r--r--test-suite/bugs/closed/3596.v18
-rw-r--r--test-suite/bugs/closed/3616.v3
-rw-r--r--test-suite/bugs/closed/3618.v103
-rw-r--r--test-suite/bugs/closed/3623.v4
-rw-r--r--test-suite/bugs/closed/3624.v11
-rw-r--r--test-suite/bugs/closed/3625.v11
-rw-r--r--test-suite/bugs/closed/3628.v9
-rw-r--r--test-suite/bugs/closed/3633.v10
-rw-r--r--test-suite/bugs/closed/3637.v11
-rw-r--r--test-suite/bugs/closed/3638.v25
-rw-r--r--test-suite/bugs/closed/3640.v31
-rw-r--r--test-suite/bugs/closed/3641.v21
-rw-r--r--test-suite/bugs/closed/3647.v652
-rw-r--r--test-suite/bugs/closed/3648.v83
-rw-r--r--test-suite/bugs/closed/3652.v101
-rw-r--r--test-suite/bugs/closed/3653.v12
-rw-r--r--test-suite/bugs/closed/3654.v7
-rw-r--r--test-suite/bugs/closed/3656.v53
-rw-r--r--test-suite/bugs/closed/3657.v12
-rw-r--r--test-suite/bugs/closed/3658.v74
-rw-r--r--test-suite/bugs/closed/3660.v27
-rw-r--r--test-suite/bugs/closed/3661.v88
-rw-r--r--test-suite/bugs/closed/3662.v47
-rw-r--r--test-suite/bugs/closed/3664.v23
-rw-r--r--test-suite/bugs/closed/3665.v33
-rw-r--r--test-suite/bugs/closed/3666.v50
-rw-r--r--test-suite/bugs/closed/3667.v25
-rw-r--r--test-suite/bugs/closed/3668.v53
-rw-r--r--test-suite/bugs/closed/3670.v23
-rw-r--r--test-suite/bugs/closed/3672.v27
-rw-r--r--test-suite/bugs/closed/3675.v20
-rw-r--r--test-suite/bugs/closed/3682.v5
-rw-r--r--test-suite/bugs/closed/3684.v4
-rw-r--r--test-suite/bugs/closed/3686.v62
-rw-r--r--test-suite/bugs/closed/3692.v26
-rw-r--r--test-suite/bugs/closed/3698.v25
-rw-r--r--test-suite/bugs/closed/3699.v162
-rw-r--r--test-suite/bugs/closed/3700.v84
-rw-r--r--test-suite/bugs/closed/3709.v23
-rw-r--r--test-suite/bugs/closed/3710.v48
-rw-r--r--test-suite/bugs/closed/3723.v6
-rw-r--r--test-suite/bugs/closed/3782.v63
-rw-r--r--test-suite/bugs/closed/3788.v6
-rw-r--r--test-suite/bugs/closed/3792.v4
-rw-r--r--test-suite/bugs/closed/38.v (renamed from test-suite/bugs/closed/shouldsucceed/38.v)0
-rw-r--r--test-suite/bugs/closed/3804.v12
-rw-r--r--test-suite/bugs/closed/3821.v2
-rw-r--r--test-suite/bugs/closed/3828.v2
-rw-r--r--test-suite/bugs/closed/3848.v21
-rw-r--r--test-suite/bugs/closed/3854.v21
-rw-r--r--test-suite/bugs/closed/3892.v8
-rw-r--r--test-suite/bugs/closed/3895.v22
-rw-r--r--test-suite/bugs/closed/3896.v4
-rw-r--r--test-suite/bugs/closed/3899.v11
-rw-r--r--test-suite/bugs/closed/545.v (renamed from test-suite/bugs/closed/shouldsucceed/545.v)0
-rw-r--r--test-suite/bugs/closed/808_2411.v (renamed from test-suite/bugs/closed/shouldsucceed/808_2411.v)0
-rw-r--r--test-suite/bugs/closed/846.v (renamed from test-suite/bugs/closed/shouldsucceed/846.v)0
-rw-r--r--test-suite/bugs/closed/931.v (renamed from test-suite/bugs/closed/shouldsucceed/931.v)2
-rw-r--r--test-suite/bugs/closed/HoTT_coq_001.v5
-rw-r--r--test-suite/bugs/closed/HoTT_coq_002.v33
-rw-r--r--test-suite/bugs/closed/HoTT_coq_006.v99
-rw-r--r--test-suite/bugs/closed/HoTT_coq_007.v112
-rw-r--r--test-suite/bugs/closed/HoTT_coq_010.v3
-rw-r--r--test-suite/bugs/closed/HoTT_coq_012.v4
-rw-r--r--test-suite/bugs/closed/HoTT_coq_013.v24
-rw-r--r--test-suite/bugs/closed/HoTT_coq_014.v200
-rw-r--r--test-suite/bugs/closed/HoTT_coq_016.v15
-rw-r--r--test-suite/bugs/closed/HoTT_coq_020.v95
-rw-r--r--test-suite/bugs/closed/HoTT_coq_023.v12
-rw-r--r--test-suite/bugs/closed/HoTT_coq_025.v29
-rw-r--r--test-suite/bugs/closed/HoTT_coq_027.v94
-rw-r--r--test-suite/bugs/closed/HoTT_coq_028.v14
-rw-r--r--test-suite/bugs/closed/HoTT_coq_029.v335
-rw-r--r--test-suite/bugs/closed/HoTT_coq_030.v241
-rw-r--r--test-suite/bugs/closed/HoTT_coq_032.v22
-rw-r--r--test-suite/bugs/closed/HoTT_coq_034.v23
-rw-r--r--test-suite/bugs/closed/HoTT_coq_035.v19
-rw-r--r--test-suite/bugs/closed/HoTT_coq_036.v135
-rw-r--r--test-suite/bugs/closed/HoTT_coq_037.v16
-rw-r--r--test-suite/bugs/closed/HoTT_coq_041.v18
-rw-r--r--test-suite/bugs/closed/HoTT_coq_042.v27
-rw-r--r--test-suite/bugs/closed/HoTT_coq_043.v15
-rw-r--r--test-suite/bugs/closed/HoTT_coq_044.v35
-rw-r--r--test-suite/bugs/closed/HoTT_coq_045.v53
-rw-r--r--test-suite/bugs/closed/HoTT_coq_047.v46
-rw-r--r--test-suite/bugs/closed/HoTT_coq_048.v7
-rw-r--r--test-suite/bugs/closed/HoTT_coq_049.v6
-rw-r--r--test-suite/bugs/closed/HoTT_coq_050.v33
-rw-r--r--test-suite/bugs/closed/HoTT_coq_052.v22
-rw-r--r--test-suite/bugs/closed/HoTT_coq_053.v50
-rw-r--r--test-suite/bugs/closed/HoTT_coq_054.v94
-rw-r--r--test-suite/bugs/closed/HoTT_coq_055.v53
-rw-r--r--test-suite/bugs/closed/HoTT_coq_056.v156
-rw-r--r--test-suite/bugs/closed/HoTT_coq_057.v33
-rw-r--r--test-suite/bugs/closed/HoTT_coq_058.v140
-rw-r--r--test-suite/bugs/closed/HoTT_coq_059.v17
-rw-r--r--test-suite/bugs/closed/HoTT_coq_061.v132
-rw-r--r--test-suite/bugs/closed/HoTT_coq_062.v106
-rw-r--r--test-suite/bugs/closed/HoTT_coq_063.v34
-rw-r--r--test-suite/bugs/closed/HoTT_coq_064.v190
-rw-r--r--test-suite/bugs/closed/HoTT_coq_067.v28
-rw-r--r--test-suite/bugs/closed/HoTT_coq_068.v61
-rw-r--r--test-suite/bugs/closed/HoTT_coq_071.v9
-rw-r--r--test-suite/bugs/closed/HoTT_coq_074.v10
-rw-r--r--test-suite/bugs/closed/HoTT_coq_077.v39
-rw-r--r--test-suite/bugs/closed/HoTT_coq_078.v43
-rw-r--r--test-suite/bugs/closed/HoTT_coq_079.v16
-rw-r--r--test-suite/bugs/closed/HoTT_coq_080.v27
-rw-r--r--test-suite/bugs/closed/HoTT_coq_081.v16
-rw-r--r--test-suite/bugs/closed/HoTT_coq_082.v19
-rw-r--r--test-suite/bugs/closed/HoTT_coq_083.v29
-rw-r--r--test-suite/bugs/closed/HoTT_coq_084.v49
-rw-r--r--test-suite/bugs/closed/HoTT_coq_085.v74
-rw-r--r--test-suite/bugs/closed/HoTT_coq_087.v14
-rw-r--r--test-suite/bugs/closed/HoTT_coq_088.v78
-rw-r--r--test-suite/bugs/closed/HoTT_coq_089.v44
-rw-r--r--test-suite/bugs/closed/HoTT_coq_090.v187
-rw-r--r--test-suite/bugs/closed/HoTT_coq_091.v191
-rw-r--r--test-suite/bugs/closed/HoTT_coq_093.v27
-rw-r--r--test-suite/bugs/closed/HoTT_coq_094.v9
-rw-r--r--test-suite/bugs/closed/HoTT_coq_097.v5
-rw-r--r--test-suite/bugs/closed/HoTT_coq_098.v63
-rw-r--r--test-suite/bugs/closed/HoTT_coq_099.v61
-rw-r--r--test-suite/bugs/closed/HoTT_coq_100.v151
-rw-r--r--test-suite/bugs/closed/HoTT_coq_101.v77
-rw-r--r--test-suite/bugs/closed/HoTT_coq_102.v29
-rw-r--r--test-suite/bugs/closed/HoTT_coq_103.v4
-rw-r--r--test-suite/bugs/closed/HoTT_coq_104.v13
-rw-r--r--test-suite/bugs/closed/HoTT_coq_105.v32
-rw-r--r--test-suite/bugs/closed/HoTT_coq_107.v106
-rw-r--r--test-suite/bugs/closed/HoTT_coq_108.v127
-rw-r--r--test-suite/bugs/closed/HoTT_coq_110.v23
-rw-r--r--test-suite/bugs/closed/HoTT_coq_111.v24
-rw-r--r--test-suite/bugs/closed/HoTT_coq_112.v75
-rw-r--r--test-suite/bugs/closed/HoTT_coq_113.v19
-rw-r--r--test-suite/bugs/closed/HoTT_coq_114.v1
-rw-r--r--test-suite/bugs/closed/HoTT_coq_115.v1
-rw-r--r--test-suite/bugs/closed/HoTT_coq_116.v13
-rw-r--r--test-suite/bugs/closed/HoTT_coq_117.v25
-rw-r--r--test-suite/bugs/closed/HoTT_coq_118.v35
-rw-r--r--test-suite/bugs/closed/HoTT_coq_121.v18
-rw-r--r--test-suite/bugs/closed/HoTT_coq_122.v25
-rw-r--r--test-suite/bugs/closed/HoTT_coq_123.v171
-rw-r--r--test-suite/bugs/closed/HoTT_coq_124.v29
-rw-r--r--test-suite/bugs/closed/shouldfail/1915.v6
-rw-r--r--test-suite/bugs/closed/shouldfail/2406.v3
-rw-r--r--test-suite/bugs/closed/shouldsucceed/1041.v13
-rw-r--r--test-suite/bugs/closed/shouldsucceed/1519.v14
442 files changed, 14032 insertions, 68 deletions
diff --git a/test-suite/bugs/closed/shouldsucceed/1100.v b/test-suite/bugs/closed/1100.v
index 32c78b4b..32c78b4b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1100.v
+++ b/test-suite/bugs/closed/1100.v
diff --git a/test-suite/bugs/closed/shouldsucceed/121.v b/test-suite/bugs/closed/121.v
index 8c5a3885..8c5a3885 100644
--- a/test-suite/bugs/closed/shouldsucceed/121.v
+++ b/test-suite/bugs/closed/121.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1243.v b/test-suite/bugs/closed/1243.v
index 7d6781db..7d6781db 100644
--- a/test-suite/bugs/closed/shouldsucceed/1243.v
+++ b/test-suite/bugs/closed/1243.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1302.v b/test-suite/bugs/closed/1302.v
index e94dfcfb..e94dfcfb 100644
--- a/test-suite/bugs/closed/shouldsucceed/1302.v
+++ b/test-suite/bugs/closed/1302.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1322.v b/test-suite/bugs/closed/1322.v
index 1ec7d452..1ec7d452 100644
--- a/test-suite/bugs/closed/shouldsucceed/1322.v
+++ b/test-suite/bugs/closed/1322.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1411.v b/test-suite/bugs/closed/1411.v
index a1a7b288..a1a7b288 100644
--- a/test-suite/bugs/closed/shouldsucceed/1411.v
+++ b/test-suite/bugs/closed/1411.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1414.v b/test-suite/bugs/closed/1414.v
index ee9e2504..ee9e2504 100644
--- a/test-suite/bugs/closed/shouldsucceed/1414.v
+++ b/test-suite/bugs/closed/1414.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1416.v b/test-suite/bugs/closed/1416.v
index ee092005..ee092005 100644
--- a/test-suite/bugs/closed/shouldsucceed/1416.v
+++ b/test-suite/bugs/closed/1416.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1419.v b/test-suite/bugs/closed/1419.v
index d021107d..d021107d 100644
--- a/test-suite/bugs/closed/shouldsucceed/1419.v
+++ b/test-suite/bugs/closed/1419.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1425.v b/test-suite/bugs/closed/1425.v
index 6be30174..6be30174 100644
--- a/test-suite/bugs/closed/shouldsucceed/1425.v
+++ b/test-suite/bugs/closed/1425.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1446.v b/test-suite/bugs/closed/1446.v
index 8cb2d653..8cb2d653 100644
--- a/test-suite/bugs/closed/shouldsucceed/1446.v
+++ b/test-suite/bugs/closed/1446.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1448.v b/test-suite/bugs/closed/1448.v
index fe3b4c8b..fe3b4c8b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1448.v
+++ b/test-suite/bugs/closed/1448.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1477.v b/test-suite/bugs/closed/1477.v
index dfc8c328..dfc8c328 100644
--- a/test-suite/bugs/closed/shouldsucceed/1477.v
+++ b/test-suite/bugs/closed/1477.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1483.v b/test-suite/bugs/closed/1483.v
index a3d7f168..a3d7f168 100644
--- a/test-suite/bugs/closed/shouldsucceed/1483.v
+++ b/test-suite/bugs/closed/1483.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1507.v b/test-suite/bugs/closed/1507.v
index f2ab9100..f2ab9100 100644
--- a/test-suite/bugs/closed/shouldsucceed/1507.v
+++ b/test-suite/bugs/closed/1507.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1568.v b/test-suite/bugs/closed/1568.v
index 3609e9c8..3609e9c8 100644
--- a/test-suite/bugs/closed/shouldsucceed/1568.v
+++ b/test-suite/bugs/closed/1568.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1576.v b/test-suite/bugs/closed/1576.v
index 3621f7a1..3621f7a1 100644
--- a/test-suite/bugs/closed/shouldsucceed/1576.v
+++ b/test-suite/bugs/closed/1576.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1582.v b/test-suite/bugs/closed/1582.v
index be5d3dd2..be5d3dd2 100644
--- a/test-suite/bugs/closed/shouldsucceed/1582.v
+++ b/test-suite/bugs/closed/1582.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1604.v b/test-suite/bugs/closed/1604.v
index 22c3df82..22c3df82 100644
--- a/test-suite/bugs/closed/shouldsucceed/1604.v
+++ b/test-suite/bugs/closed/1604.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1614.v b/test-suite/bugs/closed/1614.v
index 6bc165d4..6bc165d4 100644
--- a/test-suite/bugs/closed/shouldsucceed/1614.v
+++ b/test-suite/bugs/closed/1614.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1618.v b/test-suite/bugs/closed/1618.v
index a9b067ce..a9b067ce 100644
--- a/test-suite/bugs/closed/shouldsucceed/1618.v
+++ b/test-suite/bugs/closed/1618.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1634.v b/test-suite/bugs/closed/1634.v
index 0150c250..0150c250 100644
--- a/test-suite/bugs/closed/shouldsucceed/1634.v
+++ b/test-suite/bugs/closed/1634.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1643.v b/test-suite/bugs/closed/1643.v
index 879a65b1..879a65b1 100644
--- a/test-suite/bugs/closed/shouldsucceed/1643.v
+++ b/test-suite/bugs/closed/1643.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1680.v b/test-suite/bugs/closed/1680.v
index 524c7bab..524c7bab 100644
--- a/test-suite/bugs/closed/shouldsucceed/1680.v
+++ b/test-suite/bugs/closed/1680.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1683.v b/test-suite/bugs/closed/1683.v
index 3e99694b..3e99694b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1683.v
+++ b/test-suite/bugs/closed/1683.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1696.v b/test-suite/bugs/closed/1696.v
index 0826428a..0826428a 100644
--- a/test-suite/bugs/closed/shouldsucceed/1696.v
+++ b/test-suite/bugs/closed/1696.v
diff --git a/test-suite/bugs/closed/shouldfail/1703.v b/test-suite/bugs/closed/1703.v
index 6b5198cc..114e3185 100644
--- a/test-suite/bugs/closed/shouldfail/1703.v
+++ b/test-suite/bugs/closed/1703.v
@@ -4,4 +4,5 @@ Ltac intros_until n := intros until n.
Goal forall i j m n : nat, i = 0 /\ j = 0 /\ m = 0 /\ n = 0.
intro i.
-intros until i.
+Fail intros until i.
+Abort.
diff --git a/test-suite/bugs/closed/shouldsucceed/1704.v b/test-suite/bugs/closed/1704.v
index 4b02d5f9..4b02d5f9 100644
--- a/test-suite/bugs/closed/shouldsucceed/1704.v
+++ b/test-suite/bugs/closed/1704.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1711.v b/test-suite/bugs/closed/1711.v
index e16612e3..e16612e3 100644
--- a/test-suite/bugs/closed/shouldsucceed/1711.v
+++ b/test-suite/bugs/closed/1711.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1718.v b/test-suite/bugs/closed/1718.v
index 715fa941..715fa941 100644
--- a/test-suite/bugs/closed/shouldsucceed/1718.v
+++ b/test-suite/bugs/closed/1718.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1738.v b/test-suite/bugs/closed/1738.v
index c2926a2b..c2926a2b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1738.v
+++ b/test-suite/bugs/closed/1738.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1740.v b/test-suite/bugs/closed/1740.v
index ec4a7a6b..ec4a7a6b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1740.v
+++ b/test-suite/bugs/closed/1740.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1754.v b/test-suite/bugs/closed/1754.v
index 06b8dce8..06b8dce8 100644
--- a/test-suite/bugs/closed/shouldsucceed/1754.v
+++ b/test-suite/bugs/closed/1754.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1773.v b/test-suite/bugs/closed/1773.v
index 211af89b..211af89b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1773.v
+++ b/test-suite/bugs/closed/1773.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1774.v b/test-suite/bugs/closed/1774.v
index 4c24b481..4c24b481 100644
--- a/test-suite/bugs/closed/shouldsucceed/1774.v
+++ b/test-suite/bugs/closed/1774.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1775.v b/test-suite/bugs/closed/1775.v
index 932949a3..932949a3 100644
--- a/test-suite/bugs/closed/shouldsucceed/1775.v
+++ b/test-suite/bugs/closed/1775.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1776.v b/test-suite/bugs/closed/1776.v
index 58491f9d..58491f9d 100644
--- a/test-suite/bugs/closed/shouldsucceed/1776.v
+++ b/test-suite/bugs/closed/1776.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1779.v b/test-suite/bugs/closed/1779.v
index 95bb66b9..95bb66b9 100644
--- a/test-suite/bugs/closed/shouldsucceed/1779.v
+++ b/test-suite/bugs/closed/1779.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1784.v b/test-suite/bugs/closed/1784.v
index fb2f0ca9..0b63d7b5 100644
--- a/test-suite/bugs/closed/shouldsucceed/1784.v
+++ b/test-suite/bugs/closed/1784.v
@@ -92,7 +92,7 @@ Next Obligation. intro H; inversion H; subst. Defined.
Next Obligation.
intro H1; contradict H. inversion H1; subst. assumption.
contradict H0; assumption. Defined.
-Next Obligation.
+Next Obligation.
intro H1; contradict H0. inversion H1; subst. assumption. Defined.
Next Obligation.
intro H1; contradict H. inversion H1; subst. assumption. Defined.
diff --git a/test-suite/bugs/closed/shouldsucceed/1791.v b/test-suite/bugs/closed/1791.v
index be0e8ae8..be0e8ae8 100644
--- a/test-suite/bugs/closed/shouldsucceed/1791.v
+++ b/test-suite/bugs/closed/1791.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1834.v b/test-suite/bugs/closed/1834.v
index 947d15f0..884ac01c 100644
--- a/test-suite/bugs/closed/shouldsucceed/1834.v
+++ b/test-suite/bugs/closed/1834.v
@@ -53,7 +53,7 @@ Definition S1_1 y0 y1 (e0:eq_0 y0) (e1:S0_0 y0 e0 = y1) :=
y1 e1.
Definition eq_ok1 y0 y1 y2 (E: eq_1 y0 y1) :=
- match E with exist e0 e1 => S1_1 y0 y1 e0 e1 = y2 end.
+ match E with exist _ e0 e1 => S1_1 y0 y1 e0 e1 = y2 end.
Definition eq_2 y0 y1 y2 :=
{E1:eq_1 y0 y1 | eq_ok1 y0 y1 y2 E1}.
@@ -81,7 +81,7 @@ Definition S2_2 y0 y1 y2 (e0:eq_0 y0) (e1:S0_0 y0 e0 = y1)
y2 e2.
Definition eq_ok2 y0 y1 y2 y3 (E: eq_2 y0 y1 y2) : Prop :=
- match E with exist (exist e0 e1) e2 =>
+ match E with exist _ (exist _ e0 e1) e2 =>
S2_2 y0 y1 y2 e0 e1 e2 = y3 end.
Definition eq_3 y0 y1 y2 y3 :=
@@ -118,7 +118,7 @@ Definition S3_3 y0 y1 y2 y3 (e0:eq_0 y0) (e1:S0_0 y0 e0 = y1)
y3 e3.
Definition eq_ok3 y0 y1 y2 y3 y4 (E: eq_3 y0 y1 y2 y3) : Prop :=
- match E with exist (exist (exist e0 e1) e2) e3 =>
+ match E with exist _ (exist _ (exist _ e0 e1) e2) e3 =>
S3_3 y0 y1 y2 y3 e0 e1 e2 e3 = y4 end.
Definition eq_4 y0 y1 y2 y3 y4 :=
@@ -165,7 +165,7 @@ Definition S4_4 y0 y1 y2 y3 y4 (e0:eq_0 y0) (e1:S0_0 y0 e0 = y1)
y4 e4.
Definition eq_ok4 y0 y1 y2 y3 y4 y5 (E: eq_4 y0 y1 y2 y3 y4) : Prop :=
- match E with exist (exist (exist (exist e0 e1) e2) e3) e4 =>
+ match E with exist _ (exist _ (exist _ (exist _ e0 e1) e2) e3) e4 =>
S4_4 y0 y1 y2 y3 y4 e0 e1 e2 e3 e4 = y5 end.
Definition eq_5 y0 y1 y2 y3 y4 y5 :=
diff --git a/test-suite/bugs/closed/shouldsucceed/1844.v b/test-suite/bugs/closed/1844.v
index 17eeb352..17eeb352 100644
--- a/test-suite/bugs/closed/shouldsucceed/1844.v
+++ b/test-suite/bugs/closed/1844.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1865.v b/test-suite/bugs/closed/1865.v
index 17c19989..17c19989 100644
--- a/test-suite/bugs/closed/shouldsucceed/1865.v
+++ b/test-suite/bugs/closed/1865.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1891.v b/test-suite/bugs/closed/1891.v
index 2d90a2f1..68581117 100644
--- a/test-suite/bugs/closed/shouldsucceed/1891.v
+++ b/test-suite/bugs/closed/1891.v
@@ -7,7 +7,7 @@
Lemma L (x: T unit): (unit -> T unit) -> unit.
Proof.
- refine (match x return _ with mkT n => fun g => f (g _) end).
+ refine (match x return _ with mkT _ n => fun g => f (g _) end).
trivial.
Qed.
diff --git a/test-suite/bugs/closed/shouldfail/1898.v b/test-suite/bugs/closed/1898.v
index 92490eb9..70461286 100644
--- a/test-suite/bugs/closed/shouldfail/1898.v
+++ b/test-suite/bugs/closed/1898.v
@@ -2,4 +2,5 @@
Lemma bug_fold_unfold : True.
set (h := 1).
- fold h in h.
+ Fail fold h in h.
+ Abort.
diff --git a/test-suite/bugs/closed/shouldsucceed/1900.v b/test-suite/bugs/closed/1900.v
index cf03efda..cf03efda 100644
--- a/test-suite/bugs/closed/shouldsucceed/1900.v
+++ b/test-suite/bugs/closed/1900.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1901.v b/test-suite/bugs/closed/1901.v
index 7d86adbf..7d86adbf 100644
--- a/test-suite/bugs/closed/shouldsucceed/1901.v
+++ b/test-suite/bugs/closed/1901.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1905.v b/test-suite/bugs/closed/1905.v
index 8c81d751..8c81d751 100644
--- a/test-suite/bugs/closed/shouldsucceed/1905.v
+++ b/test-suite/bugs/closed/1905.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1907.v b/test-suite/bugs/closed/1907.v
index 55fc8231..55fc8231 100644
--- a/test-suite/bugs/closed/shouldsucceed/1907.v
+++ b/test-suite/bugs/closed/1907.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1912.v b/test-suite/bugs/closed/1912.v
index 987a5417..987a5417 100644
--- a/test-suite/bugs/closed/shouldsucceed/1912.v
+++ b/test-suite/bugs/closed/1912.v
diff --git a/test-suite/bugs/closed/1915.v b/test-suite/bugs/closed/1915.v
new file mode 100644
index 00000000..7e62437d
--- /dev/null
+++ b/test-suite/bugs/closed/1915.v
@@ -0,0 +1,6 @@
+
+Require Import Setoid.
+
+Fail Goal forall x, impl True (x = 0) -> x = 0 -> False.
+(*intros x H E.
+rewrite H in E.*) \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/1918.v b/test-suite/bugs/closed/1918.v
index 9d92fe12..9d92fe12 100644
--- a/test-suite/bugs/closed/shouldsucceed/1918.v
+++ b/test-suite/bugs/closed/1918.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1925.v b/test-suite/bugs/closed/1925.v
index 4caee1c3..4caee1c3 100644
--- a/test-suite/bugs/closed/shouldsucceed/1925.v
+++ b/test-suite/bugs/closed/1925.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1931.v b/test-suite/bugs/closed/1931.v
index 930ace1d..930ace1d 100644
--- a/test-suite/bugs/closed/shouldsucceed/1931.v
+++ b/test-suite/bugs/closed/1931.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1935.v b/test-suite/bugs/closed/1935.v
index d5837619..d5837619 100644
--- a/test-suite/bugs/closed/shouldsucceed/1935.v
+++ b/test-suite/bugs/closed/1935.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1939.v b/test-suite/bugs/closed/1939.v
index 5e61529b..5e61529b 100644
--- a/test-suite/bugs/closed/shouldsucceed/1939.v
+++ b/test-suite/bugs/closed/1939.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1944.v b/test-suite/bugs/closed/1944.v
index ee2918c6..ee2918c6 100644
--- a/test-suite/bugs/closed/shouldsucceed/1944.v
+++ b/test-suite/bugs/closed/1944.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1951.v b/test-suite/bugs/closed/1951.v
index 12c0ef9b..7558b0b8 100644
--- a/test-suite/bugs/closed/shouldsucceed/1951.v
+++ b/test-suite/bugs/closed/1951.v
@@ -5,11 +5,11 @@ Set Printing Universes.
Inductive enc (A:Type (*1*)) (* : Type.1 *) := C : A -> enc A.
-Definition id (X:Type(*5*)) (x:X) := x.
+Definition id (X:Type(*4*)) (x:X) := x.
-Lemma test : let S := Type(*6 : 7*) in enc S -> S.
+Lemma test : let S := Type(*5 : 6*) in enc S -> S.
simpl; intros.
-apply enc.
+refine (enc _).
apply id.
apply Prop.
Defined.
@@ -26,7 +26,7 @@ b : (list a) -> a. (* i don't know if this *)
Inductive sg : Type := Sg. (* single *)
Definition ipl2 (P : a -> Type) := (* in Prop, that means P is true forall *)
-fold_right (fun x => prod (P x)) sg. (* the elements of a given list *)
+ fold_right (fun x => fun A => prod (P x) A) sg. (* the elements of a given list *)
Definition ind
: forall S : a -> Type,
@@ -55,7 +55,7 @@ Defined.
Lemma k' : a -> Type. (* same lemma but with our bug *)
intro;pattern H;apply ind;intros.
- apply prod.
+ refine (prod _ _).
induction ls.
exact sg.
exact sg.
diff --git a/test-suite/bugs/closed/shouldsucceed/1962.v b/test-suite/bugs/closed/1962.v
index a6b0fee5..a6b0fee5 100644
--- a/test-suite/bugs/closed/shouldsucceed/1962.v
+++ b/test-suite/bugs/closed/1962.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1963.v b/test-suite/bugs/closed/1963.v
index 11e2ee44..11e2ee44 100644
--- a/test-suite/bugs/closed/shouldsucceed/1963.v
+++ b/test-suite/bugs/closed/1963.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1977.v b/test-suite/bugs/closed/1977.v
index 28715040..28715040 100644
--- a/test-suite/bugs/closed/shouldsucceed/1977.v
+++ b/test-suite/bugs/closed/1977.v
diff --git a/test-suite/bugs/closed/shouldsucceed/1981.v b/test-suite/bugs/closed/1981.v
index 99952682..99952682 100644
--- a/test-suite/bugs/closed/shouldsucceed/1981.v
+++ b/test-suite/bugs/closed/1981.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2001.v b/test-suite/bugs/closed/2001.v
index d0b3bf17..d0b3bf17 100644
--- a/test-suite/bugs/closed/shouldsucceed/2001.v
+++ b/test-suite/bugs/closed/2001.v
diff --git a/test-suite/bugs/closed/shouldfail/2006.v b/test-suite/bugs/closed/2006.v
index 91a16f95..d353d0e2 100644
--- a/test-suite/bugs/closed/shouldfail/2006.v
+++ b/test-suite/bugs/closed/2006.v
@@ -1,7 +1,7 @@
(* Take the type constraint on Record into account *)
Definition Type1 := Type.
-Record R : Type1 := { p:Type1 }. (* was accepted before trunk revision 11619 *)
+Fail Record R : Type1 := { p:Type1 }. (* was accepted before trunk revision 11619 *)
(*
Remarks:
diff --git a/test-suite/bugs/closed/shouldsucceed/2017.v b/test-suite/bugs/closed/2017.v
index df666148..df666148 100644
--- a/test-suite/bugs/closed/shouldsucceed/2017.v
+++ b/test-suite/bugs/closed/2017.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2021.v b/test-suite/bugs/closed/2021.v
index e598e5ae..e598e5ae 100644
--- a/test-suite/bugs/closed/shouldsucceed/2021.v
+++ b/test-suite/bugs/closed/2021.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2027.v b/test-suite/bugs/closed/2027.v
index fb53c6ef..fb53c6ef 100644
--- a/test-suite/bugs/closed/shouldsucceed/2027.v
+++ b/test-suite/bugs/closed/2027.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2083.v b/test-suite/bugs/closed/2083.v
index a6ce4de0..5f17f7af 100644
--- a/test-suite/bugs/closed/shouldsucceed/2083.v
+++ b/test-suite/bugs/closed/2083.v
@@ -15,7 +15,7 @@ Program Fixpoint check_n (n : nat) (P : { i | i < n } -> bool) (p : nat)
Require Import Omega.
-Solve Obligations using program_simpl ; auto with *; try omega.
+Solve Obligations with program_simpl ; auto with *; try omega.
Next Obligation.
apply H. simpl. omega.
diff --git a/test-suite/bugs/closed/shouldsucceed/2089.v b/test-suite/bugs/closed/2089.v
index aebccc94..aebccc94 100644
--- a/test-suite/bugs/closed/shouldsucceed/2089.v
+++ b/test-suite/bugs/closed/2089.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2095.v b/test-suite/bugs/closed/2095.v
index 28ea99df..28ea99df 100644
--- a/test-suite/bugs/closed/shouldsucceed/2095.v
+++ b/test-suite/bugs/closed/2095.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2108.v b/test-suite/bugs/closed/2108.v
index cad8baa9..cad8baa9 100644
--- a/test-suite/bugs/closed/shouldsucceed/2108.v
+++ b/test-suite/bugs/closed/2108.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2117.v b/test-suite/bugs/closed/2117.v
index 6377a8b7..6377a8b7 100644
--- a/test-suite/bugs/closed/shouldsucceed/2117.v
+++ b/test-suite/bugs/closed/2117.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2123.v b/test-suite/bugs/closed/2123.v
index 422a2c12..422a2c12 100644
--- a/test-suite/bugs/closed/shouldsucceed/2123.v
+++ b/test-suite/bugs/closed/2123.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2127.v b/test-suite/bugs/closed/2127.v
index 142ada26..142ada26 100644
--- a/test-suite/bugs/closed/shouldsucceed/2127.v
+++ b/test-suite/bugs/closed/2127.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2135.v b/test-suite/bugs/closed/2135.v
index 61882176..61882176 100644
--- a/test-suite/bugs/closed/shouldsucceed/2135.v
+++ b/test-suite/bugs/closed/2135.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2136.v b/test-suite/bugs/closed/2136.v
index d2b926f3..d2b926f3 100644
--- a/test-suite/bugs/closed/shouldsucceed/2136.v
+++ b/test-suite/bugs/closed/2136.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2137.v b/test-suite/bugs/closed/2137.v
index 6c2023ab..6c2023ab 100644
--- a/test-suite/bugs/closed/shouldsucceed/2137.v
+++ b/test-suite/bugs/closed/2137.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2139.v b/test-suite/bugs/closed/2139.v
index a7f35508..a7f35508 100644
--- a/test-suite/bugs/closed/shouldsucceed/2139.v
+++ b/test-suite/bugs/closed/2139.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2141.v b/test-suite/bugs/closed/2141.v
index 941ae530..941ae530 100644
--- a/test-suite/bugs/closed/shouldsucceed/2141.v
+++ b/test-suite/bugs/closed/2141.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2145.v b/test-suite/bugs/closed/2145.v
index 4dc0de74..4dc0de74 100644
--- a/test-suite/bugs/closed/shouldsucceed/2145.v
+++ b/test-suite/bugs/closed/2145.v
diff --git a/test-suite/bugs/closed/2149.v b/test-suite/bugs/closed/2149.v
new file mode 100644
index 00000000..38c5f36a
--- /dev/null
+++ b/test-suite/bugs/closed/2149.v
@@ -0,0 +1,7 @@
+Lemma Foo : forall x y : nat, y = x -> y = x.
+Proof.
+intros x y.
+rename x into y, y into x.
+trivial.
+Qed.
+
diff --git a/test-suite/bugs/closed/2164.v b/test-suite/bugs/closed/2164.v
new file mode 100644
index 00000000..6adb3577
--- /dev/null
+++ b/test-suite/bugs/closed/2164.v
@@ -0,0 +1,334 @@
+(* Check that "inversion as" manages names as expected *)
+Inductive type: Set
+ := | int: type
+ | pointer: type -> type.
+Print type.
+
+Parameter value_set
+ : type -> Set.
+
+Parameter string : Set.
+
+Parameter Z : Set.
+
+Inductive lvalue (t: type): Set
+ := | var: string -> lvalue t (* name of the variable *)
+ | lvalue_loc: Z -> lvalue t (* address of the variable *)
+ | deref_l: lvalue (pointer t) -> lvalue t (* deref an lvalue ptr *)
+ | deref_r: rvalue (pointer t) -> lvalue t (* deref an rvalue ptr *)
+with rvalue (t: type): Set
+ := | value_of: lvalue t -> rvalue t (* variable as value *)
+ | mk_rvalue: value_set t -> rvalue t. (* literal value *)
+Print lvalue.
+
+Inductive statement: Set
+ := | void_stat: statement
+ | var_loc: (* to be destucted at end of scope *)
+ forall (t: type) (n: string) (loc: Z), statement
+ | var_ref: (* not to be destructed *)
+ forall (t: type) (n: string) (loc: Z), statement
+ | var_def: (* var def as typed in code *)
+ forall (t:type) (n: string) (val: rvalue t), statement
+ | assign:
+ forall (t: type) (var: lvalue t) (val: rvalue t), statement
+ | group:
+ forall (l: list statement), statement
+ | fun_def:
+ forall (s: string) (l: list statement), statement
+ | param_decl:
+ forall (t: type) (n: string), statement
+ | delete:
+ forall a: Z, statement.
+
+Inductive expr: Set
+:= | statement_to_expr: statement -> expr
+ | lvalue_to_expr: forall t: type, lvalue t -> expr
+ | rvalue_to_expr: forall t: type, rvalue t -> expr.
+
+Inductive executable_prim_expr: expr -> Set
+:=
+(* statements *)
+ | var_def_primitive:
+ forall (t: type) (n: string) (loc: Z),
+ executable_prim_expr
+ (statement_to_expr
+ (var_def t n
+ (value_of t (lvalue_loc t loc))))
+ | assign_primitive:
+ forall (t: type) (loc1 loc2: Z),
+ executable_prim_expr
+ (statement_to_expr
+ (assign t (lvalue_loc t loc1)
+ (value_of t (lvalue_loc t loc2))))
+(* rvalue *)
+ | mk_rvalue_primitive:
+ forall (t: type) (v: value_set t),
+ executable_prim_expr
+ (rvalue_to_expr t (mk_rvalue t v))
+(* lvalue *)
+ (* var *)
+ | var_primitive:
+ forall (t: type) (n: string),
+ executable_prim_expr (lvalue_to_expr t (var t n))
+ (* deref_l *)
+ | deref_l_primitive:
+ forall (t: type) (loc: Z),
+ executable_prim_expr
+ (lvalue_to_expr t
+ (deref_l t (lvalue_loc (pointer t) loc)))
+ (* deref_r *)
+ | deref_r_primitive:
+ forall (t: type) (loc: Z),
+ executable_prim_expr
+ (lvalue_to_expr t
+ (deref_r t
+ (value_of (pointer t)
+ (lvalue_loc (pointer t) loc)))).
+
+Inductive executable_sub_expr: expr -> Set
+:= | executable_sub_expr_prim:
+ forall e: expr,
+ executable_prim_expr e ->
+ executable_sub_expr e
+(* statements *)
+ | var_def_sub_rvalue:
+ forall (t: type) (n: string) (rv: rvalue t),
+ executable_sub_expr (rvalue_to_expr t rv) ->
+ executable_sub_expr (statement_to_expr (var_def t n rv))
+ | assign_sub_lvalue:
+ forall (t: type) (lv: lvalue t) (rv: rvalue t),
+ executable_sub_expr (lvalue_to_expr t lv) ->
+ executable_sub_expr (statement_to_expr (assign t lv rv))
+ | assign_sub_rvalue:
+ forall (t: type) (lv: lvalue t) (rv: rvalue t),
+ executable_sub_expr (rvalue_to_expr t rv) ->
+ executable_sub_expr (statement_to_expr (assign t lv rv))
+(* rvalue *)
+ | value_of_sub_lvalue:
+ forall (t: type) (lv: lvalue t),
+ executable_sub_expr (lvalue_to_expr t lv) ->
+ executable_sub_expr (rvalue_to_expr t (value_of t lv))
+(* lvalue *)
+ | deref_l_sub_lvalue:
+ forall (t: type) (lv: lvalue (pointer t)),
+ executable_sub_expr (lvalue_to_expr (pointer t) lv) ->
+ executable_sub_expr (lvalue_to_expr t (deref_l t lv))
+ | deref_r_sub_rvalue:
+ forall (t: type) (rv: rvalue (pointer t)),
+ executable_sub_expr (rvalue_to_expr (pointer t) rv) ->
+ executable_sub_expr (lvalue_to_expr t (deref_r t rv)).
+
+Inductive expr_kind: Set
+:= | statement_kind: expr_kind
+ | lvalue_kind: type -> expr_kind
+ | rvalue_kind: type -> expr_kind.
+
+Definition expr_to_kind: expr -> expr_kind.
+intro e.
+destruct e.
+exact statement_kind.
+exact (lvalue_kind t).
+exact (rvalue_kind t).
+Defined.
+
+Inductive def_sub_expr_subs:
+ forall e: expr,
+ forall ee: executable_sub_expr e,
+ forall ee': expr,
+ forall e': expr,
+ Prop
+:= | def_sub_expr_subs_prim:
+ forall e: expr,
+ forall p: executable_prim_expr e,
+ forall ee': expr,
+ expr_to_kind e = expr_to_kind ee' ->
+ def_sub_expr_subs e (executable_sub_expr_prim e p) ee' ee'
+ | def_sub_expr_subs_var_def_sub_rvalue:
+ forall (t: type) (n: string),
+ forall rv rv': rvalue t,
+ forall ee': expr,
+ forall se_rv: executable_sub_expr (rvalue_to_expr t rv),
+ def_sub_expr_subs (rvalue_to_expr t rv) se_rv ee'
+ (rvalue_to_expr t rv') ->
+ def_sub_expr_subs
+ (statement_to_expr (var_def t n rv))
+ (var_def_sub_rvalue t n rv se_rv)
+ ee'
+ (statement_to_expr (var_def t n rv'))
+ | def_sub_expr_subs_assign_sub_lvalue:
+ forall t: type,
+ forall lv lv': lvalue t,
+ forall rv: rvalue t,
+ forall ee': expr,
+ forall se_lv: executable_sub_expr (lvalue_to_expr t lv),
+ def_sub_expr_subs (lvalue_to_expr t lv) se_lv ee'
+ (lvalue_to_expr t lv') ->
+ def_sub_expr_subs
+ (statement_to_expr (assign t lv rv))
+ (assign_sub_lvalue t lv rv se_lv)
+ ee'
+ (statement_to_expr (assign t lv' rv))
+ | def_sub_expr_subs_assign_sub_rvalue:
+ forall t: type,
+ forall lv: lvalue t,
+ forall rv rv': rvalue t,
+ forall ee': expr,
+ forall se_rv: executable_sub_expr (rvalue_to_expr t rv),
+ def_sub_expr_subs (rvalue_to_expr t rv) se_rv ee'
+ (rvalue_to_expr t rv') ->
+ def_sub_expr_subs
+ (statement_to_expr (assign t lv rv))
+ (assign_sub_rvalue t lv rv se_rv)
+ ee'
+ (statement_to_expr (assign t lv rv'))
+ | def_sub_expr_subs_value_of_sub_lvalue:
+ forall t: type,
+ forall lv lv': lvalue t,
+ forall ee': expr,
+ forall se_lv: executable_sub_expr (lvalue_to_expr t lv),
+ def_sub_expr_subs (lvalue_to_expr t lv) se_lv ee'
+ (lvalue_to_expr t lv') ->
+ def_sub_expr_subs
+ (rvalue_to_expr t (value_of t lv))
+ (value_of_sub_lvalue t lv se_lv)
+ ee'
+ (rvalue_to_expr t (value_of t lv'))
+ | def_sub_expr_subs_deref_l_sub_lvalue:
+ forall t: type,
+ forall lv lv': lvalue (pointer t),
+ forall ee': expr,
+ forall se_lv: executable_sub_expr (lvalue_to_expr (pointer t) lv),
+ def_sub_expr_subs (lvalue_to_expr (pointer t) lv) se_lv ee'
+ (lvalue_to_expr (pointer t) lv') ->
+ def_sub_expr_subs
+ (lvalue_to_expr t (deref_l t lv))
+ (deref_l_sub_lvalue t lv se_lv)
+ ee'
+ (lvalue_to_expr t (deref_l t lv'))
+ | def_sub_expr_subs_deref_r_sub_rvalue:
+ forall t: type,
+ forall rv rv': rvalue (pointer t),
+ forall ee': expr,
+ forall se_rv: executable_sub_expr (rvalue_to_expr (pointer t) rv),
+ def_sub_expr_subs (rvalue_to_expr (pointer t) rv) se_rv ee'
+ (rvalue_to_expr (pointer t) rv') ->
+ def_sub_expr_subs
+ (lvalue_to_expr t (deref_r t rv))
+ (deref_r_sub_rvalue t rv se_rv)
+ ee'
+ (lvalue_to_expr t (deref_r t rv')).
+
+Lemma type_dec: forall t t': type, {t = t'} + {t <> t'}.
+Proof.
+intros t.
+induction t as [|t IH].
+destruct t'.
+tauto.
+right.
+discriminate.
+destruct t'.
+right.
+discriminate.
+destruct (IH t') as [H|H].
+left.
+f_equal.
+tauto.
+right.
+injection.
+tauto.
+Qed.
+Check type_dec.
+
+Definition sigT_get_proof:
+ forall T: Type,
+ forall eq_dec_T: forall t t': T, {t = t'} + {~ t = t'},
+ forall P: T -> Type,
+ forall t: T,
+ P t ->
+ sigT P ->
+ P t.
+intros T eq_dec_T P t H1 H2.
+destruct H2 as [t' H2].
+destruct (eq_dec_T t t') as [H3|H3].
+rewrite H3.
+exact H2.
+exact H1.
+Defined.
+
+Axiom sigT_get_proof_existT_same:
+ forall T: Type,
+ forall eq_dec_T: forall t t': T, {t = t'} + {~ t = t'},
+ forall P: T -> Type,
+ forall t: T,
+ forall H1 H2: P t,
+ sigT_get_proof T eq_dec_T P t H1 (existT P t H2) = H2.
+
+Theorem existT_injective:
+ forall T,
+ (forall t1 t2: T, { t1 = t2 } + { t1 <> t2 }) ->
+ forall P: T -> Type,
+ forall t: T,
+ forall pt1 pt2: P t,
+ existT P t pt1 = existT P t pt2 ->
+ pt1 = pt2.
+Proof.
+intros T T_dec P t pt1 pt2 H1.
+pose (H2 := f_equal (sigT_get_proof T T_dec P t pt1) H1).
+repeat rewrite sigT_get_proof_existT_same in H2.
+assumption.
+Qed.
+
+Ltac decide_equality_sub dec x x' H :=
+ destruct (dec x x') as [H|H];
+ [subst x'; try tauto|try(right; injection; tauto; fail)].
+
+Axiom value_set_dec:
+ forall t: type,
+ forall v v': value_set t,
+ {v = v'} + {v <> v'}.
+
+Theorem lvalue_dec:
+ forall (t: type) (l l': lvalue t), {l = l'} + {l <> l'}
+with rvalue_dec:
+ forall (t: type) (r r': rvalue t), {r = r'} + {r <> r'}.
+Admitted.
+
+Theorem sub_expr_subs_same_kind:
+ forall e: expr,
+ forall ee: executable_sub_expr e,
+ forall ee': expr,
+ forall e': expr,
+ def_sub_expr_subs e ee ee' e' ->
+ expr_to_kind e = expr_to_kind e'.
+Proof.
+intros e ee ee' e' H1.
+case H1; try (intros; tauto; fail).
+Qed.
+
+Theorem def_sub_expr_subs_assign_sub_lvalue_inversion:
+ forall t: type,
+ forall lv: lvalue t,
+ forall rv: rvalue t,
+ forall ee' e': expr,
+ forall ee_sub: executable_sub_expr (lvalue_to_expr t lv),
+ def_sub_expr_subs (statement_to_expr (assign t lv rv))
+ (assign_sub_lvalue t lv rv ee_sub) ee' e' ->
+ { lv': lvalue t
+ | def_sub_expr_subs (lvalue_to_expr t lv) ee_sub ee'
+ (lvalue_to_expr t lv')
+ & e' = statement_to_expr (assign t lv' rv) }.
+Proof.
+intros t lv rv ee' [s'|t' lv''|t' rv''] ee_sub H1;
+ try discriminate (sub_expr_subs_same_kind _ _ _ _ H1).
+destruct s' as [| | | |t' lv'' rv''| | | |];
+ try(assert (H2: False); [inversion H1|elim H2]; fail).
+destruct (type_dec t t') as [H2|H2];
+ [|assert (H3: False);
+ [|elim H3; fail]].
+2: inversion H1 as [];tauto.
+subst t'.
+exists lv''.
+ inversion H1 as
+ [| |t' lv''' lv'''' rv''' ee'' ee_sub' H2 (H3_1,H3_2,H3_3) (H4_1,H4_2,H4_3,H4_4,H4_5) H5 (H6_1,H6_2)| | | |].
+(* Check that all names are the given ones: *)
+clear t' lv''' lv'''' rv''' ee'' ee_sub' H2 H3_1 H3_2 H3_3 H4_1 H4_2 H4_3 H4_4 H4_5 H5 H6_1 H6_2.
diff --git a/test-suite/bugs/closed/shouldsucceed/2181.v b/test-suite/bugs/closed/2181.v
index 62820d86..62820d86 100644
--- a/test-suite/bugs/closed/shouldsucceed/2181.v
+++ b/test-suite/bugs/closed/2181.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2193.v b/test-suite/bugs/closed/2193.v
index fe258867..fe258867 100644
--- a/test-suite/bugs/closed/shouldsucceed/2193.v
+++ b/test-suite/bugs/closed/2193.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2230.v b/test-suite/bugs/closed/2230.v
index 5076fb2b..5076fb2b 100644
--- a/test-suite/bugs/closed/shouldsucceed/2230.v
+++ b/test-suite/bugs/closed/2230.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2231.v b/test-suite/bugs/closed/2231.v
index 03e2c9bb..03e2c9bb 100644
--- a/test-suite/bugs/closed/shouldsucceed/2231.v
+++ b/test-suite/bugs/closed/2231.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2244.v b/test-suite/bugs/closed/2244.v
index d499e515..d499e515 100644
--- a/test-suite/bugs/closed/shouldsucceed/2244.v
+++ b/test-suite/bugs/closed/2244.v
diff --git a/test-suite/bugs/closed/2250.v b/test-suite/bugs/closed/2250.v
new file mode 100644
index 00000000..565d7b68
--- /dev/null
+++ b/test-suite/bugs/closed/2250.v
@@ -0,0 +1,3 @@
+Check prod: Prop -> Prop -> Prop.
+(* (fun A B : Prop => (A * B)%type):Prop -> Prop -> Prop
+ : Prop -> Prop -> Prop *)
diff --git a/test-suite/bugs/closed/shouldfail/2251.v b/test-suite/bugs/closed/2251.v
index 642717f4..d0fa3f2b 100644
--- a/test-suite/bugs/closed/shouldfail/2251.v
+++ b/test-suite/bugs/closed/2251.v
@@ -2,4 +2,5 @@
Lemma evar_rewrite : (forall a : nat, a = 0 -> True) -> True.
intros; eapply H. (* goal is ?30 = nil *)
-rewrite plus_n_Sm.
+Fail rewrite plus_n_Sm.
+Abort.
diff --git a/test-suite/bugs/closed/shouldsucceed/2255.v b/test-suite/bugs/closed/2255.v
index bf80ff66..bf80ff66 100644
--- a/test-suite/bugs/closed/shouldsucceed/2255.v
+++ b/test-suite/bugs/closed/2255.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2262.v b/test-suite/bugs/closed/2262.v
index b61f18b8..b61f18b8 100644
--- a/test-suite/bugs/closed/shouldsucceed/2262.v
+++ b/test-suite/bugs/closed/2262.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2281.v b/test-suite/bugs/closed/2281.v
index 40948d90..40948d90 100644
--- a/test-suite/bugs/closed/shouldsucceed/2281.v
+++ b/test-suite/bugs/closed/2281.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2295.v b/test-suite/bugs/closed/2295.v
index f5ca28dc..f5ca28dc 100644
--- a/test-suite/bugs/closed/shouldsucceed/2295.v
+++ b/test-suite/bugs/closed/2295.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2299.v b/test-suite/bugs/closed/2299.v
index c0552ca7..c0552ca7 100644
--- a/test-suite/bugs/closed/shouldsucceed/2299.v
+++ b/test-suite/bugs/closed/2299.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2300.v b/test-suite/bugs/closed/2300.v
index 4e587cbb..4e587cbb 100644
--- a/test-suite/bugs/closed/shouldsucceed/2300.v
+++ b/test-suite/bugs/closed/2300.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2303.v b/test-suite/bugs/closed/2303.v
index e614b9b5..e614b9b5 100644
--- a/test-suite/bugs/closed/shouldsucceed/2303.v
+++ b/test-suite/bugs/closed/2303.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2304.v b/test-suite/bugs/closed/2304.v
index 1ac2702b..1ac2702b 100644
--- a/test-suite/bugs/closed/shouldsucceed/2304.v
+++ b/test-suite/bugs/closed/2304.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2307.v b/test-suite/bugs/closed/2307.v
index 7c049495..7c049495 100644
--- a/test-suite/bugs/closed/shouldsucceed/2307.v
+++ b/test-suite/bugs/closed/2307.v
diff --git a/test-suite/bugs/closed/2310.v b/test-suite/bugs/closed/2310.v
new file mode 100644
index 00000000..0be859ed
--- /dev/null
+++ b/test-suite/bugs/closed/2310.v
@@ -0,0 +1,17 @@
+(* Dependent higher-order hole in "refine" (simplified version) *)
+
+Set Implicit Arguments.
+
+Inductive Nest t := Cons : Nest (prod t t) -> Nest t.
+
+Definition cast A x y Heq P H := @eq_rect A x P H y Heq.
+
+Definition replace a (y:Nest (prod a a)) : a = a -> Nest a.
+
+(* This used to raise an anomaly Unknown Meta in 8.2 and 8.3beta.
+ It raises a regular error in 8.3 and almost succeeds with the new
+ proof engine: there are two solutions to a unification problem
+ (P:=\a.Nest (prod a a) and P:=\_.Nest (prod a a)) and refine should either
+ leave P as subgoal or choose itself one solution *)
+
+intros. refine (Cons (cast H _ y)). \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/2320.v b/test-suite/bugs/closed/2320.v
index facb9ecf..facb9ecf 100644
--- a/test-suite/bugs/closed/shouldsucceed/2320.v
+++ b/test-suite/bugs/closed/2320.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2342.v b/test-suite/bugs/closed/2342.v
index 094e5466..6613b285 100644
--- a/test-suite/bugs/closed/shouldsucceed/2342.v
+++ b/test-suite/bugs/closed/2342.v
@@ -4,5 +4,5 @@
Parameter A : Set.
Parameter B : A -> Set.
Parameter F : Set -> Prop.
-Check (F (forall x, B x)).
+Check (F (forall x, B x)).
diff --git a/test-suite/bugs/closed/shouldsucceed/2347.v b/test-suite/bugs/closed/2347.v
index e433f158..e433f158 100644
--- a/test-suite/bugs/closed/shouldsucceed/2347.v
+++ b/test-suite/bugs/closed/2347.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2350.v b/test-suite/bugs/closed/2350.v
index e91f22e2..e91f22e2 100644
--- a/test-suite/bugs/closed/shouldsucceed/2350.v
+++ b/test-suite/bugs/closed/2350.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2353.v b/test-suite/bugs/closed/2353.v
index b5c45c28..baae9a6e 100644
--- a/test-suite/bugs/closed/shouldsucceed/2353.v
+++ b/test-suite/bugs/closed/2353.v
@@ -4,9 +4,9 @@ Inductive term n := app (l : list term n).
Definition term_list :=
fix term_size n (t : term n) (acc : nat) {struct t} : nat :=
match t with
- | app l =>
+ | app _ l =>
(fix term_list_size n (l : list term n) (acc : nat) {struct l} : nat :=
match l with
- | cons t q => term_list_size (S n) q (term_size n t acc)
+ | cons _ _ t q => term_list_size (S n) q (term_size n t acc)
end) n l (S acc)
end.
diff --git a/test-suite/bugs/closed/shouldsucceed/2360.v b/test-suite/bugs/closed/2360.v
index 4ae97c97..4ae97c97 100644
--- a/test-suite/bugs/closed/shouldsucceed/2360.v
+++ b/test-suite/bugs/closed/2360.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2362.v b/test-suite/bugs/closed/2362.v
index febb9c7b..febb9c7b 100644
--- a/test-suite/bugs/closed/shouldsucceed/2362.v
+++ b/test-suite/bugs/closed/2362.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2375.v b/test-suite/bugs/closed/2375.v
index c17c426c..c17c426c 100644
--- a/test-suite/bugs/closed/shouldsucceed/2375.v
+++ b/test-suite/bugs/closed/2375.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2378.v b/test-suite/bugs/closed/2378.v
index 7deec64d..35c69db2 100644
--- a/test-suite/bugs/closed/shouldsucceed/2378.v
+++ b/test-suite/bugs/closed/2378.v
@@ -66,9 +66,9 @@ Implicit Arguments lpSat.
Fixpoint LPTransfo Pred1 Pred2 p2lp (f: LP Pred1): LP Pred2 :=
match f with
- LPPred p => p2lp p
- | LPAnd f1 f2 => LPAnd _ (LPTransfo Pred1 Pred2 p2lp f1) (LPTransfo Pred1 Pred2 p2lp f2)
- | LPNot f1 => LPNot _ (LPTransfo Pred1 Pred2 p2lp f1)
+ LPPred _ p => p2lp p
+ | LPAnd _ f1 f2 => LPAnd _ (LPTransfo Pred1 Pred2 p2lp f1) (LPTransfo Pred1 Pred2 p2lp f2)
+ | LPNot _ f1 => LPNot _ (LPTransfo Pred1 Pred2 p2lp f1)
end.
Implicit Arguments LPTransfo.
@@ -503,6 +503,9 @@ Qed.
Require Export Coq.Logic.FunctionalExtensionality.
Print PLanguage.
+
+Unset Standard Proposition Elimination Names.
+
Program Definition PTransfo l1 l2 (tr: Transformation l1 l2) (h: isSharedTransfo l1 l2 tr):
Transformation (PLanguage l1) (PLanguage l2) :=
mkTransformation (PLanguage l1) (PLanguage l2)
diff --git a/test-suite/bugs/closed/shouldsucceed/2388.v b/test-suite/bugs/closed/2388.v
index c7926711..c7926711 100644
--- a/test-suite/bugs/closed/shouldsucceed/2388.v
+++ b/test-suite/bugs/closed/2388.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2393.v b/test-suite/bugs/closed/2393.v
index fb4f9261..fb4f9261 100644
--- a/test-suite/bugs/closed/shouldsucceed/2393.v
+++ b/test-suite/bugs/closed/2393.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2404.v b/test-suite/bugs/closed/2404.v
index fe8eba54..8ac696e9 100644
--- a/test-suite/bugs/closed/shouldsucceed/2404.v
+++ b/test-suite/bugs/closed/2404.v
@@ -37,8 +37,8 @@ Definition Rweak : forall a b : bWorld, Type := RstarInv bwweak.
Fixpoint exportRweak {a b} (aRWb : Rweak a b) (y : bName b) : option (bName a) :=
match aRWb,y with
- | starReflS a, y' => Some y'
- | starTransS i j k jWk jRWi, y' =>
+ | starReflS _ a, y' => Some y'
+ | starTransS jWk jRWi, y' =>
match (bexportw jWk y) with
| Some x => exportRweak jRWi x
| None => None
diff --git a/test-suite/bugs/closed/2406.v b/test-suite/bugs/closed/2406.v
new file mode 100644
index 00000000..1bd66ffc
--- /dev/null
+++ b/test-suite/bugs/closed/2406.v
@@ -0,0 +1,6 @@
+(* Check correct handling of unsupported notations *)
+Notation "'’'" := (fun x => x) (at level 20).
+
+(* This fails with a syntax error but it is not catched by Fail
+Fail Definition crash_the_rooster f := ’.
+*)
diff --git a/test-suite/bugs/closed/2447.v b/test-suite/bugs/closed/2447.v
new file mode 100644
index 00000000..fdeb69fc
--- /dev/null
+++ b/test-suite/bugs/closed/2447.v
@@ -0,0 +1,7 @@
+Record t := {x : bool; y : bool; z : bool}.
+
+Goal forall x1 x2 y z,
+ {| x := x1; y := y; z := z |} = {| x := x2; y := y; z := z |} -> x1 = x2.
+Proof.
+intros; congruence. (* was doing stack overflow *)
+Qed.
diff --git a/test-suite/bugs/closed/shouldsucceed/2456.v b/test-suite/bugs/closed/2456.v
index 56f046c4..56f046c4 100644
--- a/test-suite/bugs/closed/shouldsucceed/2456.v
+++ b/test-suite/bugs/closed/2456.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2464.v b/test-suite/bugs/closed/2464.v
index af708587..af708587 100644
--- a/test-suite/bugs/closed/shouldsucceed/2464.v
+++ b/test-suite/bugs/closed/2464.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2467.v b/test-suite/bugs/closed/2467.v
index ad17814a..ad17814a 100644
--- a/test-suite/bugs/closed/shouldsucceed/2467.v
+++ b/test-suite/bugs/closed/2467.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2473.v b/test-suite/bugs/closed/2473.v
index 4c302512..4c302512 100644
--- a/test-suite/bugs/closed/shouldsucceed/2473.v
+++ b/test-suite/bugs/closed/2473.v
diff --git a/test-suite/bugs/closed/shouldfail/2586.v b/test-suite/bugs/closed/2586.v
index 6111a641..7e02e7f1 100644
--- a/test-suite/bugs/closed/shouldfail/2586.v
+++ b/test-suite/bugs/closed/2586.v
@@ -2,4 +2,5 @@ Require Import Setoid SetoidClass Program.
Goal forall `(Setoid nat) x y, x == y -> S x == S y.
intros.
- clsubst H0. \ No newline at end of file
+ Fail clsubst H0.
+ Abort. \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/2603.v b/test-suite/bugs/closed/2603.v
index 371bfdc5..371bfdc5 100644
--- a/test-suite/bugs/closed/shouldsucceed/2603.v
+++ b/test-suite/bugs/closed/2603.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2608.v b/test-suite/bugs/closed/2608.v
index a4c95ff9..a4c95ff9 100644
--- a/test-suite/bugs/closed/shouldsucceed/2608.v
+++ b/test-suite/bugs/closed/2608.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2613.v b/test-suite/bugs/closed/2613.v
index 4f0470b1..4f0470b1 100644
--- a/test-suite/bugs/closed/shouldsucceed/2613.v
+++ b/test-suite/bugs/closed/2613.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2615.v b/test-suite/bugs/closed/2615.v
index 54e1a07c..dde6a6a5 100644
--- a/test-suite/bugs/closed/shouldsucceed/2615.v
+++ b/test-suite/bugs/closed/2615.v
@@ -12,3 +12,5 @@ Fail induction 1.
refine (fun p => match p with _ => _ end).
Undo.
refine (fun p => match p with foo_intro _ _ => _ end).
+admit.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/2616.v b/test-suite/bugs/closed/2616.v
index 8758e32d..8758e32d 100644
--- a/test-suite/bugs/closed/shouldsucceed/2616.v
+++ b/test-suite/bugs/closed/2616.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2629.v b/test-suite/bugs/closed/2629.v
index 759cd3dd..759cd3dd 100644
--- a/test-suite/bugs/closed/shouldsucceed/2629.v
+++ b/test-suite/bugs/closed/2629.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2640.v b/test-suite/bugs/closed/2640.v
index da0cc68a..da0cc68a 100644
--- a/test-suite/bugs/closed/shouldsucceed/2640.v
+++ b/test-suite/bugs/closed/2640.v
diff --git a/test-suite/bugs/closed/2667.v b/test-suite/bugs/closed/2667.v
new file mode 100644
index 00000000..0631e535
--- /dev/null
+++ b/test-suite/bugs/closed/2667.v
@@ -0,0 +1,11 @@
+(* Check that extra arguments to Arguments Scope do not disturb use of *)
+(* scopes in constructors *)
+
+Inductive stmt : Type := Sskip: stmt | Scall : nat -> stmt.
+Bind Scope Cminor with stmt.
+
+(* extra argument is ok because of possible coercion to funclass *)
+Arguments Scope Scall [_ Cminor ].
+
+(* extra argument is ok because of possible coercion to funclass *)
+Fixpoint f (c: stmt) : Prop := match c with Scall _ => False | _ => False end.
diff --git a/test-suite/bugs/closed/shouldsucceed/2668.v b/test-suite/bugs/closed/2668.v
index 74c8fa34..74c8fa34 100644
--- a/test-suite/bugs/closed/shouldsucceed/2668.v
+++ b/test-suite/bugs/closed/2668.v
diff --git a/test-suite/bugs/closed/2670.v b/test-suite/bugs/closed/2670.v
new file mode 100644
index 00000000..c401420e
--- /dev/null
+++ b/test-suite/bugs/closed/2670.v
@@ -0,0 +1,21 @@
+(* Check that problems with several solutions are solved in 8.4 as in 8.2 and 8.3 *)
+
+Inductive Fin: nat -> Set :=
+| first k : Fin (S k)
+| succ k: Fin k -> Fin (S k).
+
+Lemma match_sym_eq_eq: forall (n1 n2: nat)(f: Fin n1)(e: n1 = n2),
+f = match sym_eq e in (_ = l) return (Fin l) with refl_equal =>
+ match e in (_ = l) return (Fin l) with refl_equal => f end end.
+Proof.
+ intros n1 n2 f e.
+ (* Next line has a dependent and a non dependent solution *)
+ (* 8.2 and 8.3 used to choose the dependent one which is the one to make *)
+ (* the goal progress *)
+ refine (match e return _ with refl_equal => _ end).
+ reflexivity.
+ Undo 2.
+ (* Next line similarly has a dependent and a non dependent solution *)
+ refine (match e with refl_equal => _ end).
+ reflexivity.
+Qed.
diff --git a/test-suite/bugs/closed/2680.v b/test-suite/bugs/closed/2680.v
new file mode 100644
index 00000000..0f573a28
--- /dev/null
+++ b/test-suite/bugs/closed/2680.v
@@ -0,0 +1,17 @@
+(* Tauto bug initially due to wrong test for binary connective *)
+
+Parameter A B : Type.
+
+Axiom P : A -> B -> Prop.
+
+Inductive IP (a : A) (b: B) : Prop :=
+| IP_def : P a b -> IP a b.
+
+
+Goal forall (a : A) (b : B), IP a b -> ~ IP a b -> False.
+Proof.
+ intros.
+ tauto.
+Qed.
+
+
diff --git a/test-suite/bugs/closed/2713.v b/test-suite/bugs/closed/2713.v
new file mode 100644
index 00000000..b5fc74bf
--- /dev/null
+++ b/test-suite/bugs/closed/2713.v
@@ -0,0 +1,17 @@
+Set Implicit Arguments.
+
+Definition pred_le A (P Q : A->Prop) :=
+ forall x, P x -> Q x.
+
+Lemma pred_le_refl : forall A (P:A->Prop),
+ pred_le P P.
+Proof. unfold pred_le. auto. Qed.
+
+Hint Resolve pred_le_refl.
+
+Lemma test :
+ forall (P1 P2:nat->Prop),
+ (forall Q, pred_le (fun a => P1 a /\ P2 a) Q -> True) ->
+ True.
+Proof. intros. eapply H. eauto. (* used to work *)
+ apply pred_le_refl. Qed.
diff --git a/test-suite/bugs/closed/2729.v b/test-suite/bugs/closed/2729.v
new file mode 100644
index 00000000..7929b881
--- /dev/null
+++ b/test-suite/bugs/closed/2729.v
@@ -0,0 +1,115 @@
+(* This bug report actually revealed two bugs in the reconstruction of
+ a term with "match" in the vm *)
+
+(* A simplified form of the first problem *)
+
+(* Reconstruction of terms normalized with vm when a constructor has *)
+(* let-ins arguments *)
+
+Record A : Type := C { a := 0 : nat; b : a=a }.
+Goal forall d:A, match d with C a b => b end = match d with C a b => b end.
+intro.
+vm_compute.
+(* Now check that it is well-typed *)
+match goal with |- ?c = _ => first [let x := type of c in idtac | fail 2] end.
+Abort.
+
+(* A simplified form of the second problem *)
+
+Parameter P : nat -> Type.
+
+Inductive box A := Box : A -> box A.
+
+Axiom com : {m : nat & box (P m) }.
+
+Lemma L :
+ (let (w, s) as com' return (com' = com -> Prop) := com in
+ let (s0) as s0
+ return (existT (fun m : nat => box (P m)) w s0 = com -> Prop) := s in
+ fun _ : existT (fun m : nat => box (P m)) w (Box (P w) s0) = com =>
+ True) eq_refl.
+Proof.
+vm_compute.
+(* Now check that it is well-typed (the "P w" used to be turned into "P s") *)
+match goal with |- ?c => first [let x := type of c in idtac | fail 2] end.
+Abort.
+
+(* Then the original report *)
+
+Require Import Equality.
+
+Parameter NameSet : Set.
+Parameter SignedName : Set.
+Parameter SignedName_compare : forall (x y : SignedName), comparison.
+Parameter pu_type : NameSet -> NameSet -> Type.
+Parameter pu_nameOf : forall {from to : NameSet}, pu_type from to -> SignedName.
+Parameter commute : forall {from mid1 mid2 to : NameSet},
+ pu_type from mid1 -> pu_type mid1 to
+ -> pu_type from mid2 -> pu_type mid2 to -> Prop.
+
+Program Definition castPatchFrom {from from' to : NameSet}
+ (HeqFrom : from = from')
+ (p : pu_type from to)
+ : pu_type from' to
+ := p.
+
+Class PatchUniverse : Type := mkPatchUniverse {
+
+ commutable : forall {from mid1 to : NameSet},
+ pu_type from mid1 -> pu_type mid1 to -> Prop
+ := fun {from mid1 to : NameSet}
+ (p : pu_type from mid1) (q : pu_type mid1 to) =>
+ exists mid2 : NameSet,
+ exists q' : pu_type from mid2,
+ exists p' : pu_type mid2 to,
+ commute p q q' p';
+
+ commutable_dec : forall {from mid to : NameSet}
+ (p : pu_type from mid)
+ (q : pu_type mid to),
+ {mid2 : NameSet &
+ { q' : pu_type from mid2 &
+ { p' : pu_type mid2 to &
+ commute p q q' p' }}}
+ + {~(commutable p q)}
+}.
+
+Inductive SequenceBase (pu : PatchUniverse)
+ : NameSet -> NameSet -> Type
+ := Nil : forall {cxt : NameSet},
+ SequenceBase pu cxt cxt
+ | Cons : forall {from mid to : NameSet}
+ (p : pu_type from mid)
+ (qs : SequenceBase pu mid to),
+ SequenceBase pu from to.
+Implicit Arguments Nil [pu cxt].
+Implicit Arguments Cons [pu from mid to].
+
+Program Fixpoint insertBase {pu : PatchUniverse}
+ {from mid to : NameSet}
+ (p : pu_type from mid)
+ (qs : SequenceBase pu mid to)
+ : SequenceBase pu from to
+ := match qs with
+ | Nil => Cons p Nil
+ | Cons q qs' =>
+ match SignedName_compare (pu_nameOf p) (pu_nameOf q) with
+ | Lt => Cons p qs
+ | _ => match commutable_dec p (castPatchFrom _ q) with
+ | inleft (existT _ _ (existT _ q' (existT _ p' _))) => Cons q'
+(insertBase p' qs')
+ | inright _ => Cons p qs
+ end
+ end
+ end.
+
+Lemma insertBaseConsLt {pu : PatchUniverse}
+ {o op opq opqr : NameSet}
+ (p : pu_type o op)
+ (q : pu_type op opq)
+ (rs : SequenceBase pu opq opqr)
+ (p_Lt_q : SignedName_compare (pu_nameOf p) (pu_nameOf q)
+= Lt)
+ : insertBase p (Cons q rs) = Cons p (Cons q rs).
+Proof.
+vm_compute.
diff --git a/test-suite/bugs/closed/shouldsucceed/2732.v b/test-suite/bugs/closed/2732.v
index f22a8ccc..f22a8ccc 100644
--- a/test-suite/bugs/closed/shouldsucceed/2732.v
+++ b/test-suite/bugs/closed/2732.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2733.v b/test-suite/bugs/closed/2733.v
index fd7bd3bd..832de4f9 100644
--- a/test-suite/bugs/closed/shouldsucceed/2733.v
+++ b/test-suite/bugs/closed/2733.v
@@ -1,3 +1,5 @@
+Unset Asymmetric Patterns.
+
Definition goodid : forall {A} (x: A), A := fun A x => x.
Definition wrongid : forall A (x: A), A := fun {A} x => x.
@@ -17,9 +19,9 @@ end.
Fixpoint app (P : forall {k k'}, alt_list k k' -> alt_list k k') {t1 t2} (l : alt_list t1 t2) {struct l}: forall {t3}, alt_list t2 t3 ->
alt_list t1 t3 :=
match l with
- | nil _ => fun _ l2 => P l2
- | Ncons _ n l1 => fun _ l2 => Ncons n (app (@P) l1 l2)
- | Bcons _ b l1 => fun _ l2 => Bcons b (app (@P) l1 l2)
+ | nil => fun _ l2 => P l2
+ | Ncons n l1 => fun _ l2 => Ncons n (app (@P) l1 l2)
+ | Bcons b l1 => fun _ l2 => Bcons b (app (@P) l1 l2)
end.
Check (fun {t t'} (l: alt_list t t') =>
diff --git a/test-suite/bugs/closed/shouldsucceed/2734.v b/test-suite/bugs/closed/2734.v
index 826361be..826361be 100644
--- a/test-suite/bugs/closed/shouldsucceed/2734.v
+++ b/test-suite/bugs/closed/2734.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2750.v b/test-suite/bugs/closed/2750.v
index fc580f10..fc580f10 100644
--- a/test-suite/bugs/closed/shouldsucceed/2750.v
+++ b/test-suite/bugs/closed/2750.v
diff --git a/test-suite/bugs/closed/2810.v b/test-suite/bugs/closed/2810.v
new file mode 100644
index 00000000..a66078c6
--- /dev/null
+++ b/test-suite/bugs/closed/2810.v
@@ -0,0 +1,10 @@
+Section foo.
+ Variable A : Type.
+ Let B := A.
+
+ Hint Unfold B.
+
+ Goal False.
+ clear B. autounfold with core.
+ Abort.
+End foo.
diff --git a/test-suite/bugs/closed/shouldsucceed/2817.v b/test-suite/bugs/closed/2817.v
index 08dff992..08dff992 100644
--- a/test-suite/bugs/closed/shouldsucceed/2817.v
+++ b/test-suite/bugs/closed/2817.v
diff --git a/test-suite/bugs/closed/2818.v b/test-suite/bugs/closed/2818.v
new file mode 100644
index 00000000..010855cf
--- /dev/null
+++ b/test-suite/bugs/closed/2818.v
@@ -0,0 +1,11 @@
+Module M.
+
+Local Ltac t := exact I.
+Ltac u := t.
+
+End M.
+
+Goal True.
+Proof.
+M.u.
+Qed.
diff --git a/test-suite/bugs/closed/2828.v b/test-suite/bugs/closed/2828.v
new file mode 100644
index 00000000..0b8abace
--- /dev/null
+++ b/test-suite/bugs/closed/2828.v
@@ -0,0 +1,4 @@
+Parameter A B : Type.
+Coercion POL (p : prod A B) := fst p.
+Goal forall x : prod A B, A.
+ intro x. Fail exact x.
diff --git a/test-suite/bugs/closed/2830.v b/test-suite/bugs/closed/2830.v
new file mode 100644
index 00000000..b72c821d
--- /dev/null
+++ b/test-suite/bugs/closed/2830.v
@@ -0,0 +1,226 @@
+(* Bug report #2830 (evar defined twice) covers different bugs *)
+
+(* 1- This was submitted by qb.h.agws *)
+
+Module A.
+
+Set Implicit Arguments.
+
+Inductive Bit := O | I.
+
+Inductive BitString: nat -> Set :=
+| bit: Bit -> BitString 0
+| bitStr: forall n: nat, Bit -> BitString n -> BitString (S n).
+
+Definition BitOr (a b: Bit) :=
+ match a, b with
+ | O, O => O
+ | _, _ => I
+ end.
+
+(* Should fail with an error; used to failed in 8.4 and trunk with
+ anomaly Evd.define: cannot define an evar twice *)
+
+Fail Fixpoint StringOr (n m: nat) (a: BitString n) (b: BitString m) :=
+ match a with
+ | bit a' =>
+ match b with
+ | bit b' => bit (BitOr a' b')
+ | bitStr b' bT => bitStr b' (StringOr (bit a') bT)
+ end
+ | bitStr a' aT =>
+ match b with
+ | bit b' => bitStr a' (StringOr aT (bit b'))
+ | bitStr b' bT => bitStr (BitOr a' b') (StringOr aT bT)
+ end
+ end.
+
+End A.
+
+(* 2- This was submitted by Andrew Appel *)
+
+Module B.
+
+Require Import Program Relations.
+
+Record ageable_facts (A:Type) (level: A -> nat) (age1:A -> option A) :=
+{ af_unage : forall x x' y', level x' = level y' -> age1 x = Some x' -> exists y, age1 y = Some y'
+; af_level1 : forall x, age1 x = None <-> level x = 0
+; af_level2 : forall x y, age1 x = Some y -> level x = S (level y)
+}.
+
+Implicit Arguments af_unage [[A] [level] [age1]].
+Implicit Arguments af_level1 [[A] [level] [age1]].
+Implicit Arguments af_level2 [[A] [level] [age1]].
+
+Class ageable (A:Type) := mkAgeable
+{ level : A -> nat
+; age1 : A -> option A
+; age_facts : ageable_facts A level age1
+}.
+Definition age {A} `{ageable A} (x y:A) := age1 x = Some y.
+Definition necR {A} `{ageable A} : relation A := clos_refl_trans A age.
+Delimit Scope pred with pred.
+Local Open Scope pred.
+
+Definition hereditary {A} (R:A->A->Prop) (p:A->Prop) :=
+ forall a a':A, R a a' -> p a -> p a'.
+
+Definition pred (A:Type) {AG:ageable A} :=
+ { p:A -> Prop | hereditary age p }.
+
+Bind Scope pred with pred.
+
+Definition app_pred {A} `{ageable A} (p:pred A) : A -> Prop := proj1_sig p.
+Definition pred_hereditary `{ageable} (p:pred A) := proj2_sig p.
+Coercion app_pred : pred >-> Funclass.
+Global Opaque pred.
+
+Definition derives {A} `{ageable A} (P Q:pred A) := forall a:A, P a -> Q a.
+Implicit Arguments derives.
+
+Program Definition andp {A} `{ageable A} (P Q:pred A) : pred A :=
+ fun a:A => P a /\ Q a.
+Next Obligation.
+ intros; intro; intuition; apply pred_hereditary with a; auto.
+Qed.
+
+Program Definition imp {A} `{ageable A} (P Q:pred A) : pred A :=
+ fun a:A => forall a':A, necR a a' -> P a' -> Q a'.
+Next Obligation.
+ intros; intro; intuition.
+ apply H1; auto.
+ apply rt_trans with a'; auto.
+ apply rt_step; auto.
+Qed.
+
+Program Definition allp {A} `{ageable A} {B: Type} (f: B -> pred A) : pred A
+ := fun a => forall b, f b a.
+Next Obligation.
+ intros; intro; intuition.
+ apply pred_hereditary with a; auto.
+ apply H1.
+Qed.
+
+Notation "P '<-->' Q" := (andp (imp P Q) (imp Q P)) (at level 57, no associativity) : pred.
+Notation "P '|--' Q" := (derives P Q) (at level 80, no associativity).
+Notation "'All' x ':' T ',' P " := (allp (fun x:T => P%pred)) (at level 65, x at level 99) : pred.
+
+Lemma forall_pred_ext {A} `{agA : ageable A}: forall B P Q,
+ (All x : B, (P x <--> Q x)) |-- (All x : B, P x) <--> (All x: B, Q x).
+Abort.
+
+End B.
+
+(* 3. *)
+
+(* This was submitted by Anthony Cowley *)
+
+Require Import Coq.Classes.Morphisms.
+Require Import Setoid.
+
+Module C.
+
+Reserved Notation "a ~> b" (at level 70, right associativity).
+Reserved Notation "a ≈ b" (at level 54).
+Generalizable All Variables.
+
+Class Category (Object:Type) (Hom:Object -> Object -> Type) := {
+ hom := Hom where "a ~> b" := (hom a b) : category_scope
+ ; ob := Object
+ ; id : forall a, hom a a
+ ; comp : forall c b a, hom b c -> hom a b -> hom a c
+ where "g ∘ f" := (comp _ _ _ g f) : category_scope
+ ; eqv : forall a b, hom a b -> hom a b -> Prop
+ where "f ≈ g" := (eqv _ _ f g) : category_scope
+ ; eqv_equivalence : forall a b, Equivalence (eqv a b)
+ ; comp_respects : forall a b c,
+ Proper (eqv b c ==> eqv a b ==> eqv a c) (comp c b a)
+ ; left_identity : forall `(f:a ~> b), id b ∘ f ≈ f
+ ; right_identity : forall `(f:a ~> b), f ∘ id a ≈ f
+ ; associativity : forall `(f:a~>b) `(g:b~>c) `(h:c~>d),
+ h ∘ (g ∘ f) ≈ (h ∘ g) ∘ f
+}.
+Notation "a ~> b" := (@hom _ _ _ a b) : category_scope.
+Notation "g ∘ f" := (@comp _ _ _ _ _ _ g f) : category_scope.
+Notation "a ≈ b" := (@eqv _ _ _ _ _ a b) : category_scope.
+Notation "a ~{ C }~> b" := (@hom _ _ C a b) (at level 100) : category_scope.
+Coercion ob : Category >-> Sortclass.
+
+Open Scope category_scope.
+
+Add Parametric Relation `(C:Category Ob Hom) (a b : Ob) : (hom a b) (eqv a b)
+ reflexivity proved by (@Equivalence_Reflexive _ _ (eqv_equivalence a b))
+ symmetry proved by (@Equivalence_Symmetric _ _ (eqv_equivalence a b))
+ transitivity proved by (@Equivalence_Transitive _ _ (eqv_equivalence a b))
+ as parametric_relation_eqv.
+
+Add Parametric Morphism `(C:Category Ob Hom) (c b a : Ob) : (comp c b a)
+ with signature (eqv _ _ ==> eqv _ _ ==> eqv _ _) as parametric_morphism_comp.
+ intros x y Heq x' y'. apply comp_respects. exact Heq.
+ Defined.
+
+Class Functor `(C:Category) `(D:Category) (im : C -> D) := {
+ functor_im := im
+ ; fmap : forall {a b}, `(a ~> b) -> im a ~> im b
+ ; fmap_respects : forall a b (f f' : a ~> b), f ≈ f' -> fmap f ≈ fmap f'
+ ; fmap_preserves_id : forall a, fmap (id a) ≈ id (im a)
+ ; fmap_preserves_comp : forall `(f:a~>b) `(g:b~>c),
+ fmap g ∘ fmap f ≈ fmap (g ∘ f)
+}.
+Coercion functor_im : Functor >-> Funclass.
+Implicit Arguments fmap [Object Hom C Object0 Hom0 D im a b].
+
+Add Parametric Morphism `(C:Category) `(D:Category)
+ (Im:C->D) (F:Functor C D Im) (a b:C) : (@fmap _ _ C _ _ D Im F a b)
+ with signature (@eqv C _ C a b ==> @eqv D _ D (Im a) (Im b))
+ as parametric_morphism_fmap.
+intros. apply fmap_respects. assumption. Qed.
+
+(* HERE IS THE PROBLEMATIC INSTANCE. If we change this to a regular Definition,
+ then the problem goes away. *)
+Instance functor_comp `{C:Category} `{D:Category} `{E:Category}
+ {Gim} (G:Functor D E Gim) {Fim} (F:Functor C D Fim)
+ : Functor C E (Basics.compose Gim Fim).
+intros. apply Build_Functor with (fmap := fun a b f => fmap G (fmap F f)).
+abstract (intros; rewrite H; reflexivity).
+abstract (intros; repeat (rewrite fmap_preserves_id); reflexivity).
+abstract (intros; repeat (rewrite fmap_preserves_comp); reflexivity).
+Defined.
+
+Definition skel {A:Type} : relation A := @eq A.
+Instance skel_equiv A : Equivalence (@skel A).
+Admitted.
+
+Import FunctionalExtensionality.
+Instance set_cat : Category Type (fun A B => A -> B) := {
+ id := fun A => fun x => x
+ ; comp c b a f g := fun x => f (g x)
+ ; eqv := fun A B => @skel (A -> B)
+}.
+intros. compute. symmetry. apply eta_expansion.
+intros. compute. symmetry. apply eta_expansion.
+intros. compute. reflexivity. Defined.
+
+(* The [list] type constructor is a Functor. *)
+
+Import List.
+
+Definition setList (A:set_cat) := list A.
+Instance list_functor : Functor set_cat set_cat setList.
+apply Build_Functor with (fmap := @map).
+intros. rewrite H. reflexivity.
+intros; simpl; apply functional_extensionality.
+ induction x; [auto|simpl]. rewrite IHx. reflexivity.
+intros; simpl; apply functional_extensionality.
+ induction x; [auto|simpl]. rewrite IHx. reflexivity.
+Defined.
+
+Local Notation "[ a , .. , b ]" := (a :: .. (b :: nil) ..) : list_scope.
+Definition setFmap {Fim} {F:Functor set_cat set_cat Fim} `(f:A~>B) (xs:Fim A) := fmap F f xs.
+
+(* We want to infer the [Functor] instance based on the value's
+ structure, but the [functor_comp] instance throws things awry. *)
+Eval cbv in setFmap (fun x => x * 3) [67,8].
+
+End C.
diff --git a/test-suite/bugs/closed/2834.v b/test-suite/bugs/closed/2834.v
new file mode 100644
index 00000000..6015c53b
--- /dev/null
+++ b/test-suite/bugs/closed/2834.v
@@ -0,0 +1,4 @@
+(* Testing typing of subst *)
+
+Lemma eqType2Set (a b : Set) (H : @eq Type a b) : @eq Set a b.
+Fail subst.
diff --git a/test-suite/bugs/closed/shouldsucceed/2836.v b/test-suite/bugs/closed/2836.v
index a948b75e..a948b75e 100644
--- a/test-suite/bugs/closed/shouldsucceed/2836.v
+++ b/test-suite/bugs/closed/2836.v
diff --git a/test-suite/bugs/closed/shouldsucceed/2837.v b/test-suite/bugs/closed/2837.v
index 5d984463..5d984463 100644
--- a/test-suite/bugs/closed/shouldsucceed/2837.v
+++ b/test-suite/bugs/closed/2837.v
diff --git a/test-suite/bugs/closed/2839.v b/test-suite/bugs/closed/2839.v
new file mode 100644
index 00000000..e396fe06
--- /dev/null
+++ b/test-suite/bugs/closed/2839.v
@@ -0,0 +1,10 @@
+(* Check a case where ltac typing error should result in error, not anomaly *)
+
+Goal forall (H : forall x : nat, x = x), False.
+intro.
+Fail
+ let H :=
+ match goal with
+ | [ H : appcontext G [@eq _ _] |- _ ] => let H' := context G[@plus 2] in H'
+ end
+ in pose H.
diff --git a/test-suite/bugs/closed/2846.v b/test-suite/bugs/closed/2846.v
new file mode 100644
index 00000000..8d6d348a
--- /dev/null
+++ b/test-suite/bugs/closed/2846.v
@@ -0,0 +1,3 @@
+Variable R : Type.
+
+Fail Inductive I : R := c : R.
diff --git a/test-suite/bugs/closed/2848.v b/test-suite/bugs/closed/2848.v
new file mode 100644
index 00000000..de137d39
--- /dev/null
+++ b/test-suite/bugs/closed/2848.v
@@ -0,0 +1,9 @@
+Require Import Setoid.
+
+Parameter value' : Type.
+Parameter equiv' : value' -> value' -> Prop.
+
+Add Parametric Relation : _ equiv'
+ reflexivity proved by (Equivalence.equiv_reflexive _)
+ transitivity proved by (Equivalence.equiv_transitive _)
+ as apply_equiv'_rel.
diff --git a/test-suite/bugs/closed/2850.v b/test-suite/bugs/closed/2850.v
new file mode 100644
index 00000000..64a93aeb
--- /dev/null
+++ b/test-suite/bugs/closed/2850.v
@@ -0,0 +1,2 @@
+Definition id {A} (x : A) := x.
+Fail Compute id.
diff --git a/test-suite/bugs/closed/2854.v b/test-suite/bugs/closed/2854.v
new file mode 100644
index 00000000..14aee17f
--- /dev/null
+++ b/test-suite/bugs/closed/2854.v
@@ -0,0 +1,7 @@
+Section foo.
+ Let foo := Type.
+ Definition bar : foo -> foo := @id _.
+ Goal False.
+ subst foo.
+ Fail pose bar as f.
+ (* simpl in f. *)
diff --git a/test-suite/bugs/closed/2876.v b/test-suite/bugs/closed/2876.v
new file mode 100644
index 00000000..a66ee6b3
--- /dev/null
+++ b/test-suite/bugs/closed/2876.v
@@ -0,0 +1,11 @@
+Lemma test_bug : forall (R:nat->nat->Prop) n m m' (P: Prop),
+ P ->
+ (P -> R n m) ->
+ (P -> R n m') ->
+ (forall u, R n u -> u = u -> True) ->
+ True.
+Proof.
+ intros * HP H1 H2 H3. eapply H3.
+ eauto. (* H1 is used, but H2 should be used since it is the last hypothesis *)
+ auto.
+Qed.
diff --git a/test-suite/bugs/closed/2883.v b/test-suite/bugs/closed/2883.v
new file mode 100644
index 00000000..5a5d90a4
--- /dev/null
+++ b/test-suite/bugs/closed/2883.v
@@ -0,0 +1,34 @@
+Require Import List.
+Require Import Coq.Program.Equality.
+
+Inductive star {genv state : Type}
+ (step : genv -> state -> state -> Prop)
+ (ge : genv) : state -> state -> Prop :=
+ | star_refl : forall s : state, star step ge s s
+ | star_step :
+ forall (s1 : state) (s2 : state)
+ (s3 : state),
+ step ge s1 s2 ->
+ star step ge s2 s3 ->
+ star step ge s1 s3.
+
+Parameter genv expr env mem : Type.
+Definition genv' := genv.
+Inductive state : Type :=
+ | State : expr -> env -> mem -> state.
+Parameter step : genv' -> state -> state -> Prop.
+
+Section Test.
+
+Variable ge : genv'.
+
+Lemma compat_eval_steps:
+ forall a b e a' b',
+ star step ge (State a e b) (State a' e b') ->
+ True.
+Proof.
+ intros. dependent induction H.
+ trivial.
+ eapply IHstar; eauto.
+ replace s2 with (State a' e b') by admit. eauto.
+Qed. (* Oups *)
diff --git a/test-suite/bugs/closed/2900.v b/test-suite/bugs/closed/2900.v
new file mode 100644
index 00000000..8f4264e9
--- /dev/null
+++ b/test-suite/bugs/closed/2900.v
@@ -0,0 +1,28 @@
+(* Was raising stack overflow in 8.4 and assertion failed in future 8.5 *)
+Set Implicit Arguments.
+
+Require Import List.
+Require Import Coq.Program.Equality.
+
+(** Reflexive-transitive closure ( R* ) *)
+
+Inductive rtclosure (A : Type) (R : A-> A->Prop) : A->A->Prop :=
+ | rtclosure_refl : forall x,
+ rtclosure R x x
+ | rtclosure_step : forall y x z,
+ R x y -> rtclosure R y z -> rtclosure R x z.
+ (* bug goes away if rtclosure_step is commented out *)
+
+(** The closure of the trivial binary relation [eq] *)
+
+Definition tr (A:Type) := rtclosure (@eq A).
+
+(** The bug *)
+
+Lemma bug : forall A B (l t:list A) (r s:list B),
+ length l = length r ->
+ tr (combine l r) (combine t s) -> tr l t.
+Proof.
+ intros * E Hp.
+ (* bug goes away if [revert E] is called explicitly *)
+ dependent induction Hp.
diff --git a/test-suite/bugs/closed/2920.v b/test-suite/bugs/closed/2920.v
new file mode 100644
index 00000000..13548b9e
--- /dev/null
+++ b/test-suite/bugs/closed/2920.v
@@ -0,0 +1,2 @@
+Fail Definition my_f_equal {A B : Type} (f : A -> B) (a a' : A) (p : a = a') : f a = f a' :=
+ eq_ind _ _ (fun a' => f a = f a') _ _ p.
diff --git a/test-suite/bugs/closed/2923.v b/test-suite/bugs/closed/2923.v
new file mode 100644
index 00000000..8a0003a3
--- /dev/null
+++ b/test-suite/bugs/closed/2923.v
@@ -0,0 +1,12 @@
+Module Type SIGNATURE1.
+ Inductive IndType: Set :=
+ | AConstructor.
+End SIGNATURE1.
+
+Module Type SIGNATURE2.
+ Declare Module M1: SIGNATURE1.
+End SIGNATURE2.
+
+Module M2 (Module M1_: SIGNATURE1) : SIGNATURE2.
+ Module M1 := M1_.
+End M2.
diff --git a/test-suite/bugs/closed/shouldsucceed/2928.v b/test-suite/bugs/closed/2928.v
index 21e92ae2..21e92ae2 100644
--- a/test-suite/bugs/closed/shouldsucceed/2928.v
+++ b/test-suite/bugs/closed/2928.v
diff --git a/test-suite/bugs/closed/2930.v b/test-suite/bugs/closed/2930.v
new file mode 100644
index 00000000..0994b6fb
--- /dev/null
+++ b/test-suite/bugs/closed/2930.v
@@ -0,0 +1,12 @@
+(* Checking that let-in's hiding evars are expanded when enforcing
+ "occur-check" *)
+
+Require Import List.
+
+Definition foo x y :=
+let xy := (x, y) in
+let bar xys :=
+ match xys with
+ | nil => xy :: nil
+ | xy' :: xys' => xy' :: xys'
+ end in bar (nil : list (nat * nat)).
diff --git a/test-suite/bugs/closed/2945.v b/test-suite/bugs/closed/2945.v
new file mode 100644
index 00000000..59b57c07
--- /dev/null
+++ b/test-suite/bugs/closed/2945.v
@@ -0,0 +1,5 @@
+Notation "f1 =1 f2 :> A" := (f1 = (f2 : A))
+ (at level 70, f2 at next level, A at level 90) : fun_scope.
+
+Notation "e :? pf" := (eq_rect _ (fun X : _ => X) e _ pf)
+ (no associativity, at level 90).
diff --git a/test-suite/bugs/closed/2966.v b/test-suite/bugs/closed/2966.v
new file mode 100644
index 00000000..debada85
--- /dev/null
+++ b/test-suite/bugs/closed/2966.v
@@ -0,0 +1,79 @@
+(** Non-termination and state monad with extraction *)
+Require Import List.
+
+Set Implicit Arguments.
+Set Asymmetric Patterns.
+
+Module MemSig.
+ Definition t: Type := list Type.
+
+ Definition Nth (sig: t) (n: nat) :=
+ nth n sig unit.
+End MemSig.
+
+(** A memory of type [Mem.t s] is the union of cells whose type is specified
+ by [s]. *)
+Module Mem.
+ Inductive t: MemSig.t -> Type :=
+ | Nil: t nil
+ | Cons: forall (T: Type), option T -> forall (sig: MemSig.t), t sig ->
+ t (T :: sig).
+End Mem.
+
+Module Ref.
+ Inductive t (sig: MemSig.t) (T: Type): Type :=
+ | Input: t sig T.
+
+ Definition Read (sig: MemSig.t) (T: Type) (ref: t sig T) (s: Mem.t sig)
+ : option T :=
+ match ref with
+ | Input => None
+ end.
+End Ref.
+
+Module Monad.
+ Definition t (sig: MemSig.t) (A: Type) :=
+ Mem.t sig -> option A * Mem.t sig.
+
+ Definition Return (sig: MemSig.t) (A: Type) (x: A): t sig A :=
+ fun s =>
+ (Some x, s).
+
+ Definition Bind (sig: MemSig.t) (A B: Type) (x: t sig A) (f: A -> t sig B)
+ : t sig B :=
+ fun s =>
+ match x s with
+ | (Some x', s') => f x' s'
+ | (None, s') => (None, s')
+ end.
+
+ Definition Select (T: Type) (f g: unit -> T): T :=
+ f tt.
+
+ (** Read in a reference. *)
+ Definition Read (sig: MemSig.t) (T: Type) (ref: Ref.t sig T)
+ : t sig T :=
+ fun s =>
+ match Ref.Read ref s with
+ | None => (None, s)
+ | Some x => (Some x, s)
+ end.
+End Monad.
+
+Import Monad.
+
+Definition pop (sig: MemSig.t) (T: Type) (trace: Ref.t sig (list T))
+ : Monad.t sig T :=
+ Bind (Read trace) (fun _ s => (None, s)).
+
+Definition sig: MemSig.t := (list nat: Type) :: nil.
+
+Definition trace: Ref.t sig (list nat).
+Admitted.
+
+Definition Gre (sig: MemSig.t) (trace: _)
+ (f: bool -> bool): Monad.t sig nat :=
+ Select (fun _ => pop trace) (fun _ => Return 0).
+
+Definition Arg :=
+ Gre trace (fun _ => false).
diff --git a/test-suite/bugs/closed/2969.v b/test-suite/bugs/closed/2969.v
new file mode 100644
index 00000000..ff75a1f3
--- /dev/null
+++ b/test-suite/bugs/closed/2969.v
@@ -0,0 +1,25 @@
+(* Check that Goal.V82.byps and Goal.V82.env are consistent *)
+
+(* This is a shorten variant of the initial bug which raised anomaly *)
+
+Goal forall x : nat, (forall z, (exists y:nat, z = y) -> True) -> True.
+evar nat.
+intros x H.
+apply (H n).
+unfold n. clear n.
+eexists.
+reflexivity.
+Grab Existential Variables.
+admit.
+
+(* Alternative variant which failed but without raising anomaly *)
+
+Goal forall x : nat, True.
+evar nat.
+intro x.
+evar nat.
+assert (H := eq_refl : n0 = n).
+clearbody n n0.
+exact I.
+Grab Existential Variables.
+admit.
diff --git a/test-suite/bugs/closed/2981.v b/test-suite/bugs/closed/2981.v
new file mode 100644
index 00000000..1facd9b7
--- /dev/null
+++ b/test-suite/bugs/closed/2981.v
@@ -0,0 +1,15 @@
+Check let TTT := Type in (fun (a b : @sigT TTT (fun A : TTT => A))
+ (f : @projT1 TTT (fun A : TTT => A) a ->
+ @projT1 TTT (fun A : TTT => A) b) =>
+ @eq_refl
+ (@projT1 TTT (fun A : TTT => A) a ->
+ @projT1 TTT (fun A : TTT => A) b)
+ (fun x : @projT1 TTT (fun A : TTT => A) a => f x)) :
+ forall (a b : @sigT TTT (fun A : TTT => A))
+ (f : @projT1 TTT (fun A : TTT => A) a ->
+ @projT1 TTT (fun A : TTT => A) b),
+ @eq
+ (@projT1 TTT (fun A : TTT => A) a ->
+ @projT1 TTT (fun A : TTT => A) b)
+ (fun x : @projT1 TTT (fun A : TTT => A) a => f x) f.
+
diff --git a/test-suite/bugs/closed/shouldsucceed/2983.v b/test-suite/bugs/closed/2983.v
index 15598352..15598352 100644
--- a/test-suite/bugs/closed/shouldsucceed/2983.v
+++ b/test-suite/bugs/closed/2983.v
diff --git a/test-suite/bugs/closed/2990.v b/test-suite/bugs/closed/2990.v
new file mode 100644
index 00000000..5f832626
--- /dev/null
+++ b/test-suite/bugs/closed/2990.v
@@ -0,0 +1,8 @@
+Goal True.
+Proof.
+ evar (pfT : Type).
+ cut pfT.
+ subst pfT.
+ intro pf.
+ refine ((fun A : Set => pf A) unit).
+Abort.
diff --git a/test-suite/bugs/closed/2994.v b/test-suite/bugs/closed/2994.v
new file mode 100644
index 00000000..457b1893
--- /dev/null
+++ b/test-suite/bugs/closed/2994.v
@@ -0,0 +1,2 @@
+(* Was an anomaly at some time *)
+Fail Class foo : Prop := { bar :> Set }.
diff --git a/test-suite/bugs/closed/shouldsucceed/2995.v b/test-suite/bugs/closed/2995.v
index ba3acd08..ba3acd08 100644
--- a/test-suite/bugs/closed/shouldsucceed/2995.v
+++ b/test-suite/bugs/closed/2995.v
diff --git a/test-suite/bugs/closed/2996.v b/test-suite/bugs/closed/2996.v
new file mode 100644
index 00000000..440cda61
--- /dev/null
+++ b/test-suite/bugs/closed/2996.v
@@ -0,0 +1,30 @@
+(* Test on definitions referring to section variables that are not any
+ longer in the current context *)
+
+Section x.
+
+ Hypothesis h : forall(n : nat), n < S n.
+
+ Definition f(n m : nat)(less : n < m) : nat := n + m.
+
+ Lemma a : forall(n : nat), f n (S n) (h n) = 1 + 2 * n.
+ Proof.
+ (* XXX *) admit.
+ Qed.
+
+ Lemma b : forall(n : nat), n < 3 + n.
+ Proof.
+ clear.
+ intros n.
+ Fail assert (H := a n).
+ Abort.
+
+ Let T := True.
+ Definition p := I : T.
+
+ Lemma paradox : False.
+ Proof.
+ clear.
+ set (T := False).
+ Fail pose proof p as H.
+ Abort.
diff --git a/test-suite/bugs/closed/shouldsucceed/3000.v b/test-suite/bugs/closed/3000.v
index 27de34ed..27de34ed 100644
--- a/test-suite/bugs/closed/shouldsucceed/3000.v
+++ b/test-suite/bugs/closed/3000.v
diff --git a/test-suite/bugs/closed/3001.v b/test-suite/bugs/closed/3001.v
new file mode 100644
index 00000000..6e565554
--- /dev/null
+++ b/test-suite/bugs/closed/3001.v
@@ -0,0 +1,21 @@
+Definition my_fun (n:nat) := n.
+
+Section My_Sec.
+ Global Arguments my_fun x : rename.
+End My_Sec.
+
+(* The following code suffices to trigger it, on my system:
+
+ Definition my_fun (n:nat) := n.
+
+ Section My_Sec.
+ Global Arguments my_fun x : rename.
+ End My_Sec.
+
+The `Global Arguments` declaration succeeds fine, but the `End My_Sec` fails, with `Anomaly: dirpath_prefix: empty dirpath. Please report.`
+
+If `Global` is removed, or if no arguments are renamed, then everything works as expected.
+
+If other declarations go between the `Global Arguments` and the `End My_Sec`, then the other declarations work normally, but the `End My_Sec` still fails.
+
+Previously reported at https://github.com/HoTT/coq/issues/24 . Occurs in both 8.4 and current trunk. *)
diff --git a/test-suite/bugs/closed/shouldsucceed/3004.v b/test-suite/bugs/closed/3004.v
index 896b1958..896b1958 100644
--- a/test-suite/bugs/closed/shouldsucceed/3004.v
+++ b/test-suite/bugs/closed/3004.v
diff --git a/test-suite/bugs/closed/shouldsucceed/3008.v b/test-suite/bugs/closed/3008.v
index 3f3a979a..3f3a979a 100644
--- a/test-suite/bugs/closed/shouldsucceed/3008.v
+++ b/test-suite/bugs/closed/3008.v
diff --git a/test-suite/bugs/closed/3010b.v b/test-suite/bugs/closed/3010b.v
new file mode 100644
index 00000000..65fea424
--- /dev/null
+++ b/test-suite/bugs/closed/3010b.v
@@ -0,0 +1,5 @@
+Definition wtf (n : nat) : nat :=
+ (match n with
+ 0 => (fun H : n = 0 => 0)
+ | S n' => (fun H : n = S n' => 0)
+ end) (eq_refl n).
diff --git a/test-suite/bugs/closed/3016.v b/test-suite/bugs/closed/3016.v
new file mode 100644
index 00000000..bd4f1dd8
--- /dev/null
+++ b/test-suite/bugs/closed/3016.v
@@ -0,0 +1,4 @@
+Section foo.
+ Variable C : Type.
+ Goal True.
+ change (eq (A := ?C) ?x ?y) with (eq).
diff --git a/test-suite/bugs/closed/3017.v b/test-suite/bugs/closed/3017.v
new file mode 100644
index 00000000..63a06bd3
--- /dev/null
+++ b/test-suite/bugs/closed/3017.v
@@ -0,0 +1,6 @@
+Class A := {}.
+ Class B {T} `(A) := { B_intro : forall t t' : T, t = t' }.
+ Lemma foo T (t t' : T) : t = t'.
+ erewrite @B_intro.
+ reflexivity.
+ Abort.
diff --git a/test-suite/bugs/closed/3022.v b/test-suite/bugs/closed/3022.v
new file mode 100644
index 00000000..dcfe7339
--- /dev/null
+++ b/test-suite/bugs/closed/3022.v
@@ -0,0 +1,8 @@
+Goal forall (O obj : Type) (f : O -> obj) (x : O) (e : x = x)
+ (T : obj -> obj -> Type) (m : forall x0 : obj, T x0 x0),
+ match eq_sym e in (_ = y) return (T (f y) (f x)) with
+ | eq_refl => m (f x)
+ end = m (f x).
+intros.
+try case e.
+Abort.
diff --git a/test-suite/bugs/closed/3023.v b/test-suite/bugs/closed/3023.v
index ed489511..70a1491e 100644
--- a/test-suite/bugs/closed/3023.v
+++ b/test-suite/bugs/closed/3023.v
@@ -1,5 +1,3 @@
-(* Checking use of eta on Flexible/Rigid and SemiFlexible/Rigid unif problems *)
-
Set Implicit Arguments.
Generalizable All Variables.
@@ -14,6 +12,7 @@ Record Category {obj : Type} :=
Section DiscreteAdjoints.
+
Let C := {|
Morphism := (fun X Y : Type => X -> Y);
Identity := (fun X : Type => (fun x : X => x));
@@ -28,4 +27,7 @@ Section DiscreteAdjoints.
revert ObjectFunctor.
intro ObjectFunctor.
simpl in ObjectFunctor.
- revert ObjectFunctor. (* Used to failed in 8.4 up to 16 April 2013 *)
+ revert ObjectFunctor.
+ Abort.
+
+End DiscreteAdjoints.
diff --git a/test-suite/bugs/closed/3036.v b/test-suite/bugs/closed/3036.v
new file mode 100644
index 00000000..451bec9b
--- /dev/null
+++ b/test-suite/bugs/closed/3036.v
@@ -0,0 +1,169 @@
+(* Checking use of retyping in w_unify0 in the presence of unification
+problems of the form \x:Meta.Meta = \x:ind.match x with ... end *)
+
+Require Import List.
+Require Import QArith.
+Require Import Qcanon.
+
+Set Implicit Arguments.
+
+Inductive dynamic : Type :=
+ | Dyn : forall T, T -> dynamic.
+
+Definition perm := Qc.
+
+Locate Qle_bool.
+
+Definition compatibleb (p1 p2 : perm) : bool :=
+let p1pos := Qle_bool 00 p1 in
+ let p2pos := Qle_bool 00 p2 in
+ negb (
+ (p1pos && p2pos)
+ || ((p1pos || p2pos) && (negb (Qle_bool 00 ((p1 + p2)%Qc)))))%Qc.
+
+Definition compatible (p1 p2 : perm) := compatibleb p1 p2 = true.
+
+Definition perm_plus (p1 p2 : perm) : option perm :=
+ if compatibleb p1 p2 then Some (p1 + p2) else None.
+
+Infix "+p" := perm_plus (at level 60, no associativity).
+
+Axiom axiom_ptr : Set.
+
+Definition ptr := axiom_ptr.
+
+Axiom axiom_ptr_eq_dec : forall (a b : ptr), {a = b} + {a <> b}.
+
+Definition ptr_eq_dec := axiom_ptr_eq_dec.
+
+Definition hval := (dynamic * perm)%type.
+
+Definition heap := ptr -> option hval.
+
+Bind Scope heap_scope with heap.
+Delimit Scope heap_scope with heap.
+Local Open Scope heap_scope.
+
+Definition read (h : heap) (p : ptr) : option hval := h p.
+
+Notation "a # b" := (read a b) (at level 55, no associativity) : heap_scope.
+
+Definition val (v:hval) := fst v.
+Definition frac (v:hval) := snd v.
+
+Definition hval_plus (v1 v2 : hval) : option hval :=
+ match (frac v1) +p (frac v2) with
+ | None => None
+ | Some v1v2 => Some (val v1, v1v2)
+ end.
+
+Definition hvalo_plus (v1 v2 : option hval) :=
+ match v1 with
+ | None => v2
+ | Some v1' =>
+ match v2 with
+ | None => v1
+ | Some v2' => (hval_plus v1' v2')
+ end
+ end.
+
+Notation "v1 +o v2" := (hvalo_plus v1 v2) (at level 60, no associativity) : heap_scope.
+
+Definition join (h1 h2 : heap) : heap :=
+ (fun p => (h1 p) +o (h2 p)).
+
+Infix "*" := join (at level 40, left associativity) : heap_scope.
+
+Definition hprop := heap -> Prop.
+
+Bind Scope hprop_scope with hprop.
+Delimit Scope hprop_scope with hprop.
+
+Definition hprop_cell (p : ptr) T (v : T) (pi:Qc): hprop := fun h =>
+ h#p = Some (Dyn v, pi) /\ forall p', p' <> p -> h#p' = None.
+
+Notation "p ---> v" := (hprop_cell p v (0%Qc)) (at level 38, no associativity) : hprop_scope.
+
+Definition empty : heap := fun _ => None.
+
+Definition hprop_empty : hprop := eq empty.
+Notation "'emp'" := hprop_empty : hprop_scope.
+
+Definition hprop_inj (P : Prop) : hprop := fun h => h = empty /\ P.
+Notation "[ P ]" := (hprop_inj P) (at level 0, P at level 200) : hprop_scope.
+
+Definition hprop_imp (p1 p2 : hprop) : Prop := forall h, p1 h -> p2 h.
+Infix "==>" := hprop_imp (right associativity, at level 55).
+
+Definition hprop_ex T (p : T -> hprop) : hprop := fun h => exists v, p v h.
+Notation "'Exists' v :@ T , p" := (hprop_ex (fun v : T => p%hprop))
+ (at level 90, T at next level) : hprop_scope.
+
+Local Open Scope hprop_scope.
+Definition disjoint (h1 h2 : heap) : Prop :=
+ forall p,
+ match h1#p with
+ | None => True
+ | Some v1 => match h2#p with
+ | None => True
+ | Some v2 => val v1 = val v2
+ /\ compatible (frac v1) (frac v2)
+ end
+ end.
+
+Infix "<#>" := disjoint (at level 40, no associativity) : heap_scope.
+
+Definition split (h h1 h2 : heap) : Prop := h1 <#> h2 /\ h = h1 * h2.
+
+Notation "h ~> h1 * h2" := (split h h1 h2) (at level 40, h1 at next level, no associativity).
+
+Definition hprop_sep (p1 p2 : hprop) : hprop := fun h =>
+ exists h1, exists h2, h ~> h1 * h2
+ /\ p1 h1
+ /\ p2 h2.
+Infix "*" := hprop_sep (at level 40, left associativity) : hprop_scope.
+
+Section Stack.
+ Variable T : Set.
+
+ Record node : Set := Node {
+ data : T;
+ next : option ptr
+ }.
+
+ Fixpoint listRep (ls : list T) (hd : option ptr) {struct ls} : hprop :=
+ match ls with
+ | nil => [hd = None]
+ | h :: t =>
+ match hd with
+ | None => [False]
+ | Some hd' => Exists p :@ option ptr, hd' ---> Node h p * listRep t p
+ end
+ end%hprop.
+
+ Definition stack := ptr.
+
+ Definition rep q ls := (Exists po :@ option ptr, q ---> po * listRep ls po)%hprop.
+
+ Definition isExistential T (x : T) := True.
+
+ Theorem himp_ex_conc_trivial : forall T p p1 p2,
+ p ==> p1 * p2
+ -> T
+ -> p ==> hprop_ex (fun _ : T => p1) * p2.
+ Admitted.
+
+ Goal forall (s : ptr) (x : T) (nd : ptr) (v : unit) (x0 : list T) (v0 : option ptr)
+ (H0 : isExistential v0),
+ nd ---> {| data := x; next := v0 |} * (s ---> Some nd * listRep x0 v0) ==>
+ (Exists po :@ option ptr,
+ s ---> po *
+ match po with
+ | Some hd' =>
+ Exists p :@ option ptr,
+ hd' ---> {| data := x; next := p |} * listRep x0 p
+ | None => [False]
+ end) * emp.
+ Proof.
+ intros.
+ try apply himp_ex_conc_trivial.
diff --git a/test-suite/bugs/closed/3037.v b/test-suite/bugs/closed/3037.v
new file mode 100644
index 00000000..baa7eff5
--- /dev/null
+++ b/test-suite/bugs/closed/3037.v
@@ -0,0 +1,11 @@
+(* Anomaly before 4a8950ec7a0d9f2b216e67e69b446c064590a8e9 *)
+
+Require Import Recdef.
+
+Function f_R (a: nat) {wf (fun x y: nat => False) a}:Prop:=
+ match a:nat with
+ | 0 => True
+ | (S y') => f_R y'
+ end.
+(* Anomaly: File "plugins/funind/recdef.ml", line 916, characters 13-19: Assertion failed.
+Please report. *)
diff --git a/test-suite/bugs/closed/3043.v b/test-suite/bugs/closed/3043.v
new file mode 100644
index 00000000..654663b4
--- /dev/null
+++ b/test-suite/bugs/closed/3043.v
@@ -0,0 +1,4 @@
+Goal (fun A (P : A -> Prop) (X : sigT P) => proj1_sig (sig_of_sigT X)) =
+ (fun A (P : A -> Prop) (X : sigT P) => projT1 X).
+ reflexivity.
+Qed.
diff --git a/test-suite/bugs/closed/3045.v b/test-suite/bugs/closed/3045.v
new file mode 100644
index 00000000..ef110ad0
--- /dev/null
+++ b/test-suite/bugs/closed/3045.v
@@ -0,0 +1,34 @@
+
+Set Asymmetric Patterns.
+Generalizable All Variables.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+Arguments Compose {obj} [C s d d'] m1 m2 : rename.
+
+Inductive ReifiedMorphism : forall objC (C : SpecializedCategory objC), C -> C -> Type :=
+| ReifiedComposedMorphism : forall objC C s d d', ReifiedMorphism C d d' -> ReifiedMorphism C s d -> @ReifiedMorphism objC C s d'.
+
+Fixpoint ReifiedMorphismDenote objC C s d (m : @ReifiedMorphism objC C s d) : Morphism C s d :=
+ match m in @ReifiedMorphism objC C s d return Morphism C s d with
+ | ReifiedComposedMorphism _ _ _ _ _ m1 m2 => Compose (@ReifiedMorphismDenote _ _ _ _ m1)
+ (@ReifiedMorphismDenote _ _ _ _ m2)
+ end.
+
+Fixpoint ReifiedMorphismSimplifyWithProof objC C s d (m : @ReifiedMorphism objC C s d)
+: { m' : ReifiedMorphism C s d | ReifiedMorphismDenote m = ReifiedMorphismDenote m' }.
+refine match m with
+ | ReifiedComposedMorphism _ _ s0 d0 d0' m1 m2 => _
+ end; clear m.
+(* This fails with an error rather than an anomaly, but morally
+ it should work, if destruct were able to do the good generalization
+ in advance, before doing the "intros []". *)
+Fail destruct (@ReifiedMorphismSimplifyWithProof T s1 d0 d0' m1) as [ [] ? ].
diff --git a/test-suite/bugs/closed/3050.v b/test-suite/bugs/closed/3050.v
new file mode 100644
index 00000000..4b187224
--- /dev/null
+++ b/test-suite/bugs/closed/3050.v
@@ -0,0 +1,7 @@
+Goal forall A B, A * B -> A.
+Proof.
+intros A B H.
+match goal with
+ | [ H : _ * _ |- _ ] => exact (fst H)
+end.
+Qed.
diff --git a/test-suite/bugs/closed/3054.v b/test-suite/bugs/closed/3054.v
new file mode 100644
index 00000000..936e58e1
--- /dev/null
+++ b/test-suite/bugs/closed/3054.v
@@ -0,0 +1,10 @@
+Section S.
+
+Let V := Type.
+
+Goal ~ true = false.
+Proof.
+congruence.
+Qed.
+
+End S.
diff --git a/test-suite/bugs/closed/3062.v b/test-suite/bugs/closed/3062.v
new file mode 100644
index 00000000..a7b5fab0
--- /dev/null
+++ b/test-suite/bugs/closed/3062.v
@@ -0,0 +1,5 @@
+Lemma foo : forall x y:nat, x < y -> False.
+Proof.
+ intros x y H.
+ induction H as [ |?y ?y ?y].
+Abort.
diff --git a/test-suite/bugs/closed/3068.v b/test-suite/bugs/closed/3068.v
new file mode 100644
index 00000000..03e5af61
--- /dev/null
+++ b/test-suite/bugs/closed/3068.v
@@ -0,0 +1,63 @@
+Section Counted_list.
+
+ Variable A : Type.
+
+ Inductive counted_list : nat -> Type :=
+ | counted_nil : counted_list 0
+ | counted_cons : forall(n : nat),
+ A -> counted_list n -> counted_list (S n).
+
+
+ Fixpoint counted_def_nth{n : nat}(l : counted_list n)
+ (i : nat)(def : A) : A :=
+ match i with
+ | 0 => match l with
+ | counted_nil => def
+ | counted_cons _ a _ => a
+ end
+ | S i => match l with
+ | counted_nil => def
+ | counted_cons _ _ tl => counted_def_nth tl i def
+ end
+ end.
+
+
+ Lemma counted_list_equal_nth_char :
+ forall(n : nat)(l1 l2 : counted_list n)(def : A),
+ (forall(i : nat), counted_def_nth l1 i def = counted_def_nth l2 i def) ->
+ l1 = l2.
+ Proof.
+ admit.
+ Qed.
+
+End Counted_list.
+
+Implicit Arguments counted_def_nth [A n].
+
+Section Finite_nat_set.
+
+ Variable set_size : nat.
+
+ Definition fnat_subset : Type := counted_list bool set_size.
+
+ Definition fnat_member(fs : fnat_subset)(n : nat) : Prop :=
+ is_true (counted_def_nth fs n false).
+
+
+ Lemma fnat_subset_member_eq : forall(fs1 fs2 : fnat_subset),
+ fs1 = fs2 <->
+ forall(n : nat), fnat_member fs1 n <-> fnat_member fs2 n.
+
+ Proof.
+ intros fs1 fs2.
+ split.
+ intros H n.
+ subst fs1.
+ apply iff_refl.
+ intros H.
+ eapply counted_list_equal_nth_char.
+ intros i.
+ destruct (counted_def_nth fs1 i _ ) eqn:H0.
+ (* This was not part of the initial bug report; this is to check that
+ the existential variable kept its name *)
+ change (true = counted_def_nth fs2 i ?def).
diff --git a/test-suite/bugs/closed/3088.v b/test-suite/bugs/closed/3088.v
new file mode 100644
index 00000000..3c362510
--- /dev/null
+++ b/test-suite/bugs/closed/3088.v
@@ -0,0 +1,12 @@
+Inductive R {A} : A -> A -> Type := c : forall x y, R x y.
+
+Goal forall A (x y : A) P (e : R x y) (f : forall x y, P x y (c x y)),
+ let g := match e in R x y return P x y e with c x y => f x y end in
+ True.
+Proof.
+intros A x y P e f g.
+let t := eval red in g in
+match t with
+ (match ?E as e in R x y return @?P x y e with c X Y => @?f X Y end) => idtac P f
+end.
+Abort.
diff --git a/test-suite/bugs/closed/3093.v b/test-suite/bugs/closed/3093.v
new file mode 100644
index 00000000..f6b4a03f
--- /dev/null
+++ b/test-suite/bugs/closed/3093.v
@@ -0,0 +1,6 @@
+Require Import FunctionalExtensionality.
+
+Goal forall y, @f_equal = y.
+ intro.
+ apply functional_extensionality_dep.
+Abort.
diff --git a/test-suite/bugs/closed/3142.v b/test-suite/bugs/closed/3142.v
new file mode 100644
index 00000000..988074e2
--- /dev/null
+++ b/test-suite/bugs/closed/3142.v
@@ -0,0 +1,9 @@
+(* Fixed together with #3262 in 48af6d1418282323b9fff0e789fed9478c064434 *)
+(* April 4, 2014 (non-progress in candidates was not detected) *)
+
+Definition eqbool_dep (P : bool -> Prop) (h1 : P true) (b : bool) (h2 : P b)
+ : Prop :=
+(match b (* return P b -> Prop *) with
+ | true => fun (h : P true) => h1 = h
+ | false => fun (_ : P false) => False
+end (* : P b -> Prop *)) h2.
diff --git a/test-suite/bugs/closed/3164.v b/test-suite/bugs/closed/3164.v
new file mode 100644
index 00000000..3c9af8d0
--- /dev/null
+++ b/test-suite/bugs/closed/3164.v
@@ -0,0 +1,49 @@
+(* Before 31a69c4d0fd7b8325187e8da697a9c283594047d, [case] would stack overflow *)
+Require Import Arith.
+
+Section Acc_generator.
+ Variable A : Type.
+ Variable R : A -> A -> Prop.
+
+ (* *Lazily* add 2^n - 1 Acc_intro on top of wf.
+ Needed for fast reductions using Function and Program Fixpoint
+ and probably using Fix and Fix_F_2
+ *)
+ Fixpoint Acc_intro_generator n (wf : well_founded R) :=
+ match n with
+ | O => wf
+ | S n => fun x => Acc_intro x (fun y _ => Acc_intro_generator n (Acc_intro_generator n wf) y)
+ end.
+
+
+End Acc_generator.
+
+Definition pred_F : (forall x : nat,
+ (forall y : nat, y < x -> (fun _ : nat => nat) y) ->
+ (fun _ : nat => nat) x).
+Proof.
+ intros x.
+ simpl.
+ case x.
+ exact (fun _ => 0).
+ intros n h.
+ apply (h n).
+ constructor.
+Defined.
+
+Definition my_pred := Fix lt_wf (fun _ => nat) pred_F.
+
+
+Lemma my_pred_is_pred : forall x, match my_pred x with | 0 => True | S n => False end.
+Proof.
+ intros x.
+ case x.
+Abort.
+
+Definition my_pred_bad := Fix (Acc_intro_generator _ _ 100 lt_wf) (fun _ => nat) pred_F.
+
+Lemma my_pred_is_pred : forall x, match my_pred_bad x with | 0 => True | S n => False end.
+Proof.
+ intros x.
+ Timeout 2 case x.
+Admitted.
diff --git a/test-suite/bugs/closed/3188.v b/test-suite/bugs/closed/3188.v
new file mode 100644
index 00000000..01176026
--- /dev/null
+++ b/test-suite/bugs/closed/3188.v
@@ -0,0 +1,22 @@
+(* File reduced by coq-bug-finder from 1656 lines to 221 lines to 26 lines to 7 lines. *)
+
+Module Long.
+ Require Import Coq.Classes.RelationClasses.
+
+ Hint Extern 0 => apply reflexivity : typeclass_instances.
+ Hint Extern 1 => symmetry.
+
+ Lemma foo : exists m' : Type, True.
+ intuition. (* Anomaly: Uncaught exception Not_found. Please report. *)
+ Abort.
+End Long.
+
+Module Short.
+ Require Import Coq.Classes.RelationClasses.
+
+ Hint Extern 0 => apply reflexivity : typeclass_instances.
+
+ Lemma foo : exists m' : Type, True.
+ try symmetry. (* Anomaly: Uncaught exception Not_found. Please report. *)
+ Abort.
+End Short.
diff --git a/test-suite/bugs/closed/3205.v b/test-suite/bugs/closed/3205.v
new file mode 100644
index 00000000..5c44f070
--- /dev/null
+++ b/test-suite/bugs/closed/3205.v
@@ -0,0 +1,26 @@
+Fail Fixpoint F (u : unit) : Prop :=
+ (fun p : {P : Prop & _} => match p with existT _ _ P => P end)
+ (existT (fun P => False -> P) (F tt) _).
+(* Anomaly: A universe comparison can only happen between variables.
+Please report. *)
+
+
+
+Definition g (x : Prop) := x.
+
+Definition h (y : Type) := y.
+
+Definition eq_hf : h = g :> (Prop -> Type) :=
+ @eq_refl (Prop -> Type) g.
+
+Set Printing All.
+Set Printing Universes.
+Fail Definition eq_hf : h = g :> (Prop -> Type) :=
+ eq_refl g.
+(* Originally an anomaly, now says
+Toplevel input, characters 48-57:
+Error:
+The term "@eq_refl (forall _ : Prop, Prop) g" has type
+ "@eq (forall _ : Prop, Prop) g g" while it is expected to have type
+ "@eq (forall _ : Prop, Type (* Top.16 *)) (fun y : Prop => h y) g"
+(Universe inconsistency: Cannot enforce Prop = Top.16)). *)
diff --git a/test-suite/bugs/closed/3212.v b/test-suite/bugs/closed/3212.v
new file mode 100644
index 00000000..53d8dfe3
--- /dev/null
+++ b/test-suite/bugs/closed/3212.v
@@ -0,0 +1,10 @@
+Lemma H : Prop = Prop.
+reflexivity.
+Qed.
+
+Lemma foo : match H in (_ = X) return X with
+ | eq_refl => True
+end.
+Proof.
+Fail destruct H.
+Abort.
diff --git a/test-suite/bugs/closed/3217.v b/test-suite/bugs/closed/3217.v
new file mode 100644
index 00000000..ec846bf9
--- /dev/null
+++ b/test-suite/bugs/closed/3217.v
@@ -0,0 +1,36 @@
+(** [Set Implicit Arguments] causes Coq to run out of memory on [Qed] before c3feef4ed5dec126f1144dec91eee9c0f0522a94 *)
+Set Implicit Arguments.
+
+Variable LEM: forall P : Prop, sumbool P (P -> False).
+
+Definition pmap := option (nat -> option nat).
+
+Definition pmplus (oha ohb: pmap) : pmap :=
+ match oha, ohb with
+ | Some ha, Some hb =>
+ if LEM (oha = ohb) then None else None
+ | _, _ => None
+ end.
+
+Definition pmemp: pmap := Some (fun _ => None).
+
+Lemma foo:
+ True ->
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ (pmplus pmemp
+ pmemp))))))))))))
+ =
+ None -> True.
+Proof.
+ auto.
+Timeout 2 Qed.
diff --git a/test-suite/bugs/closed/3228.v b/test-suite/bugs/closed/3228.v
new file mode 100644
index 00000000..5d1a0ff8
--- /dev/null
+++ b/test-suite/bugs/closed/3228.v
@@ -0,0 +1,7 @@
+(* Check that variables in the context do not take precedence over
+ ltac variables *)
+
+Ltac bar x := exact x.
+Goal False -> False.
+ intro x.
+ Fail bar doesnotexist.
diff --git a/test-suite/bugs/closed/3242.v b/test-suite/bugs/closed/3242.v
new file mode 100644
index 00000000..805baee1
--- /dev/null
+++ b/test-suite/bugs/closed/3242.v
@@ -0,0 +1,2 @@
+Inductive Foo (x := Type) := C : Foo -> Foo.
+
diff --git a/test-suite/bugs/closed/3251.v b/test-suite/bugs/closed/3251.v
new file mode 100644
index 00000000..5a7ae200
--- /dev/null
+++ b/test-suite/bugs/closed/3251.v
@@ -0,0 +1,13 @@
+Goal True.
+Ltac foo := idtac.
+(* print out happens twice:
+foo is defined
+foo is defined
+
+... that's fishy. But E. Tassi tells me that it's expected since "Ltac" generates a side
+effect that escapes the proof. In the STM model this means the command is executed twice,
+once in the proof branch, and another time in the main branch *)
+Undo.
+Ltac foo := idtac.
+(* Before 5b39c3535f7b3383d89d7b844537244a4e7c0eca, this would print out: *)
+(* Anomaly: Backtrack.backto to a state with no vcs_backup. Please report. *)
diff --git a/test-suite/bugs/closed/3258.v b/test-suite/bugs/closed/3258.v
new file mode 100644
index 00000000..a1390e30
--- /dev/null
+++ b/test-suite/bugs/closed/3258.v
@@ -0,0 +1,35 @@
+Require Import Coq.Classes.Morphisms Coq.Classes.RelationClasses Coq.Program.Program Coq.Setoids.Setoid.
+
+Global Set Implicit Arguments.
+
+Hint Extern 0 => apply reflexivity : typeclass_instances.
+
+Inductive Comp : Type -> Type :=
+| Pick : forall A, (A -> Prop) -> Comp A.
+
+Axiom computes_to : forall A, Comp A -> A -> Prop.
+
+Axiom refine : forall {A} (old : Comp A) (new : Comp A), Prop.
+
+Global Instance refine_PreOrder A : PreOrder (@refine A).
+Admitted.
+Add Parametric Morphism A
+: (@Pick A)
+ with signature
+ (pointwise_relation _ (flip impl))
+ ==> (@refine A)
+ as refine_flip_impl_Pick.
+ admit.
+Defined.
+Definition remove_forall_eq' A x B (P : A -> B -> Prop) : pointwise_relation _ impl (P x) (fun z => forall y : A, y = x -> P y z).
+ admit.
+Defined.
+Goal forall A B (x : A) (P : _ -> _ -> Prop),
+ refine (Pick (fun n : B => forall y, y = x -> P y n))
+ (Pick (fun n : B => P x n)).
+Proof.
+ intros.
+ setoid_rewrite (@remove_forall_eq' _ _ _ _).
+ Undo.
+ (* This failed with NotConvertible at some time *)
+ setoid_rewrite (@remove_forall_eq' _ _ _).
diff --git a/test-suite/bugs/closed/3259.v b/test-suite/bugs/closed/3259.v
new file mode 100644
index 00000000..0306c686
--- /dev/null
+++ b/test-suite/bugs/closed/3259.v
@@ -0,0 +1,21 @@
+Goal forall m n, n+n = m+m -> m+m = m+m.
+Proof.
+intros.
+set (k := n+n) in *.
+cut (n=m).
+intro.
+subst n.
+admit.
+admit.
+Qed.
+
+Goal forall m n, n+n = m+m -> n+n = m+m.
+Proof.
+intros.
+set (k := n+n).
+cut (n=m).
+intro.
+subst n.
+admit.
+admit.
+Qed.
diff --git a/test-suite/bugs/closed/3260.v b/test-suite/bugs/closed/3260.v
new file mode 100644
index 00000000..9f0231d9
--- /dev/null
+++ b/test-suite/bugs/closed/3260.v
@@ -0,0 +1,7 @@
+Require Import Setoid.
+Goal forall m n, n = m -> n+n = m+m.
+intros.
+replace n with m at 2.
+lazymatch goal with
+|- n + m = m + m => idtac
+end.
diff --git a/test-suite/bugs/closed/3262.v b/test-suite/bugs/closed/3262.v
new file mode 100644
index 00000000..70bfde29
--- /dev/null
+++ b/test-suite/bugs/closed/3262.v
@@ -0,0 +1,78 @@
+(* Not having a [return] clause causes the [refine] at the bottom to stack overflow before f65fa9de8a4c9c12d933188a755b51508bd51921 *)
+
+Require Import Coq.Lists.List.
+Require Import Relations RelationClasses.
+
+Set Implicit Arguments.
+Set Strict Implicit.
+Set Asymmetric Patterns.
+
+Section hlist.
+ Context {iT : Type}.
+ Variable F : iT -> Type.
+
+ Inductive hlist : list iT -> Type :=
+ | Hnil : hlist nil
+ | Hcons : forall l ls, F l -> hlist ls -> hlist (l :: ls).
+
+ Definition hlist_hd {a b} (hl : hlist (a :: b)) : F a :=
+ match hl in hlist x return match x with
+ | nil => unit
+ | l :: _ => F l
+ end with
+ | Hnil => tt
+ | Hcons _ _ x _ => x
+ end.
+
+ Definition hlist_tl {a b} (hl : hlist (a :: b)) : hlist b :=
+ match hl in hlist x return match x with
+ | nil => unit
+ | _ :: ls => hlist ls
+ end with
+ | Hnil => tt
+ | Hcons _ _ _ x => x
+ end.
+
+ Lemma hlist_eta : forall ls (h : hlist ls),
+ h = match ls as ls return hlist ls -> hlist ls with
+ | nil => fun _ => Hnil
+ | a :: b => fun h => Hcons (hlist_hd h) (hlist_tl h)
+ end h.
+ Proof.
+ intros. destruct h; auto.
+ Qed.
+
+ Variable eqv : forall x, relation (F x).
+
+ Inductive equiv_hlist : forall ls, hlist ls -> hlist ls -> Prop :=
+ | hlist_eqv_nil : equiv_hlist Hnil Hnil
+ | hlist_eqv_cons : forall l ls x y h1 h2, eqv x y -> equiv_hlist h1 h2 ->
+ @equiv_hlist (l :: ls) (Hcons x h1) (Hcons y h2).
+
+ Global Instance Reflexive_equiv_hlist (R : forall t, Reflexive (@eqv t)) ls
+ : Reflexive (@equiv_hlist ls).
+ Proof.
+ red. induction x; constructor; auto. reflexivity.
+ Qed.
+
+ Global Instance Transitive_equiv_hlist (R : forall t, Transitive (@eqv t)) ls
+ : Transitive (@equiv_hlist ls).
+ Proof.
+ red. induction 1.
+ { intro; assumption. }
+ { rewrite (hlist_eta z).
+ Timeout 2 Fail refine
+ (fun H =>
+ match H in @equiv_hlist ls X Y
+ return
+ (* Uncommenting the following gives an immediate error in 8.4pl3; commented out results in a stack overflow *)
+ match ls (*as ls return hlist ls -> hlist ls -> Type*) with
+ | nil => fun _ _ : hlist nil => True
+ | l :: ls => fun (X Y : hlist (l :: ls)) =>
+ equiv_hlist (Hcons x h1) Y
+ end X Y
+ with
+ | hlist_eqv_nil => I
+ | hlist_eqv_cons l ls x y h1 h2 pf pf' =>
+ _
+ end).
diff --git a/test-suite/bugs/closed/3264.v b/test-suite/bugs/closed/3264.v
new file mode 100644
index 00000000..4eb21890
--- /dev/null
+++ b/test-suite/bugs/closed/3264.v
@@ -0,0 +1,45 @@
+Module File1.
+ Module Export DirA.
+ Module A.
+ Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+ Arguments idpath {A a} , [A] a.
+
+ Notation "x = y :> A" := (@paths A x y) : type_scope.
+ Notation "x = y" := (x = y :>_) : type_scope.
+ End A.
+ End DirA.
+End File1.
+
+Module File2.
+ Module Export DirA.
+ Module B.
+ Import File1.
+ Export A.
+ Lemma foo : forall x y : Type, x = y -> y = x.
+ Proof.
+ intros x y H.
+ rewrite <- H.
+ constructor.
+ Qed.
+ End B.
+ End DirA.
+End File2.
+
+Module File3.
+ Module Export DirA.
+ Module C.
+ Import File1.
+ Export A.
+ Lemma bar : forall x y : Type, x = y -> y = x.
+ Proof.
+ intros x y H.
+ rewrite <- H.
+ constructor.
+ Defined.
+ Definition bar'
+ := Eval cbv beta iota zeta delta [bar internal_paths_rew] in bar.
+ End C.
+ End DirA.
+End File3.
diff --git a/test-suite/bugs/closed/3265.v b/test-suite/bugs/closed/3265.v
new file mode 100644
index 00000000..269c7b74
--- /dev/null
+++ b/test-suite/bugs/closed/3265.v
@@ -0,0 +1,6 @@
+Require Import Setoid.
+Hint Extern 0 => apply reflexivity : typeclass_instances.
+Goal forall (B : Type) (P : B -> Prop), exists y : B, P y.
+ intros.
+ try reflexivity. (* Anomaly: Uncaught exception Not_found. Please report. *)
+Abort.
diff --git a/test-suite/bugs/closed/3266.v b/test-suite/bugs/closed/3266.v
new file mode 100644
index 00000000..fd4cbff8
--- /dev/null
+++ b/test-suite/bugs/closed/3266.v
@@ -0,0 +1,3 @@
+Class A := a : nat.
+Lemma p : True.
+Proof. cut A; [tauto | exact 1]. Qed.
diff --git a/test-suite/bugs/closed/3267.v b/test-suite/bugs/closed/3267.v
new file mode 100644
index 00000000..5ce1ddf0
--- /dev/null
+++ b/test-suite/bugs/closed/3267.v
@@ -0,0 +1,36 @@
+Module a.
+ Local Hint Extern 0 => progress subst.
+ Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y.
+ Proof.
+ intros.
+ (* this should not fail *)
+ progress eauto.
+ Defined.
+End a.
+
+Module b.
+ Local Hint Extern 0 => progress subst.
+ Goal forall T (x y : T) (P Q : _ -> Prop), y = x -> (P x -> Q x) -> P y -> Q y.
+ Proof.
+ intros.
+ eauto.
+ Defined.
+End b.
+
+Module c.
+ Local Hint Extern 0 => progress subst; eauto.
+ Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y.
+ Proof.
+ intros.
+ eauto.
+ Defined.
+End c.
+
+Module d.
+ Local Hint Extern 0 => progress subst; repeat match goal with H : _ |- _ => revert H end.
+ Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y.
+ Proof.
+ intros.
+ debug eauto.
+ Defined.
+End d.
diff --git a/test-suite/bugs/closed/328.v b/test-suite/bugs/closed/328.v
new file mode 100644
index 00000000..52cfbbc4
--- /dev/null
+++ b/test-suite/bugs/closed/328.v
@@ -0,0 +1,40 @@
+Module Type TITI.
+Parameter B:Set.
+Parameter x:B.
+Inductive A:Set:=
+a1:B->A.
+Definition f2: A ->B
+:= fun (a:A) =>
+match a with
+ (a1 b)=>b
+end.
+Definition f: A -> B:=fun (a:A) => x.
+End TITI.
+
+
+Module Type TIT.
+Declare Module t:TITI.
+End TIT.
+
+Module Seq(titi:TIT).
+Module t:=titi.t.
+Inductive toto:t.A->t.B->Set:=
+t1:forall (a:t.A), (toto a (t.f a))
+| t2:forall (a:t.A), (toto a (t.f2 a)).
+End Seq.
+
+Module koko(tit:TIT).
+Module seq:=Seq tit.
+Module t':=tit.t.
+
+Definition def:forall (a:t'.A), (seq.toto a (t'.f a)).
+intro ; constructor 1.
+Defined.
+
+Definition def2: forall (a:t'.A), (seq.toto a (t'.f2 a)).
+intro; constructor 2.
+(* Toplevel input, characters 0-13
+ constructor 2.
+ ^^^^^^^^^^^^^
+Error: Impossible to unify (seq.toto ?3 (seq.t.f2 ?3)) with
+ (seq.toto a (t'.f2 a)).*)
diff --git a/test-suite/bugs/closed/3281.v b/test-suite/bugs/closed/3281.v
new file mode 100644
index 00000000..d340f0ca
--- /dev/null
+++ b/test-suite/bugs/closed/3281.v
@@ -0,0 +1,5 @@
+Fail Lemma foo : @eq _ nat Type.
+Fail Lemma foo : @eq Set nat Type.
+
+Lemma foo : @eq Type nat Type. Admitted.
+Lemma foo' : @eq _ Type nat. Admitted.
diff --git a/test-suite/bugs/closed/3282.v b/test-suite/bugs/closed/3282.v
new file mode 100644
index 00000000..ce7cab1c
--- /dev/null
+++ b/test-suite/bugs/closed/3282.v
@@ -0,0 +1,7 @@
+(* Check let-ins in fix and Fixpoint *)
+
+Definition foo := fix f (m : nat) (o := true) (n : nat) {struct n} :=
+ match n with 0 => 0 | S n' => f 0 n' end.
+
+Fixpoint f (m : nat) (o := true) (n : nat) {struct n} :=
+ match n with 0 => 0 | S n' => f 0 n' end.
diff --git a/test-suite/bugs/closed/3284.v b/test-suite/bugs/closed/3284.v
new file mode 100644
index 00000000..34cd09c6
--- /dev/null
+++ b/test-suite/bugs/closed/3284.v
@@ -0,0 +1,23 @@
+(* Several bugs:
+- wrong env in pose_all_metas_as_evars leading to out of scope instance of evar
+- check that metas posed as evars in pose_all_metas_as_evars were
+ resolved was not done
+*)
+
+Axiom functional_extensionality_dep :
+ forall {A : Type} {B : A -> Type} (f g : forall x : A, B x),
+ (forall x : A, f x = g x) -> f = g.
+
+Goal forall A B C (f g : forall (x : A) (y : B x), C x y), forall x:A, (forall x y, f x y = g x y) -> True.
+Proof.
+ intros A B C f g x H.
+ Fail apply @functional_extensionality_dep in H.
+ Fail apply functional_extensionality_dep in H.
+ eapply functional_extensionality_dep in H.
+Abort.
+
+Goal forall A B C (f g : forall (x : A) (y : B x), C x y), forall x:A, (forall x y, f x y = g x y) -> True.
+Proof.
+ intros A B C f g x H.
+ specialize (H x).
+ apply functional_extensionality_dep in H.
diff --git a/test-suite/bugs/closed/3285.v b/test-suite/bugs/closed/3285.v
new file mode 100644
index 00000000..25162329
--- /dev/null
+++ b/test-suite/bugs/closed/3285.v
@@ -0,0 +1,7 @@
+Goal True.
+Proof.
+match goal with
+ | _ => let x := constr:($(fail)$) in idtac
+ | _ => idtac
+end.
+Abort.
diff --git a/test-suite/bugs/closed/3286.v b/test-suite/bugs/closed/3286.v
new file mode 100644
index 00000000..b08b7ab3
--- /dev/null
+++ b/test-suite/bugs/closed/3286.v
@@ -0,0 +1,41 @@
+Require Import FunctionalExtensionality.
+
+Ltac make_apply_under_binders_in lem H :=
+ let tac := make_apply_under_binders_in in
+ match type of H with
+ | forall x : ?T, @?P x
+ => let ret := constr:(fun x' : T =>
+ let Hx := H x' in
+ $(let ret' := tac lem Hx in
+ exact ret')$) in
+ match eval cbv zeta in ret with
+ | fun x => Some (@?P x) => let P' := (eval cbv zeta in P) in
+ constr:(Some P')
+ end
+ | _ => let ret := constr:($(match goal with
+ | _ => (let H' := fresh in
+ pose H as H';
+ apply lem in H';
+ exact (Some H'))
+ | _ => exact (@None nat)
+ end
+ )$) in
+ let ret' := (eval cbv beta zeta in ret) in
+ constr:(ret')
+ | _ => constr:(@None nat)
+ end.
+
+Ltac apply_under_binders_in lem H :=
+ let H' := make_apply_under_binders_in lem H in
+ let H'0 := match H' with Some ?H'0 => constr:(H'0) end in
+ let H'' := fresh in
+ pose proof H'0 as H'';
+ clear H;
+ rename H'' into H.
+
+Goal forall A B C (f g : forall (x : A) (y : B x), C x y), (forall x y, f x y = g x y) -> True.
+Proof.
+ intros A B C f g H.
+ let lem := constr:(@functional_extensionality_dep) in
+ apply_under_binders_in lem H.
+(* Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/3287.v b/test-suite/bugs/closed/3287.v
new file mode 100644
index 00000000..7c781312
--- /dev/null
+++ b/test-suite/bugs/closed/3287.v
@@ -0,0 +1,20 @@
+Module Foo.
+(* Definition foo := (I,I). *)
+Definition bar := true.
+End Foo.
+
+Recursive Extraction Foo.bar.
+
+Module Foo'.
+Definition foo := (I,I).
+Definition bar := true.
+End Foo'.
+
+Recursive Extraction Foo'.bar.
+
+Module Foo''.
+Definition foo := (I,I).
+Definition bar := true.
+End Foo''.
+
+Extraction Foo.bar.
diff --git a/test-suite/bugs/closed/3289.v b/test-suite/bugs/closed/3289.v
new file mode 100644
index 00000000..4542b015
--- /dev/null
+++ b/test-suite/bugs/closed/3289.v
@@ -0,0 +1,27 @@
+(* File reduced by coq-bug-finder from original input, then from 1829 lines to 37 lines, then from 47 lines to 18 lines *)
+
+Class Contr_internal (A : Type) :=
+ BuildContr { center : A ;
+ contr : (forall y : A, True) }.
+Class Contr A := Contr_is_contr : Contr_internal A.
+Inductive Unit : Set := tt.
+Instance contr_unit : Contr Unit | 0 :=
+ let x := {|
+ center := tt;
+ contr := fun t : Unit => I
+ |} in x. (* success *)
+
+Instance contr_internal_unit' : Contr_internal Unit | 0 :=
+ {|
+ center := tt;
+ contr := fun t : Unit => I
+ |}.
+
+Instance contr_unit' : Contr Unit | 0 :=
+ {|
+ center := tt;
+ contr := fun t : Unit => I
+ |}.
+(* Error: Mismatched contexts while declaring instance:
+ Expected: (Contr_is_contr : Contr_internal _UNBOUND_REL_1)
+ Found: tt (fun t : Unit => I) *)
diff --git a/test-suite/bugs/closed/329.v b/test-suite/bugs/closed/329.v
new file mode 100644
index 00000000..def6ed98
--- /dev/null
+++ b/test-suite/bugs/closed/329.v
@@ -0,0 +1,100 @@
+Module Sylvain_Boulme.
+Module Type Essai.
+Parameter T: Type.
+Parameter my_eq: T -> T -> Prop.
+Parameter my_eq_refl: forall (x:T), (my_eq x x).
+Parameter c: T.
+End Essai.
+
+Module Type Essai2.
+Declare Module M: Essai.
+Parameter c2: M.T.
+End Essai2.
+
+Module Type Essai3.
+Declare Module M: Essai.
+Parameter c3: M.T.
+End Essai3.
+
+Module Type Lift.
+Declare Module Core: Essai.
+Declare Module M: Essai.
+Parameter lift: Core.T -> M.T.
+Parameter lift_prop:forall (x:Core.T), (Core.my_eq x Core.c)->(M.my_eq (lift x) M.c).
+End Lift.
+
+Module I2 (X:Essai) <: Essai2.
+ Module Core := X.
+ Module M<:Essai.
+ Definition T:Type :=Prop.
+ Definition my_eq:=(@eq Prop).
+ Definition c:=True.
+ Lemma my_eq_refl: forall (x:T), (my_eq x x).
+ Proof.
+ unfold my_eq; auto.
+ Qed.
+ End M.
+ Definition c2:=False.
+ Definition lift:=fun (_:Core.T) => M.c.
+ Definition lift_prop: forall (x:Core.T), (Core.my_eq x Core.c)->(M.my_eq (lift x) M.c).
+ Proof.
+ unfold lift, M.my_eq; auto.
+ Qed.
+End I2.
+
+Module I4(X:Essai3) (L: Lift with Module Core := X.M) <: Essai3 with Module
+M:=L.M.
+ Module M:=L.M.
+ Definition c3:=(L.lift X.c3).
+End I4.
+
+Module I5(X:Essai3).
+ Module Toto<: Lift with Module Core := X.M := I2(X.M).
+ Module E4<: Essai3 with Module M:=Toto.M := I4(X)(Toto).
+(*
+Le typage de E4 echoue avec le message
+ Error: Signature components for label my_eq_refl do not match
+ *)
+
+ Module E3<: Essai3 := I4(X)(Toto).
+
+ Definition zarb: forall (x:Toto.M.T), (Toto.M.my_eq x x) := E3.M.my_eq_refl.
+End I5.
+End Sylvain_Boulme.
+
+
+Module Jacek.
+
+ Module Type SIG.
+ End SIG.
+ Module N.
+ Definition A:=Set.
+ End N.
+ Module Type SIG2.
+ Declare Module M:SIG.
+ Parameter B:Type.
+ End SIG2.
+ Module F(X:SIG2 with Module M:=N) (Y:SIG2 with Definition B:=X.M.A).
+ End F.
+End Jacek.
+
+
+Module anoun.
+ Module Type TITI.
+ Parameter X: Set.
+ End TITI.
+
+ Module Type Ex.
+ Declare Module t: TITI.
+ Parameter X : t.X -> t.X -> Set.
+ End Ex.
+
+ Module unionEx(X1: Ex) (X2:Ex with Module t :=X1.t): Ex.
+ Module t:=X1.t.
+ Definition X :=fun (a b:t.X) => ((X1.X a b)+(X2.X a b))%type.
+ End unionEx.
+End anoun.
+(* Le warning qui s'affiche lors de la compilation est le suivant :
+ TODO:replace module after with!
+ Est ce qu'il y'a qq1 qui pourrait m'aider à comprendre le probleme?!
+ Je vous remercie d'avance *)
diff --git a/test-suite/bugs/closed/3291.v b/test-suite/bugs/closed/3291.v
new file mode 100644
index 00000000..4ea748c0
--- /dev/null
+++ b/test-suite/bugs/closed/3291.v
@@ -0,0 +1,9 @@
+Require Import Setoid.
+
+Definition segv : forall x, (x = 0%nat) -> (forall (y : nat), (y < x)%nat -> nat) = forall (y : nat), (y < 0)%nat -> nat.
+intros x eq.
+assert (H : forall y, (y < x)%nat = (y < 0)%nat).
+rewrite -> eq. auto.
+Set Typeclasses Debug.
+Fail setoid_rewrite <- H. (* The command has indeed failed with message:
+=> Stack overflow. *)
diff --git a/test-suite/bugs/closed/3294.v b/test-suite/bugs/closed/3294.v
new file mode 100644
index 00000000..ed1a0c29
--- /dev/null
+++ b/test-suite/bugs/closed/3294.v
@@ -0,0 +1,6 @@
+Check (match true return
+ match eq_refl Type return Type with eq_refl => bool end
+ with _ => true end).
+Check (match true return
+ match eq_refl Type with eq_refl => bool end
+ with _ => true end).
diff --git a/test-suite/bugs/closed/3297.v b/test-suite/bugs/closed/3297.v
new file mode 100644
index 00000000..1cacb97f
--- /dev/null
+++ b/test-suite/bugs/closed/3297.v
@@ -0,0 +1,12 @@
+Goal forall (n : nat) (H := eq_refl : n = n) (H' : n = 0), H = eq_refl.
+ intros.
+ subst. (* Toplevel input, characters 15-20:
+Error: Abstracting over the term "n" leads to a term
+"λ n : nat, H = eq_refl" which is ill-typed. *)
+ Undo.
+ revert H.
+ subst. (* success *)
+ Undo.
+ intro.
+ clearbody H.
+ subst. (* success *)
diff --git a/test-suite/bugs/closed/3300.v b/test-suite/bugs/closed/3300.v
new file mode 100644
index 00000000..a28144b9
--- /dev/null
+++ b/test-suite/bugs/closed/3300.v
@@ -0,0 +1,7 @@
+Set Primitive Projections.
+Record Box (T : Type) : Prop := wrap {prop : T}.
+
+Definition down (x : Type) : Prop := Box x.
+Definition up (x : Prop) : Type := x.
+
+Fail Definition back A : up (down A) -> A := @prop A.
diff --git a/test-suite/bugs/closed/3305.v b/test-suite/bugs/closed/3305.v
new file mode 100644
index 00000000..f3f21952
--- /dev/null
+++ b/test-suite/bugs/closed/3305.v
@@ -0,0 +1,13 @@
+Require Export Coq.Classes.RelationClasses.
+
+Section defs.
+ Variable A : Type.
+ Variable lt : A -> A -> Prop.
+ Context {ltso : StrictOrder lt}.
+
+ Goal forall (a : A), lt a a -> False.
+ Proof.
+ intros a H.
+ contradict (irreflexivity H).
+ Qed.
+End defs.
diff --git a/test-suite/bugs/closed/3306.v b/test-suite/bugs/closed/3306.v
new file mode 100644
index 00000000..599e8391
--- /dev/null
+++ b/test-suite/bugs/closed/3306.v
@@ -0,0 +1,12 @@
+
+Inductive Foo(A : Type) : Prop :=
+ foo: A -> Foo A.
+
+Arguments foo [A] _.
+
+Scheme Foo_elim := Induction for Foo Sort Prop.
+
+Goal forall (fn : Foo nat), { x: nat | foo x = fn }.
+intro fn.
+Fail induction fn as [n] using Foo_elim. (* should fail in a non-Prop context *)
+Admitted.
diff --git a/test-suite/bugs/closed/3309.v b/test-suite/bugs/closed/3309.v
new file mode 100644
index 00000000..fcebdec7
--- /dev/null
+++ b/test-suite/bugs/closed/3309.v
@@ -0,0 +1,326 @@
+(* -*- coq-prog-args: ("-emacs" "-impredicative-set") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 5968 lines to 11933 lines, then from 11239 lines to 11231 lines, then from 10365 lines to 446 lines, then from 456 lines to 379 lines, then from 391 lines to 373 lines, then from 369 lines to 351 lines, then from 350 lines to 340 lines, then from 348 lines to 320 lines, then from 328 lines to 302 lines *)
+Set Universe Polymorphism.
+Record sigT' {A} (P : A -> Type) := existT' { projT1' : A; projT2' : P projT1' }.
+Notation "{ x : A &' P }" := (sigT' (A := A) (fun x => P)) : type_scope.
+Arguments existT' {A} P _ _.
+Axiom admit : forall {T}, T.
+Notation paths := identity .
+
+Unset Automatic Introduction.
+
+Definition UU := Set.
+
+Definition dirprod ( X Y : UU ) := sigT' ( fun x : X => Y ) .
+Definition dirprodpair { X Y : UU } := existT' ( fun x : X => Y ) .
+
+Definition ddualand { X Y P : UU } (xp : ( X -> P ) -> P ) ( yp : ( Y -> P ) -> P ) : ( dirprod X Y -> P ) -> P.
+Proof.
+ intros X Y P xp yp X0 .
+ set ( int1 := fun ypp : ( ( Y -> P ) -> P ) => fun x : X => yp ( fun y : Y => X0 ( dirprodpair x y) ) ) .
+ apply ( xp ( int1 yp ) ) .
+Defined .
+Definition weq ( X Y : UU ) : UU .
+intros; exact ( sigT' (fun f:X->Y => admit) ).
+Defined.
+Definition pr1weq ( X Y : UU):= @projT1' _ _ : weq X Y -> (X -> Y).
+Coercion pr1weq : weq >-> Funclass.
+
+Definition invweq { X Y : UU } ( w : weq X Y ) : weq Y X .
+admit.
+Defined.
+
+Definition hProp := sigT' (fun X : Type => admit).
+
+Definition hProppair ( X : UU ) ( is : admit ) : hProp@{i j Set k}.
+intros; exact (existT' (fun X : UU => admit ) X is ).
+Defined.
+Definition hProptoType := @projT1' _ _ : hProp -> Type .
+Coercion hProptoType: hProp >-> Sortclass.
+
+Definition ishinh_UU ( X : UU ) : UU := forall P: Set, ( ( X -> P ) -> P ).
+
+Definition ishinh ( X : UU ) : hProp := hProppair ( ishinh_UU X ) admit.
+
+Definition hinhfun { X Y : UU } ( f : X -> Y ) : ishinh_UU X -> ishinh_UU Y.
+intros X Y f; exact ( fun isx : ishinh X => fun P : _ => fun yp : Y -> P => isx P ( fun x : X => yp ( f x ) ) ).
+Defined.
+
+Definition hinhuniv { X : UU } { P : hProp } ( f : X -> P ) ( wit : ishinh_UU X ) : P.
+intros; exact ( wit P f ).
+Defined.
+
+Definition hinhand { X Y : UU } ( inx1 : ishinh_UU X ) ( iny1 : ishinh_UU Y) : ishinh ( dirprod X Y ).
+intros; exact ( fun P:_ => ddualand (inx1 P) (iny1 P)) .
+Defined.
+
+Definition UU' := Type.
+Definition hSet:= sigT' (fun X : UU' => admit) .
+Definition hSetpair := existT' (fun X : UU' => admit).
+Definition pr1hSet:= @projT1' UU (fun X : UU' => admit) : hSet -> Type.
+Coercion pr1hSet: hSet >-> Sortclass.
+
+Definition hPropset : hSet := existT' _ hProp admit .
+
+Definition hsubtypes ( X : UU ) : Type.
+intros; exact (X -> hProp ).
+Defined.
+Definition carrier { X : UU } ( A : hsubtypes X ) : Type.
+intros; exact (sigT' A).
+Defined.
+Coercion carrier : hsubtypes >-> Sortclass.
+
+Definition subtypesdirprod { X Y : UU } ( A : hsubtypes X ) ( B : hsubtypes Y ) : hsubtypes ( dirprod X Y ).
+admit.
+Defined.
+
+Lemma weqsubtypesdirprod { X Y : UU } ( A : hsubtypes X ) ( B : hsubtypes Y ) : weq ( subtypesdirprod A B ) ( dirprod A B ) .
+ admit.
+Defined.
+
+Lemma ishinhsubtypesdirprod { X Y : UU } ( A : hsubtypes X ) ( B : hsubtypes Y ) ( isa : ishinh A ) ( isb : ishinh B ) : ishinh ( subtypesdirprod A B ) .
+Proof .
+ intros .
+ apply ( hinhfun ( invweq ( weqsubtypesdirprod A B ) ) ) .
+ apply hinhand .
+ apply isa .
+ apply isb .
+Defined .
+
+Definition hrel ( X : UU ) : Type.
+intros; exact ( X -> X -> hProp).
+Defined.
+
+Definition iseqrel { X : UU } ( R : hrel X ) : Type.
+admit.
+Defined.
+
+Definition eqrel ( X : UU ) : Type.
+intros; exact ( sigT' ( fun R : hrel X => iseqrel R ) ).
+Defined.
+Definition pr1eqrel ( X : UU ) : eqrel X -> ( X -> ( X -> hProp ) ) := @projT1' _ _ .
+Coercion pr1eqrel : eqrel >-> Funclass .
+
+Definition hreldirprod { X Y : UU } ( RX : hrel X ) ( RY : hrel Y ) : hrel ( dirprod X Y ) .
+admit.
+Defined.
+Set Printing Universes.
+Print hProp.
+Print ishinh_UU.
+Print hProppair.
+Definition iseqclass { X : UU } ( R : hrel X ) ( A : hsubtypes X ) : Type.
+intros; exact ( dirprod ( ishinh ( carrier A ) ) ( dirprod ( forall x1 x2 : X , R x1 x2 -> A x1 -> A x2 ) ( forall x1 x2 : X, A x1 -> A x2 -> R x1 x2 ) )) .
+Defined.
+Definition iseqclassconstr { X : UU } ( R : hrel X ) { A : hsubtypes X } ( ax0 : ishinh ( carrier A ) ) ( ax1 : forall x1 x2 : X , R x1 x2 -> A x1 -> A x2 ) ( ax2 : forall x1 x2 : X, A x1 -> A x2 -> R x1 x2 ) : iseqclass R A.
+intros. hnf. apply dirprodpair. exact ax0. apply dirprodpair. exact ax1. exact ax2.
+Defined.
+
+Definition eqax0 { X : UU } { R : hrel X } { A : hsubtypes X } : iseqclass R A -> ishinh ( carrier A ) .
+intros X R A; exact ( fun is : iseqclass R A => projT1' _ is ).
+Defined.
+
+Lemma iseqclassdirprod { X Y : UU } { R : hrel X } { Q : hrel Y } { A : hsubtypes X } { B : hsubtypes Y } ( isa : iseqclass R A ) ( isb : iseqclass Q B ) : iseqclass ( hreldirprod R Q ) ( subtypesdirprod A B ) .
+Proof .
+ intros .
+ set ( XY := dirprod X Y ) .
+ set ( AB := subtypesdirprod A B ) .
+ set ( RQ := hreldirprod R Q ) .
+ set ( ax0 := ishinhsubtypesdirprod A B ( eqax0 isa ) admit ) .
+ apply ( iseqclassconstr _ ax0 admit admit ) .
+Defined .
+
+Definition image { X Y : UU } ( f : X -> Y ) : Type.
+intros; exact ( sigT' ( fun y : Y => admit ) ).
+Defined.
+Definition pr1image { X Y : UU } ( f : X -> Y ) : image f -> Y.
+intros X Y f; exact ( @projT1' _ ( fun y : Y => admit ) ).
+Defined.
+
+Definition prtoimage { X Y : UU } (f : X -> Y) : X -> image f.
+ admit.
+Defined.
+
+Definition setquot { X : UU } ( R : hrel X ) : Type.
+intros; exact ( sigT' ( fun A : _ => iseqclass R A ) ).
+Defined.
+Definition setquotpair { X : UU } ( R : hrel X ) ( A : hsubtypes X ) ( is : iseqclass R A ) : setquot R.
+intros; exact (existT' _ A is ).
+Defined.
+Definition pr1setquot { X : UU } ( R : hrel X ) : setquot R -> ( hsubtypes X ).
+intros X R.
+exact ( @projT1' _ ( fun A : _ => iseqclass R A ) ).
+Defined.
+Coercion pr1setquot : setquot >-> hsubtypes .
+
+Definition setquotinset { X : UU } ( R : hrel X ) : hSet.
+intros; exact ( hSetpair (setquot R) admit) .
+Defined.
+
+Definition dirprodtosetquot { X Y : UU } ( RX : hrel X ) ( RY : hrel Y ) (cd : dirprod ( setquot RX ) ( setquot RY ) ) : setquot ( hreldirprod RX RY ).
+intros; exact ( setquotpair _ _ ( iseqclassdirprod ( projT2' _ ( projT1' _ cd ) ) ( projT2' _ ( projT2' _ cd ) ) ) ).
+Defined.
+
+Definition iscomprelfun2 { X Y : UU } ( R : hrel X ) ( f : X -> X -> Y ) := forall x x' x0 x0' : X , R x x' -> R x0 x0' -> paths ( f x x0 ) ( f x' x0' ) .
+
+Definition binop ( X : UU ) : Type.
+intros; exact ( X -> X -> X ).
+Defined.
+
+Definition setwithbinop : Type.
+exact (sigT' ( fun X : hSet => binop X ) ).
+Defined.
+Definition pr1setwithbinop : setwithbinop -> hSet@{j k Set l}.
+unfold setwithbinop.
+exact ( @projT1' _ ( fun X : hSet@{j k Set l} => binop@{Set} X ) ).
+Defined.
+Coercion pr1setwithbinop : setwithbinop >-> hSet .
+
+Definition op { X : setwithbinop } : binop X.
+intros; exact ( projT2' _ X ).
+Defined.
+
+Definition subsetswithbinop { X : setwithbinop } : Type.
+admit.
+Defined.
+
+Definition carrierofasubsetwithbinop { X : setwithbinop } ( A : @subsetswithbinop X ) : setwithbinop .
+admit.
+Defined.
+
+Coercion carrierofasubsetwithbinop : subsetswithbinop >-> setwithbinop .
+
+Definition binopeqrel { X : setwithbinop } : Type.
+intros; exact (sigT' ( fun R : eqrel X => admit ) ).
+Defined.
+Definition binopeqrelpair { X : setwithbinop } := existT' ( fun R : eqrel X => admit ).
+Definition pr1binopeqrel ( X : setwithbinop ) : @binopeqrel X -> eqrel X.
+intros X; exact ( @projT1' _ ( fun R : eqrel X => admit ) ) .
+Defined.
+Coercion pr1binopeqrel : binopeqrel >-> eqrel .
+
+Definition setwithbinopdirprod ( X Y : setwithbinop ) : setwithbinop .
+admit.
+Defined.
+
+Definition monoid : Type.
+exact ( sigT' ( fun X : setwithbinop => admit ) ).
+Defined.
+Definition monoidpair := existT' ( fun X : setwithbinop => admit ) .
+Definition pr1monoid : monoid -> setwithbinop := @projT1' _ _ .
+Coercion pr1monoid : monoid >-> setwithbinop .
+
+Notation "x + y" := ( op x y ) : addmonoid_scope .
+
+Definition submonoids { X : monoid } : Type.
+admit.
+Defined.
+
+Definition submonoidstosubsetswithbinop ( X : monoid ) : @submonoids X -> @subsetswithbinop X.
+admit.
+Defined.
+Coercion submonoidstosubsetswithbinop : submonoids >-> subsetswithbinop .
+
+Definition abmonoid : Type.
+exact (sigT' ( fun X : setwithbinop => admit ) ).
+Defined.
+
+Definition abmonoidtomonoid : abmonoid -> monoid.
+exact (fun X : _ => monoidpair ( projT1' _ X ) admit ).
+Defined.
+Coercion abmonoidtomonoid : abmonoid >-> monoid .
+
+Definition subabmonoids { X : abmonoid } := @submonoids X .
+
+Definition carrierofsubabmonoid { X : abmonoid } ( A : @subabmonoids X ) : abmonoid .
+Proof .
+ intros .
+ unfold subabmonoids in A .
+ split with A .
+ admit.
+Defined .
+
+Coercion carrierofsubabmonoid : subabmonoids >-> abmonoid .
+
+Definition abmonoiddirprod ( X Y : abmonoid ) : abmonoid .
+Proof .
+ intros .
+ split with ( setwithbinopdirprod X Y ) .
+ admit.
+Defined .
+
+Open Scope addmonoid_scope .
+
+Definition eqrelabmonoidfrac ( X : abmonoid ) ( A : @submonoids X ) : eqrel ( setwithbinopdirprod X A ).
+admit.
+Defined.
+
+Definition binopeqrelabmonoidfrac ( X : abmonoid ) ( A : @subabmonoids X ) : @binopeqrel ( abmonoiddirprod X A ).
+intros; exact ( @binopeqrelpair ( setwithbinopdirprod X A ) ( eqrelabmonoidfrac X A ) admit ).
+Defined.
+
+Theorem setquotuniv { X : UU } ( R : hrel X ) ( Y : hSet ) ( f : X -> Y ) ( c : setquot R ) : Y .
+Proof.
+ intros.
+ apply ( pr1image ( fun x : c => f ( projT1' _ x ) ) ) .
+ apply ( @hinhuniv ( projT1' _ c ) ( hProppair _ admit ) ( prtoimage ( fun x : c => f ( projT1' _ x ) ) ) ) .
+ pose ( eqax0 ( projT2' _ c ) ) as h.
+ simpl in *.
+ Set Printing Universes.
+ exact h.
+Defined .
+
+Definition setquotuniv2 { X : UU } ( R : hrel X ) ( Y : hSet ) ( f : X -> X -> Y ) ( is : iscomprelfun2 R f ) ( c c0 : setquot R ) : Y .
+Proof.
+ intros .
+ set ( RR := hreldirprod R R ) .
+ apply (setquotuniv RR Y admit).
+ apply dirprodtosetquot.
+ apply dirprodpair.
+ exact c.
+ exact c0.
+Defined .
+
+Definition setquotfun2 { X Y : UU } ( RX : hrel X ) ( RY : eqrel Y ) ( f : X -> X -> Y ) ( cx cx0 : setquot RX ) : setquot RY .
+Proof .
+ intros .
+ apply ( setquotuniv2 RX ( setquotinset RY ) admit admit admit admit ) .
+Defined .
+
+Definition quotrel { X : UU } { R : hrel X } : hrel ( setquot R ).
+intros; exact ( setquotuniv2 R hPropset admit admit ).
+Defined.
+
+Definition setwithbinopquot { X : setwithbinop } ( R : @binopeqrel X ) : setwithbinop .
+Proof .
+ intros .
+ split with ( setquotinset R ) .
+ set ( qtmlt := setquotfun2 R R op ) .
+ simpl .
+ unfold binop .
+ apply qtmlt .
+Defined .
+
+Definition abmonoidquot { X : abmonoid } ( R : @binopeqrel X ) : abmonoid .
+Proof .
+ intros .
+ split with ( setwithbinopquot R ) .
+ admit.
+Defined .
+
+Definition abmonoidfrac ( X : abmonoid ) ( A : @submonoids X ) : abmonoid.
+intros; exact ( @abmonoidquot (abmonoiddirprod X (@carrierofsubabmonoid X A)) ( binopeqrelabmonoidfrac X A ) ).
+Defined.
+
+Definition abmonoidfracrel ( X : abmonoid ) ( A : @submonoids X ) : hrel (@setquot (setwithbinopdirprod X A) (eqrelabmonoidfrac X A)).
+intros; exact (@quotrel _ _).
+Defined.
+
+Fail Timeout 1 Axiom ispartlbinopabmonoidfracrel : forall ( X : abmonoid ) ( A : @subabmonoids X ) { L : hrel X } ( z : abmonoidfrac X A ) , @abmonoidfracrel X A ( ( admit + z ) )admit.
+
+Definition ispartlbinopabmonoidfracrel_type : Type :=
+ forall ( X : abmonoid ) ( A : @subabmonoids X ) { L : hrel X } ( z : abmonoidfrac X A ),
+ @abmonoidfracrel X A ( ( admit + z ) )admit.
+
+Axiom ispartlbinopabmonoidfracrel : $(let t:= eval unfold ispartlbinopabmonoidfracrel_type in
+ ispartlbinopabmonoidfracrel_type in exact t)$.
+
diff --git a/test-suite/bugs/closed/331.v b/test-suite/bugs/closed/331.v
new file mode 100644
index 00000000..9ef796fa
--- /dev/null
+++ b/test-suite/bugs/closed/331.v
@@ -0,0 +1,20 @@
+Module Type TIT.
+
+Inductive X:Set:=
+ b:X.
+End TIT.
+
+
+Module Type TOTO.
+Declare Module t:TIT.
+Inductive titi:Set:=
+ a:t.X->titi.
+End TOTO.
+
+
+Module toto (ta:TOTO).
+Module ti:=ta.t.
+
+Definition ex1:forall (c d:ti.X), (ta.a d)=(ta.a c) -> d=c.
+intros.
+injection H.
diff --git a/test-suite/bugs/closed/3310.v b/test-suite/bugs/closed/3310.v
new file mode 100644
index 00000000..d6c31c6b
--- /dev/null
+++ b/test-suite/bugs/closed/3310.v
@@ -0,0 +1,11 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+
+CoInductive stream A := cons { hd : A; tl : stream A }.
+
+CoFixpoint id {A} (s : stream A) := cons (hd s) (id (tl s)).
+
+Lemma id_spec : forall A (s : stream A), id s = s.
+Proof.
+intros A s.
+Fail change (id s) with (cons (hd (id s)) (tl (id s))).
diff --git a/test-suite/bugs/closed/3314.v b/test-suite/bugs/closed/3314.v
new file mode 100644
index 00000000..64786263
--- /dev/null
+++ b/test-suite/bugs/closed/3314.v
@@ -0,0 +1,147 @@
+Set Universe Polymorphism.
+Definition Lift
+: $(let U1 := constr:(Type) in
+ let U0 := constr:(Type : U1) in
+ exact (U0 -> U1))$
+ := fun T => T.
+
+Fail Check nat:Prop. (* The command has indeed failed with message:
+=> Error:
+The term "nat" has type "Set" while it is expected to have type "Prop". *)
+Set Printing All.
+Set Printing Universes.
+Fail Check Lift nat : Prop. (* Lift (* Top.8 Top.9 Top.10 *) nat:Prop
+ : Prop
+(* Top.10
+ Top.9
+ Top.8 |= Top.10 < Top.9
+ Top.9 < Top.8
+ Top.9 <= Prop
+ *)
+ *)
+Fail Eval compute in Lift nat : Prop.
+(* = nat
+ : Prop *)
+
+Section Hurkens.
+
+ Monomorphic Definition Type2 := Type.
+ Monomorphic Definition Type1 := Type : Type2.
+
+ (** Assumption of a retract from Type into Prop *)
+
+ Variable down : Type1 -> Prop.
+ Variable up : Prop -> Type1.
+
+ Hypothesis back : forall A, up (down A) -> A.
+
+ Hypothesis forth : forall A, A -> up (down A).
+
+ Hypothesis backforth : forall (A:Type) (P:A->Type) (a:A),
+ P (back A (forth A a)) -> P a.
+
+ Hypothesis backforth_r : forall (A:Type) (P:A->Type) (a:A),
+ P a -> P (back A (forth A a)).
+
+ (** Proof *)
+
+ Definition V : Type1 := forall A:Prop, ((up A -> Prop) -> up A -> Prop) -> up A -> Prop.
+ Definition U : Type1 := V -> Prop.
+
+ Definition sb (z:V) : V := fun A r a => r (z A r) a.
+ Definition le (i:U -> Prop) (x:U) : Prop := x (fun A r a => i (fun v => sb v A r a)).
+ Definition le' (i:up (down U) -> Prop) (x:up (down U)) : Prop := le (fun a:U => i (forth _ a)) (back _ x).
+ Definition induct (i:U -> Prop) : Type1 := forall x:U, up (le i x) -> up (i x).
+ Definition WF : U := fun z => down (induct (fun a => z (down U) le' (forth _ a))).
+ Definition I (x:U) : Prop :=
+ (forall i:U -> Prop, up (le i x) -> up (i (fun v => sb v (down U) le' (forth _ x)))) -> False.
+
+ Lemma Omega : forall i:U -> Prop, induct i -> up (i WF).
+ Proof.
+ intros i y.
+ apply y.
+ unfold le, WF, induct.
+ apply forth.
+ intros x H0.
+ apply y.
+ unfold sb, le', le.
+ compute.
+ apply backforth_r.
+ exact H0.
+ Qed.
+
+ Lemma lemma1 : induct (fun u => down (I u)).
+ Proof.
+ unfold induct.
+ intros x p.
+ apply forth.
+ intro q.
+ generalize (q (fun u => down (I u)) p).
+ intro r.
+ apply back in r.
+ apply r.
+ intros i j.
+ unfold le, sb, le', le in j |-.
+ apply backforth in j.
+ specialize q with (i := fun y => i (fun v:V => sb v (down U) le' (forth _ y))).
+ apply q.
+ exact j.
+ Qed.
+
+ Lemma lemma2 : (forall i:U -> Prop, induct i -> up (i WF)) -> False.
+ Proof.
+ intro x.
+ generalize (x (fun u => down (I u)) lemma1).
+ intro r; apply back in r.
+ apply r.
+ intros i H0.
+ apply (x (fun y => i (fun v => sb v (down U) le' (forth _ y)))).
+ unfold le, WF in H0.
+ apply back in H0.
+ exact H0.
+ Qed.
+
+ Theorem paradox : False.
+ Proof.
+ exact (lemma2 Omega).
+ Qed.
+
+End Hurkens.
+
+Definition informative (x : bool) :=
+ match x with
+ | true => Type
+ | false => Prop
+ end.
+
+Definition depsort (T : Type) (x : bool) : informative x :=
+ match x with
+ | true => T
+ | false => True
+ end.
+
+(** This definition should fail *)
+Definition Box (T : Type1) : Prop := Lift T.
+
+Definition prop {T : Type1} (t : Box T) : T := t.
+Definition wrap {T : Type1} (t : T) : Box T := t.
+
+Definition down (x : Type1) : Prop := Box x.
+Definition up (x : Prop) : Type1 := x.
+
+Fail Definition back A : up (down A) -> A := @prop A.
+
+Fail Definition forth (A : Type1) : A -> up (down A) := @wrap A.
+
+Fail Definition backforth (A:Type1) (P:A->Type) (a:A) :
+ P (back A (forth A a)) -> P a := fun H => H.
+
+Fail Definition backforth_r (A:Type1) (P:A->Type) (a:A) :
+ P a -> P (back A (forth A a)) := fun H => H.
+
+Theorem pandora : False.
+ Fail apply (paradox down up back forth backforth backforth_r).
+ admit.
+Qed.
+
+Print Assumptions pandora.
diff --git a/test-suite/bugs/closed/3315.v b/test-suite/bugs/closed/3315.v
new file mode 100644
index 00000000..b69097f9
--- /dev/null
+++ b/test-suite/bugs/closed/3315.v
@@ -0,0 +1,37 @@
+Set Universe Polymorphism.
+Set Primitive Projections.
+Set Implicit Arguments.
+Record sigT {A : Type} (P : A -> Type) := existT { projT1 : A; projT2 : P projT1 }.
+Arguments existT {A} _ _ _.
+Definition unpack_sigma' {A} {P : A -> Type} (Q : sigT P -> Type) (u : sigT P) :
+ Q (existT _ (projT1 u) (projT2 u)) -> Q u
+ :=
+ fun H =>
+ (let (x,p) as u return (Q (existT _ (projT1 u) (projT2 u)) -> Q u) := u in fun x : Q (existT _ _ p) => x) H. (* success *)
+Definition unpack_sigma {A} {P : A -> Type} (Q : sigT P -> Type) (u : sigT P) :
+ Q (existT _ (projT1 u) (projT2 u)) -> Q u
+ :=
+ fun H =>
+ (let (x,p) as u return (Q (existT _ (projT1 u) (projT2 u)) -> Q u) := u in fun x => x) H.
+(* Toplevel input, characters 219-229:
+Error:
+In environment
+A : Type
+P : A -> Type
+Q : sigT P -> Type
+u : sigT P
+H : Q {| projT1 := projT1 u; projT2 := projT2 u |}
+x : A
+p : P x
+The term
+ "fun
+ x : Q
+ {|
+ projT1 := projT1 {| projT1 := x; projT2 := p |};
+ projT2 := projT2 {| projT1 := x; projT2 := p |} |} => x" has type
+ "Q
+ {|
+ projT1 := projT1 {| projT1 := x; projT2 := p |};
+ projT2 := projT2 {| projT1 := x; projT2 := p |} |} ->
+... "
+*)
diff --git a/test-suite/bugs/closed/3317.v b/test-suite/bugs/closed/3317.v
new file mode 100644
index 00000000..8d152894
--- /dev/null
+++ b/test-suite/bugs/closed/3317.v
@@ -0,0 +1,94 @@
+Set Implicit Arguments.
+Module A.
+ Set Universe Polymorphism.
+ Set Primitive Projections.
+ Set Asymmetric Patterns.
+ Inductive paths {A} (x : A) : A -> Type := idpath : paths x x
+ where "x = y" := (@paths _ x y) : type_scope.
+ Record sigT {A : Type} (P : A -> Type) := existT { projT1 : A; projT2 : P projT1 }.
+ Arguments existT {A} _ _ _.
+ Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+ Notation "x .1" := (projT1 x) (at level 3).
+ Notation "x .2" := (projT2 x) (at level 3).
+ Notation "( x ; y )" := (existT _ x y).
+ Set Printing All.
+ Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (pq : sigT (fun p : u.1 = v.1 => transport _ p u.2 = v.2))
+ : u = v
+ := match pq with
+ | existT p q =>
+ match u, v return (forall p0 : (u.1 = v.1), (transport P p0 u.2 = v.2) -> (u=v)) with
+ | (x;y), (x';y') => fun p1 (q1 : transport P p1 (existT P x y).2 = (existT P x' y').2) =>
+ match p1 in (_ = x'') return (forall y'', (transport _ p1 y = y'') -> (x;y)=(x'';y'')) with
+ | idpath => fun y' (q2 : transport _ (@idpath _ _) y = y') =>
+ match q2 in (_ = y'') return (x;y) = (x;y'') with
+ | idpath => @idpath _ _
+ end
+ end y' q1
+ end p q
+ end.
+ (* Toplevel input, characters 341-357:
+Error:
+In environment
+A : Type
+P : forall _ : A, Type
+u : @sigT A P
+v : @sigT A P
+pq :
+@sigT (@paths A (projT1 u) (projT1 v))
+ (fun p : @paths A (projT1 u) (projT1 v) =>
+ @paths (P (projT1 v)) (@transport A P (projT1 u) (projT1 v) p (projT2 u))
+ (projT2 v))
+p : @paths A (projT1 u) (projT1 v)
+q :
+@paths (P (projT1 v)) (@transport A P (projT1 u) (projT1 v) p (projT2 u))
+ (projT2 v)
+x : A
+y : P x
+x' : A
+y' : P x'
+p1 : @paths A (projT1 (@existT A P x y)) (projT1 (@existT A P x' y'))
+The term "projT2 (@existT A P x y)" has type "P (projT1 (@existT A P x y))"
+while it is expected to have type "P (projT1 (@existT A P x y))".
+ *)
+End A.
+
+Module B.
+ Set Universe Polymorphism.
+ Set Primitive Projections.
+ Set Asymmetric Patterns.
+ Inductive paths {A} (x : A) : A -> Type := idpath : paths x x
+ where "x = y" := (@paths _ x y) : type_scope.
+ Record sigT {A : Type} (P : A -> Type) := existT { projT1 : A; projT2 : P projT1 }.
+ Arguments existT {A} _ _ _.
+ Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+ Notation "x .1" := (projT1 x) (at level 3).
+ Notation "x .2" := (projT2 x) (at level 3).
+ Notation "( x ; y )" := (existT _ x y).
+ Set Printing All.
+
+ Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (pq : sigT (fun p : u.1 = v.1 => transport _ p u.2 = v.2))
+ : u = v.
+ Proof.
+ destruct u as [x y].
+ destruct v. (* Toplevel input, characters 0-11:
+Error: Illegal application:
+The term "transport" of type
+ "forall (A : Type) (P : forall _ : A, Type) (x y : A)
+ (_ : @paths A x y) (_ : P x), P y"
+cannot be applied to the terms
+ "A" : "Type"
+ "P" : "forall _ : A, Type"
+ "projT1 (@existT A P x y)" : "A"
+ "projT1 v" : "A"
+ "p" : "@paths A (projT1 (@existT A P x y)) (projT1 v)"
+ "projT2 (@existT A P x y)" : "P (projT1 (@existT A P x y))"
+The 5th term has type "@paths A (projT1 (@existT A P x y)) (projT1 v)"
+which should be coercible to
+ "@paths A (projT1 (@existT A P x y)) (projT1 v)".
+ *)
+ Abort.
+End B.
diff --git a/test-suite/bugs/closed/3319.v b/test-suite/bugs/closed/3319.v
new file mode 100644
index 00000000..bb5853dd
--- /dev/null
+++ b/test-suite/bugs/closed/3319.v
@@ -0,0 +1,25 @@
+(* File reduced by coq-bug-finder from original input, then from 5353 lines to 4545 lines, then from 4513 lines to 4504 lines, then from 4515 lines to 4508 lines, then from 4519 lines to 132 lines, then from 111 lines to 66 lines, then from 68 lines to 35 lines *)
+Set Implicit Arguments.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a
+ where "x = y" := (@paths _ x y) : type_scope.
+
+Record PreCategory := { obj :> Type; morphism : obj -> obj -> Type }.
+Record NotionOfStructure (X : PreCategory) :=
+ { structure :> X -> Type;
+ is_structure_homomorphism
+ : forall x y (f : morphism X x y) (a : structure x) (b : structure y), Type }.
+
+Section precategory.
+ Variable X : PreCategory.
+ Variable P : NotionOfStructure X.
+ Local Notation object := { x : X & P x }.
+ Record morphism' (xa yb : object) := {}.
+
+ Lemma issig_morphism xa yb
+ : { f : morphism X (projT1 xa) (projT1 yb)
+ & is_structure_homomorphism _ _ _ f (projT2 xa) (projT2 yb) }
+ = morphism' xa yb.
+ Proof.
+ admit.
+ Defined. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3321.v b/test-suite/bugs/closed/3321.v
new file mode 100644
index 00000000..07e3b3cb
--- /dev/null
+++ b/test-suite/bugs/closed/3321.v
@@ -0,0 +1,18 @@
+(* File reduced by coq-bug-finder from original input, then from 5302 lines to 4649 lines, then from 4660 lines to 355 lines, then from 360 lines to 269 lines, then from 269 lines to 175 lines, then from 144 lines to 119 lines, then from 103 lines to 83 lines, then from 86 lines to 36 lines, then from 37 lines to 17 lines *)
+
+Axiom admit : forall {T}, T.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A ; eisretr : Sect equiv_inv f }.
+Record Equiv A B := BuildEquiv { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Definition hfiber {A B : Type} (f : A -> B) (y : B) := { x : A & f x = y }.
+Definition equiv_path (A B : Type) (p : A = B) : Equiv A B := admit.
+Class Univalence := { isequiv_equiv_path :> forall (A B : Type), IsEquiv (equiv_path A B) }.
+Definition path_universe `{Univalence} {A B : Type} (f : A -> B) {feq : IsEquiv f} : (A = B) := admit.
+Context `{ua:Univalence}.
+Variable A:Type.
+Goal forall (I : Type) (f : I -> A),
+ {p : I = {a : A & @hfiber I A f a} & True }.
+intros.
+clear.
+try exists (path_universe admit). (* Toplevel input, characters 15-44:
+Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/3322.v b/test-suite/bugs/closed/3322.v
new file mode 100644
index 00000000..925f22a2
--- /dev/null
+++ b/test-suite/bugs/closed/3322.v
@@ -0,0 +1,23 @@
+(* File reduced by coq-bug-finder from original input, then from 11971 lines to 11753 lines, then from 7702 lines to 564 lines, then from 571 lines to 61 lines *)
+Set Asymmetric Patterns.
+Axiom admit : forall {T}, T.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (pq : {p : (projT1 u) = (projT1 v) & transport _ p (projT2 u) = (projT2 v)})
+: u = v.
+Proof.
+ destruct pq as [p q], u as [x y], v as [x' y']; simpl in *.
+ destruct p, q; simpl; reflexivity.
+Defined.
+Arguments path_sigma_uncurried : simpl never.
+Section opposite.
+ Let opposite_functor_involutive_helper
+ := @path_sigma_uncurried admit admit (existT _ admit admit) admit (existT _ admit admit).
+
+ Goal True.
+ Opaque path_sigma_uncurried.
+ simpl in *.
+ Transparent path_sigma_uncurried.
+ (* This command should fail with "Error: Failed to progress.", as it does in 8.4; the simpl never directive should prevent simpl from progressing *)
+ Fail progress simpl in *.
diff --git a/test-suite/bugs/closed/3323.v b/test-suite/bugs/closed/3323.v
new file mode 100644
index 00000000..fb5a8a7e
--- /dev/null
+++ b/test-suite/bugs/closed/3323.v
@@ -0,0 +1,77 @@
+(* -*- coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 5302 lines to 4649 lines, then from 4660 lines to 355 lines, then from 360 lines to 269 lines, then from 269 lines to 175 lines, then from 144 lines to 119 lines, then from 297 lines to 117 lines, then from 95 lines to 79 lines, then from 82 lines to 68 lines *)
+
+Set Universe Polymorphism.
+Generalizable All Variables.
+Inductive sigT {A:Type} (P:A -> Type) : Type := existT : forall x:A, P x -> sigT P.
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+Definition projT1 {A} {P : A -> Type} (x : sigT P) : A := let (a, _) := x in a.
+Definition projT2 {A} {P : A -> Type} (x : sigT P) : P (projT1 x) := let (a, h) return P (projT1 x) := x in h.
+Axiom admit : forall {T}, T.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x := match p with idpath => idpath end.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A ; eisretr : Sect equiv_inv f }.
+Record Equiv A B := BuildEquiv { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Existing Instance equiv_isequiv.
+Global Instance isequiv_inverse `{IsEquiv A B f} : IsEquiv (@equiv_inv _ _ f _) | 10000 := admit.
+Definition equiv_path_sigma `(P : A -> Type) (u v : sigT P)
+: Equiv {p : projT1 u = projT1 v & transport _ p (projT2 u) = projT2 v} (u = v) := admit.
+Definition hfiber {A B : Type} (f : A -> B) (y : B) := { x : A & f x = y }.
+Definition path_universe {A B : Type} (f : A -> B) : (A = B) := admit.
+Section AssumeFunext.
+ Let equiv_fibration_replacement_eissect {B C f}
+ : forall x : {y : B & {x : C & f x = y}},
+ existT _ (f (projT1 (projT2 x))) (existT _ (projT1 (projT2 x)) idpath) = x.
+ admit.
+ Defined.
+ Definition equiv_fibration_replacement {B C} (f:C ->B):
+ Equiv C {y:B & {x:C & f x = y}}.
+ Proof.
+ refine (BuildEquiv
+ _ _ _
+ (BuildIsEquiv
+ C {y:B & {x:C & f x = y}}
+ (fun c => existT _ (f c) (existT _ c idpath))
+ (fun c => projT1 (projT2 c))
+ equiv_fibration_replacement_eissect)).
+ Defined.
+ Definition equiv_total_paths (A : Type) (P : A-> Type) (x y : sigT P) :
+ Equiv (x = y) { p : projT1 x = projT1 y & transport P p (projT2 x) = (projT2 y) }
+ := BuildEquiv _ _ (@equiv_inv _ _ _ (equiv_path_sigma P x y)) _.
+ Variable A:Type.
+ Definition Fam A:=sigT (fun I:Type => I->A).
+ Definition p2f: (A->Type)-> Fam A := fun Q:(A->Type) => existT _ (sigT Q) (@projT1 _ _).
+ Definition f2p: Fam A -> (A->Type) := fun F => let (I, f) := F in (fun a => (hfiber f a)).
+ Definition exp {U V:Type}(w:Equiv U V):Equiv (U->A) (V->A).
+ exists (fun f:(U->A)=> (fun x => (f (@equiv_inv _ _ w _ x)))).
+ admit.
+ Defined.
+ Goal { h : Fam A -> A -> Type & Sect h p2f }.
+ exists f2p.
+ intros [I f].
+ set (e:=@equiv_total_paths _ _ (@existT Type (fun I0 : Type => I0 -> A) I f)
+ (existT _ {a : A & hfiber f a} (@projT1 _ _))).
+ simpl in e.
+ cut ( {p : I = {a : A & @hfiber I A f a} &
+ @transport _ (fun I0 : Type => I0 -> A) _ _ p f = @projT1 _ _}).
+ { intro X.
+ apply (inverse (@equiv_inv _ _ _ e X)). }
+ set (w:=@equiv_fibration_replacement A I f).
+ exists (path_universe w).
+ assert (forall x, (exp w) f x = projT1 x); [ | admit ].
+ intros [a [i p]].
+ exact p.
+ Qed.
+(* Toplevel input, characters 15-19:
+Error: In pattern-matching on term "x" the branch for constructor
+"existT(*Top.256 Top.258*)" has type
+ "forall (I : Type) (f : I -> A),
+ existT (fun I0 : Type => I0 -> A) {a : A & hfiber f a} projT1 =
+ existT (fun I0 : Type => I0 -> A) I f" which should be
+ "forall (x : Type) (H : x -> A),
+ p2f (f2p (existT (fun I : Type => I -> A) x H)) =
+ existT (fun I : Type => I -> A) x H".
+ *)
diff --git a/test-suite/bugs/closed/3324.v b/test-suite/bugs/closed/3324.v
new file mode 100644
index 00000000..9cd6e4c2
--- /dev/null
+++ b/test-suite/bugs/closed/3324.v
@@ -0,0 +1,47 @@
+Module ETassi.
+ Axiom admit : forall {T}, T.
+ Class IsHProp (A : Type) : Type := {}.
+ Class IsHSet (A : Type) : Type := {}.
+ Record hProp := hp { hproptype :> Type ; isp : IsHProp hproptype}.
+ Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+ Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
+ Global Instance isset_hProp : IsHSet hProp | 0.
+
+ Check (eq_refl _ : setT (default_HSet _ _) = hProp).
+ Check (eq_refl _ : setT _ = hProp).
+End ETassi.
+
+Module JGross.
+ (* File reduced by coq-bug-finder from original input, then from 6462 lines to 5760 lines, then from 5761 lines to 181 lines, then from 191 lines to 181 lines, then from 181 lines to 83 lines, then from 87 lines to 27 lines *)
+ Axiom admit : forall {T}, T.
+ Class IsHProp (A : Type) : Type := {}.
+ Class IsHSet (A : Type) : Type := {}.
+ Inductive Unit : Set := tt.
+ Record hProp := hp { hproptype :> Type ; isp : IsHProp hproptype}.
+ Definition Unit_hp:hProp:=(hp Unit admit).
+ Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+ Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
+ Global Instance isset_hProp : IsHSet hProp | 0.
+ Definition isepi {X Y} `(f:X->Y) := forall Z: hSet,
+ forall g h: Y -> Z, (fun x => g (f x)) = (fun x => h (f x)) -> g = h.
+ Lemma isepi_issurj {X Y} (f:X->Y): isepi f -> True.
+ Proof.
+ intros epif.
+ set (g :=fun _:Y => Unit_hp).
+ pose proof (epif (default_HSet hProp isset_hProp) g).
+ specialize (epif _ g).
+ (* Toplevel input, characters 34-35:
+Error:
+In environment
+X : Type
+Y : Type
+f : X -> Y
+epif : isepi f
+g := fun _ : Y => Unit_hp : Y -> hProp
+H : forall h : Y -> default_HSet hProp isset_hProp,
+ (fun x : X => g (f x)) = (fun x : X => h (f x)) -> g = h
+The term "g" has type "Y -> hProp" while it is expected to have type
+ "Y -> ?30".
+ *)
+ Abort.
+End JGross.
diff --git a/test-suite/bugs/closed/3325.v b/test-suite/bugs/closed/3325.v
new file mode 100644
index 00000000..36c065eb
--- /dev/null
+++ b/test-suite/bugs/closed/3325.v
@@ -0,0 +1,48 @@
+Typeclasses eauto := debug.
+Set Printing All.
+
+Axiom SProp : Set.
+Axiom sp : SProp.
+
+(* If we hardcode valueType := nat, it goes through *)
+Class StateIs := {
+ valueType : Type;
+ stateIs : valueType -> SProp
+}.
+
+Instance NatStateIs : StateIs := {
+ valueType := nat;
+ stateIs := fun _ => sp
+}.
+Canonical Structure NatStateIs.
+
+Class LogicOps F := { land: F -> F }.
+Instance : LogicOps SProp. Admitted.
+Instance : LogicOps Prop. Admitted.
+
+Parameter (n : nat).
+(* If this is a [Definition], the resolution goes through fine. *)
+Notation vn := (@stateIs _ n).
+Definition vn' := (@stateIs _ n).
+Definition GOOD : SProp :=
+ @land _ _ vn'.
+(* This doesn't resolve, if PropLogicOps is defined later than SPropLogicOps *)
+Definition BAD : SProp :=
+ @land _ _ vn.
+
+
+Class A T := { foo : T -> Prop }.
+Instance: A nat. Admitted.
+Instance: A Set. Admitted.
+
+Class B := { U : Type ; b : U }.
+Instance bi: B := {| U := nat ; b := 0 |}.
+Canonical Structure bi.
+
+Notation b0N := (@b _ : nat).
+Notation b0Ni := (@b bi : nat).
+Definition b0D := (@b _ : nat).
+Definition GOOD1 := (@foo _ _ b0D).
+Definition GOOD2 := (let x := b0N in @foo _ _ x).
+Definition GOOD3 := (@foo _ _ b0Ni).
+Definition BAD1 := (@foo _ _ b0N). (* Error: The term "b0Ni" has type "nat" while it is expected to have type "Set". *)
diff --git a/test-suite/bugs/closed/3326.v b/test-suite/bugs/closed/3326.v
new file mode 100644
index 00000000..4d7e9f77
--- /dev/null
+++ b/test-suite/bugs/closed/3326.v
@@ -0,0 +1,19 @@
+Class ORDER A := Order {
+ LEQ : A -> A -> bool;
+ leqRefl: forall x, true = LEQ x x
+}.
+
+Section XXX.
+
+Variable A:Type.
+Variable (O:ORDER A).
+Definition aLeqRefl := @leqRefl _ O.
+
+Lemma OK : forall x, true = LEQ x x.
+Proof.
+ intros.
+ unfold LEQ.
+ destruct O.
+ clear.
+ Fail apply aLeqRefl.
+Abort.
diff --git a/test-suite/bugs/closed/3329.v b/test-suite/bugs/closed/3329.v
new file mode 100644
index 00000000..f7e368f8
--- /dev/null
+++ b/test-suite/bugs/closed/3329.v
@@ -0,0 +1,93 @@
+(* File reduced by coq-bug-finder from original input, then from 12095 lines to 869 lines, then from 792 lines to 504 lines, then from 487 lines to 353 lines, then from 258 lines to 174 lines, then from 164 lines to 132 lines, then from 129 lines to 99 lines *)
+Set Universe Polymorphism.
+Generalizable All Variables.
+Axiom admit : forall {T}, T.
+Reserved Notation "g 'o' f" (at level 40, left associativity).
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Notation "g 'o' f" := (compose g f).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x) : Type := forall x:A, f x = g x.
+Hint Unfold pointwise_paths : typeclass_instances.
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+: forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
+Class IsHSet (A : Type) := { _ : False }.
+Class Funext := { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+ trunc_morphism : forall s d, IsHSet (morphism s d) }.
+
+Definition trunc_equiv `(f : A -> B) `{IsHSet A} `{IsEquiv A B f} : IsHSet B := admit.
+Global Instance trunc_forall `{Funext} `{P : A -> Type} `{forall a, IsHSet (P a)}
+: IsHSet (forall a, P a) | 100.
+Proof.
+ generalize dependent P.
+ intro P.
+ assert (f : forall a, P a) by admit.
+ assert (g : forall a, P a) by admit.
+ pose (@trunc_equiv (forall x : A, @paths (P x) (f x) (g x))
+ (@paths (forall x : A, P x) f g)
+ (@equiv_inv (@paths (forall x : A, P x) f g)
+ (forall x : A, @paths (P x) (f x) (g x))
+ (@apD10 A P f g) (@isequiv_apD10 H A P f g))).
+ admit.
+Defined.
+Record Functor (C D : PreCategory) := { object_of :> C -> D }.
+Definition identity C : Functor C C := Build_Functor C C admit.
+Notation "1" := (identity _) : functor_scope.
+Definition functor_category (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D) admit admit.
+Notation "C -> D" := (functor_category C D) : category_scope.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+Global Existing Instance iss.
+Definition set_cat `{Funext} : PreCategory :=
+ @Build_PreCategory hSet
+ (fun x y => x -> y)
+ _.
+
+Section hom_functor.
+ Context `{Funext}.
+ Variable C : PreCategory.
+
+ Local Notation obj_of c'c :=
+ (BuildhSet
+ (morphism
+ C
+ c'c
+ c'c)
+ admit).
+ Let hom_functor_morphism_of s's d'd (hf : morphism C s's d'd)
+ : morphism set_cat (obj_of s's) (obj_of d'd)
+ := admit.
+
+ Definition hom_functor : Functor C set_cat := admit.
+End hom_functor.
+Local Open Scope category_scope.
+Local Open Scope functor_scope.
+Context `{Funext}.
+Variable D : PreCategory.
+Set Printing Universes.
+Check hom_functor D o 1.
+(* Toplevel input, characters 20-44:
+Error: Illegal application:
+The term "@set_cat" of type "(Funext -> PreCategory)%type"
+cannot be applied to the term
+ "H" : "Funext"
+This term has type "Funext" which should be coercible to
+"Funext". *)
+(* The command has indeed failed with message:
+=> Error: Illegal application:
+The term "@set_cat@{Top.345 Top.346 Top.331 Top.332 Top.337 Top.338 Top.339}"
+of type
+ "(Funext@{Top.346 Top.346 Top.331 Top.332 Top.346} -> PreCategory@{Top.345
+ Top.346})%type"
+cannot be applied to the term
+ "H@{Top.346 Top.330 Top.331 Top.332 Top.333}"
+ : "Funext@{Top.346 Top.330 Top.331 Top.332 Top.333}"
+This term has type "Funext@{Top.346 Top.330 Top.331 Top.332 Top.333}"
+which should be coercible to
+ "Funext@{Top.346 Top.346 Top.331 Top.332 Top.346}".
+*)
diff --git a/test-suite/bugs/closed/3330.v b/test-suite/bugs/closed/3330.v
new file mode 100644
index 00000000..15303cca
--- /dev/null
+++ b/test-suite/bugs/closed/3330.v
@@ -0,0 +1,1110 @@
+(* File reduced by coq-bug-finder from original input, then from 12106 lines to 1070 lines *)
+Set Universe Polymorphism.
+Definition setleq (A : Type@{i}) (B : Type@{j}) := A : Type@{j}.
+
+Inductive foo : Type@{l} := bar : foo .
+Section MakeEq.
+ Variables (a : foo@{i}) (b : foo@{j}).
+
+ Let t := $(let ty := type of b in exact ty)$.
+ Definition make_eq (x:=b) := a : t.
+End MakeEq.
+
+Definition same (x : foo@{i}) (y : foo@{i}) := x.
+
+Section foo.
+
+ Variables x : foo@{i}.
+ Variables y : foo@{j}.
+
+ Let AleqB := let foo := make_eq x y in (Type * Type)%type.
+
+ Definition baz := same x y.
+End foo.
+
+Definition baz' := Eval unfold baz in baz@{i j k l}.
+
+Module Export HoTT_DOT_Overture.
+Module Export HoTT.
+Module Export Overture.
+
+Definition relation (A : Type) := A -> A -> Type.
+Class Symmetric {A} (R : relation A) :=
+ symmetry : forall x y, R x y -> R y x.
+
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) :=
+ fun x => g (f x).
+
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
+
+Open Scope function_scope.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Delimit Scope path_scope with path.
+
+Local Open Scope path_scope.
+
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+
+Instance symmetric_paths {A} : Symmetric (@paths A) | 0 := @inverse A.
+
+Notation "1" := idpath : path_scope.
+
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+
+Notation "p ^" := (inverse p) (at level 3) : path_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x) : Type
+ := forall x:A, f x = g x.
+
+Hint Unfold pointwise_paths : typeclass_instances.
+
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
+
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+ : f == g
+ := fun x => match h with idpath => 1 end.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Delimit Scope equiv_scope with equiv.
+
+Local Open Scope equiv_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+}.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint nat_to_trunc_index (n : nat) : trunc_index
+ := match n with
+ | 0 => trunc_S (trunc_S minus_two)
+ | S n' => trunc_S (nat_to_trunc_index n')
+ end.
+
+Coercion nat_to_trunc_index : nat >-> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Notation IsHSet := (IsTrunc 0).
+
+Class Funext :=
+ { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+
+Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) :
+ f == g -> f = g
+ :=
+ (@apD10 A P f g)^-1.
+
+End Overture.
+
+End HoTT.
+
+End HoTT_DOT_Overture.
+
+Module Export HoTT_DOT_categories_DOT_Category_DOT_Core.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Category.
+Module Export Core.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Delimit Scope morphism_scope with morphism.
+
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+
+Record PreCategory :=
+ Build_PreCategory' {
+ object :> Type;
+ morphism : object -> object -> Type;
+
+ identity : forall x, morphism x x;
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ associativity : forall x1 x2 x3 x4
+ (m1 : morphism x1 x2)
+ (m2 : morphism x2 x3)
+ (m3 : morphism x3 x4),
+ (m3 o m2) o m1 = m3 o (m2 o m1);
+
+ associativity_sym : forall x1 x2 x3 x4
+ (m1 : morphism x1 x2)
+ (m2 : morphism x2 x3)
+ (m3 : morphism x3 x4),
+ m3 o (m2 o m1) = (m3 o m2) o m1;
+
+ left_identity : forall a b (f : morphism a b), identity b o f = f;
+ right_identity : forall a b (f : morphism a b), f o identity a = f;
+
+ identity_identity : forall x, identity x o identity x = identity x;
+
+ trunc_morphism : forall s d, IsHSet (morphism s d)
+ }.
+
+Bind Scope category_scope with PreCategory.
+
+Arguments identity [!C%category] x%object : rename.
+Arguments compose [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+
+Definition Build_PreCategory
+ object morphism compose identity
+ associativity left_identity right_identity
+ := @Build_PreCategory'
+ object
+ morphism
+ compose
+ identity
+ associativity
+ (fun _ _ _ _ _ _ _ => symmetry _ _ (associativity _ _ _ _ _ _ _))
+ left_identity
+ right_identity
+ (fun _ => left_identity _ _ _).
+
+Existing Instance trunc_morphism.
+
+Hint Resolve @left_identity @right_identity @associativity : category morphism.
+
+Module Export CategoryCoreNotations.
+
+ Infix "o" := compose : morphism_scope.
+End CategoryCoreNotations.
+End Core.
+
+End Category.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Category_DOT_Core.
+
+Module Export HoTT_DOT_types_DOT_Forall.
+
+Module Export HoTT.
+Module Export types.
+Module Export Forall.
+Generalizable Variables A B f g e n.
+
+Section AssumeFunext.
+
+Global Instance trunc_forall `{P : A -> Type} `{forall a, IsTrunc n (P a)}
+ : IsTrunc n (forall a, P a) | 100.
+
+admit.
+Defined.
+End AssumeFunext.
+
+End Forall.
+
+End types.
+
+End HoTT.
+
+End HoTT_DOT_types_DOT_Forall.
+
+Module Export HoTT_DOT_types_DOT_Prod.
+
+Module Export HoTT.
+Module Export types.
+Module Export Prod.
+Local Open Scope path_scope.
+
+Definition path_prod_uncurried {A B : Type} (z z' : A * B)
+ (pq : (fst z = fst z') * (snd z = snd z'))
+ : (z = z')
+ := match pq with (p,q) =>
+ match z, z' return
+ (fst z = fst z') -> (snd z = snd z') -> (z = z') with
+ | (a,b), (a',b') => fun p q =>
+ match p, q with
+ idpath, idpath => 1
+ end
+ end p q
+ end.
+
+Definition path_prod {A B : Type} (z z' : A * B) :
+ (fst z = fst z') -> (snd z = snd z') -> (z = z')
+ := fun p q => path_prod_uncurried z z' (p,q).
+
+Definition path_prod' {A B : Type} {x x' : A} {y y' : B}
+ : (x = x') -> (y = y') -> ((x,y) = (x',y'))
+ := fun p q => path_prod (x,y) (x',y') p q.
+
+End Prod.
+
+End types.
+
+End HoTT.
+
+End HoTT_DOT_types_DOT_Prod.
+
+Module Export HoTT_DOT_categories_DOT_Functor_DOT_Core.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Functor.
+Module Export Core.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Delimit Scope functor_scope with functor.
+
+Local Open Scope morphism_scope.
+
+Section Functor.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Record Functor :=
+ {
+ object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d);
+ composition_of : forall s d d'
+ (m1 : morphism C s d) (m2: morphism C d d'),
+ morphism_of _ _ (m2 o m1)
+ = (morphism_of _ _ m2) o (morphism_of _ _ m1);
+ identity_of : forall x, morphism_of _ _ (identity x)
+ = identity (object_of x)
+ }.
+
+End Functor.
+Bind Scope functor_scope with Functor.
+
+Arguments morphism_of [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+Module Export FunctorCoreNotations.
+
+ Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
+End FunctorCoreNotations.
+End Core.
+
+End Functor.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Functor_DOT_Core.
+
+Module Export HoTT_DOT_categories_DOT_Category_DOT_Morphisms.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Category.
+Module Export Morphisms.
+Set Universe Polymorphism.
+
+Local Open Scope morphism_scope.
+
+Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) :=
+ {
+ morphism_inverse : morphism C d s;
+ left_inverse : morphism_inverse o m = identity _;
+ right_inverse : m o morphism_inverse = identity _
+ }.
+
+Class Isomorphic {C : PreCategory} s d :=
+ {
+ morphism_isomorphic :> morphism C s d;
+ isisomorphism_isomorphic :> IsIsomorphism morphism_isomorphic
+ }.
+
+Module Export CategoryMorphismsNotations.
+
+ Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
+
+End CategoryMorphismsNotations.
+End Morphisms.
+
+End Category.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Category_DOT_Morphisms.
+
+Module Export HoTT_DOT_categories_DOT_Category_DOT_Dual.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Category.
+Module Export Dual.
+Set Universe Polymorphism.
+
+Local Open Scope morphism_scope.
+
+Section opposite.
+
+ Definition opposite (C : PreCategory) : PreCategory
+ := @Build_PreCategory'
+ C
+ (fun s d => morphism C d s)
+ (identity (C := C))
+ (fun _ _ _ m1 m2 => m2 o m1)
+ (fun _ _ _ _ _ _ _ => @associativity_sym _ _ _ _ _ _ _ _)
+ (fun _ _ _ _ _ _ _ => @associativity _ _ _ _ _ _ _ _)
+ (fun _ _ => @right_identity _ _ _)
+ (fun _ _ => @left_identity _ _ _)
+ (@identity_identity C)
+ _.
+End opposite.
+
+Module Export CategoryDualNotations.
+
+ Notation "C ^op" := (opposite C) (at level 3) : category_scope.
+End CategoryDualNotations.
+End Dual.
+
+End Category.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Category_DOT_Dual.
+
+Module Export HoTT_DOT_categories_DOT_Functor_DOT_Composition_DOT_Core.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Functor.
+Module Export Composition.
+Module Export Core.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Local Open Scope morphism_scope.
+
+Section composition.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable E : PreCategory.
+ Variable G : Functor D E.
+ Variable F : Functor C D.
+
+ Local Notation c_object_of c := (G (F c)) (only parsing).
+
+ Local Notation c_morphism_of m := (morphism_of G (morphism_of F m)) (only parsing).
+
+ Let compose_composition_of' s d d'
+ (m1 : morphism C s d) (m2 : morphism C d d')
+ : c_morphism_of (m2 o m1) = c_morphism_of m2 o c_morphism_of m1.
+admit.
+Defined.
+ Definition compose_composition_of s d d' m1 m2
+ := Eval cbv beta iota zeta delta
+ [compose_composition_of'] in
+ @compose_composition_of' s d d' m1 m2.
+ Let compose_identity_of' x
+ : c_morphism_of (identity x) = identity (c_object_of x).
+
+admit.
+Defined.
+ Definition compose_identity_of x
+ := Eval cbv beta iota zeta delta
+ [compose_identity_of'] in
+ @compose_identity_of' x.
+ Definition compose : Functor C E
+ := Build_Functor
+ C E
+ (fun c => G (F c))
+ (fun _ _ m => morphism_of G (morphism_of F m))
+ compose_composition_of
+ compose_identity_of.
+
+End composition.
+Module Export FunctorCompositionCoreNotations.
+
+ Infix "o" := compose : functor_scope.
+End FunctorCompositionCoreNotations.
+End Core.
+
+End Composition.
+
+End Functor.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Functor_DOT_Composition_DOT_Core.
+
+Module Export HoTT_DOT_categories_DOT_Functor_DOT_Dual.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Functor.
+Module Export Dual.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+
+Section opposite.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Definition opposite (F : Functor C D) : Functor C^op D^op
+ := Build_Functor (C^op) (D^op)
+ (object_of F)
+ (fun s d => morphism_of F (s := d) (d := s))
+ (fun d' d s m1 m2 => composition_of F s d d' m2 m1)
+ (identity_of F).
+
+End opposite.
+Module Export FunctorDualNotations.
+
+ Notation "F ^op" := (opposite F) : functor_scope.
+End FunctorDualNotations.
+End Dual.
+
+End Functor.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Functor_DOT_Dual.
+
+Module Export HoTT_DOT_categories_DOT_Functor_DOT_Identity.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Functor.
+Module Export Identity.
+Set Universe Polymorphism.
+
+Section identity.
+
+ Definition identity C : Functor C C
+ := Build_Functor C C
+ (fun x => x)
+ (fun _ _ x => x)
+ (fun _ _ _ _ _ => idpath)
+ (fun _ => idpath).
+End identity.
+Module Export FunctorIdentityNotations.
+
+ Notation "1" := (identity _) : functor_scope.
+End FunctorIdentityNotations.
+End Identity.
+
+End Functor.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Functor_DOT_Identity.
+
+Module Export HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Core.
+
+Module Export HoTT.
+Module Export categories.
+Module Export NaturalTransformation.
+Module Export Core.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Local Open Scope morphism_scope.
+
+Section NaturalTransformation.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+
+ Record NaturalTransformation :=
+ Build_NaturalTransformation' {
+ components_of :> forall c, morphism D (F c) (G c);
+ commutes : forall s d (m : morphism C s d),
+ components_of d o F _1 m = G _1 m o components_of s;
+
+ commutes_sym : forall s d (m : C.(morphism) s d),
+ G _1 m o components_of s = components_of d o F _1 m
+ }.
+
+End NaturalTransformation.
+End Core.
+
+End NaturalTransformation.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Core.
+
+Module Export HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Dual.
+
+Module Export HoTT.
+Module Export categories.
+Module Export NaturalTransformation.
+Module Export Dual.
+Set Universe Polymorphism.
+
+Section opposite.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Definition opposite
+ (F G : Functor C D)
+ (T : NaturalTransformation F G)
+ : NaturalTransformation G^op F^op
+ := Build_NaturalTransformation' (G^op) (F^op)
+ (components_of T)
+ (fun s d => commutes_sym T d s)
+ (fun s d => commutes T d s).
+
+End opposite.
+
+End Dual.
+
+End NaturalTransformation.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Dual.
+
+Module Export HoTT_DOT_categories_DOT_Category_DOT_Strict.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Category.
+Module Export Strict.
+
+Export Category.Core.
+Set Universe Polymorphism.
+
+End Strict.
+
+End Category.
+
+End categories.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_Category_DOT_Strict.
+
+Module Export HoTT.
+Module Export categories.
+Module Export Category.
+Module Export Prod.
+Set Universe Polymorphism.
+
+Local Open Scope morphism_scope.
+
+Section prod.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Definition prod : PreCategory.
+
+ refine (@Build_PreCategory
+ (C * D)%type
+ (fun s d => (morphism C (fst s) (fst d)
+ * morphism D (snd s) (snd d))%type)
+ (fun x => (identity (fst x), identity (snd x)))
+ (fun s d d' m2 m1 => (fst m2 o fst m1, snd m2 o snd m1))
+ _
+ _
+ _
+ _); admit.
+ Defined.
+End prod.
+Module Export CategoryProdNotations.
+
+ Infix "*" := prod : category_scope.
+End CategoryProdNotations.
+End Prod.
+
+End Category.
+
+End categories.
+
+End HoTT.
+
+Module Functor.
+Module Export Prod.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Local Open Scope morphism_scope.
+
+Section proj.
+
+ Context {C : PreCategory}.
+ Context {D : PreCategory}.
+ Definition fst : Functor (C * D) C
+ := Build_Functor (C * D) C
+ (@fst _ _)
+ (fun _ _ => @fst _ _)
+ (fun _ _ _ _ _ => idpath)
+ (fun _ => idpath).
+
+ Definition snd : Functor (C * D) D
+ := Build_Functor (C * D) D
+ (@snd _ _)
+ (fun _ _ => @snd _ _)
+ (fun _ _ _ _ _ => idpath)
+ (fun _ => idpath).
+
+End proj.
+
+Section prod.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable D' : PreCategory.
+ Definition prod (F : Functor C D) (F' : Functor C D')
+ : Functor C (D * D')
+ := Build_Functor
+ C (D * D')
+ (fun c => (F c, F' c))
+ (fun s d m => (F _1 m, F' _1 m))
+ (fun _ _ _ _ _ => path_prod' (composition_of F _ _ _ _ _)
+ (composition_of F' _ _ _ _ _))
+ (fun _ => path_prod' (identity_of F _) (identity_of F' _)).
+
+End prod.
+Local Infix "*" := prod : functor_scope.
+
+Section pair.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable C' : PreCategory.
+ Variable D' : PreCategory.
+ Variable F : Functor C D.
+ Variable F' : Functor C' D'.
+ Definition pair : Functor (C * C') (D * D')
+ := (F o fst) * (F' o snd).
+
+End pair.
+
+Module Export FunctorProdNotations.
+
+ Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : functor_scope.
+End FunctorProdNotations.
+End Prod.
+
+End Functor.
+
+Module Export HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Composition_DOT_Core.
+
+Module Export HoTT.
+Module categories.
+Module Export NaturalTransformation.
+Module Export Composition.
+Module Export Core.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Local Open Scope path_scope.
+
+Local Open Scope morphism_scope.
+
+Section composition.
+
+ Section compose.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F F' F'' : Functor C D.
+ Variable T' : NaturalTransformation F' F''.
+
+ Variable T : NaturalTransformation F F'.
+ Local Notation CO c := (T' c o T c).
+
+ Definition compose_commutes s d (m : morphism C s d)
+ : CO d o morphism_of F m = morphism_of F'' m o CO s
+ := (associativity _ _ _ _ _ _ _ _)
+ @ ap (fun x => _ o x) (commutes T _ _ m)
+ @ (associativity_sym _ _ _ _ _ _ _ _)
+ @ ap (fun x => x o _) (commutes T' _ _ m)
+ @ (associativity _ _ _ _ _ _ _ _).
+
+ Definition compose_commutes_sym s d (m : morphism C s d)
+ : morphism_of F'' m o CO s = CO d o morphism_of F m
+ := (associativity_sym _ _ _ _ _ _ _ _)
+ @ ap (fun x => x o _) (commutes_sym T' _ _ m)
+ @ (associativity _ _ _ _ _ _ _ _)
+ @ ap (fun x => _ o x) (commutes_sym T _ _ m)
+ @ (associativity_sym _ _ _ _ _ _ _ _).
+
+ Definition compose
+ : NaturalTransformation F F''
+ := Build_NaturalTransformation' F F''
+ (fun c => CO c)
+ compose_commutes
+ compose_commutes_sym.
+
+ End compose.
+ End composition.
+Module Export NaturalTransformationCompositionCoreNotations.
+
+ Infix "o" := compose : natural_transformation_scope.
+End NaturalTransformationCompositionCoreNotations.
+End Core.
+
+End Composition.
+
+End NaturalTransformation.
+
+End categories.
+
+Set Universe Polymorphism.
+
+Section path_natural_transformation.
+
+ Context `{Funext}.
+ Variable C : PreCategory.
+
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+
+ Global Instance trunc_natural_transformation
+ : IsHSet (NaturalTransformation F G).
+
+admit.
+Defined.
+ Section path.
+
+ Variables T U : NaturalTransformation F G.
+
+ Lemma path'_natural_transformation
+ : components_of T = components_of U
+ -> T = U.
+
+admit.
+Defined.
+ Lemma path_natural_transformation
+ : components_of T == components_of U
+ -> T = U.
+
+ Proof.
+ intros.
+ apply path'_natural_transformation.
+ apply path_forall; assumption.
+ Qed.
+ End path.
+End path_natural_transformation.
+
+Ltac path_natural_transformation :=
+ repeat match goal with
+ | _ => intro
+ | _ => apply path_natural_transformation; simpl
+ end.
+
+Module Export Identity.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+Local Open Scope morphism_scope.
+
+Local Open Scope path_scope.
+Section identity.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Section generalized.
+
+ Variables F G : Functor C D.
+ Hypothesis HO : object_of F = object_of G.
+ Hypothesis HM : transport (fun GO => forall s d,
+ morphism C s d
+ -> morphism D (GO s) (GO d))
+ HO
+ (morphism_of F)
+ = morphism_of G.
+ Local Notation CO c := (transport (fun GO => morphism D (F c) (GO c))
+ HO
+ (identity (F c))).
+
+ Definition generalized_identity_commutes s d (m : morphism C s d)
+ : CO d o morphism_of F m = morphism_of G m o CO s.
+
+ Proof.
+ case HM.
+case HO.
+ exact (left_identity _ _ _ _ @ (right_identity _ _ _ _)^).
+ Defined.
+ Definition generalized_identity_commutes_sym s d (m : morphism C s d)
+ : morphism_of G m o CO s = CO d o morphism_of F m.
+
+admit.
+Defined.
+ Definition generalized_identity
+ : NaturalTransformation F G
+ := Build_NaturalTransformation'
+ F G
+ (fun c => CO c)
+ generalized_identity_commutes
+ generalized_identity_commutes_sym.
+
+ End generalized.
+ Definition identity (F : Functor C D)
+ : NaturalTransformation F F
+ := Eval simpl in @generalized_identity F F 1 1.
+
+End identity.
+Module Export NaturalTransformationIdentityNotations.
+
+ Notation "1" := (identity _) : natural_transformation_scope.
+End NaturalTransformationIdentityNotations.
+End Identity.
+
+Module Export Laws.
+Import HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Composition_DOT_Core.HoTT.categories.
+Set Universe Polymorphism.
+
+Local Open Scope natural_transformation_scope.
+Section natural_transformation_identity.
+
+ Context `{fs : Funext}.
+ Variable C : PreCategory.
+
+ Variable D : PreCategory.
+
+ Lemma left_identity (F F' : Functor C D)
+ (T : NaturalTransformation F F')
+ : 1 o T = T.
+
+ Proof.
+ path_natural_transformation; auto with morphism.
+ Qed.
+
+ Lemma right_identity (F F' : Functor C D)
+ (T : NaturalTransformation F F')
+ : T o 1 = T.
+
+ Proof.
+ path_natural_transformation; auto with morphism.
+ Qed.
+End natural_transformation_identity.
+Section associativity.
+
+ Section nt.
+
+ Context `{fs : Funext}.
+ Definition associativity
+ C D F G H I
+ (V : @NaturalTransformation C D F G)
+ (U : @NaturalTransformation C D G H)
+ (T : @NaturalTransformation C D H I)
+ : (T o U) o V = T o (U o V).
+
+ Proof.
+ path_natural_transformation.
+ apply associativity.
+ Qed.
+ End nt.
+End associativity.
+End Laws.
+
+Module Export FunctorCategory.
+Module Export Core.
+Import HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Composition_DOT_Core.HoTT.categories.
+Set Universe Polymorphism.
+
+Section functor_category.
+
+ Context `{Funext}.
+ Variable C : PreCategory.
+
+ Variable D : PreCategory.
+
+ Definition functor_category : PreCategory
+ := @Build_PreCategory (Functor C D)
+ (@NaturalTransformation C D)
+ (@identity C D)
+ (@compose C D)
+ (@associativity _ C D)
+ (@left_identity _ C D)
+ (@right_identity _ C D)
+ _.
+
+End functor_category.
+Module Export FunctorCategoryCoreNotations.
+
+ Notation "C -> D" := (functor_category C D) : category_scope.
+End FunctorCategoryCoreNotations.
+End Core.
+
+End FunctorCategory.
+
+Module Export Morphisms.
+Set Universe Polymorphism.
+
+Set Implicit Arguments.
+
+Definition NaturalIsomorphism `{Funext} (C D : PreCategory) F G :=
+ @Isomorphic (C -> D) F G.
+
+Module Export FunctorCategoryMorphismsNotations.
+
+ Infix "<~=~>" := NaturalIsomorphism : natural_transformation_scope.
+End FunctorCategoryMorphismsNotations.
+End Morphisms.
+
+Module Export HSet.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+
+Global Existing Instance iss.
+End HSet.
+
+Module Export Core.
+Set Universe Polymorphism.
+
+Notation cat_of obj :=
+ (@Build_PreCategory obj
+ (fun x y => x -> y)
+ (fun _ x => x)
+ (fun _ _ _ f g => f o g)%core
+ (fun _ _ _ _ _ _ _ => idpath)
+ (fun _ _ _ => idpath)
+ (fun _ _ _ => idpath)
+ _).
+
+Definition set_cat `{Funext} : PreCategory := cat_of hSet.
+Set Universe Polymorphism.
+
+Local Open Scope morphism_scope.
+
+Section hom_functor.
+
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Local Notation obj_of c'c :=
+ (BuildhSet
+ (morphism
+ C
+ (fst (c'c : object (C^op * C)))
+ (snd (c'c : object (C^op * C))))
+ _).
+
+ Let hom_functor_morphism_of s's d'd (hf : morphism (C^op * C) s's d'd)
+ : morphism set_cat (obj_of s's) (obj_of d'd)
+ := fun g => snd hf o g o fst hf.
+
+ Definition hom_functor : Functor (C^op * C) set_cat.
+
+ refine (Build_Functor (C^op * C) set_cat
+ (fun c'c => obj_of c'c)
+ hom_functor_morphism_of
+ _
+ _);
+ subst hom_functor_morphism_of;
+ simpl; admit.
+ Defined.
+End hom_functor.
+Set Universe Polymorphism.
+
+Import Category.Dual Functor.Dual.
+Import Category.Prod Functor.Prod.
+Import Functor.Composition.Core.
+Import Functor.Identity.
+Set Universe Polymorphism.
+
+Local Open Scope functor_scope.
+Local Open Scope natural_transformation_scope.
+Section Adjunction.
+
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable F : Functor C D.
+ Variable G : Functor D C.
+
+ Let Adjunction_Type :=
+ Eval simpl in (hom_functor D) o (F^op, 1) <~=~> (hom_functor C) o (1, G).
+
+ Record AdjunctionHom :=
+ {
+ mate_of :
+ @NaturalIsomorphism H
+ (Prod.prod (Category.Dual.opposite C) D)
+ (@set_cat H)
+ (@compose (Prod.prod (Category.Dual.opposite C) D)
+ (Prod.prod (Category.Dual.opposite D) D)
+ (@set_cat H) (@hom_functor H D)
+ (@pair (Category.Dual.opposite C)
+ (Category.Dual.opposite D) D D
+ (@opposite C D F) (identity D)))
+ (@compose (Prod.prod (Category.Dual.opposite C) D)
+ (Prod.prod (Category.Dual.opposite C) C)
+ (@set_cat H) (@hom_functor H C)
+ (@pair (Category.Dual.opposite C)
+ (Category.Dual.opposite C) D C
+ (identity (Category.Dual.opposite C)) G))
+ }.
+End Adjunction.
+(* Error: Illegal application:
+The term "NaturalIsomorphism" of type
+ "forall (H : Funext) (C D : PreCategory),
+ (C -> D)%category -> (C -> D)%category -> Type"
+cannot be applied to the terms
+ "H" : "Funext"
+ "(C ^op * D)%category" : "PreCategory"
+ "set_cat" : "PreCategory"
+ "hom_functor D o (F ^op, 1)" : "Functor (C ^op * D) set_cat"
+ "hom_functor C o (1, G)" : "Functor (C ^op * D) set_cat"
+The 5th term has type "Functor (C ^op * D) set_cat"
+which should be coercible to "object (C ^op * D -> set_cat)".
+*)
+End Core.
+
+End HoTT.
+
+End HoTT_DOT_categories_DOT_NaturalTransformation_DOT_Composition_DOT_Core.
diff --git a/test-suite/bugs/closed/3331.v b/test-suite/bugs/closed/3331.v
new file mode 100644
index 00000000..9cd44bd0
--- /dev/null
+++ b/test-suite/bugs/closed/3331.v
@@ -0,0 +1,31 @@
+(* File reduced by coq-bug-finder from original input, then from 6303 lines to 66 lines, then from 63 lines to 36 lines *)
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y :> A" := (@paths A x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Notation "x = y" := (x = y :>_) : type_scope.
+Class Contr_internal (A : Type) := BuildContr { center : A ; contr : (forall y : A, center = y) }.
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
+Instance istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A) : IsTrunc n (x = y) := H x y.
+Notation Contr := (IsTrunc minus_two).
+Section groupoid_category.
+ Variable X : Type.
+ Context `{H : IsTrunc (trunc_S (trunc_S (trunc_S minus_two))) X}.
+ Goal X -> True.
+ intro d.
+ pose (_ : Contr (idpath = idpath :> (@paths (@paths X d d) idpath idpath))) as H'. (* success *)
+ clear H'.
+ compute in H.
+ change (forall (x y : X) (p q : x = y) (r s : p = q), Contr (r = s)) in H.
+ assert (H' := H).
+ set (foo:=_ : Contr (idpath = idpath :> (@paths (@paths X d d) idpath idpath))). (* success *)
+ clear H' foo.
+ Set Typeclasses Debug.
+ pose (_ : Contr (idpath = idpath :> (@paths (@paths X d d) idpath idpath))).
+Abort. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3332.v b/test-suite/bugs/closed/3332.v
new file mode 100644
index 00000000..d86470cd
--- /dev/null
+++ b/test-suite/bugs/closed/3332.v
@@ -0,0 +1,6 @@
+(* -*- coq-prog-args: ("-emacs" "-time") -*- *)
+Definition foo : True.
+Proof.
+Abort. (* Toplevel input, characters 15-21:
+Anomaly: Backtrack.backto to a state with no vcs_backup. Please report. *)
+(* Anomaly: VernacAbort not handled by Stm. Please report. *)
diff --git a/test-suite/bugs/closed/3336.v b/test-suite/bugs/closed/3336.v
new file mode 100644
index 00000000..dc358c60
--- /dev/null
+++ b/test-suite/bugs/closed/3336.v
@@ -0,0 +1,9 @@
+Require Import Setoid.
+
+Goal forall x y : Type, x = y -> x = y.
+intros x y H.
+setoid_rewrite H.
+reflexivity.
+Defined.
+(* Toplevel input, characters 0-16:
+Anomaly: Uncaught exception Reduction.NotConvertible(_). Please report. *)
diff --git a/test-suite/bugs/closed/3337.v b/test-suite/bugs/closed/3337.v
new file mode 100644
index 00000000..cd7891f1
--- /dev/null
+++ b/test-suite/bugs/closed/3337.v
@@ -0,0 +1,4 @@
+Require Import Setoid.
+Goal forall x y : Set, x = y -> x = y.
+intros x y H.
+rewrite_strat subterms H.
diff --git a/test-suite/bugs/closed/3338.v b/test-suite/bugs/closed/3338.v
new file mode 100644
index 00000000..076cd5e6
--- /dev/null
+++ b/test-suite/bugs/closed/3338.v
@@ -0,0 +1,4 @@
+Require Import Setoid.
+Goal forall x y : Set, x = y -> y = y.
+intros x y H.
+rewrite_strat try topdown terms H.
diff --git a/test-suite/bugs/closed/3344.v b/test-suite/bugs/closed/3344.v
new file mode 100644
index 00000000..8255fd6c
--- /dev/null
+++ b/test-suite/bugs/closed/3344.v
@@ -0,0 +1,58 @@
+(* File reduced by coq-bug-finder from original input, then from 716 lines to 197 lines, then from 206 lines to 162 lines, then from 163 lines to 73 lines *)
+Require Import Coq.Sets.Ensembles.
+Require Import Coq.Strings.String.
+Global Set Implicit Arguments.
+Global Set Asymmetric Patterns.
+Ltac clearbodies := repeat match goal with | [ H := _ |- _ ] => clearbody H end.
+
+Inductive Comp : Type -> Type :=
+| Return : forall A, A -> Comp A
+| Bind : forall A B, Comp A -> (A -> Comp B) -> Comp B.
+Inductive computes_to : forall A, Comp A -> A -> Prop :=
+| ReturnComputes : forall A v, @computes_to A (Return v) v
+| BindComputes : forall A B comp_a f comp_a_value comp_b_value,
+ @computes_to A comp_a comp_a_value
+ -> @computes_to B (f comp_a_value) comp_b_value
+ -> @computes_to B (Bind comp_a f) comp_b_value.
+
+Inductive is_computational : forall A, Comp A -> Prop :=
+| Return_is_computational : forall A (x : A), is_computational (Return x)
+| Bind_is_computational : forall A B (cA : Comp A) (f : A -> Comp B),
+ is_computational cA
+ -> (forall a,
+ @computes_to _ cA a -> is_computational (f a))
+ -> is_computational (Bind cA f).
+Theorem is_computational_inv A (c : Comp A)
+: is_computational c
+ -> match c with
+ | Return _ _ => True
+ | Bind _ _ x f => is_computational x
+ /\ forall v, computes_to x v
+ -> is_computational (f v)
+ end.
+ admit.
+Defined.
+Fixpoint is_computational_unique_val A (c : Comp A) {struct c}
+: is_computational c -> { a | unique (computes_to c) a }.
+Proof.
+ refine match c as c return is_computational c -> { a | unique (computes_to c) a } with
+ | Return T x => fun _ => exist (unique (computes_to (Return x)))
+ x
+ _
+ | Bind _ _ x f
+ => fun H
+ => let H' := is_computational_inv H in
+ let xv := @is_computational_unique_val _ _ (proj1 H') in
+ let fxv := @is_computational_unique_val _ _ (proj2 H' _ (proj1 (proj2_sig xv))) in
+ exist (unique (computes_to _))
+ (proj1_sig fxv)
+ _
+ end;
+ clearbodies;
+ clear is_computational_unique_val;
+ clear;
+ first [ abstract admit
+ | abstract admit ].
+(* [Fail] does not catch the anomaly *)
+Defined.
+(* Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/3346.v b/test-suite/bugs/closed/3346.v
new file mode 100644
index 00000000..638404f2
--- /dev/null
+++ b/test-suite/bugs/closed/3346.v
@@ -0,0 +1,4 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Monomorphic Inductive paths (A : Type) (a : A) : A -> Type := idpath : paths A a a.
+(* This should fail with -indices-matter *)
+Fail Check paths nat O O : Prop.
diff --git a/test-suite/bugs/closed/3347.v b/test-suite/bugs/closed/3347.v
new file mode 100644
index 00000000..37c0d87e
--- /dev/null
+++ b/test-suite/bugs/closed/3347.v
@@ -0,0 +1,39 @@
+(* File reduced by coq-bug-finder from original input, then from 12653 lines to 12453 lines, then from 11673 lines to 681 lines, then from 693 lines to 469 lines, then from 375 lines to 56 lines *)
+Set Universe Polymorphism.
+Notation Type1 := $(let U := constr:(Type) in let gt := constr:(Set : U) in exact U)$ (only parsing).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Inductive Unit : Type1 := tt : Unit.
+Fail Check Unit : Set. (* [Check Unit : Set] should fail if [Type1] is defined correctly *)
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Record Functor (C D : PreCategory) := { object_of :> C -> D }.
+Definition indiscrete_category X : PreCategory := @Build_PreCategory X (fun _ _ => Unit).
+Definition from_terminal (C : PreCategory) one (c : C) := Build_Functor one C (fun _ => c).
+Local Notation "! x" := (from_terminal _ (indiscrete_category Unit) x) (at level 3).
+Record NaturalTransformation {C D} (F G : Functor C D) :=
+ { components_of :> forall c, morphism D (F c) (G c);
+ commutes : forall c, components_of c = components_of c }.
+Definition slice_category_induced_functor_nt (D : PreCategory) s d (m : morphism D s d)
+: NaturalTransformation !s !d.
+Proof.
+ exists (fun _ : Unit => m);
+ simpl; intros; clear;
+ abstract admit.
+Defined.
+(* Toplevel input, characters 15-23:
+Error: Illegal application:
+The term "Build_NaturalTransformation" of type
+ "forall (C D : PreCategory) (F G : Functor C D)
+ (components_of : forall c : C, morphism D (F c) (G c)),
+ (forall c : C, components_of c = components_of c) ->
+ NaturalTransformation F G"
+cannot be applied to the terms
+ "indiscrete_category Unit" : "PreCategory"
+ "D" : "PreCategory"
+ "! s" : "Functor (indiscrete_category Unit) D"
+ "! d" : "Functor (indiscrete_category Unit) D"
+ "fun _ : Unit => m" : "Unit -> morphism D s d"
+ "fun _ : Unit => slice_category_induced_functor_nt_subproof D s d m"
+ : "forall c : indiscrete_category Unit, m = m"
+The 5th term has type "Unit -> morphism D s d" which should be coercible to
+ "forall c : indiscrete_category Unit, morphism D (! s c) (! d c)".
+ *)
diff --git a/test-suite/bugs/closed/3348.v b/test-suite/bugs/closed/3348.v
new file mode 100644
index 00000000..d9ac09d8
--- /dev/null
+++ b/test-suite/bugs/closed/3348.v
@@ -0,0 +1,6 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Set Universe Polymorphism.
+Set Printing Universes.
+Inductive Empty : Set := .
+(* Toplevel input, characters 15-41:
+Error: Universe inconsistency. Cannot enforce Prop <= Set). *)
diff --git a/test-suite/bugs/closed/shouldsucceed/335.v b/test-suite/bugs/closed/335.v
index 166fa7a9..166fa7a9 100644
--- a/test-suite/bugs/closed/shouldsucceed/335.v
+++ b/test-suite/bugs/closed/335.v
diff --git a/test-suite/bugs/closed/3350.v b/test-suite/bugs/closed/3350.v
new file mode 100644
index 00000000..30fdf169
--- /dev/null
+++ b/test-suite/bugs/closed/3350.v
@@ -0,0 +1,120 @@
+Require Coq.Vectors.Fin.
+Require Coq.Vectors.Vector.
+
+Local Generalizable All Variables.
+Set Implicit Arguments.
+
+Arguments Fin.F1 : clear implicits.
+
+Lemma fin_0_absurd : notT (Fin.t 0).
+Proof. hnf. apply Fin.case0. Qed.
+
+Axiom admit : forall {A}, A.
+
+Fixpoint lower {n:nat} (p:Fin.t (S n)) {struct p} :
+ forall (i:Fin.t (S n)), option (Fin.t n)
+ := match p in Fin.t (S n1)
+ return Fin.t (S n1) -> option (Fin.t n1)
+ with
+ | @Fin.F1 n1 =>
+ fun (i:Fin.t (S n1)) =>
+ match i in Fin.t (S n2) return option (Fin.t n2) with
+ | @Fin.F1 n2 => None
+ | @Fin.FS n2 i2 => Some i2
+ end
+ | @Fin.FS n1 p1 =>
+ fun (i:Fin.t (S n1)) =>
+ match i in Fin.t (S n2) return Fin.t n2 -> option (Fin.t n2) with
+ | @Fin.F1 n2 =>
+ match n2 as n3 return Fin.t n3 -> option (Fin.t n3) with
+ | 0 => fun p2 => False_rect _ (fin_0_absurd p2)
+ | S n3 => fun p2 => Some (Fin.F1 n3)
+ end
+ | @Fin.FS n2 i2 =>
+ match n2 as n3 return Fin.t n3 -> Fin.t n3 -> option (Fin.t n3) with
+ | 0 => fun i3 p3 => False_rect _ (fin_0_absurd p3)
+ | S n3 => fun (i3 p3:Fin.t (S n3)) =>
+ option_map (@Fin.FS _) admit
+ end i2
+ end p1
+ end.
+
+Lemma lower_ind (P: forall n (p i:Fin.t (S n)), option (Fin.t n) -> Prop)
+ (c11 : forall n, P n (Fin.F1 n) (Fin.F1 n) None)
+ (c1S : forall n (i:Fin.t n), P n (Fin.F1 n) (Fin.FS i) (Some i))
+ (cS1 : forall n (p:Fin.t (S n)),
+ P (S n) (Fin.FS p) (Fin.F1 (S n)) (Some (Fin.F1 n)))
+ (cSSS : forall n (p i:Fin.t (S n)) (i':Fin.t n)
+ (Elow:lower p i = Some i'),
+ P n p i (Some i') ->
+ P (S n) (Fin.FS p) (Fin.FS i) (Some (Fin.FS i')))
+ (cSSN : forall n (p i:Fin.t (S n))
+ (Elow:lower p i = None),
+ P n p i None ->
+ P (S n) (Fin.FS p) (Fin.FS i) None) :
+ forall n (p i:Fin.t (S n)), P n p i (lower p i).
+Proof.
+ fix 2. intros n p.
+ refine (match p as p1 in Fin.t (S n1)
+ return forall (i1:Fin.t (S n1)), P n1 p1 i1 (lower p1 i1)
+ with
+ | @Fin.F1 n1 => _
+ | @Fin.FS n1 p1 => _
+ end); clear n p.
+ { revert n1. refine (@Fin.caseS _ _ _); cbn; intros.
+ apply c11. apply c1S. }
+ { intros i1. revert p1.
+ pattern n1, i1; refine (@Fin.caseS _ _ _ _ _);
+ clear n1 i1;
+ (intros [|n] i; [refine (False_rect _ (fin_0_absurd i)) | cbn ]).
+ { apply cS1. }
+ { intros p. pose proof (admit : P n p i (lower p i)) as H.
+ destruct (lower p i) eqn:E.
+ { admit; assumption. }
+ { cbn. apply admit; assumption. } } }
+Qed.
+
+Section squeeze.
+ Context {A:Type} (x:A).
+ Notation vec := (Vector.t A).
+
+ Fixpoint squeeze {n} (v:vec n) (i:Fin.t (S n)) {struct i} : vec (S n) :=
+ match i in Fin.t (S _n) return vec _n -> vec (S _n)
+ with
+ | @Fin.F1 n' => fun v' => Vector.cons _ x _ v'
+ | @Fin.FS n' i' =>
+ fun v' =>
+ match n' as _n return vec _n -> Fin.t _n -> vec (S _n)
+ with
+ | 0 => fun u i' => False_rect _ (fin_0_absurd i')
+ | S m =>
+ fun (u:vec (S m)) =>
+ match u in Vector.t _ (S _m)
+ return Fin.t (S _m) -> vec (S (S _m))
+ with
+ | Vector.nil _ => tt
+ | Vector.cons _ h _ u' =>
+ fun j' => Vector.cons _ h _ admit (* (squeeze u' j') *)
+ end
+ end v' i'
+ end v.
+End squeeze.
+
+Require Import Program.
+Lemma squeeze_nth (A:Type) (x:A) (n:nat) (v:Vector.t A n) p i :
+ Vector.nth (squeeze x v p) i = match lower p i with
+ | Some j => Vector.nth v j
+ | None => x
+ end.
+Proof.
+ (* alternatively: [functional induction (lower p i) using lower_ind] *)
+ revert v. pattern n, p, i, (lower p i).
+ refine (@lower_ind _ _ _ _ _ _ n p i);
+ intros; cbn; auto.
+
+ (*** Fails here with "Conversion test raised an anomaly" ***)
+ revert v.
+ admit.
+ admit.
+ admit.
+Qed.
diff --git a/test-suite/bugs/closed/3352.v b/test-suite/bugs/closed/3352.v
new file mode 100644
index 00000000..b57b0a0f
--- /dev/null
+++ b/test-suite/bugs/closed/3352.v
@@ -0,0 +1,34 @@
+
+(*
+I'm not sure what the general rule should be; intuitively, I want [IsHProp (* Set *) Foo] to mean [IsHProp (* U >= Set *) Foo]. (I think this worked in HoTT/coq, too.) Morally, [IsHProp] has no universe level associated with it distinct from that of its argument, you should never get a universe inconsistency from unifying [IsHProp A] with [IsHProp A]. (The issue is tricker when IsHProp uses [A] elsewhere, as in:
+*)
+
+(* File reduced by coq-bug-finder from original input, then from 7725 lines to 78 lines, then from 51 lines to 13 lines *)
+Set Universe Polymorphism.
+Inductive Empty : Set := .
+Record IsHProp (A : Type) := { foo : True }.
+Definition hprop_Empty : IsHProp@{i} Empty := {| foo := I |}.
+Goal let U := Type in let gt := Set : U in IsHProp (Empty : U).
+simpl.
+Set Printing Universes.
+exact @hprop_Empty. (* Toplevel input, characters 21-32:
+Error:
+The term "hprop_Empty" has type "IsHProp (* Set *) Empty"
+while it is expected to have type "IsHProp (* Top.17 *) Empty"
+(Universe inconsistency: Cannot enforce Top.17 = Set because Set < Top.17)). *)
+Defined.
+
+Module B.
+(* -*- coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 7725 lines to 78 lines, then from 51 lines to 13 lines *)
+Set Universe Polymorphism.
+Inductive paths {A} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Record Contr (A : Type) := { center : A }.
+Monomorphic Record IsHProp (A : Type) := { foo : forall x y : A, Contr (x = y) }.
+Definition hprop_Empty : IsHProp Empty := {| foo x y := match x : Empty with end |}.
+Goal let U := Type in let gt := Set : U in IsHProp (Empty : U).
+simpl.
+Set Printing Universes.
+exact hprop_Empty.
+Defined.
+End B. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3354.v b/test-suite/bugs/closed/3354.v
new file mode 100644
index 00000000..14b66db3
--- /dev/null
+++ b/test-suite/bugs/closed/3354.v
@@ -0,0 +1,12 @@
+Set Universe Polymorphism.
+Notation Type1 := $(let U := constr:(Type) in let gt := constr:(Set : U) in exact U)$ (only parsing).
+Inductive Empty : Type1 := .
+Fail Check Empty : Set.
+(* Toplevel input, characters 15-116:
+Error: Conversion test raised an anomaly *)
+(* Now we make sure it's not an anomaly *)
+Goal True.
+Proof.
+ try exact (let x := Empty : Set in I).
+ exact I.
+Defined.
diff --git a/test-suite/bugs/closed/3355.v b/test-suite/bugs/closed/3355.v
new file mode 100644
index 00000000..46a57147
--- /dev/null
+++ b/test-suite/bugs/closed/3355.v
@@ -0,0 +1,6 @@
+Inductive paths {A} (x : A) : A -> Type := idpath : paths x x.
+Goal forall A B : Set, @paths Type A B -> @paths Set A B.
+Proof.
+ intros A B H.
+ Fail exact H.
+Abort.
diff --git a/test-suite/bugs/closed/3368.v b/test-suite/bugs/closed/3368.v
new file mode 100644
index 00000000..1eff1dba
--- /dev/null
+++ b/test-suite/bugs/closed/3368.v
@@ -0,0 +1,16 @@
+(* File reduced by coq-bug-finder from 7411 lines to 2271 lines., then from 889 lines to 119 lines, then from 76 lines to 19 lines *)
+Set Universe Polymorphism.
+Set Implicit Arguments.
+Set Primitive Projections.
+Record PreCategory := { object :> Type; morphism : object -> object -> Type }.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d) }.
+Definition opposite (C : PreCategory) : PreCategory := @Build_PreCategory C (fun s d => morphism C d s).
+Definition opposite' C D (F : Functor C D)
+ := Build_Functor (opposite C) (opposite D)
+ (object_of F)
+ (fun s d => @morphism_of C D F d s).
+(* Toplevel input, characters 15-191:
+Anomaly: File "pretyping/reductionops.ml", line 149, characters 4-10: Assertion failed.
+Please report. *)
diff --git a/test-suite/bugs/closed/3372.v b/test-suite/bugs/closed/3372.v
new file mode 100644
index 00000000..91e3df76
--- /dev/null
+++ b/test-suite/bugs/closed/3372.v
@@ -0,0 +1,7 @@
+Set Universe Polymorphism.
+Definition hProp : Type := sigT (fun _ : Type => True).
+Goal Type.
+Fail exact hProp@{Set}. (* test that it fails, but is not an anomaly *)
+try (exact hProp@{Set}; fail 1). (* Toplevel input, characters 15-32:
+Anomaly: Uncaught exception Invalid_argument("Array.iter2", _).
+Please report. *)
diff --git a/test-suite/bugs/closed/3373.v b/test-suite/bugs/closed/3373.v
new file mode 100644
index 00000000..5ecf2801
--- /dev/null
+++ b/test-suite/bugs/closed/3373.v
@@ -0,0 +1,33 @@
+(* File reduced by coq-bug-finder from original input, then from 5968 lines to
+11933 lines, then from 11239 lines to 11231 lines, then from 10365 lines to 446
+lines, then from 456 lines to 379 lines, then from 391 lines to 373 lines, then
+from 369 lines to 351 lines, then from 350 lines to 340 lines, then from 348
+lines to 320 lines, then from 328 lines to 302 lines, then from 332 lines to 21
+lines *)
+Set Universe Polymorphism.
+Module short.
+ Record foo := { bar : Type }.
+ Coercion baz (x : foo@{Set}) : Set := bar x.
+ Goal True.
+ Proof.
+ Fail pose ({| bar := Set |} : Type). (* check that it fails *)
+ try pose ({| bar := Set |} : Type). (* Anomaly: apply_coercion_args: mismatch between arguments and coercion.
+Please report. *)
+ Admitted.
+End short.
+
+Module long.
+ Axiom admit : forall {T}, T.
+ Definition UU := Set.
+ Definition UU' := Type.
+ Definition hSet:= sigT (fun X : UU' => admit) .
+ Definition pr1hSet:= @projT1 UU (fun X : UU' => admit) : hSet -> Type.
+ Coercion pr1hSet: hSet >-> Sortclass.
+ Axiom binop : UU -> Type.
+ Axiom setwithbinop : Type.
+ Goal True.
+ Proof.
+ Fail pose (( @projT1 _ ( fun X : hSet@{i j k} => binop X ) ) : _ -> hSet). (* check that it fails *)
+ try pose (( @projT1 _ ( fun X : hSet@{i j k} => binop X ) ) : _ -> hSet). (* check that it's not an anomaly *)
+ Admitted.
+End long.
diff --git a/test-suite/bugs/closed/3374.v b/test-suite/bugs/closed/3374.v
new file mode 100644
index 00000000..3c67703a
--- /dev/null
+++ b/test-suite/bugs/closed/3374.v
@@ -0,0 +1,51 @@
+(* File reduced by coq-bug-finder from original input, then from 5968 lines to 11933 lines, then from 11239 lines to 11231 lines, then from 10365 lines to 446 lines, then from 456 lines to 379 lines, then from 391 lines to 373 lines, then from 369 lines to 351 lines, then from 350 lines to 340 lines, then from 348 lines to 320 lines, then from 328 lines to 302 lines, then from 331 lines to 59 lines *)
+
+Set Universe Polymorphism.
+Axiom admit : forall {T}, T.
+Notation paths := identity .
+Definition UU := Set.
+Definition dirprod ( X Y : UU ) := sigT ( fun x : X => Y ) .
+Definition dirprodpair { X Y : UU } := existT ( fun x : X => Y ) .
+Definition hProp := sigT (fun X : Type => admit).
+Definition hProptoType := @projT1 _ _ : hProp -> Type .
+Coercion hProptoType: hProp >-> Sortclass.
+Definition UU' := Type.
+Definition hSet:= sigT (fun X : UU' => admit) .
+Definition pr1hSet:= @projT1 UU (fun X : UU' => admit) : hSet -> Type.
+Coercion pr1hSet: hSet >-> Sortclass.
+Axiom hsubtypes : UU -> Type.
+Definition hrel ( X : UU ) := X -> X -> hProp.
+Axiom hreldirprod : forall { X Y : UU } ( RX : hrel X ) ( RY : hrel Y ), hrel ( dirprod X Y ) .
+Axiom iseqclass : forall { X : UU } ( R : hrel X ) ( A : hsubtypes X ), Type.
+Definition setquot { X : UU } ( R : hrel X ) : Type := sigT (fun A => iseqclass R A).
+Axiom dirprodtosetquot : forall { X Y : UU } ( RX : hrel X ) ( RY : hrel Y ) (cd : dirprod ( setquot RX ) ( setquot RY ) ),
+ setquot ( hreldirprod RX RY ).
+Definition iscomprelfun2 { X Y : UU } ( R : hrel X ) ( f : X -> X -> Y )
+ := forall x x' x0 x0' : X , R x x' -> R x0 x0' -> paths ( f x x0 ) ( f x' x0' ) .
+Axiom setquotuniv : forall { X : UU } ( R : hrel X ) ( Y : hSet ) ( f : X -> Y ) ( c : setquot R ), Y .
+Definition setquotuniv2 { X : UU } ( R : hrel X ) ( Y : hSet ) ( f : X -> X -> Y ) ( is : iscomprelfun2 R f ) ( c c0 : setquot R )
+: Y .
+Proof.
+ intros .
+ set ( RR := hreldirprod R R ) .
+ apply (setquotuniv RR Y admit).
+ apply (dirprodtosetquot R R).
+ apply dirprodpair; [ exact c | exact c0 ].
+ Undo.
+ exact (dirprodpair c c0).
+Defined.
+ (* Toplevel input, characters 39-40:
+Error:
+In environment
+X : UU
+R : hrel X
+Y : hSet
+f : X -> X -> Y
+is : iscomprelfun2 R f
+c : setquot R
+c0 : setquot R
+RR := hreldirprod R R : hrel (dirprod X X)
+The term "c" has type "setquot R" while it is expected to have type
+"?42" (unable to find a well-typed instantiation for
+"?42": cannot unify"Type" and "UU").
+ *)
diff --git a/test-suite/bugs/closed/3375.v b/test-suite/bugs/closed/3375.v
new file mode 100644
index 00000000..fe323fcb
--- /dev/null
+++ b/test-suite/bugs/closed/3375.v
@@ -0,0 +1,48 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-impredicative-set") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 5968 lines to 11933 lines, then from 11239 lines to 11231 lines, then from 10365 lines to 446 lines, then from 456 lines to 379 lines, then from 391 lines to 373 lines, then from 369 lines to 351 lines, then from 350 lines to 340 lines, then from 348 lines to 320 lines, then from 328 lines to 302 lines, then from 330 lines to 45 lines *)
+
+Set Universe Polymorphism.
+Axiom admit : forall {T}, T.
+Definition UU := Set.
+Definition dirprod ( X Y : UU ) := sigT ( fun x : X => Y ) .
+Definition dirprodpair { X Y : UU } := existT ( fun x : X => Y ) .
+Definition hProp := sigT (fun X : Type => admit).
+Axiom hProppair : forall ( X : UU ) ( is : admit ), hProp.
+Definition hProptoType := @projT1 _ _ : hProp -> Type .
+Coercion hProptoType: hProp >-> Sortclass.
+Definition ishinh_UU ( X : UU ) : UU := forall P: Set, ( ( X -> P ) -> P ).
+Definition ishinh ( X : UU ) : hProp := hProppair ( ishinh_UU X ) admit.
+Definition hsubtypes ( X : UU ) : Type := X -> hProp.
+Axiom carrier : forall { X : UU } ( A : hsubtypes X ), Type.
+Definition hrel ( X : UU ) : Type := X -> X -> hProp.
+Set Printing Universes.
+Definition iseqclass { X : UU } ( R : hrel X ) ( A : hsubtypes X ) : Type.
+ intros; exact ( dirprod ( ishinh ( carrier A ) ) ( dirprod ( forall x1 x2 : X , R x1 x2 -> A x1 -> A x2 )
+ ( forall x1 x2 : X, A x1 -> A x2 -> R x1 x2 ) )) .
+Defined.
+Definition iseqclassconstr' { X : UU } ( R : hrel X ) { A : hsubtypes X } ( ax0 : ishinh ( carrier A ) )
+ ( ax1 : forall x1 x2 : X , R x1 x2 -> A x1 -> A x2 ) ( ax2 : forall x1 x2 : X, A x1 -> A x2 -> R x1 x2 ) : iseqclass R A.
+ intros.
+ apply dirprodpair. { exact ax0. }
+ apply dirprodpair. { exact ax1. } {exact ax2. }
+Defined.
+Definition iseqclassconstr { X : UU } ( R : hrel X ) { A : hsubtypes X } ( ax0 : ishinh ( carrier A ) )
+ ( ax1 : forall x1 x2 : X , R x1 x2 -> A x1 -> A x2 ) ( ax2 : forall x1 x2 : X, A x1 -> A x2 -> R x1 x2 ) : iseqclass R A.
+ pose @iseqclassconstr'.
+ intros.
+ exact (dirprodpair ax0 (dirprodpair ax1 ax2)).
+Defined.
+(* Toplevel input, characters 15-23:
+Error: Illegal application:
+The term "dirprodpair" of type
+ "forall (X Y : UU) (x : X), (fun _ : X => Y) x -> {_ : X & Y}"
+cannot be applied to the terms
+ "forall x1 x2 : X, R x1 x2 -> A x1 -> A x2"
+ : "Type@{max(Set, Top.476, Top.479)}"
+ "forall x1 x2 : X, A x1 -> A x2 -> R x1 x2"
+ : "Type@{max(Set, Top.476, Top.479)}"
+ "ax1" : "forall x1 x2 : X, R x1 x2 -> A x1 -> A x2"
+ "ax2" : "forall x1 x2 : X, A x1 -> A x2 -> R x1 x2"
+The 1st term has type "Type@{max(Set, Top.476, Top.479)}"
+which should be coercible to "UU".
+ *)
diff --git a/test-suite/bugs/closed/3377.v b/test-suite/bugs/closed/3377.v
new file mode 100644
index 00000000..8e9e3933
--- /dev/null
+++ b/test-suite/bugs/closed/3377.v
@@ -0,0 +1,17 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Record prod A B := pair { fst : A; snd : B}.
+
+Goal fst (@pair Type Type Type Type).
+Set Printing All.
+match goal with |- ?f ?x => set (foo := f x) end.
+
+Goal forall x : prod Set Set, x = @pair _ _ (fst x) (snd x).
+Proof.
+ intro x.
+ lazymatch goal with
+ | [ |- ?x = @pair _ _ (?f ?x) (?g ?x) ] => pose f
+ end.
+
+(* Toplevel input, characters 7-44:
+Error: No matching clauses for match. *)
diff --git a/test-suite/bugs/closed/3382.v b/test-suite/bugs/closed/3382.v
new file mode 100644
index 00000000..1d8e9167
--- /dev/null
+++ b/test-suite/bugs/closed/3382.v
@@ -0,0 +1,63 @@
+(* File reduced by coq-bug-finder from 9039 lines to 7786 lines, then from 7245 lines to 476 lines, then from 417 lines to 249 lines, then from 171 lines to 127 lines, then from 139 lines to 114 lines, then from 93 lines to 77 lines *)
+
+Set Implicit Arguments.
+Definition admit {T} : T.
+Admitted.
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope functor_scope with functor.
+Reserved Infix "o" (at level 40, left associativity).
+Record PreCategory :=
+ { Object :> Type;
+ Morphism : Object -> Object -> Type;
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d' where "f 'o' g" := (Compose f g) }.
+Bind Scope category_scope with PreCategory.
+Infix "o" := (@Compose _ _ _ _) : morphism_scope.
+Local Open Scope morphism_scope.
+Record Functor (C D : PreCategory) :=
+ { ObjectOf :> C -> D;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d);
+ FCompositionOf : forall s d d' (m1 : C.(Morphism) s d) (m2: C.(Morphism) d d'),
+ MorphismOf _ _ (m2 o m1) = (MorphismOf _ _ m2) o (MorphismOf _ _ m1) }.
+Bind Scope functor_scope with Functor.
+Arguments MorphismOf [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+Definition ComposeFunctors C D E
+ (G : Functor D E) (F : Functor C D) : Functor C E
+ := Build_Functor C E (fun c => G (F c)) admit admit.
+Infix "o" := ComposeFunctors : functor_scope.
+Record NaturalTransformation C D (F G : Functor C D) :=
+ { ComponentsOf :> forall c, D.(Morphism) (F c) (G c);
+ Commutes : forall s d (m : C.(Morphism) s d),
+ ComponentsOf d o F.(MorphismOf) m = G.(MorphismOf) m o ComponentsOf s }.
+Definition NTComposeT C D (F F' F'' : Functor C D)
+ (T' : NaturalTransformation F' F'')
+ (T : NaturalTransformation F F')
+ (CO := fun c => T' c o T c)
+: NaturalTransformation F F''.
+ exact (Build_NaturalTransformation F F''
+ (fun c => T' c o T c)
+ (admit : forall s d (m : Morphism C s d), CO d o MorphismOf F m = MorphismOf F'' m o CO s)).
+Defined.
+Definition NTWhiskerR C D E (F F' : Functor D E) (T : NaturalTransformation F F')
+ (G : Functor C D)
+ := Build_NaturalTransformation (F o G) (F' o G) (fun c => T (G c)) admit.
+Axiom NTWhiskerR_CompositionOf
+: forall C D
+ (F G H : Functor C D)
+ (T : NaturalTransformation G H)
+ (T' : NaturalTransformation F G) B (I : Functor B C),
+ NTComposeT (NTWhiskerR T I) (NTWhiskerR T' I) = NTWhiskerR (NTComposeT T T') I.
+Definition FunctorCategory C D : PreCategory
+ := @Build_PreCategory (Functor C D)
+ (NaturalTransformation (C := C) (D := D))
+ admit.
+Notation "[ C , D ]" := (FunctorCategory C D) : category_scope.
+Class silly {T} := term : T.
+Timeout 1 Fail Definition NTWhiskerR_Functorial (C D E : PreCategory) (G : [C, D]%category)
+: [[D, E], [C, E]]%category
+ := Build_Functor
+ [C, D] [C, E]
+ (fun F => _ : silly)
+ (fun _ _ T => _ : silly)
+ (fun _ _ _ _ _ => NTWhiskerR_CompositionOf _ _ _).
diff --git a/test-suite/bugs/closed/3386.v b/test-suite/bugs/closed/3386.v
new file mode 100644
index 00000000..0e236c21
--- /dev/null
+++ b/test-suite/bugs/closed/3386.v
@@ -0,0 +1,16 @@
+Set Universe Polymorphism.
+Set Printing Universes.
+Record Cat := { Obj :> Type }.
+Definition set_cat := {| Obj := Type |}.
+Goal Type@{i} = Type@{j}.
+Proof.
+ (* 1 subgoals
+, subgoal 1 (ID 3)
+
+ ============================
+ Type@{Top.368} = Type@{Top.370}
+(dependent evars:) *)
+ Fail change Type@{i} with (Obj set_cat@{i}). (* check that it fails *)
+ try change Type@{i} with (Obj set_cat@{i}). (* check that it's not an anomaly *)
+(* Anomaly: Uncaught exception Invalid_argument("Array.iter2", _).
+Please report. *)
diff --git a/test-suite/bugs/closed/3387.v b/test-suite/bugs/closed/3387.v
new file mode 100644
index 00000000..ae212caa
--- /dev/null
+++ b/test-suite/bugs/closed/3387.v
@@ -0,0 +1,21 @@
+Set Universe Polymorphism.
+Set Printing Universes.
+Record Cat := { Obj :> Type }.
+Definition set_cat := {| Obj := Type |}.
+Goal Type@{i} = Type@{j}.
+Proof.
+ (* 1 subgoals
+, subgoal 1 (ID 3)
+
+ ============================
+ Type@{Top.368} = Type@{Top.370}
+(dependent evars:) *)
+ let x := constr:(Type) in
+ let y := constr:(Obj set_cat) in
+ unify x y. (* success *)
+ let x := constr:(Type) in
+ let y := constr:(Obj set_cat) in
+ first [ unify x y | fail 2 "no unify" ];
+ change x with y at -1. (* Error: Not convertible. *)
+ reflexivity.
+Defined. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3388.v b/test-suite/bugs/closed/3388.v
new file mode 100644
index 00000000..78262804
--- /dev/null
+++ b/test-suite/bugs/closed/3388.v
@@ -0,0 +1,57 @@
+Inductive test : bool -> bool -> Type :=
+| test00 : test false false
+| test01 : test false true
+| test10 : test true false
+.
+
+(* This does not work *)
+Definition test_a (t : test true false) : test true false :=
+ match t with
+ | test10 => test10
+ end.
+
+(* The following definition shows that test_a SHOULD work *)
+Definition test_a_workaround (t : test true false) : test true false :=
+ match t with
+ | test10 => test10
+ | _ => tt
+ end.
+
+(* Surprisingly, this works *)
+Definition test_b (t : test false true) : test false true :=
+ match t with
+ | test01 => test01
+ end.
+
+
+(* This, too, works *)
+Definition test_c x (t : test false x) : test false x :=
+ match t with
+ | test00 => test00
+ | test01 => test01
+ end.
+
+Inductive test2 : bool -> bool -> Type :=
+| test201 : test2 false true
+| test210 : test2 true false
+| test211 : test2 true true
+.
+
+(* Now this works *)
+Definition test2_a (t : test2 true false) : test2 true false :=
+ match t with
+ | test210 => test210
+ end.
+
+(* Accordingly, this now fails *)
+Definition test2_b (t : test2 false true) : test2 false true :=
+ match t with
+ | test201 => test201
+ end.
+
+
+(* This, too, fails *)
+Definition test2_c x (t : test2 false x) : test2 false x :=
+ match t with
+ | test201 => test201
+ end.
diff --git a/test-suite/bugs/closed/3390.v b/test-suite/bugs/closed/3390.v
new file mode 100644
index 00000000..eb3c4f4b
--- /dev/null
+++ b/test-suite/bugs/closed/3390.v
@@ -0,0 +1,9 @@
+Tactic Notation "basicapply" open_constr(R) "using" tactic3(tac) "sideconditions" tactic0(tacfin) := idtac.
+Tactic Notation "basicapply" open_constr(R) := basicapply R using (fun Hlem => idtac) sideconditions (autounfold with spred; idtac).
+(* segfault in coqtop *)
+
+
+Tactic Notation "basicapply" tactic0(tacfin) := idtac.
+
+Goal True.
+basicapply subst.
diff --git a/test-suite/bugs/closed/3392.v b/test-suite/bugs/closed/3392.v
new file mode 100644
index 00000000..29ee1487
--- /dev/null
+++ b/test-suite/bugs/closed/3392.v
@@ -0,0 +1,40 @@
+(* File reduced by coq-bug-finder from original input, then from 12105 lines to 142 lines, then from 83 lines to 57 lines *)
+Generalizable All Variables.
+Axiom admit : forall {T}, T.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing).
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y): transport _ p (f x) = f y := admit.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x) }.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3).
+Axiom path_forall : forall {A : Type} {P : A -> Type} (f g : forall x : A, P x), (forall x, f x = g x) -> f = g.
+Axiom isequiv_adjointify : forall {A B} (f : A -> B) (g : B -> A) (isretr : Sect g f) (issect : Sect f g), IsEquiv f.
+Definition functor_forall `{P : A -> Type} `{Q : B -> Type} (f0 : B -> A) (f1 : forall b:B, P (f0 b) -> Q b)
+: (forall a:A, P a) -> (forall b:B, Q b) := (fun g b => f1 _ (g (f0 b))).
+Goal forall `{P : A -> Type} `{Q : B -> Type} `{IsEquiv B A f} `{forall b, @IsEquiv (P (f b)) (Q b) (g b)},
+ IsEquiv (functor_forall f g).
+Proof.
+ intros.
+ refine (isequiv_adjointify (functor_forall f g)
+ (functor_forall (f^-1)
+ (fun (x:A) (y:Q (f^-1 x)) => @eisretr _ _ f _ x # (g (f^-1 x))^-1 y
+ )) _ _);
+ intros h.
+ - abstract (
+ apply path_forall; intros b; unfold functor_forall;
+ rewrite eisadj;
+ admit
+ ).
+ - abstract (
+ apply path_forall; intros a; unfold functor_forall;
+ rewrite eissect;
+ apply apD
+ ).
+Defined.
diff --git a/test-suite/bugs/closed/3393.v b/test-suite/bugs/closed/3393.v
new file mode 100644
index 00000000..ec25e682
--- /dev/null
+++ b/test-suite/bugs/closed/3393.v
@@ -0,0 +1,152 @@
+(* -*- coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 8760 lines to 7519 lines, then from 7050 lines to 909 lines, then from 846 lines to 578 lines, then from 497 lines to 392 lines, then from 365 lines to 322 lines, then from 252 lines to 205 lines, then from 215 lines to 204 lines, then from 210 lines to 182 lines, then from 175 lines to 157 lines *)
+Set Universe Polymorphism.
+Axiom admit : forall {T}, T.
+Set Implicit Arguments.
+Generalizable All Variables.
+Reserved Notation "g 'o' f" (at level 40, left associativity).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "a = b" := (@paths _ a b) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g) : forall x, f x = g x := fun x => match h with idpath => idpath end.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
+Delimit Scope equiv_scope with equiv.
+Local Open Scope equiv_scope.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+Class Funext := { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) : (forall x, f x = g x) -> f = g := (@apD10 A P f g)^-1.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+ compose : forall s d d', morphism d d' -> morphism s d -> morphism s d' where "f 'o' g" := (compose f g);
+ associativity : forall x1 x2 x3 x4 (m1 : morphism x1 x2) (m2 : morphism x2 x3) (m3 : morphism x3 x4), (m3 o m2) o m1 = m3 o (m2 o m1)
+ }.
+Bind Scope category_scope with PreCategory.
+Bind Scope morphism_scope with morphism.
+Infix "o" := (@compose _ _ _ _) : morphism_scope.
+Delimit Scope functor_scope with functor.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d) }.
+Bind Scope functor_scope with Functor.
+Notation "F '_1' m" := (@morphism_of _ _ F _ _ m) (at level 10, no associativity) : morphism_scope.
+Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
+Local Notation "m ^-1" := (morphism_inverse (m := m)) : morphism_scope.
+Class Isomorphic {C : PreCategory} s d :=
+ { morphism_isomorphic :> morphism C s d;
+ isisomorphism_isomorphic :> IsIsomorphism morphism_isomorphic }.
+Coercion morphism_isomorphic : Isomorphic >-> morphism.
+Definition isisomorphism_inverse `(@IsIsomorphism C x y m) : IsIsomorphism m^-1 := {| morphism_inverse := m |}.
+
+Global Instance isisomorphism_compose `(@IsIsomorphism C y z m0) `(@IsIsomorphism C x y m1) : IsIsomorphism (m0 o m1).
+Admitted.
+Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
+Definition composef C D E (G : Functor D E) (F : Functor C D) : Functor C E
+ := Build_Functor
+ C E
+ (fun c => G (F c))
+ (fun _ _ m => @morphism_of _ _ G _ _ (@morphism_of _ _ F _ _ m)).
+Infix "o" := composef : functor_scope.
+Delimit Scope natural_transformation_scope with natural_transformation.
+
+Local Open Scope morphism_scope.
+Record NaturalTransformation C D (F G : Functor C D) :=
+ { components_of :> forall c, morphism D (F c) (G c);
+ commutes : forall s d (m : morphism C s d), components_of d o F _1 m = G _1 m o components_of s }.
+
+Definition composet C D (F F' F'' : Functor C D) (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F')
+: NaturalTransformation F F''
+ := Build_NaturalTransformation F F'' (fun c => T' c o T c) admit.
+Infix "o" := composet : natural_transformation_scope.
+Section path_natural_transformation.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+ Section path.
+ Variables T U : NaturalTransformation F G.
+ Lemma path'_natural_transformation
+ : components_of T = components_of U
+ -> T = U.
+ admit.
+ Defined.
+ Lemma path_natural_transformation
+ : (forall x, components_of T x = components_of U x)
+ -> T = U.
+ Proof.
+ intros.
+ apply path'_natural_transformation.
+ apply path_forall; assumption.
+ Qed.
+ End path.
+End path_natural_transformation.
+Ltac path_natural_transformation :=
+ repeat match goal with
+ | _ => intro
+ | _ => apply path_natural_transformation; simpl
+ end.
+
+Local Open Scope natural_transformation_scope.
+Definition associativityt `{fs : Funext}
+ C D F G H I
+ (V : @NaturalTransformation C D F G)
+ (U : @NaturalTransformation C D G H)
+ (T : @NaturalTransformation C D H I)
+: (T o U) o V = T o (U o V).
+Proof.
+ path_natural_transformation.
+ apply associativity.
+Qed.
+Definition functor_category `{Funext} (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D) (@NaturalTransformation C D) (@composet C D) (@associativityt _ C D).
+Notation "C -> D" := (functor_category C D) : category_scope.
+Definition NaturalIsomorphism `{Funext} (C D : PreCategory) F G := @Isomorphic (C -> D) F G.
+Infix "<~=~>" := NaturalIsomorphism : natural_transformation_scope.
+Global Instance isisomorphism_compose' `{Funext}
+ `(T' : @NaturalTransformation C D F' F'')
+ `(T : @NaturalTransformation C D F F')
+ `{@IsIsomorphism (C -> D) F' F'' T'}
+ `{@IsIsomorphism (C -> D) F F' T}
+: @IsIsomorphism (C -> D) F F'' (T' o T)%natural_transformation
+ := @isisomorphism_compose (C -> D) _ _ T' _ _ T _.
+Section lemmas.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable F : C -> PreCategory.
+ Context
+ {w y z}
+ {f : Functor (F w) (F z)} {f0 : Functor (F w) (F y)}
+ {f2 : Functor (F y) (F z)}
+ {f5 : Functor (F w) (F z)}
+ {n2 : f <~=~> (f2 o f0)%functor}.
+ Lemma p_composition_of_coherent_iso_for_rewrite__isisomorphism_helper' XX
+ : @IsIsomorphism
+ (F w -> F z) f5 f
+ (n2 ^-1 o XX)%natural_transformation.
+ Proof.
+ eapply isisomorphism_compose'.
+ eapply isisomorphism_inverse. (* Toplevel input, characters 22-43:
+Error:
+In environment
+H : Funext
+C : PreCategory
+F : C -> PreCategory
+w : C
+y : C
+z : C
+f : Functor (F w) (F z)
+f0 : Functor (F w) (F y)
+f2 : Functor (F y) (F z)
+f5 : Functor (F w) (F z)
+n2 : f <~=~> (f2 o f0)%functor
+XX : NaturalTransformation f5 (f2 o f0)
+Unable to unify
+ "{|
+ object := Functor (F w) (F z);
+ morphism := NaturalTransformation (D:=F z);
+ compose := composet (D:=F z);
+ associativity := associativityt (D:=F z) |}" with
+ "{|
+ object := Functor (F w) (F z);
+ morphism := NaturalTransformation (D:=F z);
+ compose := composet (D:=F z);
+ associativity := associativityt (D:=F z) |}". *)
diff --git a/test-suite/bugs/closed/3402.v b/test-suite/bugs/closed/3402.v
new file mode 100644
index 00000000..ed47ec82
--- /dev/null
+++ b/test-suite/bugs/closed/3402.v
@@ -0,0 +1,7 @@
+Set Primitive Projections.
+Record prod A B := pair { fst : A ; snd : B }.
+Goal forall A B (p : prod A B), p = let (x, y) := p in pair A B x y.
+Proof.
+ intros A B p.
+ exact eq_refl.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3408.v b/test-suite/bugs/closed/3408.v
new file mode 100644
index 00000000..b12b8c1a
--- /dev/null
+++ b/test-suite/bugs/closed/3408.v
@@ -0,0 +1,163 @@
+Require Import BinPos.
+
+Inductive expr : Type :=
+ Var : nat -> expr
+| App : expr -> expr -> expr
+| Abs : unit -> expr -> expr.
+
+Inductive expr_acc
+: expr -> expr -> Prop :=
+ acc_App_l : forall f a : expr,
+ expr_acc f (App f a)
+| acc_App_r : forall f a : expr,
+ expr_acc a (App f a)
+| acc_Abs : forall (t : unit) (e : expr),
+ expr_acc e (Abs t e).
+
+Theorem wf_expr_acc : well_founded expr_acc.
+Proof.
+ red.
+ refine (fix rec a : Acc expr_acc a :=
+ match a as a return Acc expr_acc a with
+ | Var v => Acc_intro _ (fun y (_H : expr_acc y (Var v)) =>
+ match _H in expr_acc z Z
+ return match Z return Prop with
+ | Var _ => Acc _ y
+ | _ => True
+ end
+ with
+ | acc_App_l _ _ => I
+ | _ => I
+ end)
+ | App f x => Acc_intro _ (fun y (pf : expr_acc y (App f x)) =>
+ match pf in expr_acc z Z
+ return match Z return Prop with
+ | App a b => f = a -> x = b -> Acc expr_acc z
+ | _ => True
+ end
+ with
+ | acc_App_l f' x' => fun pf _ => match pf in _ = z return
+ Acc expr_acc z
+ with
+ | eq_refl => rec f
+ end
+ | acc_App_r f' x' => fun _ pf => match pf in _ = z return
+ Acc expr_acc z
+ with
+ | eq_refl => rec x
+ end
+ | _ => I
+ end eq_refl eq_refl)
+ | Abs t e => Acc_intro _ (fun y (pf : expr_acc y (Abs t e)) =>
+ match pf in expr_acc z Z
+ return match Z return Prop with
+ | Abs a b => e = b -> Acc expr_acc z
+ | _ => True
+ end
+ with
+ | acc_Abs f x => fun pf => match pf in _ = z return
+ Acc expr_acc z
+ with
+ | eq_refl => rec e
+ end
+ | _ => I
+ end eq_refl)
+ end).
+Defined.
+
+Theorem wf_expr_acc_delay : well_founded expr_acc.
+Proof.
+ red.
+ refine (fix rec a : Acc expr_acc a :=
+ match a as a return Acc expr_acc a with
+ | Var v => Acc_intro _ (fun y (_H : expr_acc y (Var v)) =>
+ match _H in expr_acc z Z
+ return match Z return Prop with
+ | Var _ => Acc _ y
+ | _ => True
+ end
+ with
+ | acc_App_l _ _ => I
+ | _ => I
+ end)
+ | App f x => Acc_intro _ (fun y (pf : expr_acc y (App f x)) =>
+ match pf in expr_acc z Z
+ return match Z return Prop with
+ | App a b => (unit -> Acc expr_acc a) -> (unit -> Acc expr_acc b) -> Acc expr_acc z
+ | _ => True
+ end
+ with
+ | acc_App_l f' x' => fun pf _ => pf tt
+ | acc_App_r f' x' => fun _ pf => pf tt
+ | _ => I
+ end (fun _ => rec f) (fun _ => rec x))
+ | Abs t e => Acc_intro _ (fun y (pf : expr_acc y (Abs t e)) =>
+ match pf in expr_acc z Z
+ return match Z return Prop with
+ | Abs a b => (unit -> Acc expr_acc b) -> Acc expr_acc z
+ | _ => True
+ end
+ with
+ | acc_Abs f x => fun pf => pf tt
+ | _ => I
+ end (fun _ => rec e))
+ end);
+ try solve [ inversion _H ].
+Defined.
+
+Fixpoint build_large (n : nat) : expr :=
+ match n with
+ | 0 => Var 0
+ | S n =>
+ let e := build_large n in
+ App e e
+ end.
+
+Section guard.
+ Context {A : Type} {R : A -> A -> Prop}.
+
+ Fixpoint guard (n : nat) (wfR : well_founded R) : well_founded R :=
+ match n with
+ | 0 => wfR
+ | S n0 =>
+ fun x : A =>
+ Acc_intro x
+ (fun (y : A) (_ : R y x) => guard n0 (guard n0 wfR) y)
+ end.
+End guard.
+
+
+Definition sizeF_delay : expr -> positive.
+refine
+ (@Fix expr (expr_acc)
+ (wf_expr_acc_delay)
+ (fun _ => positive)
+ (fun e =>
+ match e as e return (forall l, expr_acc l e -> positive) -> positive with
+ | Var _ => fun _ => 1
+ | App l r => fun rec => @rec l _ + @rec r _
+ | Abs _ e => fun rec => 1 + @rec e _
+ end%positive)).
+eapply acc_App_l.
+eapply acc_App_r.
+eapply acc_Abs.
+Defined.
+
+Definition sizeF_guard : expr -> positive.
+refine
+ (@Fix expr (expr_acc)
+ (guard 5 wf_expr_acc)
+ (fun _ => positive)
+ (fun e =>
+ match e as e return (forall l, expr_acc l e -> positive) -> positive with
+ | Var _ => fun _ => 1
+ | App l r => fun rec => @rec l _ + @rec r _
+ | Abs _ e => fun rec => 1 + @rec e _
+ end%positive)).
+eapply acc_App_l.
+eapply acc_App_r.
+eapply acc_Abs.
+Defined.
+
+Time Eval native_compute in sizeF_delay (build_large 2).
+Time Eval native_compute in sizeF_guard (build_large 2).
diff --git a/test-suite/bugs/closed/3416.v b/test-suite/bugs/closed/3416.v
new file mode 100644
index 00000000..5cfb8f1f
--- /dev/null
+++ b/test-suite/bugs/closed/3416.v
@@ -0,0 +1,12 @@
+Inductive list A := Node : node A -> list A
+with node A := Nil | Cons : A -> list A -> node A.
+
+Fixpoint app {A} (l1 l2 : list A) {struct l1} : list A
+with app_node {A} (n1 : node A) (l2 : list A) {struct n1} : node A.
+Proof.
++ destruct l1 as [n]; constructor.
+ exact (app_node _ n l2).
++ destruct n1 as [|x l1].
+ - destruct l2 as [n2]; exact n2.
+ - exact (Cons _ x (app _ l1 l2)).
+Qed.
diff --git a/test-suite/bugs/closed/3417.v b/test-suite/bugs/closed/3417.v
new file mode 100644
index 00000000..9d7c6f01
--- /dev/null
+++ b/test-suite/bugs/closed/3417.v
@@ -0,0 +1,7 @@
+Require Setoid.
+
+Goal forall {T}(a b : T), b=a -> {c | c=b}.
+Proof.
+intros T a b H.
+try setoid_rewrite H.
+Abort.
diff --git a/test-suite/bugs/closed/3422.v b/test-suite/bugs/closed/3422.v
new file mode 100644
index 00000000..d984f623
--- /dev/null
+++ b/test-suite/bugs/closed/3422.v
@@ -0,0 +1,208 @@
+Generalizable All Variables.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Axiom admit : forall {T}, T.
+Reserved Infix "o" (at level 40, left associativity).
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
+Record Equiv A B := { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Existing Instance equiv_isequiv.
+Delimit Scope equiv_scope with equiv.
+Local Open Scope equiv_scope.
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+Axiom IsHSet : Type -> Type.
+Existing Class IsHSet.
+Definition trunc_equiv' `(f : A <~> B) `{IsHSet A} : IsHSet B := admit.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ trunc_morphism : forall s d, IsHSet (morphism s d) }.
+
+Bind Scope category_scope with PreCategory.
+Infix "o" := (@compose _ _ _ _) : morphism_scope.
+
+Delimit Scope functor_scope with functor.
+
+Record Functor (C D : PreCategory) :=
+ {
+ object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d)
+ }.
+
+Bind Scope functor_scope with Functor.
+Arguments morphism_of [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
+Local Open Scope morphism_scope.
+
+Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
+
+Local Notation "m ^-1" := (morphism_inverse (m := m)) : morphism_scope.
+
+Class Isomorphic {C : PreCategory} s d :=
+ {
+ morphism_isomorphic :> morphism C s d;
+ isisomorphism_isomorphic :> IsIsomorphism morphism_isomorphic
+ }.
+
+Coercion morphism_isomorphic : Isomorphic >-> morphism.
+
+Local Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
+
+Definition isisomorphism_inverse `(@IsIsomorphism C x y m) : IsIsomorphism m^-1 := {| morphism_inverse := m |}.
+
+Global Instance isisomorphism_compose `(@IsIsomorphism C y z m0) `(@IsIsomorphism C x y m1)
+: IsIsomorphism (m0 o m1).
+admit.
+Defined.
+
+Section composition.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable E : PreCategory.
+ Variable G : Functor D E.
+ Variable F : Functor C D.
+
+ Definition composeF : Functor C E
+ := Build_Functor
+ C E
+ (fun c => G (F c))
+ (fun _ _ m => morphism_of G (morphism_of F m)).
+End composition.
+Infix "o" := composeF : functor_scope.
+
+Delimit Scope natural_transformation_scope with natural_transformation.
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+
+Section compose.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F F' F'' : Functor C D.
+
+ Variable T' : NaturalTransformation F' F''.
+ Variable T : NaturalTransformation F F'.
+
+ Local Notation CO c := (T' c o T c).
+
+ Definition composeT
+ : NaturalTransformation F F'' := Build_NaturalTransformation F F'' (fun c => CO c).
+
+End compose.
+
+Section whisker.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable E : PreCategory.
+
+ Section L.
+ Variable F : Functor D E.
+ Variables G G' : Functor C D.
+ Variable T : NaturalTransformation G G'.
+
+ Local Notation CO c := (morphism_of F (T c)).
+
+ Definition whisker_l
+ := Build_NaturalTransformation
+ (F o G) (F o G')
+ (fun c => CO c).
+
+ End L.
+
+ Section R.
+ Variables F F' : Functor D E.
+ Variable T : NaturalTransformation F F'.
+ Variable G : Functor C D.
+
+ Local Notation CO c := (T (G c)).
+
+ Definition whisker_r
+ := Build_NaturalTransformation
+ (F o G) (F' o G)
+ (fun c => CO c).
+ End R.
+End whisker.
+Infix "o" := composeT : natural_transformation_scope.
+Infix "oL" := whisker_l (at level 40, left associativity) : natural_transformation_scope.
+Infix "oR" := whisker_r (at level 40, left associativity) : natural_transformation_scope.
+
+Section path_natural_transformation.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+
+ Lemma equiv_sig_natural_transformation
+ : { CO : forall x, morphism D (F x) (G x)
+ | forall s d (m : morphism C s d),
+ CO d o F _1 m = G _1 m o CO s }
+ <~> NaturalTransformation F G.
+ admit.
+ Defined.
+
+ Global Instance trunc_natural_transformation
+ : IsHSet (NaturalTransformation F G).
+ Proof.
+ eapply trunc_equiv'; [ exact equiv_sig_natural_transformation | ].
+ admit.
+ Qed.
+
+End path_natural_transformation.
+Definition functor_category (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D) (@NaturalTransformation C D) (@composeT C D) _.
+
+Notation "C -> D" := (functor_category C D) : category_scope.
+
+Definition NaturalIsomorphism (C D : PreCategory) F G := @Isomorphic (C -> D) F G.
+
+Coercion natural_transformation_of_natural_isomorphism C D F G (T : @NaturalIsomorphism C D F G) : NaturalTransformation F G
+ := T : morphism _ _ _.
+Local Infix "<~=~>" := NaturalIsomorphism : natural_transformation_scope.
+Global Instance isisomorphism_compose'
+ `(T' : @NaturalTransformation C D F' F'')
+ `(T : @NaturalTransformation C D F F')
+ `{@IsIsomorphism (C -> D) F' F'' T'}
+ `{@IsIsomorphism (C -> D) F F' T}
+: @IsIsomorphism (C -> D) F F'' (T' o T)%natural_transformation
+ := @isisomorphism_compose (C -> D) _ _ T' _ _ T _.
+
+Section lemmas.
+ Local Open Scope natural_transformation_scope.
+
+ Variable C : PreCategory.
+ Variable F : C -> PreCategory.
+ Context
+ {w x y z}
+ {f : Functor (F w) (F z)} {f0 : Functor (F w) (F y)}
+ {f1 : Functor (F x) (F y)} {f2 : Functor (F y) (F z)}
+ {f3 : Functor (F w) (F x)} {f4 : Functor (F x) (F z)}
+ {f5 : Functor (F w) (F z)} {n : f5 <~=~> (f4 o f3)%functor}
+ {n0 : f4 <~=~> (f2 o f1)%functor} {n1 : f0 <~=~> (f1 o f3)%functor}
+ {n2 : f <~=~> (f2 o f0)%functor}.
+
+ Lemma p_composition_of_coherent_iso_for_rewrite__isisomorphism_helper'
+ : @IsIsomorphism
+ (_ -> _) _ _
+ (n2 ^-1 o (f2 oL n1 ^-1 o (admit o (n0 oR f3 o n))))%natural_transformation.
+ Proof.
+ eapply isisomorphism_compose';
+ [ eapply isisomorphism_inverse
+ | eapply isisomorphism_compose';
+ [ admit
+ | eapply isisomorphism_compose';
+ [ admit |
+ eapply isisomorphism_compose'; [ admit | ]]]].
+ Set Printing All. Set Printing Universes.
+ apply @isisomorphism_isomorphic.
+ Qed.
+
+End lemmas.
diff --git a/test-suite/bugs/closed/3424.v b/test-suite/bugs/closed/3424.v
new file mode 100644
index 00000000..f9b2c386
--- /dev/null
+++ b/test-suite/bugs/closed/3424.v
@@ -0,0 +1,23 @@
+Set Universe Polymorphism.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Class Contr_internal (A : Type) := BuildContr { center : A ; contr : (forall y : A, center = y) }.
+Inductive trunc_index : Type := minus_two | trunc_S (x : trunc_index).
+Bind Scope trunc_scope with trunc_index.
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+Notation minus_one:=(trunc_S minus_two).
+Notation "0" := (trunc_S minus_one) : trunc_scope.
+Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
+Notation IsHProp := (IsTrunc minus_one).
+Notation IsHSet := (IsTrunc 0).
+Goal forall (A : Type) (a b : A) (H' : IsHSet A), { x : Type & IsHProp x }.
+Proof.
+intros.
+eexists.
+(* exact (H' a b). *)
+(* Undo. *)
+apply (H' a b).
+Qed.
diff --git a/test-suite/bugs/closed/3427.v b/test-suite/bugs/closed/3427.v
new file mode 100644
index 00000000..8483a4ec
--- /dev/null
+++ b/test-suite/bugs/closed/3427.v
@@ -0,0 +1,195 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 0 lines to 7171 lines, then from 7184 lines to 558 lines, then from 556 lines to 209 lines *)
+Generalizable All Variables.
+Set Universe Polymorphism.
+Notation Type0 := Set.
+Notation idmap := (fun x => x).
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
+Open Scope function_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Delimit Scope path_scope with path.
+Local Open Scope path_scope.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z := match p, q with idpath, idpath => idpath end.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x := match p with idpath => idpath end.
+Notation "1" := idpath : path_scope.
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+Notation "p ^" := (inverse p) (at level 3) : path_scope.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing) : path_scope.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x) := forall x:A, f x = g x.
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g) : forall x, f x = g x := fun x => match h with idpath => idpath end.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+ }.
+Record Equiv A B := BuildEquiv {
+ equiv_fun :> A -> B ;
+ equiv_isequiv :> IsEquiv equiv_fun
+ }.
+
+Delimit Scope equiv_scope with equiv.
+
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+ }.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint nat_to_trunc_index (n : nat) : trunc_index
+ := match n with
+ | 0 => trunc_S (trunc_S minus_two)
+ | S n' => trunc_S (nat_to_trunc_index n')
+ end.
+
+Coercion nat_to_trunc_index : nat >-> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Notation minus_one:=(trunc_S minus_two).
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Notation Contr := (IsTrunc minus_two).
+Notation IsHProp := (IsTrunc minus_one).
+Notation IsHSet := (IsTrunc 0).
+
+Class Funext :=
+ { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+
+Definition concat_pV {A : Type} {x y : A} (p : x = y) :
+ p @ p^ = 1
+ :=
+ match p with idpath => 1 end.
+
+Definition concat_Vp {A : Type} {x y : A} (p : x = y) :
+ p^ @ p = 1
+ :=
+ match p with idpath => 1 end.
+
+Definition transport_pp {A : Type} (P : A -> Type) {x y z : A} (p : x = y) (q : y = z) (u : P x) :
+ p @ q # u = q # p # u :=
+ match q with idpath =>
+ match p with idpath => 1 end
+ end.
+
+Definition transport2 {A : Type} (P : A -> Type) {x y : A} {p q : x = y}
+ (r : p = q) (z : P x)
+: p # z = q # z
+ := ap (fun p' => p' # z) r.
+
+Inductive Unit : Type0 :=
+ tt : Unit.
+
+Instance contr_unit : Contr Unit | 0 := let x := {|
+ center := tt;
+ contr := fun t : Unit => match t with tt => 1 end
+ |} in x.
+
+Instance trunc_succ `{IsTrunc n A} : IsTrunc (trunc_S n) A | 1000.
+admit.
+Defined.
+
+Record hProp := hp { hproptype :> Type ; isp : IsHProp hproptype}.
+Definition Unit_hp:hProp:=(hp Unit _).
+
+Global Instance isequiv_ap_hproptype `{Funext} X Y : IsEquiv (@ap _ _ hproptype X Y).
+admit.
+Defined.
+
+Definition path_hprop `{Funext} X Y := (@ap _ _ hproptype X Y)^-1%equiv.
+
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+Local Open Scope equiv_scope.
+
+Instance isequiv_path {A B : Type} (p : A = B)
+: IsEquiv (transport (fun X:Type => X) p) | 0
+ := BuildIsEquiv _ _ _ (transport (fun X:Type => X) p^)
+ (fun b => ((transport_pp idmap p^ p b)^ @ transport2 idmap (concat_Vp p) b))
+ (fun a => ((transport_pp idmap p p^ a)^ @ transport2 idmap (concat_pV p) a))
+ (fun a => match p in _ = C return
+ (transport_pp idmap p^ p (transport idmap p a))^ @
+ transport2 idmap (concat_Vp p) (transport idmap p a) =
+ ap (transport idmap p) ((transport_pp idmap p p^ a) ^ @
+ transport2 idmap (concat_pV p) a) with idpath => 1 end).
+
+Definition equiv_path (A B : Type) (p : A = B) : A <~> B
+ := BuildEquiv _ _ (transport (fun X:Type => X) p) _.
+
+Class Univalence := {
+ isequiv_equiv_path :> forall (A B : Type), IsEquiv (equiv_path A B)
+ }.
+
+Section Univalence.
+ Context `{Univalence}.
+
+ Definition path_universe_uncurried {A B : Type} (f : A <~> B) : A = B
+ := (equiv_path A B)^-1 f.
+End Univalence.
+
+Local Inductive minus1Trunc (A :Type) : Type :=
+ min1 : A -> minus1Trunc A.
+
+Instance minus1Trunc_is_prop {A : Type} : IsHProp (minus1Trunc A) | 0.
+admit.
+Defined.
+
+Definition hexists {X} (P:X->Type):Type:= minus1Trunc (sigT P).
+
+Section AssumingUA.
+
+ Definition isepi {X Y} `(f:X->Y) := forall Z: hSet,
+ forall g h: Y -> Z, g o f = h o f -> g = h.
+ Context {X Y : hSet} (f : X -> Y) (Hisepi : isepi f).
+
+ Goal forall (X Y : hSet) (f : forall _ : setT X, setT Y),
+ let fib :=
+ fun y : setT Y =>
+ hp (@hexists (setT X) (fun x : setT X => @paths (setT Y) (f x) y))
+ (@minus1Trunc_is_prop
+ (@sigT (setT X) (fun x : setT X => @paths (setT Y) (f x) y))) in
+ forall (x : setT X) (_ : Univalence) (_ : Funext),
+ @paths hProp (fib (f x)) Unit_hp.
+ intros.
+
+ apply path_hprop.
+ simpl.
+ Set Printing Universes.
+ Set Printing All.
+ refine (path_universe_uncurried _).
+ Undo.
+ apply path_universe_uncurried. (* Toplevel input, characters 21-44:
+Error: Refiner was given an argument
+ "@path_universe_uncurried (* Top.425 Top.426 Top.427 Top.428 Top.429 *) X1
+ (@hexists (* Top.405 Top.404 Set Set *) (setT (* Top.405 *) X0)
+ (fun x0 : setT (* Top.405 *) X0 =>
+ @paths (* Top.404 *) (setT (* Top.404 *) Y0) (f0 x0) (f0 x))) Unit
+ ?63" of type
+ "@paths (* Top.428 *) Type (* Top.425 *)
+ (@hexists (* Top.405 Top.404 Set Set *) (setT (* Top.405 *) X0)
+ (fun x0 : setT (* Top.405 *) X0 =>
+ @paths (* Top.404 *) (setT (* Top.404 *) Y0) (f0 x0) (f0 x))) Unit"
+instead of
+ "@paths (* Top.413 *) Type (* Set *)
+ (@hexists (* Top.405 Top.404 Set Set *) (setT (* Top.405 *) X0)
+ (fun x0 : setT (* Top.405 *) X0 =>
+ @paths (* Top.404 *) (setT (* Top.404 *) Y0) (f0 x0) (f0 x))) Unit".
+ *)
diff --git a/test-suite/bugs/closed/3428.v b/test-suite/bugs/closed/3428.v
new file mode 100644
index 00000000..3eb75e43
--- /dev/null
+++ b/test-suite/bugs/closed/3428.v
@@ -0,0 +1,35 @@
+(* File reduced by coq-bug-finder from original input, then from 2809 lines to 39 lines *)
+Set Primitive Projections.
+Set Implicit Arguments.
+Module Export foo.
+ Record prod (A B : Type) := pair { fst : A ; snd : B }.
+End foo.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Axiom path_prod : forall {A B : Type} (z z' : prod A B), (fst z = fst z') -> (snd z = snd z') -> (z = z').
+Notation fst := (@fst _ _).
+Notation snd := (@snd _ _).
+Definition ap_fst_path_prod {A B : Type} {z z' : prod A B} (p : @paths A (fst z) (fst z')) (q : snd z = snd z')
+: ap fst (path_prod z z' p q) = p.
+Abort.
+
+Notation fstp x := (x.(foo.fst)).
+Notation fstap x := (foo.fst x).
+
+Definition ap_fst_path_prod' {A B : Type} {z z' : prod A B} (p : @paths A (fst z) (fst z')) (q : snd z = snd z')
+: ap (fun x => fstap x) (path_prod z z' p q) = p.
+
+Abort.
+
+(* Toplevel input, characters 137-138:
+Error:
+In environment
+A : Type
+B : Type
+z : prod A B
+z' : prod A B
+p : @paths A (foo.fst ?11 ?14 z) (foo.fst ?26 ?29 z')
+q : @paths ?54 (foo.snd ?42 ?45 z) (foo.snd ?57 ?60 z')
+The term "p" has type "@paths A (foo.fst ?11 ?14 z) (foo.fst ?26 ?29 z')"
+while it is expected to have type "@paths A (foo.fst z) (foo.fst z')". *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3439.v b/test-suite/bugs/closed/3439.v
new file mode 100644
index 00000000..bba6140f
--- /dev/null
+++ b/test-suite/bugs/closed/3439.v
@@ -0,0 +1,43 @@
+(* File reduced by coq-bug-finder from original input, then from 3154 lines to 149 lines, then from 89 lines to 55 lines, then from 44 lines to 20 lines *)
+Set Primitive Projections.
+Generalizable All Variables.
+Axiom IsHSet : Type -> Type.
+Existing Class IsHSet.
+Record PreCategory := { object :> Type }.
+Notation IsStrictCategory C := (IsHSet (object C)).
+Instance trunc_prod `{IsHSet A} `{IsHSet B} : IsHSet (A * B) | 100.
+admit.
+Defined.
+Typeclasses Transparent object.
+Definition prod (C D : PreCategory) : PreCategory := Build_PreCategory (Datatypes.prod C D).
+Global Instance isstrict_category_product `{IsStrictCategory C, IsStrictCategory D} : IsStrictCategory (prod C D).
+Proof.
+ typeclasses eauto.
+Defined.
+
+
+Set Typeclasses Debug.
+(* File reduced by coq-bug-finder from original input, then from 7425 lines to 154 lines, then from 116 lines to 20 lines *)
+Class Contr (A : Type) := { center : A }.
+Instance contr_unit : Contr unit | 0 := {| center := tt |}.
+Module non_prim.
+ Unset Primitive Projections.
+ Record PreCategory := { object :> Type }.
+ Lemma foo : Contr (object (@Build_PreCategory unit)).
+ Proof.
+ solve [ simpl; typeclasses eauto ] || fail "goal not solved".
+ Undo.
+ solve [ typeclasses eauto ].
+ Defined.
+End non_prim.
+
+Module prim.
+ Set Primitive Projections.
+ Record PreCategory := { object :> Type }.
+ Lemma foo : Contr (object (@Build_PreCategory unit)).
+ Proof.
+ solve [ simpl; typeclasses eauto ] || fail "goal not solved".
+ Undo.
+ solve [ typeclasses eauto ]. (* Error: No applicable tactic. *)
+ Defined.
+End prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3453.v b/test-suite/bugs/closed/3453.v
new file mode 100644
index 00000000..4ee9b400
--- /dev/null
+++ b/test-suite/bugs/closed/3453.v
@@ -0,0 +1,10 @@
+Set Primitive Projections.
+Record Foo := { bar : Set }.
+Class Baz (F : Foo) := { qux : F.(bar) }.
+Coercion qux : Baz >-> bar.
+
+Definition f : Foo := {| bar := nat |}.
+Canonical Structure f.
+Check (fun b : Baz f => b : _.(bar)).
+
+(* Error: Found target class bar instead of bar. *)
diff --git a/test-suite/bugs/closed/3454.v b/test-suite/bugs/closed/3454.v
new file mode 100644
index 00000000..ca4d2380
--- /dev/null
+++ b/test-suite/bugs/closed/3454.v
@@ -0,0 +1,63 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+
+Record prod {A} {B}:= pair { fst : A ; snd : B }.
+Notation " A * B " := (@prod A B) : type_scope.
+Record sigT {A} (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+Notation pr1 := (@projT1 _ _).
+Arguments prod : clear implicits.
+
+Check (@projT1 _ (fun x : nat => x = x)).
+Check (fun s : @sigT nat (fun x : nat => x = x) => s.(projT1)).
+
+Record rimpl {b : bool} {n : nat} := { foo : forall {x : nat}, x = n }.
+
+Check (fun r : @rimpl true 0 => r.(foo) (x:=0)).
+Check (fun r : @rimpl true 0 => @foo true 0 r 0).
+Check (fun r : @rimpl true 0 => foo r (x:=0)).
+Check (fun r : @rimpl true 0 => @foo _ _ r 0).
+Check (fun r : @rimpl true 0 => r.(@foo _ _)).
+Check (fun r : @rimpl true 0 => r.(foo)).
+
+Notation "{ x : T & P }" := (@sigT T P).
+Notation "{ x : A & P }" := (sigT (A:=A) (fun x => P)) : type_scope.
+(* Notation "{ x : T * U & P }" := (@sigT (T * U) P). *)
+
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Class IsEquiv {A B : Type} (f : A -> B) := {}.
+
+Local Instance isequiv_tgt_compose A B
+: @IsEquiv (A -> {xy : B * B & fst xy = snd xy})
+ (A -> B)
+ (@compose A {xy : B * B & fst xy = snd xy} B
+ (@compose {xy : B * B & fst xy = snd xy} _ B (@snd B B) pr1)).
+(* Toplevel input, characters 220-223: *)
+(* Error: Cannot infer this placeholder. *)
+
+Local Instance isequiv_tgt_compose' A B
+: @IsEquiv (A -> {xy : B * B & fst xy = snd xy})
+ (A -> B)
+ (@compose A {xy : B * B & fst xy = snd xy} B (@compose {xy : B * B & fst xy = snd xy} _ B (@snd _ _) pr1)).
+(* Toplevel input, characters 221-232: *)
+(* Error: *)
+(* In environment *)
+(* A : Type *)
+(* B : Type *)
+(* The term "pr1" has type "sigT ?30 -> ?29" while it is expected to have type *)
+(* "{xy : B * B & fst xy = snd xy} -> ?27 * B". *)
+
+Local Instance isequiv_tgt_compose'' A B
+: @IsEquiv (A -> {xy : B * B & fst xy = snd xy})
+ (A -> B)
+ (@compose A {xy : B * B & fst xy = snd xy} B (@compose {xy : B * B & fst xy = snd xy} _ B (@snd _ _)
+ (fun s => s.(projT1)))).
+(* Toplevel input, characters 15-241:
+Error:
+Cannot infer an internal placeholder of type "Type" in environment:
+
+A : Type
+B : Type
+x : ?32
+. *)
diff --git a/test-suite/bugs/closed/3469.v b/test-suite/bugs/closed/3469.v
new file mode 100644
index 00000000..b09edc65
--- /dev/null
+++ b/test-suite/bugs/closed/3469.v
@@ -0,0 +1,29 @@
+(* File reduced by coq-bug-finder from original input, then from 538 lines to 31 lines *)
+Open Scope type_scope.
+Global Set Primitive Projections.
+Set Implicit Arguments.
+Record sig (A : Type) (P : A -> Type) := exist { proj1_sig : A ; proj2_sig : P proj1_sig }.
+Notation sigT := sig (only parsing).
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+Notation projT1 := proj1_sig (only parsing).
+Notation projT2 := proj2_sig (only parsing).
+Variables X : Type.
+Variable R : X -> X -> Type.
+Lemma dependent_choice :
+ (forall x:X, {y : _ & R x y}) ->
+ forall x0, {f : nat -> X & (f O = x0) * (forall n, R (f n) (f (S n)))}.
+Proof.
+ intros H x0.
+ set (f:=fix f n := match n with O => x0 | S n' => projT1 (H (f n')) end).
+ exists f.
+ split.
+ reflexivity.
+ induction n; simpl in *.
+ clear.
+ apply (proj2_sig (H x0)).
+ Undo.
+ apply @proj2_sig.
+
+
+(* Toplevel input, characters 21-31:
+Error: Found no subterm matching "proj1_sig ?206" in the current *)
diff --git a/test-suite/bugs/closed/3477.v b/test-suite/bugs/closed/3477.v
new file mode 100644
index 00000000..e9414864
--- /dev/null
+++ b/test-suite/bugs/closed/3477.v
@@ -0,0 +1,9 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Record prod A B := pair { fst : A ; snd : B }.
+Goal forall A B : Set, True.
+Proof.
+ intros A B.
+ evar (a : prod A B); evar (f : (prod A B -> Set)).
+ let a' := (eval unfold a in a) in
+ set(foo:=eq_refl : a' = (@pair _ _ (fst a') (snd a'))). \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/348.v b/test-suite/bugs/closed/348.v
index 28cc5cb1..28cc5cb1 100644
--- a/test-suite/bugs/closed/shouldsucceed/348.v
+++ b/test-suite/bugs/closed/348.v
diff --git a/test-suite/bugs/closed/3480.v b/test-suite/bugs/closed/3480.v
new file mode 100644
index 00000000..99ac2efa
--- /dev/null
+++ b/test-suite/bugs/closed/3480.v
@@ -0,0 +1,47 @@
+Set Primitive Projections.
+Axiom admit : forall {T}, T.
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation "x .1" := (projT1 x) (at level 3) : fibration_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Set Implicit Arguments.
+Delimit Scope category_scope with category.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Local Open Scope category_scope.
+Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
+Class Isomorphic {C : PreCategory} s d := { morphism_isomorphic :> @morphism C s d ; isisomorphism_isomorphic :> IsIsomorphism morphism_isomorphic }.
+Coercion morphism_isomorphic : Isomorphic >-> morphism.
+Local Infix "<~=~>" := Isomorphic (at level 70, no associativity) : category_scope.
+Definition idtoiso (C : PreCategory) (x y : C) (H : x = y) : Isomorphic x y := admit.
+Record NotionOfStructure (X : PreCategory) := { structure :> X -> Type }.
+Record Smorphism (X : PreCategory) (P : NotionOfStructure X) (xa yb : { x : X & P x }) := { f : morphism X xa.1 yb.1 }.
+Definition precategory_of_structures X (P : NotionOfStructure X) : PreCategory.
+Proof.
+ refine (@Build_PreCategory _ (@Smorphism _ P)).
+Defined.
+Section sip.
+ Variable X : PreCategory.
+ Variable P : NotionOfStructure X.
+
+ Let StrX := @precategory_of_structures X P.
+
+ Definition sip_isotoid (xa yb : StrX) (f : xa <~=~> yb) : xa = yb.
+ admit.
+ Defined.
+
+ Lemma structure_identity_principle_helper (xa yb : StrX)
+ (x : xa <~=~> yb) : Smorphism P xa yb.
+ Proof.
+ refine ((idtoiso (precategory_of_structures P) (sip_isotoid x) : @morphism _ _ _) : morphism _ _ _).
+(* Toplevel input, characters 24-95:
+Error:
+In environment
+X : PreCategory
+P : NotionOfStructure X
+StrX := precategory_of_structures P : PreCategory
+xa : object StrX
+yb : object StrX
+x : xa <~=~> yb
+The term "morphism_isomorphic:@morphism (precategory_of_structures P) xa yb"
+has type "@morphism (precategory_of_structures P) xa yb"
+while it is expected to have type "morphism ?40 ?41 ?42". *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3481.v b/test-suite/bugs/closed/3481.v
new file mode 100644
index 00000000..89d476dc
--- /dev/null
+++ b/test-suite/bugs/closed/3481.v
@@ -0,0 +1,70 @@
+
+Set Implicit Arguments.
+
+Require Import Logic.
+Module NonPrim.
+Local Set Record Elimination Schemes.
+Record prodwithlet (A B : Type) : Type :=
+ pair' { fst : A; fst' := fst; snd : B }.
+
+Definition letreclet (p : prodwithlet nat nat) :=
+ let (x, x', y) := p in x + y.
+
+Definition pletreclet (p : prodwithlet nat nat) :=
+ let 'pair' x x' y := p in x + y + x'.
+
+Definition pletreclet2 (p : prodwithlet nat nat) :=
+ let 'pair' x y := p in x + y.
+
+Check (pair 0 0).
+End NonPrim.
+
+Global Set Universe Polymorphism.
+Global Set Asymmetric Patterns.
+Local Set Record Elimination Schemes.
+Local Set Primitive Projections.
+
+Record prod (A B : Type) : Type :=
+ pair { fst : A; snd : B }.
+
+Print prod_rect.
+
+(* What I really want: *)
+Definition prod_rect' A B (P : prod A B -> Type) (u : forall (fst : A) (snd : B), P (pair fst snd))
+ (p : prod A B) : P p
+ := u (fst p) (snd p).
+
+Definition conv : @prod_rect = @prod_rect'.
+Proof. reflexivity. Defined.
+
+Definition imposs :=
+ (fun A B P f (p : prod A B) => match p as p0 return P p0 with
+ | {| fst := x ; snd := x0 |} => f x x0
+ end).
+
+Definition letrec (p : prod nat nat) :=
+ let (x, y) := p in x + y.
+Eval compute in letrec (pair 1 5).
+
+Goal forall p : prod nat nat, letrec p = fst p + snd p.
+Proof.
+ reflexivity.
+ Undo.
+ intros p.
+ case p. simpl. unfold letrec. simpl. reflexivity.
+Defined.
+
+Eval compute in conv. (* = eq_refl
+ : prod_rect = prod_rect' *)
+
+Check eq_refl : @prod_rect = @prod_rect'. (* Toplevel input, characters 6-13:
+Error:
+The term "eq_refl" has type "prod_rect = prod_rect"
+while it is expected to have type "prod_rect = prod_rect'"
+(cannot unify "prod_rect" and "prod_rect'"). *)
+
+Record sigma (A : Type) (B : A -> Type) : Type :=
+ dpair { pi1 : A ; pi2 : B pi1 }.
+
+
+
diff --git a/test-suite/bugs/closed/3482.v b/test-suite/bugs/closed/3482.v
new file mode 100644
index 00000000..34a5e73d
--- /dev/null
+++ b/test-suite/bugs/closed/3482.v
@@ -0,0 +1,11 @@
+Set Primitive Projections.
+Class Foo (F : False) := { foo : True }.
+Arguments foo F {Foo}.
+Print Implicit foo. (* foo : forall F : False, Foo F -> True
+
+Argument Foo is implicit and maximally inserted *)
+Check foo _. (* Toplevel input, characters 6-11:
+Error: Illegal application (Non-functional construction):
+The expression "foo" of type "True"
+cannot be applied to the term
+ "?36" : "?35" *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3483.v b/test-suite/bugs/closed/3483.v
new file mode 100644
index 00000000..2cc66186
--- /dev/null
+++ b/test-suite/bugs/closed/3483.v
@@ -0,0 +1,5 @@
+(* Check proper failing when using notation of non-constructors in
+ pattern-bmatching *)
+
+Fail Definition nonsense ( x : False ) := match x with y + 2 => 0 end.
+
diff --git a/test-suite/bugs/closed/3484.v b/test-suite/bugs/closed/3484.v
new file mode 100644
index 00000000..6c40a426
--- /dev/null
+++ b/test-suite/bugs/closed/3484.v
@@ -0,0 +1,30 @@
+(* File reduced by coq-bug-finder from original input, then from 14259 lines to 305 lines, then from 237 lines to 120 lines, then from 100 lines to 30 lines *)
+Set Primitive Projections.
+Set Implicit Arguments.
+Record sigT (A : Type) (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+Notation "{ x : A & P }" := (@sigT A (fun x : A => P)) : type_scope.
+Notation pr1 := (@projT1 _ _).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Goal forall (T : Type) (H : { g : T & g = g }) (x : T), projT1 H = projT1 (existT (fun g : T => g = g) x idpath).
+Proof.
+ intros.
+ let y := match goal with |- projT1 ?x = projT1 ?y => constr:(y) end in
+ apply (@ap _ _ pr1 _ y).
+ Undo.
+ Unset Printing Notations.
+ apply (ap pr1).
+ Undo.
+ refine (ap pr1 _).
+admit.
+Defined.
+
+(* Toplevel input, characters 22-28:
+Error:
+In environment
+T : Type
+H : sigT T (fun g : T => paths g g)
+x : T
+Unable to unify "paths (@projT1 ?24 ?23 ?25) (@projT1 ?24 ?23 ?26)" with
+ "paths (projT1 H) (projT1 {| projT1 := x; projT2 := idpath |})". *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3485.v b/test-suite/bugs/closed/3485.v
new file mode 100644
index 00000000..ede6b3cb
--- /dev/null
+++ b/test-suite/bugs/closed/3485.v
@@ -0,0 +1,133 @@
+Set Universe Polymorphism.
+Set Primitive Projections.
+Reserved Infix "o" (at level 40, left associativity).
+Definition relation (A : Type) := A -> A -> Type.
+Class Transitive {A} (R : relation A) := transitivity : forall x y z, R x y -> R y z -> R x z.
+Tactic Notation "etransitivity" open_constr(y) :=
+ let R := match goal with |- ?R ?x ?z => constr:(R) end in
+ let x := match goal with |- ?R ?x ?z => constr:(x) end in
+ let z := match goal with |- ?R ?x ?z => constr:(z) end in
+ refine (@transitivity _ R _ x y z _ _).
+Tactic Notation "etransitivity" := etransitivity _.
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation "x .1" := (projT1 x) (at level 3) : fibration_scope.
+Notation "x .2" := (projT2 x) (at level 3) : fibration_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z := match p, q with idpath, idpath => idpath end.
+Instance transitive_paths {A} : Transitive (@paths A) | 0 := @concat A.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+Class Contr_internal (A : Type) := { center : A ; contr : (forall y : A, center = y) }.
+Generalizable Variables X A B C f g n.
+Definition projT1_path `{P : A -> Type} {u v : sigT P} (p : u = v) : u.1 = v.1 := ap (@projT1 _ _) p.
+Notation "p ..1" := (projT1_path p) (at level 3) : fibration_scope.
+Ltac simpl_do_clear tac term :=
+ let H := fresh in
+ assert (H := term);
+ simpl in H |- *;
+ tac H;
+ clear H.
+Set Implicit Arguments.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+
+ identity : forall x, morphism x x;
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ left_identity : forall a b (f : morphism a b), identity b o f = f;
+ right_identity : forall a b (f : morphism a b), f o identity a = f }.
+Arguments identity {C%category} / x%object : rename.
+Arguments compose {C%category} / {s d d'}%object (m1 m2)%morphism : rename.
+Infix "o" := compose : morphism_scope.
+Notation "1" := (identity _) : morphism_scope.
+Delimit Scope functor_scope with functor.
+Local Open Scope morphism_scope.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d);
+ identity_of : forall x, morphism_of _ _ (identity x)
+ = identity (object_of x) }.
+Bind Scope functor_scope with Functor.
+Arguments morphism_of [C%category] [D%category] F%functor / [s%object d%object] m%morphism : rename.
+Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
+Section composition.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable E : PreCategory.
+ Variable G : Functor D E.
+ Variable F : Functor C D.
+
+ Local Notation c_object_of c := (G (F c)) (only parsing).
+ Local Notation c_morphism_of m := (morphism_of G (morphism_of F m)) (only parsing).
+
+ Definition compose_identity_of x
+ : c_morphism_of (identity x) = identity (c_object_of x)
+ := transport (@paths _ _)
+ (identity_of G _)
+ (ap (@morphism_of _ _ G _ _) (identity_of F x)).
+
+ Definition composeF : Functor C E
+ := Build_Functor
+ C E
+ (fun c => G (F c))
+ (fun _ _ m => morphism_of G (morphism_of F m))
+ compose_identity_of.
+End composition.
+Infix "o" := composeF : functor_scope.
+
+Definition identityF C : Functor C C
+ := Build_Functor C C
+ (fun x => x)
+ (fun _ _ x => x)
+ (fun _ => idpath).
+Notation "1" := (identityF _) : functor_scope.
+
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+
+Section unit.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variable F : Functor C D.
+ Variable G : Functor D C.
+
+ Definition AdjunctionUnit :=
+ { T : NaturalTransformation 1 (G o F)
+ & forall (c : C) (d : D) (f : morphism C c (G d)),
+ Contr_internal { g : morphism D (F c) d & G _1 g o T c = f }
+ }.
+End unit.
+Variable C : PreCategory.
+Variable D : PreCategory.
+Variable F : Functor C D.
+Variable G : Functor D C.
+
+Definition zig__of__adjunction_unit
+ (A : AdjunctionUnit F G)
+ (Y : C)
+ (eta := A.1)
+ (eps := fun X => (@center _ (A.2 (G X) X 1)).1)
+: G _1 (eps (F Y) o F _1 (eta Y)) o eta Y = eta Y
+ -> eps (F Y) o F _1 (eta Y) = 1.
+Proof.
+ intros.
+ etransitivity; [ symmetry | ];
+ simpl_do_clear
+ ltac:(fun H => apply H)
+ (fun y H => (@contr _ (A.2 _ _ (A.1 Y)) (y; H))..1);
+ try assumption.
+ simpl.
+ rewrite ?@identity_of, ?@left_identity, ?@right_identity;
+ reflexivity.
+Qed.
diff --git a/test-suite/bugs/closed/3487.v b/test-suite/bugs/closed/3487.v
new file mode 100644
index 00000000..03c60a8b
--- /dev/null
+++ b/test-suite/bugs/closed/3487.v
@@ -0,0 +1,8 @@
+Notation bar := $(exact I)$.
+Notation foo := bar (only parsing).
+Class baz := { x : False }.
+Instance: baz.
+Admitted.
+Definition baz0 := ((_ : baz) = (_ : baz)).
+Definition foo1 := (foo = foo).
+Definition baz1 := prod ((_ : baz) = (_ : baz)) (foo = foo).
diff --git a/test-suite/bugs/closed/3505.v b/test-suite/bugs/closed/3505.v
new file mode 100644
index 00000000..2695bc79
--- /dev/null
+++ b/test-suite/bugs/closed/3505.v
@@ -0,0 +1,44 @@
+(* File reduced by coq-bug-finder from original input, then from 7421 lines to 6082 lines, then from 5860 lines to 5369 lines, then from 5300 lines to 165 lines, then from 111 lines to 38 lines *)
+Set Implicit Arguments.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+ identity : forall x, morphism x x }.
+Bind Scope category_scope with PreCategory.
+Local Notation "1" := (identity _ _) : morphism_scope.
+Local Open Scope morphism_scope.
+Definition prod (C D : PreCategory) : PreCategory
+ := @Build_PreCategory
+ (C * D)%type
+ (fun s d => (morphism C (fst s) (fst d) * morphism D (snd s) (snd d))%type)
+ (fun x => (identity _ (fst x), identity _ (snd x))).
+Local Infix "*" := prod : category_scope.
+Module NonPrim.
+ Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d);
+ identity_of : forall x, morphism_of _ _ (identity _ x) = identity _ (object_of x) }.
+ Notation "F '_1' m" := (morphism_of F _ _ m) (at level 10, no associativity) : morphism_scope.
+ Goal forall C1 C2 D (F : Functor (C1 * C2) D) x, F _1 (1, 1) = identity _ (F x).
+ Proof.
+ intros.
+ rewrite identity_of.
+ reflexivity.
+ Qed.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d);
+ identity_of : forall x, morphism_of _ _ (identity _ x) = identity _ (object_of x) }.
+ Notation "F '_1' m" := (morphism_of F _ _ m) (at level 10, no associativity) : morphism_scope.
+ Goal forall C1 C2 D (F : Functor (C1 * C2) D) x, F _1 (1, 1) = identity _ (F x).
+ Proof.
+ intros.
+ rewrite identity_of. (* Toplevel input, characters 0-20:
+Error:
+Found no subterm matching "morphism_of ?192 ?193 ?193 (identity ?190 ?193)" in the current goal. *)
+ reflexivity.
+ Qed.
+End Prim.
diff --git a/test-suite/bugs/closed/3520.v b/test-suite/bugs/closed/3520.v
new file mode 100644
index 00000000..c981207e
--- /dev/null
+++ b/test-suite/bugs/closed/3520.v
@@ -0,0 +1,12 @@
+Set Primitive Projections.
+
+Record foo (A : Type) :=
+ { bar : Type ; baz := Set; bad : baz = bar }.
+
+Set Record Elimination Schemes.
+
+Record notprim : Prop :=
+ { irrel : True; relevant : nat }.
+
+
+
diff --git a/test-suite/bugs/closed/3531.v b/test-suite/bugs/closed/3531.v
new file mode 100644
index 00000000..fd080a6b
--- /dev/null
+++ b/test-suite/bugs/closed/3531.v
@@ -0,0 +1,53 @@
+(* File reduced by coq-bug-finder from original input, then from 270 lines to
+198 lines, then from 178 lines to 82 lines, then from 88 lines to 59 lines *)
+(* coqc version trunk (August 2014) compiled on Aug 19 2014 14:40:15 with OCaml
+4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk
+(56ece74efc25af1b0e09265f3c7fcf74323abcaf) *)
+Require Import Coq.Lists.List.
+Set Implicit Arguments.
+Definition mem := nat -> option nat.
+Definition pred := mem -> Prop.
+Delimit Scope pred_scope with pred.
+Definition exis A (p : A -> pred) : pred := fun m => exists x, p x m.
+Notation "'exists' x .. y , p" := (exis (fun x => .. (exis (fun y => p)) ..)) :
+pred_scope.
+Definition emp : pred := fun m => forall a, m a = None.
+Definition lift_empty (P : Prop) : pred := fun m => P /\ forall a, m a = None.
+Notation "[[ P ]]" := (lift_empty P) : pred_scope.
+Definition pimpl (p q : pred) := forall m, p m -> q m.
+Notation "p ==> q" := (pimpl p%pred q%pred) (right associativity, at level 90).
+Definition piff (p q : pred) : Prop := (p ==> q) /\ (q ==> p).
+Notation "p <==> q" := (piff p%pred q%pred) (at level 90).
+Parameter sep_star : pred -> pred -> pred.
+Infix "*" := sep_star : pred_scope.
+Definition memis (m : mem) : pred := eq m.
+Definition mptsto (m : mem) (a : nat) (v : nat) := m a = Some v.
+Notation "m @ a |-> v" := (mptsto m a v) (a at level 34, at level 35).
+Lemma piff_trans: forall a b c, (a <==> b) -> (b <==> c) -> (a <==> c).
+Admitted.
+Lemma piff_refl: forall a, (a <==> a).
+Admitted.
+Definition stars (ps : list pred) := fold_left sep_star ps emp.
+Lemma flatten_exists: forall T PT p ps P,
+ (forall (a:T), (p a <==> exists (x:PT), stars (ps a x) * [[P a x]]))
+ -> (exists (a:T), p a) <==>
+ (exists (x:(T*PT)), stars (ps (fst x) (snd x)) * [[P (fst x) (snd x)]]).
+Admitted.
+Goal forall b, (exists e1 e2 e3,
+ (exists (m : mem) (v : nat) (F : pred), b)
+ <==> (exists x : e1, stars (e2 x) * [[e3 x]])).
+ intros.
+ Set Printing Universes.
+ Show Universes.
+ do 3 eapply ex_intro.
+ eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros.
+ eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros.
+ eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros.
+ assert (H : False) by (clear; admit); destruct H.
+ Grab Existential Variables.
+ admit.
+ admit.
+ admit.
+ Show Universes.
+Time Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3537.v b/test-suite/bugs/closed/3537.v
new file mode 100644
index 00000000..158642f0
--- /dev/null
+++ b/test-suite/bugs/closed/3537.v
@@ -0,0 +1,12 @@
+(* Another instance of bug #3262, on looping in unification *)
+
+Inductive bool := true | false.
+
+Inductive RBT2 : forall a:bool, Type :=
+ Full2 : forall (a b c n:bool),
+ forall H:RBT2 n, RBT2 n.
+
+Definition balance4 color p q r :=
+ match color, p, q, r with
+ | _,_,_,_ => Full2 color p q r
+ end.
diff --git a/test-suite/bugs/closed/3539.v b/test-suite/bugs/closed/3539.v
new file mode 100644
index 00000000..c862965d
--- /dev/null
+++ b/test-suite/bugs/closed/3539.v
@@ -0,0 +1,66 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter" "-no-native-compiler") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 11678 lines to 11330 lines, then from 10721 lines to 9544 lines, then from 9549 lines to 794 lines, then from 810 lines to 785 lines, then from 628 lines to 246 lines, then from 220 lines to 89 lines, then from 80 lines to 47 lines *)
+(* coqc version trunk (August 2014) compiled on Aug 22 2014 4:17:28 with OCaml 4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (a67cc6941434124465f20b14a1256f2ede31a60e) *)
+
+Set Implicit Arguments.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end.
+Local Set Primitive Projections.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Axiom path_prod : forall {A B : Type} (z z' : A * B), (fst z = fst z') -> (snd z = snd z') -> (z = z').
+Axiom transport_path_prod : forall A B (P : A * B -> Type) (x y : A * B) (HA : fst x = fst y) (HB : snd x = snd y) Px,
+ transport P (path_prod _ _ HA HB) Px
+ = transport (fun x => P (x, snd y)) HA (transport (fun y => P (fst x, y)) HB Px).
+Goal forall (T0 : Type) (snd1 snd0 f : T0) (p : @paths T0 f snd0)
+ (f0 : T0) (p1 : @paths T0 f0 snd1) (T1 : Type)
+ (fst1 fst0 : T1) (p0 : @paths T1 fst0 fst0) (p2 : @paths T1 fst1 fst1)
+ (T : Type) (x2 : T) (T2 : Type) (T3 : forall (_ : T2) (_ : T2), Type)
+ (x' : forall (_ : T1) (_ : T), T2) (m : T3 (x' fst1 x2) (x' fst0 x2)),
+ @paths (T3 (x' fst1 x2) (x' fst0 x2))
+ (@transport (prod T1 T0)
+ (fun x : prod T1 T0 =>
+ T3 (x' fst1 x2) (x' (fst x) x2))
+ (@pair T1 T0 fst0 f) (@pair T1 T0 fst0 snd0)
+ (@path_prod T1 T0 (@pair T1 T0 fst0 f)
+ (@pair T1 T0 fst0 snd0) p0 p)
+ (@transport (prod T1 T0)
+ (fun x : prod T1 T0 =>
+ T3 (x' (fst x) x2) (x' fst0 x2))
+ (@pair T1 T0 fst1 f0) (@pair T1 T0 fst1 snd1)
+ (@path_prod T1 T0 (@pair T1 T0 fst1 f0)
+ (@pair T1 T0 fst1 snd1) p2 p1) m)) m.
+ intros.
+ match goal with
+ | [ |- context[transport ?P (path_prod ?x ?y ?HA ?HB) ?Px] ]
+ => rewrite (transport_path_prod P x y HA HB Px)
+ end || fail "bad".
+ Undo.
+ Set Printing All.
+ rewrite transport_path_prod. (* Toplevel input, characters 15-43:
+Error:
+In environment
+T0 : Type
+snd1 : T0
+snd0 : T0
+f : T0
+p : @paths T0 f snd0
+f0 : T0
+p1 : @paths T0 f0 snd1
+T1 : Type
+fst1 : T1
+fst0 : T1
+p0 : @paths T1 fst0 fst0
+p2 : @paths T1 fst1 fst1
+T : Type
+x2 : T
+T2 : Type
+T3 : forall (_ : T2) (_ : T2), Type
+x' : forall (_ : T1) (_ : T), T2
+m : T3 (x' fst1 x2) (x' fst0 x2)
+Unable to unify "?25 (@pair ?23 ?24 (fst ?27) (snd ?27))" with
+"?25 ?27".
+ *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3542.v b/test-suite/bugs/closed/3542.v
new file mode 100644
index 00000000..b6837a0c
--- /dev/null
+++ b/test-suite/bugs/closed/3542.v
@@ -0,0 +1,6 @@
+Section foo.
+ Context {A:Type} {B : A -> Type}.
+ Context (f : forall x, B x).
+ Goal True.
+ pose (r := fun k => existT (fun g => forall x, f x = g x)
+ (fun x => projT1 (k x)) (fun x => projT2 (k x))).
diff --git a/test-suite/bugs/closed/3546.v b/test-suite/bugs/closed/3546.v
new file mode 100644
index 00000000..55d718bd
--- /dev/null
+++ b/test-suite/bugs/closed/3546.v
@@ -0,0 +1,17 @@
+Set Primitive Projections.
+Record prod A B := pair { fst : A ; snd : B }.
+Arguments pair {_ _} _ _.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Definition ap11 {A B} {f g:A->B} (h:f=g) {x y:A} (p:x=y) : f x = g y.
+Admitted.
+Goal forall x y z w : Set, (x, y) = (z, w).
+Proof.
+ intros.
+ apply ap11. (* Toplevel input, characters 21-25:
+Error: In environment
+x : Set
+y : Set
+z : Set
+w : Set
+Unable to unify "?31 ?191 = ?32 ?192" with "(x, y) = (z, w)".
+ *)
diff --git a/test-suite/bugs/closed/3559.v b/test-suite/bugs/closed/3559.v
new file mode 100644
index 00000000..50645090
--- /dev/null
+++ b/test-suite/bugs/closed/3559.v
@@ -0,0 +1,86 @@
+(* File reduced by coq-bug-finder from original input, then from 8657 lines to
+4731 lines, then from 4174 lines to 192 lines, then from 161 lines to 55 lines,
+then from 51 lines to 37 lines, then from 43 lines to 30 lines *)
+(* coqc version trunk (August 2014) compiled on Aug 31 2014 10:12:32 with OCaml
+4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk
+(437b91a3ffd7327975a129b95b24d3f66ad7f3e4) *)
+Require Import Coq.Init.Notations.
+Set Universe Polymorphism.
+Generalizable All Variables.
+Record prod A B := pair { fst : A ; snd : B }.
+Arguments pair {_ _} _ _.
+Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
+Reserved Notation "x <-> y" (at level 95, no associativity).
+Reserved Notation "x = y" (at level 70, no associativity).
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+Open Scope type_scope.
+
+Definition iff A B := prod (A -> B) (B -> A).
+Infix "<->" := iff : type_scope.
+Inductive paths {A : Type@{i}} (a : A) : A -> Type@{i} := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Class Contr_internal (A : Type) := { center : A ; contr : (forall y : A, center
+= y) }.
+Inductive trunc_index : Type := minus_two | trunc_S (_ : trunc_index).
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type@{i}) : Type@{i} :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+Notation minus_one:=(trunc_S minus_two).
+Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc :
+IsTrunc_internal n A.
+Instance istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A) :
+IsTrunc n (x = y) := H x y.
+
+Axiom cheat : forall {A}, A.
+
+Lemma paths_lift (A : Type@{i}) (x y : A) (p : x = y) : paths@{j} x y.
+Proof.
+ destruct p. apply idpath.
+Defined.
+
+Lemma paths_change (A : Type@{i}) (x y : A) : paths@{j} x y = paths@{i} x y.
+Proof. (* require Univalence *)
+ apply cheat.
+Defined.
+
+Lemma IsTrunc_lift (n : trunc_index) :
+ forall (A : Type@{i}), IsTrunc_internal@{i} n A -> IsTrunc_internal@{j} n A.
+Proof.
+ induction n; simpl; intros.
+ destruct X. exists center0. intros. apply (paths_lift _ _ _ (contr0 y)).
+
+ rewrite paths_change.
+ apply IHn, X.
+Defined.
+
+Notation IsHProp := (IsTrunc minus_one).
+(* Record hProp := hp { hproptype :> Type ; isp : IsTrunc minus_one hproptype}. *)
+(* Make the truncation proof polymorphic, i.e., available at any level greater or equal
+ to the carrier type level j *)
+Record hProp := hp { hproptype :> Type@{j} ; isp : IsTrunc minus_one hproptype}.
+Axiom path_iff_hprop_uncurried : forall `{IsHProp A, IsHProp B}, (A <-> B) -> A
+= B.
+Inductive V : Type@{U'} := | set {A : Type@{U}} (f : A -> V) : V.
+Axiom is0trunc_V : IsTrunc (trunc_S (trunc_S minus_two)) V.
+Axiom bisimulation : V@{U' U} -> V@{U' U} -> hProp@{U'}.
+Axiom bisimulation_refl : forall (v : V), bisimulation v v.
+Axiom bisimulation_eq : forall (u v : V), bisimulation u v -> u = v.
+Notation "u ~~ v" := (bisimulation u v) (at level 30).
+Lemma bisimulation_equals_id : forall u v : V@{i j}, (u = v) = (u ~~ v).
+Proof.
+ intros u v.
+ refine (@path_iff_hprop_uncurried _ _ _ _ _).
+(* path_iff_hprop_uncurried : *)
+(* forall A : Type@{Top.74}, *)
+(* IsHProp A -> forall B : Type@{Top.74}, IsHProp B -> A <-> B -> A = B *)
+(* (* Top.74 *)
+(* Top.78 |= Top.74 < Top.78 *)
+(* *) *)
+
+ Show Universes.
+ exact (isp _).
+ split; intros. destruct X. apply bisimulation_refl.
+ apply bisimulation_eq, X.
+Defined.
diff --git a/test-suite/bugs/closed/3561.v b/test-suite/bugs/closed/3561.v
new file mode 100644
index 00000000..b4dfd17f
--- /dev/null
+++ b/test-suite/bugs/closed/3561.v
@@ -0,0 +1,23 @@
+(* File reduced by coq-bug-finder from original input, then from 6343 lines to 2362 lines, then from 2115 lines to 303 lines, then from 321 lines to 90 lines, then from 95 lines to 41 lines *)
+(* coqc version trunk (August 2014) compiled on Aug 31 2014 10:12:32 with OCaml 4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (437b91a3ffd7327975a129b95b24d3f66ad7f3e4) *)
+Set Primitive Projections.
+Set Implicit Arguments.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing).
+Lemma ap_transport {A} {P Q : A -> Type} {x y : A} (p : x = y) (f : forall x, P x -> Q x) (z : P x) :
+ f y (p # z) = (p # (f x z)).
+Proof. admit.
+Defined.
+Lemma foo A B (f : A * B -> A) : f = f.
+Admitted.
+Goal forall (H0 H2 : Type) x p,
+ @transport (prod H0 H2)
+ (fun GO : prod H0 H2 => x (fst GO)) = p.
+ intros.
+ match goal with
+ | [ |- context[x (?f _)] ] => set(foo':=f)
+ end. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3562.v b/test-suite/bugs/closed/3562.v
new file mode 100644
index 00000000..1a1410a3
--- /dev/null
+++ b/test-suite/bugs/closed/3562.v
@@ -0,0 +1,6 @@
+(* Should not be an anomaly as it was at some time in
+ September/October 2014 but some "Disjunctive/conjunctive
+ introduction pattern expected" error *)
+
+Theorem t: True.
+Fail destruct 0 as x.
diff --git a/test-suite/bugs/closed/3563.v b/test-suite/bugs/closed/3563.v
new file mode 100644
index 00000000..67972166
--- /dev/null
+++ b/test-suite/bugs/closed/3563.v
@@ -0,0 +1,38 @@
+(* File reduced by coq-bug-finder from original input, then from 11716 lines to 11295 lines, then from 10518 lines to 21 lines, then \
+from 37 lines to 21 lines *)
+(* coqc version trunk (August 2014) compiled on Aug 31 2014 10:12:32 with OCaml 4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (437b91a3ffd7327975a129b95b24d3f66ad7f3e4) *)
+Set Primitive Projections.
+Record prod A B := pair { fst : A ; snd : B }.
+Arguments pair {A B} _ _.
+Arguments fst {A B} _ / .
+Arguments snd {A B} _ / .
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Goal forall (H H0 H1 : Type) (H2 : H1) (H3 : H1 -> H * H0)
+ (H4 : (fun c : H1 => (fst (H3 c), snd (H3 c))%core) =
+ H3) (H5 : H -> Type) (H6 H7 : H5 (fst (H3 H2))),
+ transport (fun y : H1 -> H * H0 => H5 (fst (y H2))) H4 H6 = H7.
+ intros.
+ match goal with
+ | [ |- appcontext ctx [transport (fun y => (?g (@fst ?C ?h (y H2)))) H4 H6] ]
+ => set(foo:=h); idtac
+ end.
+ match goal with
+ | [ |- appcontext ctx [transport (fun y => (?g (fst (y H2))))] ]
+ => idtac
+ end.
+Abort.
+Goal forall (H H0 H1 : Type) (H2 : H1) (H3 : H1 -> (H1 -> H) * H0)
+ (H4 : (fun c : H1 => (fst (H3 c), snd (H3 c))%core) =
+ H3) (H5 : H -> Type) (H6 H7 : H5 (fst (H3 H2) H2)),
+ transport (fun y : H1 -> (H1 -> H) * H0 => H5 (fst (y H2) H2)) H4 H6 = H7.
+ intros.
+ match goal with
+ | [ |- appcontext ctx [transport (fun y => (?g (@fst ?C ?D (y H2) ?X)))] ]
+ => set(foo:=X)
+ end.
+(* Anomaly: Uncaught exception Not_found(_). Please report. *)
+
+(* Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/3566.v b/test-suite/bugs/closed/3566.v
new file mode 100644
index 00000000..b2aa8c3c
--- /dev/null
+++ b/test-suite/bugs/closed/3566.v
@@ -0,0 +1,22 @@
+Notation idmap := (fun x => x).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Delimit Scope path_scope with path.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z := match p, q with idpath, idpath => idpath end.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x := match p with idpath => idpath end.
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+Notation "p ^" := (inverse p) (at level 3, format "p '^'") : path_scope.
+Class IsEquiv {A B : Type} (f : A -> B) := {}.
+Axiom path_universe : forall {A B : Type} (f : A -> B) {feq : IsEquiv f}, (A = B).
+
+Definition Lift : Type@{i} -> Type@{j}
+ := Eval hnf in let lt := Type@{i} : Type@{j} in fun T => T.
+
+Definition lift {T} : T -> Lift T := fun x => x.
+
+Goal forall x y : Type, x = y.
+ intros.
+ pose proof ((fun H0 : idmap _ => (@path_universe _ _ (@lift x) (H0 x) @
+ (@path_universe _ _ (@lift x) (H0 x))^)))%path as H''.
diff --git a/test-suite/bugs/closed/3567.v b/test-suite/bugs/closed/3567.v
new file mode 100644
index 00000000..cb16b3ae
--- /dev/null
+++ b/test-suite/bugs/closed/3567.v
@@ -0,0 +1,68 @@
+
+(* File reduced by coq-bug-finder from original input, then from 2901 lines to 69 lines, then from 80 lines to 63 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 2 2014 2:7:1 with OCaml 4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (3c5daf4e23ee20f0788c0deab688af452e83ccf0) *)
+
+Set Primitive Projections.
+Set Implicit Arguments.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Arguments fst {A B} _ / .
+Arguments snd {A B} _ / .
+Add Printing Let prod.
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Unset Implicit Arguments.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) :=
+ { equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x) }.
+Definition path_prod_uncurried {A B : Type} (z z' : A * B) (pq : (fst z = fst z') * (snd z = snd z'))
+: (z = z')
+ := match fst pq in (_ = z'1), snd pq in (_ = z'2) return z = (z'1, z'2) with
+ | idpath, idpath => idpath
+ end.
+Definition path_prod {A B : Type} (z z' : A * B) :
+ (fst z = fst z') -> (snd z = snd z') -> (z = z')
+ := fun p q => path_prod_uncurried z z' (p,q).
+Definition path_prod' {A B : Type} {x x' : A} {y y' : B}
+: (x = x') -> (y = y') -> ((x,y) = (x',y'))
+ := fun p q => path_prod (x,y) (x',y') p q.
+Axiom ap_fst_path_prod : forall {A B : Type} {z z' : A * B}
+ (p : fst z = fst z') (q : snd z = snd z'),
+ ap fst (path_prod _ _ p q) = p.
+Axiom ap_snd_path_prod : forall {A B : Type} {z z' : A * B}
+ (p : fst z = fst z') (q : snd z = snd z'),
+ ap snd (path_prod _ _ p q) = q.
+Axiom eta_path_prod : forall {A B : Type} {z z' : A * B} (p : z = z'),
+ path_prod _ _(ap fst p) (ap snd p) = p.
+Definition isequiv_path_prod {A B : Type} {z z' : A * B} : IsEquiv (path_prod_uncurried z z').
+Proof.
+ refine (Build_IsEquiv
+ _ _ _
+ (fun r => (ap fst r, ap snd r))
+ eta_path_prod
+ (fun pq => match pq with
+ | (p,q) => path_prod'
+ (ap_fst_path_prod p q) (ap_snd_path_prod p q)
+ end) _).
+ destruct z as [x y], z' as [x' y']. simpl.
+(* Toplevel input, characters 15-50:
+Error: Abstracting over the term "z" leads to a term
+fun z0 : A * B =>
+forall x : (fst z0 = fst z') * (snd z0 = snd z'),
+eta_path_prod (path_prod_uncurried z0 z' x) =
+ap (path_prod_uncurried z0 z')
+ (let (p, q) as pq
+ return
+ ((ap (fst) (path_prod_uncurried z0 z' pq),
+ ap (snd) (path_prod_uncurried z0 z' pq)) = pq) := x in
+ path_prod' (ap_fst_path_prod p q) (ap_snd_path_prod p q))
+which is ill-typed.
+Reason is: Pattern-matching expression on an object of inductive type prod
+has invalid information.
+ *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3584.v b/test-suite/bugs/closed/3584.v
new file mode 100644
index 00000000..3d4660b4
--- /dev/null
+++ b/test-suite/bugs/closed/3584.v
@@ -0,0 +1,16 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Record sigT {A} (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+Definition eta_sigma {A} {P : A -> Type} (u : sigT P)
+ : existT _ (projT1 u) (projT2 u) = u
+ := match u with existT _ x y => eq_refl end. (* Toplevel input, characters 0-139:
+Error: Pattern-matching expression on an object of inductive type sigT
+has invalid information. *)
+Definition sum_of_sigT A B (x : sigT (fun b : bool => if b then A else B))
+: A + B
+ := match x with
+ | existT _ true a => inl a
+ | existT _ false b => inr b
+ end. (* Toplevel input, characters 0-182:
+Error: Pattern-matching expression on an object of inductive type sigT
+has invalid information. *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3593.v b/test-suite/bugs/closed/3593.v
new file mode 100644
index 00000000..25f9db6b
--- /dev/null
+++ b/test-suite/bugs/closed/3593.v
@@ -0,0 +1,10 @@
+Set Universe Polymorphism.
+Set Printing All.
+Set Implicit Arguments.
+Record prod A B := pair { fst : A ; snd : B }.
+Goal forall x : prod Set Set, let f := @fst _ in f _ x = @fst _ _ x.
+simpl; intros.
+ constr_eq (@fst Set Set x) (fst (A := Set) (B := Set) x).
+ Fail progress change (@fst Set Set x) with (fst (A := Set) (B := Set) x).
+ reflexivity.
+Qed.
diff --git a/test-suite/bugs/closed/3594.v b/test-suite/bugs/closed/3594.v
new file mode 100644
index 00000000..d1aae7b4
--- /dev/null
+++ b/test-suite/bugs/closed/3594.v
@@ -0,0 +1,51 @@
+(* File reduced by coq-bug-finder from original input, then from 8752 lines to 735 lines, then from 735 lines to 310 lines, then from 228 lines to 105 lines, then from 98 lines to 41 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 6 2014 6:15:6 with OCaml 4.01.0
+ coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (3ea6d6888105edd5139ae0a4d8f8ecdb586aff6c) *)
+Notation idmap := (fun x => x).
+Axiom path_forall : forall {A : Type} {P : A -> Type} (f g : forall x : A, P x), (forall x, f x = g x) -> f = g.
+Local Set Primitive Projections.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Bind Scope category_scope with PreCategory.
+Set Implicit Arguments.
+Delimit Scope functor_scope with functor.
+Record Functor (C D : PreCategory) := {}.
+Definition opposite (C : PreCategory) : PreCategory := @Build_PreCategory C (fun s d => morphism C d s).
+Notation "C ^op" := (opposite C) (at level 3, format "C '^op'") : category_scope.
+Definition oppositeF C D (F : Functor C D) : Functor C^op D^op := Build_Functor (C^op) (D^op).
+Local Notation "F ^op" := (oppositeF F) (at level 3, format "F ^op") : functor_scope.
+Axiom oppositeF_involutive : forall C D (F : Functor C D), ((F^op)^op)%functor = F.
+Local Open Scope functor_scope.
+Goal forall C D : PreCategory,
+ (fun c : Functor C^op D^op => (c^op)^op) = idmap.
+ intros.
+ exact (path_forall (fun F : Functor C^op D^op => (F^op)^op) _ (@oppositeF_involutive _ _)).
+ Undo.
+ Unset Printing Notations.
+ Set Debug Unification.
+(* Check (eq_refl : Build_PreCategory (opposite D).(object) *)
+(* (fun s d : (opposite D).(object) => *)
+(* (opposite D).(morphism) d s) = *)
+(* @Build_PreCategory D (fun s d => morphism D d s)). *)
+(* opposite D). *)
+ exact (path_forall (fun F => (F^op)^op) _ (@oppositeF_involutive _ _)).
+Qed.
+ (* Toplevel input, characters 22-101:
+Error:
+In environment
+C : PreCategory
+D : PreCategory
+The term
+ "path_forall
+ (fun F : Functor (opposite C) (opposite D) => oppositeF (oppositeF F))
+ (fun F : Functor (opposite C) (opposite D) => F)
+ (oppositeF_involutive (D:=opposite D))" has type
+ "eq (fun F : Functor (opposite C) (opposite D) => oppositeF (oppositeF F))
+ (fun F : Functor (opposite C) (opposite D) => F)"
+while it is expected to have type
+ "eq (fun c : Functor (opposite C) (opposite D) => oppositeF (oppositeF c))
+ (fun x : Functor (opposite C) (opposite D) => x)"
+(cannot unify "{|
+ object := opposite D;
+ morphism := fun s d : opposite D => morphism (opposite D) d s |}"
+and "opposite D").
+ *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3596.v b/test-suite/bugs/closed/3596.v
new file mode 100644
index 00000000..d6c1c949
--- /dev/null
+++ b/test-suite/bugs/closed/3596.v
@@ -0,0 +1,18 @@
+Set Implicit Arguments.
+Record foo := { fx : nat }.
+Set Primitive Projections.
+Record bar := { bx : nat }.
+Definition Foo (f : foo) : f = f.
+ destruct f as [fx]; destruct fx; admit.
+Defined.
+Definition Bar (b : bar) : b = b.
+ destruct b as [fx]; destruct fx; admit.
+Defined.
+Goal forall f b, Bar b = Bar b -> Foo f = Foo f.
+ intros f b.
+ destruct f, b.
+ simpl.
+ Fail progress unfold Bar. (* success *)
+ Fail progress unfold Foo. (* failed to progress *)
+ reflexivity.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3616.v b/test-suite/bugs/closed/3616.v
new file mode 100644
index 00000000..68870026
--- /dev/null
+++ b/test-suite/bugs/closed/3616.v
@@ -0,0 +1,3 @@
+(* Was failing from April 2014 to September 2014 because of injection *)
+Goal forall P e es t, (e :: es = existT P tt t :: es)%list -> True.
+inversion 1.
diff --git a/test-suite/bugs/closed/3618.v b/test-suite/bugs/closed/3618.v
new file mode 100644
index 00000000..dc560ad5
--- /dev/null
+++ b/test-suite/bugs/closed/3618.v
@@ -0,0 +1,103 @@
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Notation "x = y" := (@paths _ x y) : type_scope.
+Definition concat {A} {x y z : A} : x = y -> y = z -> x = z. Admitted.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x. Admitted.
+Notation "p @ q" := (concat p q) (at level 20).
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y. Admitted.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y. Admitted.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : forall x, f (equiv_inv x) = x;
+ eissect : forall x, equiv_inv (f x) = x
+}.
+
+Class Contr_internal (A : Type).
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+Definition istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A)
+: IsTrunc n (x = y).
+Admitted.
+
+Hint Extern 4 (IsTrunc _ (_ = _)) => eapply @istrunc_paths : typeclass_instances.
+
+Class Funext.
+
+Instance isequiv_compose A B C f g `{IsEquiv A B f} `{IsEquiv B C g}
+ : IsEquiv (compose g f) | 1000.
+Admitted.
+
+Section IsEquivHomotopic.
+ Context (A B : Type) `(f : A -> B) `(g : A -> B) `{IsEquiv A B f} (h : forall x:A, f x = g x).
+ Let sect := (fun b:B => inverse (h (@equiv_inv _ _ f _ b)) @ @eisretr _ _ f _ b).
+ Let retr := (fun a:A => inverse (ap (@equiv_inv _ _ f _) (h a)) @ @eissect _ _ f _ a).
+ Global Instance isequiv_homotopic : IsEquiv g | 10000
+ := ( BuildIsEquiv _ _ g (@equiv_inv _ _ f _) sect retr).
+End IsEquivHomotopic.
+
+Instance trunc_succ A n `{IsTrunc n A} : IsTrunc (trunc_S n) A | 1000. Admitted.
+
+Global Instance trunc_forall A n `{P : A -> Type} `{forall a, IsTrunc n (P a)}
+ : IsTrunc n (forall a, P a) | 100.
+Admitted.
+
+Instance trunc_prod A B n `{IsTrunc n A} `{IsTrunc n B} : IsTrunc n (A * B) | 100.
+Admitted.
+
+Global Instance trunc_arrow n {A B : Type} `{IsTrunc n B} : IsTrunc n (A -> B) | 100.
+Admitted.
+
+Instance isequiv_pr1_contr {A} {P : A -> Type} `{forall a, IsTrunc minus_two (P a)}
+: IsEquiv (@projT1 A P) | 100.
+Admitted.
+
+Instance trunc_sigma n A `{P : A -> Type} `{IsTrunc n A} `{forall a, IsTrunc n (P a)}
+: IsTrunc n (sigT P) | 100.
+Admitted.
+
+Global Instance trunc_trunc `{Funext} A m n : IsTrunc (trunc_S n) (IsTrunc m A) | 0.
+Admitted.
+
+Definition BiInv {A B} (f : A -> B) : Type
+:= ( {g : B -> A & forall x, g (f x) = x} * {h : B -> A & forall x, f (h x) = x}).
+
+Global Instance isprop_biinv {A B} (f : A -> B) : IsTrunc (trunc_S minus_two) (BiInv f) | 0.
+Admitted.
+
+Instance isequiv_path {A B : Type} (p : A = B)
+: IsEquiv (transport (fun X:Type => X) p) | 0.
+Admitted.
+
+Class ReflectiveSubuniverse_internal :=
+ { inO_internal : Type -> Type ;
+ O : Type -> Type ;
+ O_unit : forall T, T -> O T }.
+
+Class ReflectiveSubuniverse :=
+ ReflectiveSubuniverse_wrap : Funext -> ReflectiveSubuniverse_internal.
+Global Existing Instance ReflectiveSubuniverse_wrap.
+
+Class inO {fs : Funext} {subU : ReflectiveSubuniverse} (T : Type) :=
+ isequiv_inO : inO_internal T.
+
+Global Instance hprop_inO {fs : Funext} {subU : ReflectiveSubuniverse} (T : Type) : IsTrunc (trunc_S minus_two) (inO T) .
+Admitted.
+
+(* To avoid looping class resolution *)
+Hint Mode IsEquiv - - + : typeclass_instances.
+
+Fail Definition equiv_O_rectnd {fs : Funext} {subU : ReflectiveSubuniverse}
+ (P Q : Type) {Q_inO : inO_internal Q}
+: IsEquiv (fun f : O P -> P => compose f (O_unit P)) := _. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3623.v b/test-suite/bugs/closed/3623.v
new file mode 100644
index 00000000..202b9001
--- /dev/null
+++ b/test-suite/bugs/closed/3623.v
@@ -0,0 +1,4 @@
+Require Import List.
+Goal (1 :: 2 :: nil) ++ (3::nil) = (1::2::3::nil).
+change (@app nat (?a :: ?b) ?c) with (a :: @app nat b c).
+Abort.
diff --git a/test-suite/bugs/closed/3624.v b/test-suite/bugs/closed/3624.v
new file mode 100644
index 00000000..a05d5eb2
--- /dev/null
+++ b/test-suite/bugs/closed/3624.v
@@ -0,0 +1,11 @@
+Set Implicit Arguments.
+Module NonPrim.
+ Class foo (m : Set) := { pf : m = m }.
+ Notation pf' m := (pf (m := m)).
+End NonPrim.
+
+Module Prim.
+ Set Primitive Projections.
+ Class foo (m : Set) := { pf : m = m }.
+ Notation pf' m := (pf (m:=m)). (* Wrong argument name: m. *)
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3625.v b/test-suite/bugs/closed/3625.v
new file mode 100644
index 00000000..3d30b62f
--- /dev/null
+++ b/test-suite/bugs/closed/3625.v
@@ -0,0 +1,11 @@
+Set Implicit Arguments.
+Set Primitive Projections.
+Record prod A B := pair { fst : A ; snd : B }.
+
+Goal forall x y : prod Set Set, x.(@fst _ _) = y.(@fst _ _).
+ intros.
+ refine (f_equal _ _).
+ Undo.
+ apply f_equal.
+ admit.
+Qed.
diff --git a/test-suite/bugs/closed/3628.v b/test-suite/bugs/closed/3628.v
new file mode 100644
index 00000000..4001cf7c
--- /dev/null
+++ b/test-suite/bugs/closed/3628.v
@@ -0,0 +1,9 @@
+Module NonPrim.
+ Class AClass := { x : Set }.
+ Arguments x {AClass}.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Class AClass := { x : Set }.
+ Arguments x {AClass}.
+End Prim.
diff --git a/test-suite/bugs/closed/3633.v b/test-suite/bugs/closed/3633.v
new file mode 100644
index 00000000..6a952377
--- /dev/null
+++ b/test-suite/bugs/closed/3633.v
@@ -0,0 +1,10 @@
+Set Typeclasses Strict Resolution.
+Class Contr (A : Type) := { center : A }.
+Definition foo {A} `{Contr A} : A.
+Proof.
+ apply center.
+ Undo.
+ (* Ensure the constraints are solved independently, otherwise a frozen ?A
+ makes a search for Contr ?A fail when finishing to apply (fun x => x) *)
+ apply (fun x => x), center.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3637.v b/test-suite/bugs/closed/3637.v
new file mode 100644
index 00000000..868f45c8
--- /dev/null
+++ b/test-suite/bugs/closed/3637.v
@@ -0,0 +1,11 @@
+
+Set Implicit Arguments.
+Set Primitive Projections.
+Record prod A B := pair { fst : A ; snd : B }.
+Goal forall x y : prod Set Set, fst x = fst y.
+ intros.
+ lazymatch goal with
+ | [ |- context[@fst ?A ?B] ] => pose (@fst A B) as fst';
+ progress change (@fst Set Set) with fst'
+end.
+Abort.
diff --git a/test-suite/bugs/closed/3638.v b/test-suite/bugs/closed/3638.v
new file mode 100644
index 00000000..70144174
--- /dev/null
+++ b/test-suite/bugs/closed/3638.v
@@ -0,0 +1,25 @@
+(* File reduced by coq-bug-finder from original input, then from 7593 lines to 243 lines, then from 256 lines to 102 lines, then from 104 lines to 28 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 17 2014 0:22:30 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (d34e1eed232c84590ddb80d70db9f7f7cf13584a) *)
+Set Primitive Projections.
+Set Implicit Arguments.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Class UnitSubuniverse := { O : Type -> Type ; O_unit : forall T, T -> O T }.
+Class ReflectiveSubuniverse := { rsubu_usubu : UnitSubuniverse ; O_rectnd : forall {P Q : Type} (f : P -> Q), O P -> Q }.
+Global Existing Instance rsubu_usubu.
+Context {subU : ReflectiveSubuniverse}.
+Goal forall (A B : Type) (x : O A * O B) (x0 : B),
+ { g : _ & O_rectnd (fun z : A * B => (O_unit (fst z), O_unit (snd z)))
+ (O_rectnd (fun a : A => O_unit (a, x0)) (fst x)) =
+ g x0 }.
+ eexists.
+ Show Existentials. Set Printing Existential Instances.
+ match goal with
+ | [ |- context[?e] ] => is_evar e; let e' := fresh "e'" in set (e' := e)
+ end.
+
+
+(* Toplevel input, characters 15-114:
+Anomaly: Bad recursive type. Please report. *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3640.v b/test-suite/bugs/closed/3640.v
new file mode 100644
index 00000000..bdbfbb15
--- /dev/null
+++ b/test-suite/bugs/closed/3640.v
@@ -0,0 +1,31 @@
+(* File reduced by coq-bug-finder from original input, then from 14990 lines to 70 lines, then from 44 lines to 29 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 17 2014 0:22:30 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (d34e1eed232c84590ddb80d70db9f7f7cf13584a) *)
+Set Primitive Projections.
+Set Implicit Arguments.
+Record sigT {A} P := existT { pr1 : A ; pr2 : P pr1 }.
+Notation "{ x : A & P }" := (sigT (A := A) (fun x : A => P)) : type_scope.
+Notation "x .1" := (pr1 x) (at level 3, format "x '.1'").
+Notation "x .2" := (pr2 x) (at level 3, format "x '.2'").
+Record Equiv A B := { equiv_fun :> A -> B }.
+Notation "A <~> B" := (Equiv A B) (at level 85).
+Inductive Bool : Type := true | false.
+Definition negb (b : Bool) := if b then false else true.
+Axiom eval_bool_isequiv : forall (f : Bool -> Bool), f false = negb (f true).
+Lemma bool_map_equiv_not_idmap (f : { f : Bool <~> Bool & ~(forall x, f x = x) })
+: forall b, ~(f.1 b = b).
+Proof.
+ intro b.
+ intro H''.
+ apply f.2.
+ intro b'.
+ pose proof (eval_bool_isequiv f.1) as H.
+ destruct b', b.
+ Fail match type of H with
+ | _ = negb (f.1 true) => fail 1 "no f.1 true"
+ end. (* Error: No matching clauses for match. *)
+ destruct (f.1 true).
+ simpl in *.
+ Fail match type of H with
+ | _ = negb ?T => unify T (f.1 true); fail 1 "still has f.1 true"
+ end. (* Error: Tactic failure: still has f.1 true. *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3641.v b/test-suite/bugs/closed/3641.v
new file mode 100644
index 00000000..f47f64ea
--- /dev/null
+++ b/test-suite/bugs/closed/3641.v
@@ -0,0 +1,21 @@
+(* File reduced by coq-bug-finder from original input, then from 7593 lines to 243 lines, then from 256 lines to 102 lines, then from\
+ 104 lines to 28 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 17 2014 0:22:30 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (d34e1eed232c84590ddb80d70db9f7f7cf13584a) *)
+Set Implicit Arguments.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Class UnitSubuniverse := { O : Type -> Type ; O_unit : forall T, T -> O T }.
+Class ReflectiveSubuniverse := { rsubu_usubu : UnitSubuniverse ; O_rectnd : forall {P Q : Type} (f : P -> Q), O P -> Q }.
+Global Existing Instance rsubu_usubu.
+Context {subU : ReflectiveSubuniverse}.
+Goal forall (A B : Type) (x : O A * O B) (x0 : B),
+ { g : _ & O_rectnd (fun z : A * B => (O_unit (fst z), O_unit (snd z)))
+ (O_rectnd (fun a : A => O_unit (a, x0)) (fst x)) =
+ g x0 }.
+ eexists.
+ match goal with
+ | [ |- context[?e] ] => is_evar e; let e' := fresh "e'" in pose (e' := e)
+ end.
+ Fail change ?g with e'. (* Stack overflow *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3647.v b/test-suite/bugs/closed/3647.v
new file mode 100644
index 00000000..cd542c8a
--- /dev/null
+++ b/test-suite/bugs/closed/3647.v
@@ -0,0 +1,652 @@
+Require Coq.Setoids.Setoid.
+
+Axiom BITS : nat -> Set.
+Definition n7 := 7.
+Definition n15 := 15.
+Definition n31 := 31.
+Notation n8 := (S n7).
+Notation n16 := (S n15).
+Notation n32 := (S n31).
+Inductive OpSize := OpSize1 | OpSize2 | OpSize4 .
+Definition VWORD s := BITS (match s with OpSize1 => n8 | OpSize2 => n16 | OpSize4 => n32 end).
+Definition BYTE := VWORD OpSize1.
+Definition WORD := VWORD OpSize2.
+Definition DWORD := VWORD OpSize4.
+Ltac subst_body :=
+ repeat match goal with
+ | [ H := _ |- _ ] => subst H
+ end.
+Import Coq.Setoids.Setoid.
+Class Equiv (A : Type) := equiv : relation A.
+Infix "===" := equiv (at level 70, no associativity).
+Class type (A : Type) {e : Equiv A} := eq_equiv : Equivalence equiv.
+Definition setoid_resp {T T'} (f : T -> T') `{e : type T} `{e' : type T'} := forall x y, x === y -> f x === f y.
+Record morphism T T' `{e : type T} `{e' : type T'} :=
+ mkMorph {
+ morph :> T -> T';
+ morph_resp : setoid_resp morph}.
+Implicit Arguments mkMorph [T T' e e0 e' e1].
+Infix "-s>" := morphism (at level 45, right associativity).
+Section Morphisms.
+ Context {S T U V} `{eS : type S} `{eT : type T} `{eU : type U} `{eV : type V}.
+ Global Instance morph_equiv : Equiv (S -s> T).
+ admit.
+ Defined.
+
+ Global Instance morph_type : type (S -s> T).
+ admit.
+ Defined.
+
+ Program Definition mcomp (f: T -s> U) (g: S -s> T) : (S -s> U) :=
+ mkMorph (fun x => f (g x)) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End Morphisms.
+
+Infix "<<" := mcomp (at level 35).
+
+Section MorphConsts.
+ Context {S T U V} `{eS : type S} `{eT : type T} `{eU : type U} `{eV : type V}.
+
+ Definition lift2s (f : S -> T -> U) p q : (S -s> T -s> U) :=
+ mkMorph (fun x => mkMorph (f x) (p x)) q.
+
+End MorphConsts.
+Instance Equiv_PropP : Equiv Prop.
+admit.
+Defined.
+
+Section SetoidProducts.
+ Context {A B : Type} `{eA : type A} `{eB : type B}.
+ Global Instance Equiv_prod : Equiv (A * B).
+ admit.
+ Defined.
+
+ Global Instance type_prod : type (A * B).
+ admit.
+ Defined.
+
+ Program Definition mfst : (A * B) -s> A :=
+ mkMorph (fun p => fst p) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition msnd : (A * B) -s> B :=
+ mkMorph (fun p => snd p) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Context {C} `{eC : type C}.
+
+ Program Definition mprod (f: C -s> A) (g: C -s> B) : C -s> (A * B) :=
+ mkMorph (fun c => (f c, g c)) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End SetoidProducts.
+
+Section IndexedProducts.
+
+ Record ttyp := {carr :> Type; eqc : Equiv carr; eqok : type carr}.
+ Global Instance ttyp_proj_eq {A : ttyp} : Equiv A.
+ admit.
+ Defined.
+ Global Instance ttyp_proj_prop {A : ttyp} : type A.
+ admit.
+ Defined.
+ Context {I : Type} {P : I -> ttyp}.
+
+ Global Program Instance Equiv_prodI : Equiv (forall i, P i) :=
+ fun p p' : forall i, P i => (forall i : I, @equiv _ (eqc _) (p i) (p' i)).
+
+ Global Instance type_prodI : type (forall i, P i).
+ admit.
+ Defined.
+
+ Program Definition mprojI (i : I) : (forall i, P i) -s> P i :=
+ mkMorph (fun X => X i) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Context {C : Type} `{eC : type C}.
+
+ Program Definition mprodI (f : forall i, C -s> P i) : C -s> (forall i, P i) :=
+ mkMorph (fun c i => f i c) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End IndexedProducts.
+
+Section Exponentials.
+
+ Context {A B C D} `{eA : type A} `{eB : type B} `{eC : type C} `{eD : type D}.
+
+ Program Definition comps : (B -s> C) -s> (A -s> B) -s> A -s> C :=
+ lift2s (fun f g => f << g) _ _.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition muncurry (f : A -s> B -s> C) : A * B -s> C :=
+ mkMorph (fun p => f (fst p) (snd p)) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition mcurry (f : A * B -s> C) : A -s> B -s> C :=
+ lift2s (fun a b => f (a, b)) _ _.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition meval : (B -s> A) * B -s> A :=
+ mkMorph (fun p => fst p (snd p)) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition mid : A -s> A := mkMorph (fun x => x) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition mconst (b : B) : A -s> B := mkMorph (fun _ => b) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End Exponentials.
+
+Inductive empty : Set := .
+Instance empty_Equiv : Equiv empty.
+admit.
+Defined.
+Instance empty_type : type empty.
+admit.
+Defined.
+
+Section Initials.
+ Context {A} `{eA : type A}.
+
+ Program Definition mzero_init : empty -s> A := mkMorph (fun x => match x with end) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End Initials.
+
+Section Subsetoid.
+
+ Context {A} `{eA : type A} {P : A -> Prop}.
+ Global Instance subset_Equiv : Equiv {a : A | P a}.
+ admit.
+ Defined.
+ Global Instance subset_type : type {a : A | P a}.
+ admit.
+ Defined.
+
+ Program Definition mforget : {a : A | P a} -s> A :=
+ mkMorph (fun x => x) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Context {B} `{eB : type B}.
+ Program Definition minherit (f : B -s> A) (HB : forall b, P (f b)) : B -s> {a : A | P a} :=
+ mkMorph (fun b => exist P (f b) (HB b)) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End Subsetoid.
+
+Section Option.
+
+ Context {A} `{eA : type A}.
+ Global Instance option_Equiv : Equiv (option A).
+ admit.
+ Defined.
+
+ Global Instance option_type : type (option A).
+ admit.
+ Defined.
+
+End Option.
+
+Section OptDefs.
+ Context {A B} `{eA : type A} `{eB : type B}.
+
+ Program Definition msome : A -s> option A := mkMorph (fun a => Some a) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+ Program Definition moptionbind (f : A -s> option B) : option A -s> option B :=
+ mkMorph (fun oa => match oa with None => None | Some a => f a end) _.
+ Next Obligation.
+ admit.
+ Defined.
+
+End OptDefs.
+
+Generalizable Variables Frm.
+
+Class ILogicOps Frm := {
+ lentails: relation Frm;
+ ltrue: Frm;
+ lfalse: Frm;
+ limpl: Frm -> Frm -> Frm;
+ land: Frm -> Frm -> Frm;
+ lor: Frm -> Frm -> Frm;
+ lforall: forall {T}, (T -> Frm) -> Frm;
+ lexists: forall {T}, (T -> Frm) -> Frm
+ }.
+
+Infix "|--" := lentails (at level 79, no associativity).
+Infix "//\\" := land (at level 75, right associativity).
+Infix "\\//" := lor (at level 76, right associativity).
+Infix "-->>" := limpl (at level 77, right associativity).
+Notation "'Forall' x .. y , p" :=
+ (lforall (fun x => .. (lforall (fun y => p)) .. )) (at level 78, x binder, y binder, right associativity).
+Notation "'Exists' x .. y , p" :=
+ (lexists (fun x => .. (lexists (fun y => p)) .. )) (at level 78, x binder, y binder, right associativity).
+
+Class ILogic Frm {ILOps: ILogicOps Frm} := {
+ lentailsPre:> PreOrder lentails;
+ ltrueR: forall C, C |-- ltrue;
+ lfalseL: forall C, lfalse |-- C;
+ lforallL: forall T x (P: T -> Frm) C, P x |-- C -> lforall P |-- C;
+ lforallR: forall T (P: T -> Frm) C, (forall x, C |-- P x) -> C |-- lforall P;
+ lexistsL: forall T (P: T -> Frm) C, (forall x, P x |-- C) -> lexists P |-- C;
+ lexistsR: forall T x (P: T -> Frm) C, C |-- P x -> C |-- lexists P;
+ landL1: forall P Q C, P |-- C -> P //\\ Q |-- C;
+ landL2: forall P Q C, Q |-- C -> P //\\ Q |-- C;
+ lorR1: forall P Q C, C |-- P -> C |-- P \\// Q;
+ lorR2: forall P Q C, C |-- Q -> C |-- P \\// Q;
+ landR: forall P Q C, C |-- P -> C |-- Q -> C |-- P //\\ Q;
+ lorL: forall P Q C, P |-- C -> Q |-- C -> P \\// Q |-- C;
+ landAdj: forall P Q C, C |-- (P -->> Q) -> C //\\ P |-- Q;
+ limplAdj: forall P Q C, C //\\ P |-- Q -> C |-- (P -->> Q)
+ }.
+Hint Extern 0 (?x |-- ?x) => reflexivity.
+
+Section ILogicExtra.
+ Context `{IL: ILogic Frm}.
+ Definition lpropand (p: Prop) Q := Exists _: p, Q.
+ Definition lpropimpl (p: Prop) Q := Forall _: p, Q.
+
+End ILogicExtra.
+
+Infix "/\\" := lpropand (at level 75, right associativity).
+Infix "->>" := lpropimpl (at level 77, right associativity).
+
+Section ILogic_Fun.
+ Context (T: Type) `{TType: type T}.
+ Context `{IL: ILogic Frm}.
+
+ Record ILFunFrm := mkILFunFrm {
+ ILFunFrm_pred :> T -> Frm;
+ ILFunFrm_closed: forall t t': T, t === t' ->
+ ILFunFrm_pred t |-- ILFunFrm_pred t'
+ }.
+
+ Notation "'mk'" := @mkILFunFrm.
+
+ Program Definition ILFun_Ops : ILogicOps ILFunFrm := {|
+ lentails P Q := forall t:T, P t |-- Q t;
+ ltrue := mk (fun t => ltrue) _;
+ lfalse := mk (fun t => lfalse) _;
+ limpl P Q := mk (fun t => P t -->> Q t) _;
+ land P Q := mk (fun t => P t //\\ Q t) _;
+ lor P Q := mk (fun t => P t \\// Q t) _;
+ lforall A P := mk (fun t => Forall a, P a t) _;
+ lexists A P := mk (fun t => Exists a, P a t) _
+ |}.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+
+End ILogic_Fun.
+
+Implicit Arguments ILFunFrm [[ILOps] [e]].
+Implicit Arguments mkILFunFrm [T Frm ILOps].
+
+Program Definition ILFun_eq {T R} {ILOps: ILogicOps R} {ILogic: ILogic R} (P : T -> R) :
+ @ILFunFrm T _ R ILOps :=
+ @mkILFunFrm T eq R ILOps P _.
+Next Obligation.
+ admit.
+Defined.
+
+Instance ILogicOps_Prop : ILogicOps Prop | 2 := {|
+ lentails P Q := (P : Prop) -> Q;
+ ltrue := True;
+ lfalse := False;
+ limpl P Q := P -> Q;
+ land P Q := P /\ Q;
+ lor P Q := P \/ Q;
+ lforall T F := forall x:T, F x;
+ lexists T F := exists x:T, F x
+ |}.
+
+Instance ILogic_Prop : ILogic Prop.
+admit.
+Defined.
+
+Section FunEq.
+ Context A `{eT: type A}.
+
+ Global Instance FunEquiv {T} : Equiv (T -> A) := {
+ equiv P Q := forall a, P a === Q a
+ }.
+End FunEq.
+
+Section SepAlgSect.
+ Class SepAlgOps T `{eT : type T}:= {
+ sa_unit : T;
+
+ sa_mul : T -> T -> T -> Prop
+ }.
+
+ Class SepAlg T `{SAOps: SepAlgOps T} : Type := {
+ sa_mul_eqL a b c d : sa_mul a b c -> c === d -> sa_mul a b d;
+ sa_mul_eqR a b c d : sa_mul a b c -> sa_mul a b d -> c === d;
+ sa_mon a b c : a === b -> sa_mul a c === sa_mul b c;
+ sa_mulC a b : sa_mul a b === sa_mul b a;
+ sa_mulA a b c : forall bc abc, sa_mul a bc abc -> sa_mul b c bc ->
+ exists ac, sa_mul b ac abc /\ sa_mul a c ac;
+ sa_unitI a : sa_mul a sa_unit a
+ }.
+
+End SepAlgSect.
+
+Section BILogic.
+
+ Class BILOperators (A : Type) := {
+ empSP : A;
+ sepSP : A -> A -> A;
+ wandSP : A -> A -> A
+ }.
+
+End BILogic.
+
+Notation "a '**' b" := (sepSP a b)
+ (at level 75, right associativity).
+
+Section BISepAlg.
+ Context {A} `{sa : SepAlg A}.
+ Context {B} `{IL: ILogic B}.
+
+ Program Instance SABIOps: BILOperators (ILFunFrm A B) := {
+ empSP := mkILFunFrm e (fun x => sa_unit === x /\\ ltrue) _;
+ sepSP P Q := mkILFunFrm e (fun x => Exists x1, Exists x2, sa_mul x1 x2 x /\\
+ P x1 //\\ Q x2) _;
+ wandSP P Q := mkILFunFrm e (fun x => Forall x1, Forall x2, sa_mul x x1 x2 ->>
+ P x1 -->> Q x2) _
+ }.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+ Next Obligation.
+ admit.
+ Defined.
+
+End BISepAlg.
+
+Set Implicit Arguments.
+
+Definition Chan := WORD.
+Definition Data := BYTE.
+
+Inductive Action :=
+| Out (c:Chan) (d:Data)
+| In (c:Chan) (d:Data).
+
+Definition Actions := list Action.
+
+Instance ActionsEquiv : Equiv Actions := {
+ equiv a1 a2 := a1 = a2
+ }.
+
+Definition OPred := ILFunFrm Actions Prop.
+Definition mkOPred (P : Actions -> Prop) : OPred.
+ admit.
+Defined.
+
+Definition eq_opred s := mkOPred (fun s' => s === s').
+Definition empOP : OPred.
+ exact (eq_opred nil).
+Defined.
+Definition catOP (P Q: OPred) : OPred.
+ admit.
+Defined.
+
+Class IsPointed (T : Type) := point : T.
+
+Generalizable All Variables.
+
+Notation IsPointed_OPred P := (IsPointed (exists x : Actions, (P : OPred) x)).
+
+Record PointedOPred := mkPointedOPred {
+ OPred_pred :> OPred;
+ OPred_inhabited: IsPointed_OPred OPred_pred
+ }.
+
+Existing Instance OPred_inhabited.
+
+Canonical Structure default_PointedOPred O `{IsPointed_OPred O} : PointedOPred
+ := {| OPred_pred := O ; OPred_inhabited := _ |}.
+Instance IsPointed_eq_opred x : IsPointed_OPred (eq_opred x).
+admit.
+Defined.
+Instance IsPointed_catOP `{IsPointed_OPred P, IsPointed_OPred Q} : IsPointed_OPred (catOP P Q).
+admit.
+Defined.
+
+Definition Flag := BITS 5.
+Definition OF: Flag.
+ admit.
+Defined.
+
+Inductive FlagVal := mkFlag (b: bool) | FlagUnspecified.
+Coercion mkFlag : bool >-> FlagVal.
+Inductive NonSPReg := EAX | EBX | ECX | EDX | ESI | EDI | EBP.
+
+Inductive Reg := nonSPReg (r: NonSPReg) | ESP.
+
+Inductive AnyReg := regToAnyReg (r: Reg) | EIP.
+
+Inductive BYTEReg := AL|BL|CL|DL|AH|BH|CH|DH.
+
+Inductive WORDReg := mkWordReg (r:Reg).
+Definition PState : Type.
+admit.
+Defined.
+
+Instance PStateEquiv : Equiv PState.
+admit.
+Defined.
+
+Instance PStateType : type PState.
+admit.
+Defined.
+
+Instance PStateSepAlgOps: SepAlgOps PState.
+admit.
+Defined.
+Definition SPred : Type.
+exact (ILFunFrm PState Prop).
+Defined.
+
+Local Existing Instance ILFun_Ops.
+Local Existing Instance SABIOps.
+Axiom BYTEregIs : BYTEReg -> BYTE -> SPred.
+
+Inductive RegOrFlag :=
+| RegOrFlagDWORD :> AnyReg -> RegOrFlag
+| RegOrFlagWORD :> WORDReg -> RegOrFlag
+| RegOrFlagBYTE :> BYTEReg -> RegOrFlag
+| RegOrFlagF :> Flag -> RegOrFlag.
+
+Definition RegOrFlag_target rf :=
+ match rf with
+ | RegOrFlagDWORD _ => DWORD
+ | RegOrFlagWORD _ => WORD
+ | RegOrFlagBYTE _ => BYTE
+ | RegOrFlagF _ => FlagVal
+ end.
+
+Inductive Condition :=
+| CC_O | CC_B | CC_Z | CC_BE | CC_S | CC_P | CC_L | CC_LE.
+
+Section ILSpecSect.
+
+ Axiom spec : Type.
+ Global Instance ILOps: ILogicOps spec | 2.
+ admit.
+ Defined.
+
+End ILSpecSect.
+
+Axiom parameterized_basic : forall {T_OPred} {proj : T_OPred -> OPred} {T} (P : SPred) (c : T) (O : OPred) (Q : SPred), spec.
+Global Notation loopy_basic := (@parameterized_basic PointedOPred OPred_pred _).
+
+Axiom program : Type.
+
+Axiom ConditionIs : forall (cc : Condition) (cv : RegOrFlag_target OF), SPred.
+
+Axiom foldl : forall {T R}, (R -> T -> R) -> R -> list T -> R.
+Axiom nth : forall {T}, T -> list T -> nat -> T.
+Axiom while : forall (ptest: program)
+ (cond: Condition) (value: bool)
+ (pbody: program), program.
+
+Lemma while_rule_ind {quantT}
+ {ptest} {cond : Condition} {value : bool} {pbody}
+ {S}
+ {transition_body : quantT -> quantT}
+ {P : quantT -> SPred} {Otest : quantT -> OPred} {Obody : quantT -> OPred} {O : quantT -> PointedOPred}
+ {O_after_test : quantT -> PointedOPred}
+ {I_state : quantT -> bool -> SPred}
+ {I_logic : quantT -> bool -> bool}
+ {Q : quantT -> SPred}
+ (Htest : S |-- (Forall (x : quantT),
+ (loopy_basic (P x)
+ ptest
+ (Otest x)
+ (Exists b, I_logic x b = true /\\ I_state x b ** ConditionIs cond b))))
+ (Hbody : S |-- (Forall (x : quantT),
+ (loopy_basic (I_logic x value = true /\\ I_state x value ** ConditionIs cond value)
+ pbody
+ (Obody x)
+ (P (transition_body x)))))
+ (H_after_test : forall x, catOP (Otest x) (O_after_test x) |-- O x)
+ (H_body_after_test : forall x, I_logic x value = true -> catOP (Obody x) (O (transition_body x)) |-- O_after_test x)
+ (H_empty : forall x, I_logic x (negb value) = true -> empOP |-- O_after_test x)
+ (Q_correct : forall x, I_logic x (negb value) = true /\\ I_state x (negb value) ** ConditionIs cond (negb value) |-- Q x)
+ (Q_safe : forall x, I_logic x value = true -> Q (transition_body x) |-- Q x)
+: S |-- (Forall (x : quantT),
+ loopy_basic (P x)
+ (while ptest cond value pbody)
+ (O x)
+ (Q x)).
+admit.
+Defined.
+Axiom behead : forall {T}, list T -> list T.
+Axiom all : forall {T}, (T -> bool) -> list T -> bool.
+Axiom all_behead : forall {T} (xs : list T) P, all P xs = true -> all P (behead xs) = true.
+Instance IsPointed_foldlOP A B C f g (init : A * B) `{IsPointed_OPred (g init)}
+ `{forall a acc, IsPointed_OPred (g acc) -> IsPointed_OPred (g (f acc a))}
+ (ls : list C)
+: IsPointed_OPred (g (foldl f init ls)).
+admit.
+Defined.
+Goal forall (ptest : program) (cond : Condition) (value : bool)
+ (pbody : program) (T ioT : Type) (P : T -> SPred)
+ (I : T -> bool -> SPred) (accumulate : T -> ioT -> T)
+ (Otest Obody : T -> ioT -> PointedOPred)
+ (coq_test__is_finished : ioT -> bool) (S : spec)
+ (al : BYTE),
+ (forall (initial : T) (xs : list ioT) (x : ioT),
+ all (fun t : ioT => negb (coq_test__is_finished t)) xs = true ->
+ coq_test__is_finished x = true ->
+ S
+ |-- loopy_basic (P initial ** BYTEregIs AL al) ptest
+ (Otest initial (nth x xs 0))
+ (I initial
+ (match coq_test__is_finished (nth x xs 0) with true => negb value | false => value end) **
+ ConditionIs cond
+ (match coq_test__is_finished (nth x xs 0) with true => negb value | false => value end))) ->
+ (forall (initial : T) (xs : list ioT) (x : ioT),
+ all (fun t : ioT => negb (coq_test__is_finished t)) xs = true ->
+ xs <> nil ->
+ coq_test__is_finished x = true ->
+ S
+ |-- loopy_basic (I initial value ** ConditionIs cond value) pbody
+ (Obody initial (nth x xs 0))
+ (P (accumulate initial (nth x xs 0)) ** BYTEregIs AL al)) ->
+ forall x : ioT,
+ coq_test__is_finished x = true ->
+ S
+ |-- Forall ixsp : {init_xs : T * list ioT &
+ all (fun t : ioT => negb (coq_test__is_finished t))
+ (snd init_xs) = true},
+ loopy_basic (P (fst (projT1 ixsp)) ** BYTEregIs AL al)
+ (while ptest cond value pbody)
+ (catOP
+ (snd
+ (foldl
+ (fun (xy : T * OPred) (v : ioT) =>
+ (accumulate (fst xy) v,
+ catOP (catOP (Otest (fst xy) v) (Obody (fst xy) v))
+ (snd xy))) (fst (projT1 ixsp), empOP)
+ (snd (projT1 ixsp))))
+ (Otest (foldl accumulate (fst (projT1 ixsp)) (snd (projT1 ixsp)))
+ x))
+ (I (foldl accumulate (fst (projT1 ixsp)) (snd (projT1 ixsp)))
+ (negb value) ** ConditionIs cond (negb value)).
+ intros.
+ eapply @while_rule_ind
+ with (I_logic := fun ixsp b => match (match (coq_test__is_finished (nth x (snd (projT1 ixsp)) 0)) with true => negb value | false => value end), b with true, true => true | false, false => true | _, _ => false end)
+ (Otest := fun ixsp => Otest (fst (projT1 ixsp)) (nth x (snd (projT1 ixsp)) 0))
+ (Obody := fun ixsp => Obody (fst (projT1 ixsp)) (nth x (snd (projT1 ixsp)) 0))
+ (I_state := fun ixsp => I (fst (projT1 ixsp)))
+ (transition_body := fun ixsp => let initial := fst (projT1 ixsp) in
+ let xs := snd (projT1 ixsp) in
+ existT _ (accumulate initial (nth x xs 0), behead xs) _)
+ (O_after_test := fun ixsp => let initial := fst (projT1 ixsp) in
+ let xs := snd (projT1 ixsp) in
+ match xs with | nil => default_PointedOPred empOP | _ => Obody initial (nth x xs 0) end);
+ simpl projT1; simpl projT2; simpl fst; simpl snd; clear; let H := fresh in assert (H : False) by (clear; admit); destruct H.
+
+ Grab Existential Variables.
+ subst_body; simpl.
+ refine (all_behead (projT2 _)).
diff --git a/test-suite/bugs/closed/3648.v b/test-suite/bugs/closed/3648.v
new file mode 100644
index 00000000..ba6006ed
--- /dev/null
+++ b/test-suite/bugs/closed/3648.v
@@ -0,0 +1,83 @@
+(* File reduced by coq-bug-finder from original input, then from 8808 lines to 424 lines, then from 432 lines to 196 lines, then from\
+ 145 lines to 82 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 18 2014 21:0:5 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (07e4438bd758c2ced8caf09a6961ccd77d84e42b) *)
+
+Reserved Infix "o" (at level 40, left associativity).
+Global Set Primitive Projections.
+
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+
+ identity : forall x, morphism x x;
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g)
+ }.
+Arguments identity {!C%category} / x%object : rename.
+
+Infix "o" := (@compose _ _ _ _) : morphism_scope.
+
+Local Open Scope morphism_scope.
+Definition prodC (C D : PreCategory) : PreCategory.
+ refine (@Build_PreCategory
+ (C * D)%type
+ (fun s d => (morphism C (fst s) (fst d)
+ * morphism D (snd s) (snd d))%type)
+ (fun x => (identity (fst x), identity (snd x)))
+ (fun s d d' m2 m1 => (fst m2 o fst m1, snd m2 o snd m1))).
+Defined.
+
+Local Infix "*" := prodC : category_scope.
+
+Delimit Scope functor_scope with functor.
+
+Record Functor (C D : PreCategory) :=
+ {
+ object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d);
+ identity_of : forall x, morphism_of _ _ (identity x)
+ = identity (object_of x)
+ }.
+Arguments morphism_of [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+Notation "F '_1' m" := (morphism_of F m) (at level 10, no associativity) : morphism_scope.
+Axiom cheat : forall {A}, A.
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+Definition functor_category (C D : PreCategory) : PreCategory.
+ exact (@Build_PreCategory (Functor C D)
+ (@NaturalTransformation C D) cheat cheat).
+Defined.
+
+Local Notation "C -> D" := (functor_category C D) : category_scope.
+Variable C1 : PreCategory.
+Variable C2 : PreCategory.
+Variable D : PreCategory.
+
+Definition functor_object_of
+: (C1 -> (C2 -> D))%category -> (C1 * C2 -> D)%category.
+Proof.
+ intro F; hnf in F |- *.
+ refine (Build_Functor
+ (prodC C1 C2) D
+ (fun c1c2 => F (fst c1c2) (snd c1c2))
+ (fun s d m => F (fst d) _1 (snd m) o (@morphism_of _ _ F _ _ (fst m)) (snd s))
+ _).
+ intros.
+ rewrite identity_of.
+ cbn.
+ rewrite (identity_of _ _ F (fst x)).
+ Undo.
+(* Toplevel input, characters 20-55:
+Error:
+Found no subterm matching "F _1 (identity (fst x))" in the current goal. *)
+ rewrite identity_of. (* Toplevel input, characters 15-34:
+Error:
+Found no subterm matching "morphism_of ?202 (identity ?203)" in the current goal. *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3652.v b/test-suite/bugs/closed/3652.v
new file mode 100644
index 00000000..86e06137
--- /dev/null
+++ b/test-suite/bugs/closed/3652.v
@@ -0,0 +1,101 @@
+Require Setoid.
+Require ZArith.
+Import ZArith.
+
+Inductive Erasable(A : Set) : Prop :=
+ erasable: A -> Erasable A.
+
+Arguments erasable [A] _.
+
+Hint Constructors Erasable.
+
+Scheme Erasable_elim := Induction for Erasable Sort Prop.
+
+Notation "## T" := (Erasable T) (at level 1, format "## T") : Erasable_scope.
+Notation "# x" := (erasable x) (at level 1, format "# x") : Erasable_scope.
+Open Scope Erasable_scope.
+
+Axiom Erasable_inj : forall {A : Set}{a b : A}, #a=#b -> a=b.
+
+Lemma Erasable_rw : forall (A: Set)(a b : A), (#a=#b) <-> (a=b).
+Proof.
+ intros A a b.
+ split.
+ - apply Erasable_inj.
+ - congruence.
+Qed.
+
+Open Scope Z_scope.
+Opaque Z.mul.
+
+Infix "^" := Zpower_nat : Z_scope.
+
+Notation "f ; v <- x" := (let (v) := x in f)
+ (at level 199, left associativity) : Erasable_scope.
+Notation "f ; < v" := (f ; v <- v)
+ (at level 199, left associativity) : Erasable_scope.
+Notation "f |# v <- x" := (#f ; v <- x)
+ (at level 199, left associativity) : Erasable_scope.
+Notation "f |# < v" := (#f ; < v)
+ (at level 199, left associativity) : Erasable_scope.
+
+Ltac name_evars id :=
+ repeat match goal with |- context[?V] =>
+ is_evar V; let H := fresh id in set (H:=V) in * end.
+
+Lemma Twoto0 : 2^0 = 1.
+Proof. compute. reflexivity. Qed.
+
+Ltac ring_simplify' := rewrite ?Twoto0; ring_simplify.
+
+Definition mp2a1s(x : Z)(n : nat) := x * 2^n + (2^n-1).
+
+Hint Unfold mp2a1s.
+
+Definition zotval(n1s : nat)(is2 : bool)(next_value : Z) : Z :=
+ 2 * mp2a1s next_value n1s + if is2 then 2 else 0.
+
+Inductive zot'(eis2 : ##bool)(value : ##Z) : Set :=
+| Zot'(is2 : bool)
+ (iseq : eis2=#is2)
+ {next_is2 : ##bool}
+ (ok : is2=true -> next_is2=#false)
+ {next_value : ##Z}
+ (n1s : nat)
+ (veq : value = (zotval n1s is2 next_value |#<next_value))
+ (next : zot' next_is2 next_value)
+ : zot' eis2 value.
+
+Definition de2{eis2 value}(z : zot' eis2 value) : zot' #false value.
+Proof.
+ case z.
+ intros is2 iseq next_is2 ok next_value n1s veq next.
+ subst.
+ destruct is2.
+ 2:trivial.
+ clear z.
+ specialize (ok eq_refl). subst.
+ destruct n1s.
+ - refine (Zot' _ _ _ _ _ _ _ _).
+ all:shelve_unifiable.
+ reflexivity.
+ discriminate.
+ name_evars e.
+ case_eq next_value. intros next_valueU next_valueEU.
+ case_eq e. intros eU eEU.
+ f_equal.
+ unfold zotval.
+ unfold mp2a1s.
+ ring_simplify'.
+ replace 2 with (2*1) at 2 7 by omega.
+ rewrite <-?Z.mul_assoc.
+ rewrite <-?Z.mul_add_distr_l.
+ rewrite <-Z.mul_sub_distr_l.
+ rewrite Z.mul_cancel_l by omega.
+ replace 1 with (2-1) at 1 by omega.
+ rewrite Z.add_sub_assoc.
+ rewrite Z.sub_cancel_r.
+ Unshelve.
+ all:case_eq next.
+Abort.
+
diff --git a/test-suite/bugs/closed/3653.v b/test-suite/bugs/closed/3653.v
new file mode 100644
index 00000000..947b3601
--- /dev/null
+++ b/test-suite/bugs/closed/3653.v
@@ -0,0 +1,12 @@
+Require Setoid.
+
+Variables P Q : forall {T : Set}, T -> Prop.
+
+Lemma rule{T : Set}{x : T} : Q x <-> P x. admit. Qed.
+
+Goal forall (T : Set)(x : T), Q x <-> P x.
+Proof.
+intros T x.
+setoid_rewrite rule.
+reflexivity.
+Qed.
diff --git a/test-suite/bugs/closed/3654.v b/test-suite/bugs/closed/3654.v
new file mode 100644
index 00000000..15277235
--- /dev/null
+++ b/test-suite/bugs/closed/3654.v
@@ -0,0 +1,7 @@
+Tactic Notation "mysimpl" "in" ne_hyp_list(hyps) := simpl in hyps.
+
+Goal 0+0=0->0+0=0->0=0.
+intros H1 H2.
+mysimpl in H1 H2.
+match goal with H:0=0 |- _ => exact H end.
+Qed.
diff --git a/test-suite/bugs/closed/3656.v b/test-suite/bugs/closed/3656.v
new file mode 100644
index 00000000..cbd773d0
--- /dev/null
+++ b/test-suite/bugs/closed/3656.v
@@ -0,0 +1,53 @@
+Module A.
+ Set Primitive Projections.
+ Record hSet : Type := BuildhSet { setT : Type; iss : True }.
+ Ltac head_hnf_under_binders x :=
+ match eval hnf in x with
+ | ?f _ => head_hnf_under_binders f
+ | (fun y => ?f y) => head_hnf_under_binders f
+ | ?y => y
+ end.
+Goal forall s : hSet, True.
+intros.
+let x := head_hnf_under_binders setT in pose x.
+
+set (foo := eq_refl (@setT )). generalize foo. simpl. cbn.
+Abort.
+End A.
+
+Module A'.
+Set Universe Polymorphism.
+ Set Primitive Projections.
+Record hSet (A : Type) : Type := BuildhSet { setT : Type; iss : True }.
+Ltac head_hnf_under_binders x :=
+ match eval compute in x with
+ | ?f _ => head_hnf_under_binders f
+ | (fun y => ?f y) => head_hnf_under_binders f
+ | ?y => y
+ end.
+Goal forall s : @hSet nat, True.
+intros.
+let x := head_hnf_under_binders setT in pose x.
+
+set (foo := eq_refl (@setT nat)). generalize foo. simpl. cbn.
+Abort.
+End A'.
+
+Set Primitive Projections.
+Record hSet : Type := BuildhSet { setT : Type; iss : True }.
+Ltac head_hnf_under_binders x :=
+ match eval hnf in x with
+ | ?f _ => head_hnf_under_binders f
+ | (fun y => ?f y) => head_hnf_under_binders f
+ | ?y => y
+ end.
+Goal setT = setT.
+ progress unfold setT. (* should not succeed *)
+ match goal with
+ | |- (fun h => setT h) = (fun h => setT h) => fail 1 "should not eta-expand"
+ | _ => idtac
+ end. (* should not fail *)
+Abort.
+
+Goal forall h, setT h = setT h.
+Proof. intro. progress unfold setT.
diff --git a/test-suite/bugs/closed/3657.v b/test-suite/bugs/closed/3657.v
new file mode 100644
index 00000000..778fdab1
--- /dev/null
+++ b/test-suite/bugs/closed/3657.v
@@ -0,0 +1,12 @@
+(* Check typing of replaced objects in change - even though the failure
+ was already a proper error message (but with a helpless content) *)
+
+Class foo {A} {a : A} := { bar := a; baz : bar = bar }.
+Arguments bar {_} _ {_}.
+Instance: forall A a, @foo A a.
+intros; constructor.
+abstract reflexivity.
+Defined.
+Goal @bar _ Set _ = (@bar _ (fun _ : Set => Set) _) nat.
+Proof.
+ Fail change (bar (fun _ : Set => Set)) with (bar Set).
diff --git a/test-suite/bugs/closed/3658.v b/test-suite/bugs/closed/3658.v
new file mode 100644
index 00000000..b1158b9a
--- /dev/null
+++ b/test-suite/bugs/closed/3658.v
@@ -0,0 +1,74 @@
+(* File reduced by coq-bug-finder from original input, then from 12178 lines to 457 lines, then from 500 lines to 147 lines, then from 175 lines to 56 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 21 2014 16:34:4 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (eaf864354c3fda9ddc1f03f0b1c7807b6fd44322) *)
+
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Axiom ap : forall {A B:Type} (f:A -> B) {x y:A} (p:x = y), f x = f y.
+Module NonPrim.
+ Class Contr_internal (A : Type) := { center : A ; contr : (forall y : A, center = y) }.
+ Arguments center A {_} / .
+ Inductive trunc_index : Type := minus_two | trunc_S (_ : trunc_index).
+ Notation "-2" := minus_two (at level 0).
+ Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | -2 => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+ Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
+ Notation Contr := (IsTrunc -2).
+ Hint Extern 0 => progress change Contr_internal with Contr in * : typeclass_instances.
+ Goal forall (H : Type) (H0 : H -> H -> Type) (H1 : Type)
+ (H2 : Contr H1) (H3 : H1) (H4 : H1 -> H)
+ (H5 : H0 (H4 (center H1)) (H4 H3))
+ (H6 : H0 (H4 (center H1)) (H4 (center H1))),
+ transport (fun y : H => H0 (H4 (center H1)) y) (ap H4 (contr H3)) H6 = H5.
+ intros.
+ match goal with
+ | [ |- context[contr (center _)] ] => fail 1 "bad"
+ | _ => idtac
+ end.
+ match goal with
+ | [ H : _ |- _ ] => destruct (contr H)
+ end.
+ match goal with
+ | [ |- context[contr (center ?x)] ] => fail 1 "bad" x
+ | _ => idtac
+ end.
+ admit.
+ Defined.
+End NonPrim.
+
+Module Prim.
+ Set Primitive Projections.
+ Class Contr_internal (A : Type) := { center : A ; contr : (forall y : A, center = y) }.
+ Arguments center A {_} / .
+ Inductive trunc_index : Type := minus_two | trunc_S (_ : trunc_index).
+ Notation "-2" := minus_two (at level 0).
+ Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | -2 => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+ Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
+ Notation Contr := (IsTrunc -2).
+ Hint Extern 0 => progress change Contr_internal with Contr in * : typeclass_instances.
+ Goal forall (H : Type) (H0 : H -> H -> Type) (H1 : Type)
+ (H2 : Contr H1) (H3 : H1) (H4 : H1 -> H)
+ (H5 : H0 (H4 (center H1)) (H4 H3))
+ (H6 : H0 (H4 (center H1)) (H4 (center H1))),
+ transport (fun y : H => H0 (H4 (center H1)) y) (ap H4 (contr H3)) H6 = H5.
+ intros.
+ match goal with
+ | [ |- context[contr (center _)] ] => fail 1 "bad"
+ | _ => idtac
+ end.
+ match goal with
+ | [ H : _ |- _ ] => destruct (contr H)
+ end.
+ match goal with
+ | [ |- context[contr (center ?x)] ] => fail 1 "bad" x
+ | _ => idtac
+ end. (* Error: Tactic failure: bad H1. *)
+ admit.
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3660.v b/test-suite/bugs/closed/3660.v
new file mode 100644
index 00000000..ed8964ce
--- /dev/null
+++ b/test-suite/bugs/closed/3660.v
@@ -0,0 +1,27 @@
+Generalizable All Variables.
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
+Open Scope function_scope.
+Axiom ap : forall {A B:Type} (f:A -> B) {x y:A} (p:x = y), f x = f y.
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
+Record Equiv A B := { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+Axiom IsHSet : Type -> Type.
+Instance isequiv_compose `{IsEquiv A B f} `{IsEquiv B C g} : IsEquiv (compose g f) | 1000.
+admit.
+Defined.
+Set Primitive Projections.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
+Global Instance isequiv_ap_setT X Y : IsEquiv (@ap _ _ setT X Y).
+admit.
+Defined.
+Local Open Scope equiv_scope.
+Axiom equiv_path : forall (A B : Type) (p : A = B), A <~> B.
+
+Goal forall (C D : hSet), IsEquiv (fun x : C = D => (equiv_path C D (ap setT x))).
+ intros.
+ change (IsEquiv (equiv_path C D o @ap _ _ setT C D)).
+ apply @isequiv_compose; [ | admit ].
+ Set Typeclasses Debug.
+ typeclasses eauto.
diff --git a/test-suite/bugs/closed/3661.v b/test-suite/bugs/closed/3661.v
new file mode 100644
index 00000000..fdca49bc
--- /dev/null
+++ b/test-suite/bugs/closed/3661.v
@@ -0,0 +1,88 @@
+(* File reduced by coq-bug-finder from original input, then from 11218 lines to 438 lines, then from 434 lines to 202 lines, then from 140 lines to 94 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 25 2014 2:53:46 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (bec7e0914f4a7144cd4efa8ffaccc9f72dbdb790) *)
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Set Implicit Arguments.
+Delimit Scope morphism_scope with morphism.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Bind Scope category_scope with PreCategory.
+Local Open Scope morphism_scope.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d) }.
+Set Primitive Projections.
+Class IsIsomorphism {C : PreCategory} {s d} (m : morphism C s d) := { morphism_inverse : morphism C d s }.
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+Unset Primitive Projections.
+Class Isomorphic {C : PreCategory} s d :=
+ { morphism_isomorphic :> morphism C s d;
+ isisomorphism_isomorphic :> IsIsomorphism morphism_isomorphic }.
+Arguments morphism_inverse {C s d} m {_} / .
+Local Notation "m ^-1" := (morphism_inverse m) (at level 3, format "m '^-1'") : morphism_scope.
+Definition functor_category (C D : PreCategory) : PreCategory.
+ exact (@Build_PreCategory (Functor C D)
+ (@NaturalTransformation C D)).
+Defined.
+Local Notation "C -> D" := (functor_category C D) : category_scope.
+Generalizable All Variables.
+Definition isisomorphism_components_of `{@IsIsomorphism (C -> D) F G T} x : IsIsomorphism (T x).
+Proof.
+ constructor.
+ exact (T^-1 x).
+Defined.
+Hint Immediate isisomorphism_components_of : typeclass_instances.
+Goal forall (x3 x9 : PreCategory) (x12 f0 : Functor x9 x3)
+ (x35 : @Isomorphic (@functor_category x9 x3) f0 x12)
+ (x37 : object x9)
+ (H3 : morphism x3 (@object_of x9 x3 f0 x37)
+ (@object_of x9 x3 f0 x37))
+ (x34 : @Isomorphic (@functor_category x9 x3) x12 f0)
+ (m : morphism x3 (x12 x37) (f0 x37) ->
+ morphism x3 (f0 x37) (x12 x37) ->
+ morphism x3 (f0 x37) (f0 x37)),
+ @paths
+ (morphism x3 (@object_of x9 x3 f0 x37) (@object_of x9 x3 f0 x37))
+ H3
+ (m
+ (@components_of x9 x3 x12 f0
+ (@morphism_inverse (@functor_category x9 x3) f0 x12
+ (@morphism_isomorphic (@functor_category x9 x3) f0 x12 x35)
+ (@isisomorphism_isomorphic (@functor_category x9 x3) f0 x12
+ x35)) x37)
+ (@components_of x9 x3 f0 x12
+ (@morphism_inverse (@functor_category x9 x3) x12 f0
+ (@morphism_isomorphic (@functor_category x9 x3) x12 f0 x34)
+ (@isisomorphism_isomorphic (@functor_category x9 x3) x12 f0
+ x34)) x37)).
+ Unset Printing All.
+ intros.
+ match goal with
+ | [ |- context[components_of ?T^-1 ?x] ]
+ => progress let T1 := constr:(T^-1 x) in
+ let T2 := constr:((T x)^-1) in
+ change T1 with T2 || fail 1 "too early"
+ end.
+
+ Undo.
+
+ match goal with
+ | [ |- context[components_of ?T^-1 ?x] ]
+ => progress let T1 := constr:(T^-1 x) in
+ change T1 with ((T x)^-1) || fail 1 "too early 2"
+ end.
+
+ Undo.
+
+ match goal with
+ | [ |- context[components_of ?T^-1 ?x] ]
+ => progress let T2 := constr:((T x)^-1) in
+ change (T^-1 x) with T2
+ end. (* not convertible *)
+
+(*
+
+ (@components_of x9 x3 x12 f0
+ (@morphism_inverse _ _ _
+ (@morphism_isomorphic (functor_category x9 x3) f0 x12 x35) _) x37)
+
+*) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3662.v b/test-suite/bugs/closed/3662.v
new file mode 100644
index 00000000..bd53389b
--- /dev/null
+++ b/test-suite/bugs/closed/3662.v
@@ -0,0 +1,47 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Record Elimination Schemes.
+Record prod A B := pair { fst : A ; snd : B }.
+Definition f : Set -> Type := fun x => x.
+
+Goal (fst (pair (fun x => x + 1) nat) 0) = 0.
+compute.
+Undo.
+cbv.
+Undo.
+Opaque fst.
+cbn.
+Transparent fst.
+cbn.
+Undo.
+simpl.
+Undo.
+Abort.
+
+Goal f (fst (pair nat nat)) = nat.
+compute.
+ match goal with
+ | [ |- fst ?x = nat ] => fail 1 "compute failed"
+ | [ |- nat = nat ] => idtac
+ end.
+ reflexivity.
+Defined.
+
+Goal fst (pair nat nat) = nat.
+ unfold fst.
+ match goal with
+ | [ |- fst ?x = nat ] => fail 1 "compute failed"
+ | [ |- nat = nat ] => idtac
+ end.
+ reflexivity.
+Defined.
+
+Lemma eta A B : forall x : prod A B, x = pair (fst x) (snd x). reflexivity. Qed.
+
+Goal forall x : prod nat nat, fst x = 0.
+ intros. unfold fst.
+ Fail match goal with
+ | [ |- fst ?x = 0 ] => idtac
+ end.
+Abort.
+
diff --git a/test-suite/bugs/closed/3664.v b/test-suite/bugs/closed/3664.v
new file mode 100644
index 00000000..41de74ff
--- /dev/null
+++ b/test-suite/bugs/closed/3664.v
@@ -0,0 +1,23 @@
+Module NonPrim.
+ Unset Primitive Projections.
+ Record c := { d : Set }.
+ Definition a x := d x.
+ Goal forall x, a x.
+ intro x.
+ Fail progress simpl. (* [progress simpl] fails correctly *)
+ Fail progress cbn. (* [progress cbn] fails correctly *)
+ admit.
+ Defined.
+End NonPrim.
+
+Module Prim.
+ Set Primitive Projections.
+ Record c := { d : Set }.
+ Definition a x := d x.
+ Goal forall x, a x.
+ intro x.
+ Fail progress simpl. (* [progress simpl] fails correctly *)
+ Fail progress cbn. (* [cbn] succeeds incorrectly, giving [d x] *)
+ admit.
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3665.v b/test-suite/bugs/closed/3665.v
new file mode 100644
index 00000000..f6a13596
--- /dev/null
+++ b/test-suite/bugs/closed/3665.v
@@ -0,0 +1,33 @@
+(* File reduced by coq-bug-finder from original input, then from 5449 lines to 44 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 25 2014 2:53:46 with OCaml 4.01.0
+ coqtop version trunk (September 2014) *)
+Set Primitive Projections.
+
+Axiom IsHSet : Type -> Type.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+
+Module withdefault.
+Canonical Structure default_HSet := fun T P => (@BuildhSet T P).
+Goal forall (z : hSet) (T0 : Type -> Type),
+ (forall (A : Type) (P : T0 A -> Type) (aa : T0 A), P aa) ->
+ forall x0 : setT z, Set.
+ clear; intros z T H.
+ Set Debug Unification.
+ Fail refine (H _ _). (* Timeout! *)
+Abort.
+End withdefault.
+
+Module withnondefault.
+Variable T0 : Type -> Type.
+Variable T0hset: forall A, IsHSet (T0 A).
+
+Canonical Structure nondefault_HSet := fun A =>(@BuildhSet (T0 A) (T0hset A)).
+Canonical Structure default_HSet := fun A P =>(@BuildhSet A P).
+Goal forall (z : hSet) (T0 : Type -> Type),
+ (forall (A : Type) (P : T0 A -> Type) (aa : T0 A), P aa) ->
+ forall x0 : setT z, Set.
+ clear; intros z T H.
+ Set Debug Unification.
+ Fail refine (H _ _). (* Timeout! *)
+Abort.
+End withnondefault.
diff --git a/test-suite/bugs/closed/3666.v b/test-suite/bugs/closed/3666.v
new file mode 100644
index 00000000..a5b0e934
--- /dev/null
+++ b/test-suite/bugs/closed/3666.v
@@ -0,0 +1,50 @@
+(* File reduced by coq-bug-finder from original input, then from 11542 lines to 325 lines, then from 347 lines to 56 lines, then from 58 lines to 15 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 25 2014 2:53:46 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (bec7e0914f4a7144cd4efa8ffaccc9f72dbdb790) *)
+
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing).
+Inductive V : Type@{U'} := | set {A : Type@{U}} (f : A -> V) : V.
+Module NonPrim.
+ Record hProp := hp { hproptype :> Type ; isp : Set}.
+ Goal forall (A B : Type) (H_f : A -> V -> hProp) (H_g : B -> V -> hProp)
+ (C : Type) (h : C -> V) (b : B) (a : A) (c : C),
+ H_f a (h c) -> H_f a (h c) = H_g b (h c) -> H_g b (h c).
+ intros A B H_f H_g C h b a c H3 H'.
+ exact (@transport hProp (fun x => x) _ _ H' H3).
+ Undo.
+ Set Debug Unification.
+ exact (H' # H3).
+ Defined.
+End NonPrim.
+
+Module Prim.
+ Set Primitive Projections.
+ Set Universe Polymorphism.
+ Record hProp := hp { hproptype :> Type ; isp : Set}.
+ Goal forall (A B : Type) (H_f : A -> V -> hProp) (H_g : B -> V -> hProp)
+ (C : Type) (h : C -> V) (b : B) (a : A) (c : C),
+ H_f a (h c) -> H_f a (h c) = H_g b (h c) -> H_g b (h c).
+ intros A B H_f H_g C h b a c H3 H'.
+ exact (@transport hProp (fun x => x) _ _ H' H3).
+ Undo.
+ Set Debug Unification.
+ exact (H' # H3).
+ (* Toplevel input, characters 7-14:
+Error:
+In environment
+A : Type
+B : Type
+H_f : A -> V -> hProp
+H_g : B -> V -> hProp
+C : Type
+h : C -> V
+b : B
+a : A
+c : C
+H3 : H_f a (h c)
+H' : H_f a (h c) = H_g b (h c)
+Unable to unify "hproptype (H_f a (h c))" with "?T (H_f a (h c))".
+ *)
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3667.v b/test-suite/bugs/closed/3667.v
new file mode 100644
index 00000000..d2fc4d9b
--- /dev/null
+++ b/test-suite/bugs/closed/3667.v
@@ -0,0 +1,25 @@
+
+Set Primitive Projections.
+Axiom ap10 : forall {A B} {f g:A->B} (h:f=g) x, f x = g x.
+Axiom IsHSet : Type -> Type.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d) }.
+Set Implicit Arguments.
+Record NaturalTransformation C D (F G : Functor C D) :=
+ { components_of :> forall c, morphism D (F c) (G c);
+ commutes : forall s d (m : morphism C s d), components_of s = components_of s }.
+Definition set_cat : PreCategory.
+ exact ((@Build_PreCategory hSet
+ (fun x y => x -> y))).
+Defined.
+Goal forall (A : PreCategory) (F : Functor A set_cat)
+ (a : A) (x : F a) (nt :NaturalTransformation F F), x = x.
+ intros.
+ pose (fun c d m => ap10 (commutes nt c d m)).
+
+
diff --git a/test-suite/bugs/closed/3668.v b/test-suite/bugs/closed/3668.v
new file mode 100644
index 00000000..547159b9
--- /dev/null
+++ b/test-suite/bugs/closed/3668.v
@@ -0,0 +1,53 @@
+(* File reduced by coq-bug-finder from original input, then from 6329 lines to 110 lines, then from 115 lines to 88 lines, then from 93 lines to 72 lines *)
+(* coqc version trunk (September 2014) compiled on Sep 25 2014 2:53:46 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (bec7e0914f4a7144cd4efa8ffaccc9f72dbdb790) *)
+
+Notation "( x ; y )" := (existT _ x y).
+Notation "x .1" := (projT1 x) (at level 3, format "x '.1'").
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
+Record Equiv A B := { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Notation "A <~> B" := (Equiv A B) (at level 85).
+Axiom IsHProp : Type -> Type.
+Inductive Bool := true | false.
+Definition negb (b : Bool) := if b then false else true.
+Hypothesis LEM : forall A : Type, IsHProp A -> A + (A -> False).
+Axiom cheat : forall {A},A.
+Module NonPrim.
+ Class Contr (A : Type) := { center : A ; contr : (forall y : A, center = y) }.
+ Definition Book_6_9 : forall X, X -> X.
+ Proof.
+ intro X.
+ pose proof (@LEM (Contr { f : X <~> X & ~(forall x, f x = x) }) cheat) as contrXEquiv.
+ destruct contrXEquiv as [[f H]|H]; [ exact f.1 | exact (fun x => x) ].
+ Defined.
+ Lemma Book_6_9_not_id b : Book_6_9 Bool b = negb b.
+ Proof.
+ unfold Book_6_9.
+ destruct (@LEM (Contr { f : Bool <~> Bool & ~(forall x, f x = x) }) _) as [[f H']|H'].
+ match goal with
+ | [ |- equiv_fun Bool Bool f.1 b = negb b ] => idtac
+ | [ |- equiv_fun Bool Bool center.1 b = negb b ] => fail 1 "bad"
+ end.
+ all:admit.
+ Defined.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Class Contr (A : Type) := { center : A ; contr : (forall y : A, center = y) }.
+ Definition Book_6_9 : forall X, X -> X.
+ Proof.
+ intro X.
+ pose proof (@LEM (Contr { f : X <~> X & ~(forall x, f x = x) }) cheat) as contrXEquiv.
+ destruct contrXEquiv as [[f H]|H]; [ exact (f.1) | exact (fun x => x) ].
+ Defined.
+ Lemma Book_6_9_not_id b : Book_6_9 Bool b = negb b.
+ Proof.
+ unfold Book_6_9.
+ destruct (@LEM (Contr { f : Bool <~> Bool & ~(forall x, f x = x) }) _) as [[f H']|H'].
+ match goal with
+ | [ |- equiv_fun Bool Bool f.1 b = negb b ] => idtac
+ | [ |- equiv_fun Bool Bool center.1 b = negb b ] => fail 1 "bad"
+ end. (* Tactic failure: bad *)
+ all:admit.
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3670.v b/test-suite/bugs/closed/3670.v
new file mode 100644
index 00000000..c0f03261
--- /dev/null
+++ b/test-suite/bugs/closed/3670.v
@@ -0,0 +1,23 @@
+Set Universe Polymorphism.
+Module Type FOO.
+ Parameter f : Type -> Type.
+ Parameter h : forall T, f T.
+End FOO.
+
+Module Type BAR.
+ Include FOO.
+End BAR.
+
+Module Type BAZ.
+ Include FOO.
+End BAZ.
+
+Module BAR_FROM_BAZ (baz : BAZ) <: BAR.
+
+ Definition f : Type -> Type.
+ Proof. exact baz.f. Defined.
+
+ Definition h : forall T, f T.
+ Admitted.
+
+Fail End BAR_FROM_BAZ.
diff --git a/test-suite/bugs/closed/3672.v b/test-suite/bugs/closed/3672.v
new file mode 100644
index 00000000..283be495
--- /dev/null
+++ b/test-suite/bugs/closed/3672.v
@@ -0,0 +1,27 @@
+Set Primitive Projections. (* No failures without this option. *)
+
+Record AT :=
+{ atype :> Type
+; coerce : atype -> Type
+}.
+Coercion coerce : atype >-> Sortclass.
+
+Record Ar C (A:AT) := { ar : forall (X Y : C), A }.
+
+Definition t := forall C A a X, coerce _ (ar C A a X X).
+Definition t' := forall C A a X, ar C A a X X.
+
+(* The command has indeed failed with message:
+=> Error: The term "ar C A a X X" has type "atype A" which is not a (co-)inductive type.
+*)
+
+Record Ar2 C (A:AT) :=
+{ ar2 : forall (X Y : C), A
+; id2 : forall X, coerce _ (ar2 X X) }.
+
+Record Ar3 C (A:AT) :=
+{ ar3 : forall (X Y : C), A
+; id3 : forall X, ar3 X X }.
+(* The command has indeed failed with message:
+=> Anomaly: Bad recursive type. Please report.
+*) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3675.v b/test-suite/bugs/closed/3675.v
new file mode 100644
index 00000000..93227ab8
--- /dev/null
+++ b/test-suite/bugs/closed/3675.v
@@ -0,0 +1,20 @@
+Set Primitive Projections.
+Definition compose {A B C : Type} (g : B -> C) (f : A -> B) := fun x => g (f x).
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z := match p, q with idpath, idpath => idpath end.
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+Axiom ap : forall {A B:Type} (f:A -> B) {x y:A} (p:x = y), f x = f y.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A ; eisretr : forall x, f (equiv_inv x) = x }.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'") : equiv_scope.
+Local Open Scope path_scope.
+Local Open Scope equiv_scope.
+Generalizable Variables A B C f g.
+Lemma isequiv_compose `{IsEquiv A B f} `{IsEquiv B C g}
+: IsEquiv (compose g f).
+Proof.
+ refine (Build_IsEquiv A C
+ (compose g f)
+ (compose f^-1 g^-1) _).
+ exact (fun c => ap g (@eisretr _ _ f _ (g^-1 c)) @ (@eisretr _ _ g _ c)).
diff --git a/test-suite/bugs/closed/3682.v b/test-suite/bugs/closed/3682.v
new file mode 100644
index 00000000..b8c5b4d5
--- /dev/null
+++ b/test-suite/bugs/closed/3682.v
@@ -0,0 +1,5 @@
+Class Foo.
+Definition bar `{Foo} (x : Set) := Set.
+Instance: Foo.
+Definition bar1 := bar nat.
+Definition bar2 := bar $(admit)$.
diff --git a/test-suite/bugs/closed/3684.v b/test-suite/bugs/closed/3684.v
new file mode 100644
index 00000000..94ce4a60
--- /dev/null
+++ b/test-suite/bugs/closed/3684.v
@@ -0,0 +1,4 @@
+Definition foo : Set.
+Proof.
+ refine ($(abstract admit)$).
+Qed.
diff --git a/test-suite/bugs/closed/3686.v b/test-suite/bugs/closed/3686.v
new file mode 100644
index 00000000..ee6b334b
--- /dev/null
+++ b/test-suite/bugs/closed/3686.v
@@ -0,0 +1,62 @@
+Set Universe Polymorphism.
+Set Implicit Arguments.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Bind Scope category_scope with PreCategory.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d);
+ identity_of : forall s m, morphism_of s s m = morphism_of s s m }.
+Definition sub_pre_cat (P : PreCategory -> Type) : PreCategory.
+Proof.
+ exact (@Build_PreCategory PreCategory Functor).
+Defined.
+Definition opposite (C : PreCategory) : PreCategory.
+Proof.
+ exact (@Build_PreCategory C (fun s d => morphism C d s)).
+Defined.
+Local Notation "C ^op" := (opposite C) (at level 3, format "C '^op'") : category_scope.
+Definition prod (C D : PreCategory) : PreCategory.
+Proof.
+ refine (@Build_PreCategory
+ (C * D)%type
+ (fun s d => (morphism C (fst s) (fst d) * morphism D (snd s) (snd d))%type)).
+Defined.
+Local Infix "*" := prod : category_scope.
+Axiom functor_category : PreCategory -> PreCategory -> PreCategory.
+Local Notation "C -> D" := (functor_category C D) : category_scope.
+Module Export PointwiseCore.
+ Definition pointwise
+ (C C' : PreCategory)
+ (F : Functor C' C)
+ (D D' : PreCategory)
+ (G : Functor D D')
+ : Functor (C -> D) (C' -> D').
+ Proof.
+ refine (Build_Functor
+ (C -> D) (C' -> D')
+ _
+ _
+ _);
+ abstract admit.
+ Defined.
+End PointwiseCore.
+Axiom Pidentity_of : forall (C D : PreCategory) (F : Functor C C) (G : Functor D D), pointwise F G = pointwise F G.
+Local Open Scope category_scope.
+Definition functor_uncurried (P : PreCategory -> Type)
+ (has_functor_categories : forall C D : @sub_pre_cat P, P (C -> D))
+: object (((@sub_pre_cat P)^op * (@sub_pre_cat P)) -> (@sub_pre_cat P)).
+Proof.
+ pose (let object_of := (fun CD => (((fst CD) -> (snd CD))))
+ in Build_Functor
+ ((@sub_pre_cat P)^op * (@sub_pre_cat P)) (@sub_pre_cat P)
+ object_of
+ (fun CD C'D' FG => pointwise (fst FG) (snd FG))
+ (fun _ _ => Pidentity_of _ _)) || fail "early".
+ Include PointwiseCore.
+ pose (let object_of := (fun CD => (((fst CD) -> (snd CD))))
+ in Build_Functor
+ ((@sub_pre_cat P)^op * (@sub_pre_cat P)) (@sub_pre_cat P)
+ object_of
+ (fun CD C'D' FG => pointwise (fst FG) (snd FG))
+ (fun _ _ => Pidentity_of _ _)).
+Abort.
diff --git a/test-suite/bugs/closed/3692.v b/test-suite/bugs/closed/3692.v
new file mode 100644
index 00000000..72973a8d
--- /dev/null
+++ b/test-suite/bugs/closed/3692.v
@@ -0,0 +1,26 @@
+Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
+Reserved Notation "x = y" (at level 70, no associativity).
+Reserved Notation "x * y" (at level 40, left associativity).
+Delimit Scope core_scope with core.
+Open Scope core_scope.
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+Global Set Primitive Projections.
+Global Set Implicit Arguments.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A ; eisretr : Sect equiv_inv f }.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'").
+Generalizable Variables X A B f g n.
+Axiom path_prod' : forall {A B : Type} {x x' : A} {y y' : B}, (x = x') -> (y = y') -> ((x,y) = (x',y')).
+Definition functor_prod {A A' B B' : Type} (f:A->A') (g:B->B')
+: A * B -> A' * B'.
+ exact (fun z => (f (fst z), g (snd z))).
+Defined.
+Definition isequiv_functor_prod `{IsEquiv A A' f} `{IsEquiv B B' g}
+: IsEquiv (functor_prod f g)
+ := @Build_IsEquiv
+ _ _ (functor_prod f g) (functor_prod f^-1 g^-1)
+ (fun z => path_prod' (@eisretr _ _ f _ (fst z)) (@eisretr _ _ g _ (snd z))).
diff --git a/test-suite/bugs/closed/3698.v b/test-suite/bugs/closed/3698.v
new file mode 100644
index 00000000..3c53d243
--- /dev/null
+++ b/test-suite/bugs/closed/3698.v
@@ -0,0 +1,25 @@
+(* File reduced by coq-bug-finder from original input, then from 5479 lines to 4682 lines, then from 4214 lines to 86 lines, then from 60 lines to 25 lines *)
+(* coqc version trunk (October 2014) compiled on Oct 1 2014 18:13:54 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (68846802a7be637ec805a5e374655a426b5723a5) *)
+Set Primitive Projections.
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation pr1 := projT1.
+Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+Axiom ap : forall {A B:Type} (f:A -> B) {x y:A} (p:x = y), f x = f y.
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
+Record Equiv A B := { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Global Existing Instance equiv_isequiv.
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'") : equiv_scope.
+Axiom IsHSet : Type -> Type.
+Local Open Scope equiv_scope.
+Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
+Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
+Axiom issig_hSet: (sigT IsHSet) <~> hSet.
+Definition isequiv_ap_setT X Y : IsEquiv (@ap _ _ setT X Y).
+Proof.
+ assert (H'' : forall g : X = Y -> (issig_hSet^-1 X).1 = (issig_hSet^-1 Y).1,
+ g = g -> IsEquiv g) by admit.
+ Eval compute in (@projT1 Type IsHSet (@equiv_inv _ _ _ (equiv_isequiv _ _ issig_hSet) X)).
+ Fail apply H''. (* stack overflow *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3699.v b/test-suite/bugs/closed/3699.v
new file mode 100644
index 00000000..99b3d79e
--- /dev/null
+++ b/test-suite/bugs/closed/3699.v
@@ -0,0 +1,162 @@
+(* File reduced by coq-bug-finder from original input, then from 9593 lines to 104 lines, then from 187 lines to 103 lines, then from 113 lines to 90 lines *)
+(* coqc version trunk (October 2014) compiled on Oct 1 2014 18:13:54 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (68846802a7be637ec805a5e374655a426b5723a5) *)
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Inductive trunc_index := minus_two | trunc_S (_ : trunc_index).
+Axiom IsTrunc : trunc_index -> Type -> Type.
+Existing Class IsTrunc.
+Axiom Contr : Type -> Type.
+Inductive Trunc (n : trunc_index) (A :Type) : Type := tr : A -> Trunc n A.
+Module NonPrim.
+ Unset Primitive Projections.
+ Set Implicit Arguments.
+ Record sigT {A} (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+ Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+ Unset Implicit Arguments.
+ Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+ Open Scope fibration_scope.
+ Notation pr1 := projT1.
+ Notation pr2 := projT2.
+ Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+ Notation "x .2" := (pr2 x) (at level 3, format "x '.2'") : fibration_scope.
+ Definition hfiber {A B : Type} (f : A -> B) (y : B) := { x : A & f x = y }.
+ Class IsConnected (n : trunc_index) (A : Type) := isconnected_contr_trunc :> Contr (Trunc n A).
+ Axiom isconnected_elim : forall {n} {A} `{IsConnected n A}
+ (C : Type) `{IsTrunc n C} (f : A -> C),
+ { c:C & forall a:A, f a = c }.
+ Class IsConnMap (n : trunc_index) {A B : Type} (f : A -> B)
+ := isconnected_hfiber_conn_map :> forall b:B, IsConnected n (hfiber f b).
+ Definition conn_map_elim {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall b:B, P b.
+ Proof.
+ intros b.
+ refine (pr1 (isconnected_elim _ _)).
+ 2:exact b.
+ intro x.
+ exact (transport P x.2 (d x.1)).
+ Defined.
+
+ Definition conn_map_elim' {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall b:B, P b.
+ Proof.
+ intros b.
+ refine (pr1 (isconnected_elim _ _)).
+ 2:exact b.
+ intros [a p].
+ exact (transport P p (d a)).
+ Defined.
+
+ Definition conn_map_comp {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall a:A, conn_map_elim f P d (f a) = d a /\ conn_map_elim' f P d (f a) = d a.
+ Proof.
+ intros a.
+ unfold conn_map_elim, conn_map_elim'.
+ Set Printing Coercions.
+ set (fibermap := fun a0p : hfiber f (f a)
+ => let (a0, p) := a0p in transport P p (d a0)).
+ Set Printing Implicit.
+ let G := match goal with |- ?G => constr:G end in
+ first [ match goal with
+ | [ |- (@isconnected_elim n (@hfiber A B f (f a))
+ (@isconnected_hfiber_conn_map n A B f H (f a))
+ (P (f a)) (HP (f a))
+ (fun x : @hfiber A B f (f a) =>
+ @transport B P (f x.1) (f a) x.2 (d x.1))).1 =
+ d a /\ _ ] => idtac
+ end
+ | fail 1 "projection names should be folded, [let] should generate unfolded projections, goal:" G ];
+ first [ match goal with
+ | [ |- _ /\ (@isconnected_elim n (@hfiber A B f (f a))
+ (@isconnected_hfiber_conn_map n A B f H (f a))
+ (P (f a)) (HP (f a)) fibermap).1 = d a ] => idtac
+ end
+ | fail 1 "destruct should generate unfolded projections, as should [let], goal:" G ].
+ admit.
+ Defined.
+End NonPrim.
+
+Module Prim.
+ Set Primitive Projections.
+ Set Implicit Arguments.
+ Record sigT {A} (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+ Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+ Unset Implicit Arguments.
+ Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+ Open Scope fibration_scope.
+ Notation pr1 := projT1.
+ Notation pr2 := projT2.
+ Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+ Notation "x .2" := (pr2 x) (at level 3, format "x '.2'") : fibration_scope.
+ Definition hfiber {A B : Type} (f : A -> B) (y : B) := { x : A & f x = y }.
+ Class IsConnected (n : trunc_index) (A : Type) := isconnected_contr_trunc :> Contr (Trunc n A).
+ Axiom isconnected_elim : forall {n} {A} `{IsConnected n A}
+ (C : Type) `{IsTrunc n C} (f : A -> C),
+ { c:C & forall a:A, f a = c }.
+ Class IsConnMap (n : trunc_index) {A B : Type} (f : A -> B)
+ := isconnected_hfiber_conn_map :> forall b:B, IsConnected n (hfiber f b).
+ Definition conn_map_elim {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall b:B, P b.
+ Proof.
+ intros b.
+ refine (pr1 (isconnected_elim _ _)).
+ 2:exact b.
+ intro x.
+ exact (transport P x.2 (d x.1)).
+ Defined.
+
+ Definition conn_map_elim' {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall b:B, P b.
+ Proof.
+ intros b.
+ refine (pr1 (isconnected_elim _ _)).
+ 2:exact b.
+ intros [a p].
+ exact (transport P p (d a)).
+ Defined.
+
+ Definition conn_map_comp {n : trunc_index}
+ {A B : Type} (f : A -> B) `{IsConnMap n _ _ f}
+ (P : B -> Type) {HP : forall b:B, IsTrunc n (P b)}
+ (d : forall a:A, P (f a))
+ : forall a:A, conn_map_elim f P d (f a) = d a /\ conn_map_elim' f P d (f a) = d a.
+ Proof.
+ intros a.
+ unfold conn_map_elim, conn_map_elim'.
+ Set Printing Coercions.
+ set (fibermap := fun a0p : hfiber f (f a)
+ => let (a0, p) := a0p in transport P p (d a0)).
+ Set Printing Implicit.
+ let G := match goal with |- ?G => constr:G end in
+ first [ match goal with
+ | [ |- (@isconnected_elim n (@hfiber A B f (f a))
+ (@isconnected_hfiber_conn_map n A B f H (f a))
+ (P (f a)) (HP (f a))
+ (fun x : @hfiber A B f (f a) =>
+ @transport B P (f x.1) (f a) x.2 (d x.1))).1 =
+ d a /\ _ ] => idtac
+ end
+ | fail 1 "projection names should be folded, [let] should generate unfolded projections, goal:" G ];
+ first [ match goal with
+ | [ |- _ /\ (@isconnected_elim n (@hfiber A B f (f a))
+ (@isconnected_hfiber_conn_map n A B f H (f a))
+ (P (f a)) (HP (f a)) fibermap).1 = d a ] => idtac
+ end
+ | fail 1 "destruct should generate unfolded projections, as should [let], goal:" G ].
+ admit.
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3700.v b/test-suite/bugs/closed/3700.v
new file mode 100644
index 00000000..4e226524
--- /dev/null
+++ b/test-suite/bugs/closed/3700.v
@@ -0,0 +1,84 @@
+
+Set Implicit Arguments.
+Module NonPrim.
+ Unset Primitive Projections.
+ Record prod A B := pair { fst : A ; snd : B }.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Record prod A B := pair { fst : A ; snd : B }.
+End Prim.
+Goal (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a)
+/\ (forall x : Prim.prod Set Set, let (a, b) := x in a = a).
+ Show. (* (forall x : NonPrim.prod Set Set, let (a, _) := x in a = a) /\
+ (forall x : Prim.prod Set Set,
+ let a := Prim.fst x in let b := Prim.snd x in a = a) *)
+ Set Printing All.
+ Show. (* and
+ (forall x : NonPrim.prod Set Set,
+ match x return Prop with
+ | NonPrim.pair a _ => @eq Set a a
+ end)
+ (forall x : Prim.prod Set Set,
+ let a := @Prim.fst Set Set x in
+ let b := @Prim.snd Set Set x in @eq Set a a) *)
+ Unset Printing All.
+Abort.
+Goal (forall x : NonPrim.prod Set Set, match x with NonPrim.pair a b => a = a end)
+/\ (forall x : Prim.prod Set Set, match x with Prim.pair a b => a = a end).
+ Show. (* (forall x : NonPrim.prod Set Set,
+ match x with
+ | {| NonPrim.fst := a |} => a = a
+ end) /\ (forall x : Prim.prod Set Set, Prim.fst x = Prim.fst x) *)
+ (** Wrong: [match] should generate unfolded things *)
+ Set Printing All.
+ Show. (* and
+ (forall x : NonPrim.prod Set Set,
+ match x return Prop with
+ | NonPrim.pair a _ => @eq Set a a
+ end)
+ (forall x : Prim.prod Set Set,
+ @eq Set (@Prim.fst Set Set x) (@Prim.fst Set Set x)) *)
+ Unset Printing All.
+Abort.
+Goal (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a /\ b = b)
+/\ (forall x : Prim.prod Set Set, let (a, b) := x in a = a /\ b = b).
+ Show. (* (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a /\ b = b) /\
+ (forall x : Prim.prod Set Set,
+ let a := Prim.fst x in let b := Prim.snd x in a = a /\ b = b) *)
+ (** Understandably different, maybe, but should still be unfolded *)
+ Set Printing All.
+ Show. (* and
+ (forall x : NonPrim.prod Set Set,
+ match x return Prop with
+ | NonPrim.pair a b => and (@eq Set a a) (@eq Set b b)
+ end)
+ (forall x : Prim.prod Set Set,
+ let a := @Prim.fst Set Set x in
+ let b := @Prim.snd Set Set x in and (@eq Set a a) (@eq Set b b)) *)
+ Unset Printing All.
+Abort.
+Goal (forall x : NonPrim.prod Set Set, match x with NonPrim.pair a b => a = a /\ b = b end)
+/\ (forall x : Prim.prod Set Set, match x with Prim.pair a b => a = a /\ b = b end).
+ Show. (* (forall x : NonPrim.prod Set Set,
+ match x with
+ | {| NonPrim.fst := a; NonPrim.snd := b |} => a = a /\ b = b
+ end) /\
+ (forall x : Prim.prod Set Set,
+ Prim.fst x = Prim.fst x /\ Prim.snd x = Prim.snd x) *)
+ Set Printing All.
+ Show.
+
+ set(foo:=forall x : Prim.prod Set Set, match x return Set with
+ | Prim.pair fst _ => fst
+ end).
+ (* and
+ (forall x : NonPrim.prod Set Set,
+ match x return Prop with
+ | NonPrim.pair a b => and (@eq Set a a) (@eq Set b b)
+ end)
+ (forall x : Prim.prod Set Set,
+ and (@eq Set (@Prim.fst Set Set x) (@Prim.fst Set Set x))
+ (@eq Set (@Prim.snd Set Set x) (@Prim.snd Set Set x))) *)
+ Unset Printing All.
+Abort. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3709.v b/test-suite/bugs/closed/3709.v
new file mode 100644
index 00000000..7f01be7a
--- /dev/null
+++ b/test-suite/bugs/closed/3709.v
@@ -0,0 +1,23 @@
+Module NonPrim.
+ Unset Primitive Projections.
+ Record hProp := hp { hproptype :> Type }.
+ Goal forall (h : (Type -> hProp) -> (Type -> hProp)) k f,
+ (forall y, h y = y) ->
+ h (fun b : Type => {| hproptype := f b |}) = k.
+ Proof.
+ intros h k f H.
+ etransitivity.
+ apply H.
+ admit.
+ Defined.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Record hProp := hp { hproptype :> Type }.
+ Goal forall (h : (Type -> hProp) -> (Type -> hProp)) k f,
+ (forall y, h y = y) ->
+ h (fun b : Type => {| hproptype := f b |}) = k.
+ Proof.
+ intros h k f H.
+ etransitivity.
+ apply H.
diff --git a/test-suite/bugs/closed/3710.v b/test-suite/bugs/closed/3710.v
new file mode 100644
index 00000000..b9e2798d
--- /dev/null
+++ b/test-suite/bugs/closed/3710.v
@@ -0,0 +1,48 @@
+(* File reduced by coq-bug-finder from original input, then from 13477 lines to 1457 lines, then from 1553 lines to 1586 lines, then \
+from 1574 lines to 823 lines, then from 837 lines to 802 lines, then from 793 lines to 657 lines, then from 661 lines to 233 lines, t\
+hen from 142 lines to 65 lines *)
+(* coqc version trunk (October 2014) compiled on Oct 8 2014 13:38:17 with OCaml 4.01.0
+ coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (335cf2860bfd9e714d14228d75a52fd2c88db386) *)
+Set Universe Polymorphism.
+Set Primitive Projections.
+Set Implicit Arguments.
+Record sigT {A} (P : A -> Type) := existT { projT1 : A ; projT2 : P projT1 }.
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+Definition relation (A : Type) := A -> A -> Type.
+Class Reflexive {A} (R : relation A) := reflexivity : forall x : A, R x x.
+Notation "( x ; y )" := (existT _ x y).
+Notation "x .1" := (projT1 x) (at level 3, format "x '.1'").
+Reserved Infix "o" (at level 40, left associativity).
+Delimit Scope category_scope with category.
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+ compose : forall s d d', morphism d d' -> morphism s d -> morphism s d' }.
+Delimit Scope functor_scope with functor.
+Record Functor (C D : PreCategory) := { object_of :> C -> D }.
+Local Open Scope category_scope.
+Class Isomorphic {C : PreCategory} (s d : C) := {}.
+Axiom composeF : forall C D E (G : Functor D E) (F : Functor C D), Functor C E.
+Infix "o" := composeF : functor_scope.
+Local Open Scope functor_scope.
+Definition sub_pre_cat {P : PreCategory -> Type} : PreCategory.
+ exact (@Build_PreCategory
+ { C : PreCategory & P C }
+ (fun C D => Functor C.1 D.1)
+ (fun _ _ _ F G => F o G)).
+Defined.
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+Axiom composeT : forall C D (F F' F'' : Functor C D) (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F'),
+ NaturalTransformation F F''.
+Definition functor_category (C D : PreCategory) : PreCategory.
+ exact (@Build_PreCategory (Functor C D)
+ (@NaturalTransformation C D)
+ (@composeT C D)).
+Defined.
+Local Notation "C -> D" := (functor_category C D) : category_scope.
+Definition NaturalIsomorphism (C D : PreCategory) F G : Type := @Isomorphic (C -> D) F G.
+Context `{P : PreCategory -> Type}.
+Local Notation cat := (@sub_pre_cat P).
+Goal forall (s d d' : cat) (m1 : morphism cat d d') (m2 : morphism cat s d),
+ NaturalIsomorphism (m1 o m2) (m1 o m2)%functor.
+Fail exact (fun _ _ _ _ _ => reflexivity _).
diff --git a/test-suite/bugs/closed/3723.v b/test-suite/bugs/closed/3723.v
new file mode 100644
index 00000000..d0b77c45
--- /dev/null
+++ b/test-suite/bugs/closed/3723.v
@@ -0,0 +1,6 @@
+(* Bugs #3787 and #3723 on reinitializing camlp5 levels *)
+
+Definition a := True.
+Reserved Notation "-- x" (at level 50, x at level 20).
+Reserved Notation "--- x" (at level 20).
+Reset a.
diff --git a/test-suite/bugs/closed/3782.v b/test-suite/bugs/closed/3782.v
new file mode 100644
index 00000000..08d456fc
--- /dev/null
+++ b/test-suite/bugs/closed/3782.v
@@ -0,0 +1,63 @@
+(* File reduced by coq-bug-finder from original input, then from 2674 lines to 136 lines, then from 115 lines to 61 lines *)
+(* coqc version trunk (October 2014) compiled on Oct 28 2014 14:33:38 with OCaml 4.01.0
+ coqtop version cagnode15:/afs/csail.mit.edu/u/j/jgross/coq-trunk,(no branch) (53bfe9cf58a3c40e6eb7120d25c1633a9cea3126) *)
+Class IsEquiv {A B : Type} (f : A -> B) := {}.
+Record Equiv A B := { equiv_fun : A -> B ; equiv_isequiv : IsEquiv equiv_fun }.
+Arguments equiv_fun {A B} _ _.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Set Printing Coercions.
+Set Printing Implicit.
+Module NonPrim.
+ Unset Primitive Projections.
+ Record TruncType (n : nat) := { trunctype_type :> Type }.
+ Canonical Structure default_TruncType := fun n T => (@Build_TruncType n T).
+ Goal (forall (s d : TruncType 0) (m : trunctype_type 0 s -> trunctype_type 0 d),
+ @IsEquiv (trunctype_type 0 s) (trunctype_type 0 d) m -> Type) ->
+ forall (T T0 : Type) (m : T0 -> T), @IsEquiv T0 T m -> True.
+ intros isiso_isequiv' mc md e e'.
+ (pose (@isiso_isequiv'
+ _ _
+ (e
+ : (Build_TruncType 0 md) ->
+ (Build_TruncType 0 mc))
+ e') as i || fail "too early"); clear i.
+ pose (@isiso_isequiv'
+ _ _ _
+ e').
+ admit.
+ Defined.
+End NonPrim.
+Module Prim.
+ Set Primitive Projections.
+ Record TruncType (n : nat) := { trunctype_type :> Type }.
+ Canonical Structure default_TruncType := fun n T => (@Build_TruncType n T).
+ Goal (forall (s d : TruncType 0) (m : trunctype_type 0 s -> trunctype_type 0 d),
+ @IsEquiv (trunctype_type 0 s) (trunctype_type 0 d) m -> Type) ->
+ forall (T T0 : Type) (m : T0 -> T), @IsEquiv T0 T m -> True.
+ intros isiso_isequiv' mc md e e'.
+ (pose (@isiso_isequiv'
+ _ _
+ (e
+ : (Build_TruncType 0 md) ->
+ (Build_TruncType 0 mc))
+ e') as i || fail "too early"); clear i.
+ Set Printing Existential Instances.
+ Set Debug Unification.
+ pose (@isiso_isequiv'
+ _ _ _
+ e'). (* Toplevel input, characters 48-50:
+Error:
+In environment
+isiso_isequiv' : forall (s d : TruncType 0)
+ (m : trunctype_type 0 s -> trunctype_type 0 d),
+ @IsEquiv (trunctype_type 0 s) (trunctype_type 0 d) m -> Type
+mc : Type
+md : Type
+e : md -> mc
+e' : @IsEquiv md mc e
+The term "e'" has type "@IsEquiv md mc e" while it is expected to have type
+ "@IsEquiv (trunctype_type 0 ?t) (trunctype_type 0 ?t0) ?t1".
+ *)
+ admit.
+ Defined.
+End Prim. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3788.v b/test-suite/bugs/closed/3788.v
new file mode 100644
index 00000000..2c5b9cb0
--- /dev/null
+++ b/test-suite/bugs/closed/3788.v
@@ -0,0 +1,6 @@
+Set Implicit Arguments.
+Global Set Primitive Projections.
+Record Functor (C D : Type) := { object_of :> forall _ : C, D }.
+Axiom path_functor_uncurried : forall C D (F G : Functor C D) (_ : sigT (fun HO : object_of F = object_of G => Set)), F = G.
+Fail Lemma path_functor_uncurried_snd C D F G HO HM
+: (@path_functor_uncurried C D F G (existT _ HO HM)) = HM.
diff --git a/test-suite/bugs/closed/3792.v b/test-suite/bugs/closed/3792.v
new file mode 100644
index 00000000..39057b9c
--- /dev/null
+++ b/test-suite/bugs/closed/3792.v
@@ -0,0 +1,4 @@
+Fail Definition pull_if_dep
+: forall {A} (P : bool -> Type) (a : A true) (a' : A false)
+ (b : bool),
+ P (if b as b return A b then a else a').
diff --git a/test-suite/bugs/closed/shouldsucceed/38.v b/test-suite/bugs/closed/38.v
index 4fc8d7c9..4fc8d7c9 100644
--- a/test-suite/bugs/closed/shouldsucceed/38.v
+++ b/test-suite/bugs/closed/38.v
diff --git a/test-suite/bugs/closed/3804.v b/test-suite/bugs/closed/3804.v
new file mode 100644
index 00000000..da9290cb
--- /dev/null
+++ b/test-suite/bugs/closed/3804.v
@@ -0,0 +1,12 @@
+Set Universe Polymorphism.
+Module Foo.
+ Definition T : sigT (fun x => x).
+ Proof.
+ exists Set.
+ abstract exact nat.
+ Defined.
+End Foo.
+Module Bar.
+ Include Foo.
+End Bar.
+Definition foo := eq_refl : Foo.T = Bar.T.
diff --git a/test-suite/bugs/closed/3821.v b/test-suite/bugs/closed/3821.v
new file mode 100644
index 00000000..8da4f736
--- /dev/null
+++ b/test-suite/bugs/closed/3821.v
@@ -0,0 +1,2 @@
+Inductive quotient {A : Type@{i}} {B : Type@{j}} : Type@{max(i, j)} := .
+
diff --git a/test-suite/bugs/closed/3828.v b/test-suite/bugs/closed/3828.v
new file mode 100644
index 00000000..ae11c6c9
--- /dev/null
+++ b/test-suite/bugs/closed/3828.v
@@ -0,0 +1,2 @@
+Goal 0 = 0.
+Fail pose ?Goal.
diff --git a/test-suite/bugs/closed/3848.v b/test-suite/bugs/closed/3848.v
new file mode 100644
index 00000000..b66aecca
--- /dev/null
+++ b/test-suite/bugs/closed/3848.v
@@ -0,0 +1,21 @@
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing).
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x.
+Class IsEquiv {A B} (f : A -> B) := { equiv_inv : B -> A ; eisretr : Sect equiv_inv f }.
+Arguments eisretr {A B} f {_} _.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'").
+Generalizable Variables A B f g e n.
+Definition functor_forall `{P : A -> Type} `{Q : B -> Type}
+ (f0 : B -> A) (f1 : forall b:B, P (f0 b) -> Q b)
+: (forall a:A, P a) -> (forall b:B, Q b).
+ admit.
+Defined.
+
+Lemma isequiv_functor_forall `{P : A -> Type} `{Q : B -> Type}
+ `{IsEquiv B A f} `{forall b, @IsEquiv (P (f b)) (Q b) (g b)}
+: (forall b : B, Q b) -> forall a : A, P a.
+Proof.
+ refine (functor_forall
+ (f^-1)
+ (fun (x:A) (y:Q (f^-1 x)) => eisretr f x # (g (f^-1 x))^-1 y)).
+Defined. (* Error: Attempt to save an incomplete proof *)
diff --git a/test-suite/bugs/closed/3854.v b/test-suite/bugs/closed/3854.v
new file mode 100644
index 00000000..f8329cdd
--- /dev/null
+++ b/test-suite/bugs/closed/3854.v
@@ -0,0 +1,21 @@
+Definition relation (A : Type) := A -> A -> Type.
+Class Reflexive {A} (R : relation A) := reflexivity : forall x : A, R x x.
+Axiom IsHProp : Type -> Type.
+Existing Class IsHProp.
+Inductive Empty : Set := .
+Notation "~ x" := (x -> Empty) : type_scope.
+Record hProp := BuildhProp { type :> Type ; trunc : IsHProp type }.
+Arguments BuildhProp _ {_}.
+Canonical Structure default_hProp := fun T P => (@BuildhProp T P).
+Generalizable Variables A B f g e n.
+Axiom trunc_forall : forall `{P : A -> Type}, IsHProp (forall a, P a).
+Existing Instance trunc_forall.
+Inductive V : Type := | set {A : Type} (f : A -> V) : V.
+Axiom mem : V -> V -> hProp.
+Axiom mem_induction
+: forall (C : V -> hProp), (forall v, (forall x, mem x v -> C x) -> C v) -> forall v, C v.
+Definition irreflexive_mem : forall x, (fun x y => ~ mem x y) x x.
+Proof.
+ pose (fun x => BuildhProp (~ mem x x)).
+ refine (mem_induction (fun x => BuildhProp (~ mem x x)) _); simpl in *.
+ admit.
diff --git a/test-suite/bugs/closed/3892.v b/test-suite/bugs/closed/3892.v
new file mode 100644
index 00000000..833722ba
--- /dev/null
+++ b/test-suite/bugs/closed/3892.v
@@ -0,0 +1,8 @@
+(* Check that notation variables do not capture names hidden behind
+ another notation. *)
+Notation "A <-> B" := ((A -> B) * (B -> A))%type : type_scope.
+Notation compose := (fun g f x => g (f x)).
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity).
+Definition iff_compose {A B C : Type} (g : B <-> C) (f : A <-> B) : A <-> C :=
+ (fst g o fst f , snd f o snd g).
+(* Used to fail with: This expression should be a name. *)
diff --git a/test-suite/bugs/closed/3895.v b/test-suite/bugs/closed/3895.v
new file mode 100644
index 00000000..8659ca2c
--- /dev/null
+++ b/test-suite/bugs/closed/3895.v
@@ -0,0 +1,22 @@
+Notation pr1 := (@projT1 _ _).
+Notation compose := (fun g' f' x => g' (f' x)).
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) :
+function_scope.
+Open Scope function_scope.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p
+with eq_refl => eq_refl end.
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x) := forall x:A,
+f x = g x.
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) :
+type_scope.
+Theorem Univalence_implies_FunextNondep (A B : Type)
+: forall f g : A -> B, f == g -> f = g.
+Proof.
+ intros f g p.
+ pose (d := fun x : A => existT (fun xy => fst xy = snd xy) (f x, f x)
+(eq_refl (f x))).
+ pose (e := fun x : A => existT (fun xy => fst xy = snd xy) (f x, g x) (p x)).
+ change f with ((snd o pr1) o d).
+ change g with ((snd o pr1) o e).
+ apply (ap (fun g => snd o pr1 o g)).
+(* Used to raise a not Found due to a "typo" in solve_evar_evar *)
diff --git a/test-suite/bugs/closed/3896.v b/test-suite/bugs/closed/3896.v
new file mode 100644
index 00000000..b433922a
--- /dev/null
+++ b/test-suite/bugs/closed/3896.v
@@ -0,0 +1,4 @@
+Goal True.
+pose proof 0 as n.
+Fail apply pair in n.
+(* Used to be an anomaly for a while *)
diff --git a/test-suite/bugs/closed/3899.v b/test-suite/bugs/closed/3899.v
new file mode 100644
index 00000000..e83166aa
--- /dev/null
+++ b/test-suite/bugs/closed/3899.v
@@ -0,0 +1,11 @@
+Set Primitive Projections.
+Record unit : Set := tt {}.
+Fail Check fun x : unit => eq_refl : tt = x.
+Fail Check fun x : unit => eq_refl : x = tt.
+Fail Check fun x y : unit => (eq_refl : x = tt) : x = y.
+Fail Check fun x y : unit => eq_refl : x = y.
+
+Record ok : Set := tt' { a : unit }.
+
+Record nonprim : Prop := { undef : unit }.
+Record prim : Prop := { def : True }. \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldsucceed/545.v b/test-suite/bugs/closed/545.v
index 926af7dd..926af7dd 100644
--- a/test-suite/bugs/closed/shouldsucceed/545.v
+++ b/test-suite/bugs/closed/545.v
diff --git a/test-suite/bugs/closed/shouldsucceed/808_2411.v b/test-suite/bugs/closed/808_2411.v
index 1c13e745..1c13e745 100644
--- a/test-suite/bugs/closed/shouldsucceed/808_2411.v
+++ b/test-suite/bugs/closed/808_2411.v
diff --git a/test-suite/bugs/closed/shouldsucceed/846.v b/test-suite/bugs/closed/846.v
index ee5ec1fa..ee5ec1fa 100644
--- a/test-suite/bugs/closed/shouldsucceed/846.v
+++ b/test-suite/bugs/closed/846.v
diff --git a/test-suite/bugs/closed/shouldsucceed/931.v b/test-suite/bugs/closed/931.v
index 21f15e72..e86b3be6 100644
--- a/test-suite/bugs/closed/shouldsucceed/931.v
+++ b/test-suite/bugs/closed/931.v
@@ -2,6 +2,6 @@ Parameter P : forall n : nat, n=n -> Prop.
Goal Prop.
refine (P _ _).
- instantiate (1:=0).
+ 2:instantiate (1:=0).
trivial.
Qed.
diff --git a/test-suite/bugs/closed/HoTT_coq_001.v b/test-suite/bugs/closed/HoTT_coq_001.v
new file mode 100644
index 00000000..bf1d024b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_001.v
@@ -0,0 +1,5 @@
+Record Foo : Set :=
+ {
+ A' : nat;
+ A : Prop := (A' = 0)
+ }. (* Anomaly: Uncaught exception Reduction.NotConvertible. Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_002.v b/test-suite/bugs/closed/HoTT_coq_002.v
new file mode 100644
index 00000000..ba69f6b1
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_002.v
@@ -0,0 +1,33 @@
+Set Implicit Arguments.
+
+Generalizable All Variables.
+
+Parameter SpecializedCategory : Type -> Type.
+Parameter Object : forall obj, SpecializedCategory obj -> Type.
+
+Section SpecializedFunctor.
+ (* Variable objC : Type. *)
+ Context `(C : SpecializedCategory objC).
+
+ Polymorphic Record SpecializedFunctor := {
+ ObjectOf' : objC -> Type;
+ ObjectC : Object C
+ }.
+End SpecializedFunctor.
+
+Section FunctorInterface.
+ Variable objC : Type.
+ Variable C : SpecializedCategory objC.
+ Variable F : SpecializedFunctor C.
+
+ Set Printing All.
+ Set Printing Universes.
+ Check @ObjectOf' objC C F. (* Toplevel input, characters 24-25:
+Error:
+In environment
+objC : Type (* Top.515 *)
+C : SpecializedCategory objC
+F : @SpecializedFunctor (* Top.516 *) objC C
+The term "F" has type "@SpecializedFunctor (* Top.516 *) objC C"
+ while it is expected to have type
+ "@SpecializedFunctor (* Top.519 Top.520 *) objC C". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_006.v b/test-suite/bugs/closed/HoTT_coq_006.v
new file mode 100644
index 00000000..c7943b84
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_006.v
@@ -0,0 +1,99 @@
+Module FirstIssue.
+ Set Implicit Arguments.
+
+ Record Cat (obj : Type) := {}.
+
+ Record Functor objC (C : Cat objC) objD (D : Cat objD) :=
+ {
+ ObjectOf' : objC -> objD
+ }.
+
+ Definition TypeCat : Cat Type. constructor. Defined.
+ Definition PropCat : Cat Prop. constructor. Defined.
+
+ Definition FunctorFrom_Type2Prop objC (C : Cat objC) (F : Functor TypeCat C) : Functor PropCat C.
+ Set Printing All.
+ Set Printing Universes.
+ Check F. (* F : @Functor Type (* Top.1201 *) TypeCat objC C *)
+ exact (Build_Functor PropCat C (ObjectOf' F)).
+ Show Proof. (* (fun (objC : Type (* Top.1194 *)) (C : Cat objC)
+ (F : @Functor Prop TypeCat objC C) =>
+ @Build_Functor Prop PropCat objC C
+ (@ObjectOf' Prop TypeCat objC C F)) *)
+ Defined.
+ (* Error: Illegal application (Type Error):
+The term "Functor" of type
+ "forall (objC : Type (* Top.1194 *)) (_ : Cat objC)
+ (objD : Type (* Top.1194 *)) (_ : Cat objD),
+ Type (* Top.1194 *)"
+cannot be applied to the terms
+ "Prop" : "Type (* (Set)+1 *)"
+ "TypeCat" : "Cat Type (* Top.1201 *)"
+ "objC" : "Type (* Top.1194 *)"
+ "C" : "Cat objC"
+The 2nd term has type "Cat Type (* Top.1201 *)"
+which should be coercible to "Cat Prop". *)
+End FirstIssue.
+
+Module SecondIssue.
+ Set Implicit Arguments.
+
+ Set Printing Universes.
+
+ Polymorphic Record Cat (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism' : obj -> obj -> Type
+ }.
+
+ Polymorphic Record Functor objC (C : Cat objC) objD (D : Cat objD) :=
+ {
+ ObjectOf' : objC -> objD;
+ MorphismOf' : forall s d, C.(Morphism') s d -> D.(Morphism') (ObjectOf' s) (ObjectOf' d)
+ }.
+
+ Definition SetCat : Cat Set := @Build_Cat Set (fun x y => x -> y).
+ Definition PropCat : Cat Prop := @Build_Cat Prop (fun x y => x -> y).
+
+ Set Printing All.
+
+ Definition FunctorFrom_Set2Prop objC (C : Cat objC) (F : Functor SetCat C) : Functor PropCat C.
+ exact (Build_Functor PropCat C
+ (ObjectOf' F)
+ (MorphismOf' F)
+ ).
+ Defined. (* Error: Illegal application (Type Error):
+The term "Build_Functor (* Top.748 Prop Top.808 Top.809 *)" of type
+ "forall (objC : Type (* Top.748 *)) (C : Cat (* Top.748 Prop *) objC)
+ (objD : Type (* Top.808 *)) (D : Cat (* Top.808 Top.809 *) objD)
+ (ObjectOf' : forall _ : objC, objD)
+ (_ : forall (s d : objC) (_ : @Morphism' (* Top.748 Prop *) objC C s d),
+ @Morphism' (* Top.808 Top.809 *) objD D (ObjectOf' s) (ObjectOf' d)),
+ @Functor (* Top.748 Prop Top.808 Top.809 *) objC C objD D"
+cannot be applied to the terms
+ "Prop" : "Type (* (Set)+1 *)"
+ "PropCat" : "Cat (* Top.748 Prop *) Prop"
+ "objC" : "Type (* Top.808 *)"
+ "C" : "Cat (* Top.808 Top.809 *) objC"
+ "fun x : Prop =>
+ @ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F x"
+ : "forall _ : Prop, objC"
+ "@MorphismOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F"
+ : "forall (s d : Set) (_ : @Morphism' (* Top.744 Prop *) Set SetCat s d),
+ @Morphism' (* Top.808 Top.809 *) objC C
+ (@ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F s)
+ (@ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F d)"
+The 6th term has type
+ "forall (s d : Set) (_ : @Morphism' (* Top.744 Prop *) Set SetCat s d),
+ @Morphism' (* Top.808 Top.809 *) objC C
+ (@ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F s)
+ (@ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F d)"
+which should be coercible to
+ "forall (s d : Prop) (_ : @Morphism' (* Top.748 Prop *) Prop PropCat s d),
+ @Morphism' (* Top.808 Top.809 *) objC C
+ ((fun x : Prop =>
+ @ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F x) s)
+ ((fun x : Prop =>
+ @ObjectOf' (* Top.744 Prop Top.808 Top.809 *) Set SetCat objC C F x) d)".
+ *)
+End SecondIssue.
diff --git a/test-suite/bugs/closed/HoTT_coq_007.v b/test-suite/bugs/closed/HoTT_coq_007.v
new file mode 100644
index 00000000..8592c729
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_007.v
@@ -0,0 +1,112 @@
+Module Comment1.
+ Set Implicit Arguments.
+
+ Polymorphic Record Category (obj : Type) :=
+ {
+ Morphism : obj -> obj -> Type;
+ Identity : forall o, Morphism o o
+ }.
+
+ Polymorphic Record Functor objC (C :Category objC) objD (D : Category objD) :=
+ {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d);
+ FIdentityOf : forall o, MorphismOf _ _ (C.(Identity) o) = D.(Identity) (ObjectOf o)
+ }.
+
+ Create HintDb functor discriminated.
+
+ Hint Rewrite @FIdentityOf : functor.
+
+ Polymorphic Definition ComposeFunctors objC C objD D objE E (G : @Functor objD D objE E) (F : @Functor objC C objD D) : Functor C E.
+ refine {| ObjectOf := (fun c => G (F c));
+ MorphismOf := (fun _ _ m => G.(MorphismOf) _ _ (F.(MorphismOf) _ _ m))
+ |};
+ intros; autorewrite with functor; reflexivity.
+ Defined.
+
+ Definition Cat0 : Category@{i j} Empty_set.
+ refine {|
+ Morphism := fun s d : Empty_set => s = d;
+ Identity := fun o : Empty_set => eq_refl
+ |};
+ admit.
+ Defined.
+
+ Set Printing All.
+ Set Printing Universes.
+
+ Lemma foo objC (C : @Category objC) (C0 : Category (Functor Cat0 C)) (x : Functor Cat0 Cat0)
+ : forall (y : Functor C0 Cat0) z, (ComposeFunctors y z = x).
+ intro. intro.
+ unfold ComposeFunctors.
+ Abort.
+End Comment1.
+
+Module Comment2.
+ Set Implicit Arguments.
+
+ Polymorphic Record Category (obj : Type) :=
+ {
+ Morphism : obj -> obj -> Type;
+
+ Identity : forall o, Morphism o o;
+ Compose : forall s d d2, Morphism d d2 -> Morphism s d -> Morphism s d2;
+
+ LeftIdentity : forall a b (f : Morphism a b), Compose (Identity b) f = f
+ }.
+
+ Polymorphic Record Functor objC (C : Category objC) objD (D : Category objD) :=
+ {
+ ObjectOf : objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+
+ Create HintDb morphism discriminated.
+
+ Polymorphic Hint Resolve @LeftIdentity : morphism.
+
+ Polymorphic Definition ProductCategory objC (C : Category objC) objD (D : Category objD) : @Category (objC * objD)%type.
+ refine {|
+ Morphism := (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type);
+ Identity := (fun o => (Identity _ (fst o), Identity _ (snd o)));
+ Compose := (fun (s d d2 : (objC * objD)%type) m2 m1 => (C.(Compose) _ _ _ (fst m2) (fst m1), D.(Compose) _ _ _ (snd m2) (snd m1)))
+ |};
+ intros; apply injective_projections; simpl; auto with morphism. (* Replacing [auto with morphism] with [apply @LeftIdentity] removes the error *)
+ Defined.
+
+ Polymorphic Definition Cat0 : Category Empty_set.
+ refine {|
+ Morphism := fun s d : Empty_set => s = d;
+ Identity := fun o : Empty_set => eq_refl;
+ Compose := fun s d d2 m0 m1 => eq_trans m1 m0
+ |};
+ admit.
+ Defined.
+
+ Set Printing All.
+ Set Printing Universes.
+ Polymorphic Definition ProductLaw0Functor (objC : Type) (C : Category objC) : Functor (ProductCategory C Cat0) Cat0.
+ refine (Build_Functor (ProductCategory C Cat0) Cat0 _ _). (* Toplevel input, characters 15-71:
+Error: Refiner was given an argument
+ "prod (* Top.2289 Top.2289 *) objC Empty_set" of type
+"Type (* Top.2289 *)" instead of "Set". *)
+ Abort.
+ Polymorphic Definition ProductLaw0Functor (objC : Type) (C : Category objC) : Functor (ProductCategory C Cat0) Cat0.
+ econstructor. (* Toplevel input, characters 0-12:
+Error: No applicable tactic.
+ *)
+ Abort.
+End Comment2.
+
+
+Module Comment3.
+ Polymorphic Lemma foo {obj : Type} : 1 = 1.
+ trivial.
+ Qed.
+
+ Polymorphic Hint Resolve foo. (* success *)
+ Polymorphic Hint Rewrite @foo. (* Success *)
+ Polymorphic Hint Resolve @foo. (* Error: @foo is a term and cannot be made a polymorphic hint, only global references can be polymorphic hints. *)
+ Fail Polymorphic Hint Rewrite foo. (* Error: Cannot infer the implicit parameter obj of foo. *)
+End Comment3.
diff --git a/test-suite/bugs/closed/HoTT_coq_010.v b/test-suite/bugs/closed/HoTT_coq_010.v
new file mode 100644
index 00000000..42b1244f
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_010.v
@@ -0,0 +1,3 @@
+SearchAbout and.
+(* Anomaly: Mismatched instance and context when building universe substitution.
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_012.v b/test-suite/bugs/closed/HoTT_coq_012.v
new file mode 100644
index 00000000..a3c697f8
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_012.v
@@ -0,0 +1,4 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+
+Definition UU := Type.
+Inductive toto (B : UU) : UU := c (x : B).
diff --git a/test-suite/bugs/closed/HoTT_coq_013.v b/test-suite/bugs/closed/HoTT_coq_013.v
new file mode 100644
index 00000000..13962d5b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_013.v
@@ -0,0 +1,24 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+
+Polymorphic Variant Category (obj : Type) :=.
+
+ Polymorphic Variant Functor objC (C : Category objC) objD (D : Category objD) :=.
+
+ Polymorphic Definition ComposeFunctors objC C objD D objE E (G : @Functor objD D objE E) (F : @Functor objC C objD D) : Functor C E.
+Admitted.
+
+Polymorphic Definition ProductCategory objC (C : Category objC) objD (D : Category objD) : @Category (objC * objD)%type.
+Admitted.
+
+Polymorphic Definition Cat0 : Category Empty_set.
+Admitted.
+
+Set Printing Universes.
+
+Lemma ProductLaw0 objC (C : Category objC) (F : Functor (ProductCategory C Cat0) Cat0) (G : Functor Cat0 (ProductCategory C Cat0)) x y :
+ ComposeFunctors F G = x /\
+ ComposeFunctors G F = y.
+Proof.
+ split. (* Error: Refiner was given an argument "(objC * 0)%type" of type "Type" instead of "Set". *)
+Abort.
diff --git a/test-suite/bugs/closed/HoTT_coq_014.v b/test-suite/bugs/closed/HoTT_coq_014.v
new file mode 100644
index 00000000..63548a64
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_014.v
@@ -0,0 +1,200 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Universe Polymorphism.
+
+Polymorphic Record SpecializedCategory (obj : Type) := Build_SpecializedCategory' {
+ Object :> _ := obj;
+ Morphism' : obj -> obj -> Type;
+
+ Identity' : forall o, Morphism' o o;
+ Compose' : forall s d d', Morphism' d d' -> Morphism' s d -> Morphism' s d'
+}.
+
+Polymorphic Definition Morphism obj (C : @SpecializedCategory obj) : forall s d : C, _ := Eval cbv beta delta [Morphism'] in C.(Morphism').
+
+(* eh, I'm not terribly happy. meh. *)
+Polymorphic Definition SmallSpecializedCategory (obj : Set) (*mor : obj -> obj -> Set*) := SpecializedCategory@{Set Set} obj.
+Polymorphic Identity Coercion SmallSpecializedCategory_LocallySmallSpecializedCategory_Id : SmallSpecializedCategory >-> SpecializedCategory.
+
+Polymorphic Record Category := {
+ CObject : Type;
+
+ UnderlyingCategory :> @SpecializedCategory CObject
+}.
+
+Polymorphic Definition GeneralizeCategory `(C : @SpecializedCategory obj) : Category.
+ refine {| CObject := C.(Object) |}; auto.
+Defined.
+
+Polymorphic Coercion GeneralizeCategory : SpecializedCategory >-> Category.
+
+
+
+Section SpecializedFunctor.
+ Set Universe Polymorphism.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Unset Universe Polymorphism.
+
+ Polymorphic Record SpecializedFunctor := {
+ ObjectOf' : objC -> objD;
+ MorphismOf' : forall s d, C.(Morphism') s d -> D.(Morphism') (ObjectOf' s) (ObjectOf' d);
+ FCompositionOf' : forall s d d' (m1 : C.(Morphism') s d) (m2: C.(Morphism') d d'),
+ MorphismOf' _ _ (C.(Compose') _ _ _ m2 m1) = D.(Compose') _ _ _ (MorphismOf' _ _ m2) (MorphismOf' _ _ m1);
+ FIdentityOf' : forall o, MorphismOf' _ _ (C.(Identity') o) = D.(Identity') (ObjectOf' o)
+ }.
+End SpecializedFunctor.
+
+Global Polymorphic Coercion ObjectOf' : SpecializedFunctor >-> Funclass.
+Set Universe Polymorphism.
+Section Functor.
+ Variable C D : Category.
+
+ Polymorphic Definition Functor := SpecializedFunctor C D.
+End Functor.
+Unset Universe Polymorphism.
+
+Polymorphic Identity Coercion Functor_SpecializedFunctor_Id : Functor >-> SpecializedFunctor.
+Polymorphic Definition GeneralizeFunctor objC C objD D (F : @SpecializedFunctor objC C objD D) : Functor C D := F.
+Polymorphic Coercion GeneralizeFunctor : SpecializedFunctor >-> Functor.
+
+Arguments SpecializedFunctor {objC} C {objD} D.
+
+
+Polymorphic Record SmallCategory := {
+ SObject : Set;
+
+ SUnderlyingCategory :> @SmallSpecializedCategory SObject
+}.
+
+Polymorphic Definition GeneralizeSmallCategory `(C : @SmallSpecializedCategory obj) : SmallCategory.
+ refine {| SObject := obj |}; destruct C; econstructor; eassumption.
+Defined.
+
+Polymorphic Coercion GeneralizeSmallCategory : SmallSpecializedCategory >-> SmallCategory.
+
+Bind Scope category_scope with SmallCategory.
+
+
+Polymorphic Definition TypeCat : @SpecializedCategory Type := (@Build_SpecializedCategory' Type
+ (fun s d => s -> d)
+ (fun _ => (fun x => x))
+ (fun _ _ _ f g => (fun x => f (g x)))).
+(*Unset Universe Polymorphism.*)
+Polymorphic Definition FunctorCategory objC (C : @SpecializedCategory objC) objD (D : @SpecializedCategory objD) :
+ @SpecializedCategory (SpecializedFunctor C D).
+Admitted.
+
+Polymorphic Definition DiscreteCategory (O : Type) : @SpecializedCategory O.
+Admitted.
+
+Polymorphic Definition ComputableCategory (I : Type) (Index2Object : I -> Type) (Index2Cat : forall i : I, @SpecializedCategory (@Index2Object i)) :
+ @SpecializedCategory I.
+Admitted.
+
+Polymorphic Definition is_unique (A : Type) (x : A) := forall x' : A, x' = x.
+
+Polymorphic Definition InitialObject obj {C : SpecializedCategory obj} (o : C) :=
+ forall o', { m : C.(Morphism) o o' | is_unique m }.
+
+Polymorphic Definition SmallCat := ComputableCategory _ SUnderlyingCategory.
+
+Lemma InitialCategory_Initial : InitialObject (C := SmallCat) (DiscreteCategory Empty_set : SmallSpecializedCategory _).
+ admit.
+Qed.
+
+Set Universe Polymorphism.
+Section GraphObj.
+ Context `(C : @SpecializedCategory objC).
+
+ Inductive GraphIndex := GraphIndexSource | GraphIndexTarget.
+
+ Definition GraphIndex_Morphism (a b : GraphIndex) : Set :=
+ match (a, b) with
+ | (GraphIndexSource, GraphIndexSource) => unit
+ | (GraphIndexTarget, GraphIndexTarget) => unit
+ | (GraphIndexTarget, GraphIndexSource) => Empty_set
+ | (GraphIndexSource, GraphIndexTarget) => GraphIndex
+ end.
+
+ Global Arguments GraphIndex_Morphism a b /.
+
+ Definition GraphIndex_Compose s d d' (m1 : GraphIndex_Morphism d d') (m2 : GraphIndex_Morphism s d) :
+ GraphIndex_Morphism s d'.
+ Admitted.
+
+ Definition GraphIndexingCategory : @SpecializedCategory GraphIndex.
+ refine {|
+ Morphism' := GraphIndex_Morphism;
+ Identity' := (fun x => match x with GraphIndexSource => tt | GraphIndexTarget => tt end);
+ Compose' := GraphIndex_Compose
+ |};
+ admit.
+ Defined.
+
+ Definition UnderlyingGraph_ObjectOf x :=
+ match x with
+ | GraphIndexSource => { sd : objC * objC & C.(Morphism) (fst sd) (snd sd) }
+ | GraphIndexTarget => objC
+ end.
+
+ Global Arguments UnderlyingGraph_ObjectOf x /.
+
+ Definition UnderlyingGraph_MorphismOf s d (m : Morphism GraphIndexingCategory s d) :
+ UnderlyingGraph_ObjectOf s -> UnderlyingGraph_ObjectOf d.
+ Admitted.
+
+ Definition UnderlyingGraph : SpecializedFunctor GraphIndexingCategory TypeCat.
+ Proof.
+ match goal with
+ | [ |- SpecializedFunctor ?C ?D ] =>
+ refine (Build_SpecializedFunctor C D
+ UnderlyingGraph_ObjectOf
+ UnderlyingGraph_MorphismOf
+ _
+ _
+ )
+ end;
+ admit.
+ Defined.
+End GraphObj.
+
+Set Printing Universes.
+Set Printing All.
+
+Print Coercions.
+
+Section test.
+
+Fail Polymorphic Definition UnderlyingGraphFunctor_MorphismOf' (C D : SmallCategory) (F : SpecializedFunctor C D) :
+ Morphism (FunctorCategory TypeCat GraphIndexingCategory)
+ (@UnderlyingGraph (SObject C)
+ (SmallSpecializedCategory_LocallySmallSpecializedCategory_Id (SUnderlyingCategory C)))
+ (UnderlyingGraph D).
+ (* Toplevel input, characters 216-249:
+Error:
+In environment
+C : SmallCategory (* Top.594 *)
+D : SmallCategory (* Top.595 *)
+F :
+@SpecializedFunctor (* Top.25 Set Top.25 Set *) (SObject (* Top.25 *) C)
+ (SUnderlyingCategory (* Top.25 *) C) (SObject (* Top.25 *) D)
+ (SUnderlyingCategory (* Top.25 *) D)
+The term
+ "SUnderlyingCategory (* Top.25 *) C
+ :SpecializedCategory (* Top.25 Set *) (SObject (* Top.25 *) C)" has type
+ "SpecializedCategory (* Top.618 Top.619 *) (SObject (* Top.25 *) C)"
+while it is expected to have type
+ "SpecializedCategory (* Top.224 Top.225 *) (SObject (* Top.617 *) C)"
+(Universe inconsistency: Cannot enforce Set = Top.225)).
+ *)
+Fail Admitted.
+
+Fail Polymorphic Definition UnderlyingGraphFunctor_MorphismOf (C D : SmallCategory) (F : SpecializedFunctor C D) :
+ Morphism (FunctorCategory TypeCat GraphIndexingCategory) (UnderlyingGraph C) (UnderlyingGraph D). (* Anomaly: apply_coercion. Please report.*)
+Fail Admitted.
+
+Polymorphic Definition UnderlyingGraphFunctor_MorphismOf (C D : SmallCategory) (F : SpecializedFunctor C D) :
+ Morphism (FunctorCategory GraphIndexingCategory TypeCat) (UnderlyingGraph C) (UnderlyingGraph D). (* Anomaly: apply_coercion. Please report.*)
+Proof.
+Admitted. \ No newline at end of file
diff --git a/test-suite/bugs/closed/HoTT_coq_016.v b/test-suite/bugs/closed/HoTT_coq_016.v
new file mode 100644
index 00000000..4f12cf1a
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_016.v
@@ -0,0 +1,15 @@
+Set Printing Universes.
+Local Close Scope nat_scope.
+Check (fun ab : Prop * Prop => (fst ab : Prop) * (snd ab : Prop)).
+(* fun ab : Prop * Prop =>
+(fst (* Top.5817 Top.5818 *) ab:Prop) * (snd (* Top.5817 Top.5818 *) ab:Prop)
+ : Prop * Prop -> Prop *)
+Check (fun ab : Prop * Prop => (fst ab : Prop) * (snd ab : Prop) : Prop).
+(* Toplevel input, characters 51-84:
+Error: In environment
+ab : Prop * Prop
+The term
+ "(fst (* Top.5833 Top.5834 *) ab:Prop) *
+ (snd (* Top.5833 Top.5834 *) ab:Prop)" has type
+ "Type (* max(Top.5829, Top.5830) *)" while it is expected to have type
+ "Prop". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_020.v b/test-suite/bugs/closed/HoTT_coq_020.v
new file mode 100644
index 00000000..b16c1df2
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_020.v
@@ -0,0 +1,95 @@
+Set Implicit Arguments.
+
+Generalizable All Variables.
+
+Set Asymmetric Patterns.
+
+Polymorphic Record Category (obj : Type) :=
+ Build_Category {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+Polymorphic Record Functor objC (C : Category objC) objD (D : Category objD) :=
+ { ObjectOf :> objC -> objD }.
+
+Polymorphic Record NaturalTransformation objC C objD D (F G : Functor (objC := objC) C (objD := objD) D) :=
+ { ComponentsOf' :> forall c, D.(Morphism) (F.(ObjectOf) c) (G.(ObjectOf) c);
+ Commutes' : forall s d (m : C.(Morphism) s d), ComponentsOf' s = ComponentsOf' s }.
+
+Ltac present_obj from to :=
+ match goal with
+ | [ _ : appcontext[from ?obj ?C] |- _ ] => progress change (from obj C) with (to obj C) in *
+ | [ |- appcontext[from ?obj ?C] ] => progress change (from obj C) with (to obj C) in *
+ end.
+
+Section NaturalTransformationComposition.
+ Set Universe Polymorphism.
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+ Context `(E : @Category objE).
+ Variables F F' F'' : Functor C D.
+ Unset Universe Polymorphism.
+
+ Polymorphic Definition NTComposeT (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F') :
+ NaturalTransformation F F''.
+ exists (fun c => Compose _ _ _ _ (T' c) (T c)).
+ repeat progress present_obj @Morphism @Morphism. (* removing this line makes the error go away *)
+ intros. (* removing this line makes the error go away *)
+ admit.
+ Defined.
+End NaturalTransformationComposition.
+
+
+Polymorphic Definition FunctorCategory objC (C : Category objC) objD (D : Category objD) :
+ @Category (Functor C D)
+ := @Build_Category (Functor C D)
+ (NaturalTransformation (C := C) (D := D))
+ (NTComposeT (C := C) (D := D)).
+
+Polymorphic Definition Cat0 : Category Empty_set
+ := @Build_Category Empty_set
+ (@eq _)
+ (fun x => match x return _ with end).
+
+Polymorphic Definition FunctorFrom0 objC (C : Category objC) : Functor Cat0 C
+ := Build_Functor Cat0 C (fun x => match x with end).
+
+Section Law0.
+ Variable objC : Type.
+ Variable C : Category objC.
+
+ Set Printing All.
+ Set Printing Universes.
+ Set Printing Existential Instances.
+
+ Polymorphic Definition ExponentialLaw0Functor_Inverse_ObjectOf' : Object (@FunctorCategory Empty_set Cat0 objC C).
+ (* In environment
+objC : Type (* Top.154 *)
+C : Category (* Top.155 Top.154 *) objC
+The term "objC" has type "Type (* Top.154 *)"
+while it is expected to have type "Type (* Top.184 *)"
+(Universe inconsistency: Cannot enforce Top.154 <= Set)). *)
+ Admitted.
+
+ Polymorphic Definition ExponentialLaw0Functor_Inverse_ObjectOf : Object (FunctorCategory Cat0 C).
+ hnf.
+ refine (@FunctorFrom0 _ _).
+
+ (* Toplevel input, characters 23-40:
+Error:
+In environment
+objC : Type (* Top.61069 *)
+C : Category (* Top.61069 Top.61071 *) objC
+The term
+ "@FunctorFrom0 (* Top.61077 Top.61078 *) ?69 (* [objC, C] *)
+ ?70 (* [objC, C] *)" has type
+ "@Functor (* Set Prop Top.61077 Top.61078 *) Empty_set Cat0
+ ?69 (* [objC, C] *) ?70 (* [objC, C] *)"
+ while it is expected to have type
+ "@Functor (* Set Prop Set Prop *) Empty_set Cat0 objC C".
+*)
+ Defined.
+End Law0.
diff --git a/test-suite/bugs/closed/HoTT_coq_023.v b/test-suite/bugs/closed/HoTT_coq_023.v
new file mode 100644
index 00000000..b52140de
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_023.v
@@ -0,0 +1,12 @@
+Set Universe Polymorphism.
+
+Record Type_Over (X : Type)
+:= { Domain :> Type;
+ proj : Domain -> X }.
+
+Definition Self_Over (X : Type)
+ := {| Domain := X; proj := (fun x => x) |}.
+
+Canonical Structure Self_Over. (* fails with Anomaly: Mismatched instance and context when building universe substitution. Please report. for polymorphic structures *)
+(* if monomorphic, Warning: No global reference exists for projection
+ valuefun x : _UNBOUND_REL_1 => x in instance Self_Over of proj, ignoring it. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_025.v b/test-suite/bugs/closed/HoTT_coq_025.v
new file mode 100644
index 00000000..b81b454d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_025.v
@@ -0,0 +1,29 @@
+Module monomorphic.
+ Class Inhabited (A : Type) : Prop := populate { _ : A }.
+ Arguments populate {_} _.
+
+ Instance prod_inhabited {A B : Type} (iA : Inhabited A)
+ (iB : Inhabited B) : Inhabited (A * B) :=
+ match iA, iB with
+ | populate x, populate y => populate (x,y)
+ end.
+ (* Error: In environment
+A : Type
+B : Type
+iA : Inhabited A
+iB : Inhabited B
+The term "(A * B)%type" has type "Type" while it is expected to have type
+"Prop". *)
+End monomorphic.
+
+Module polymorphic.
+ Set Universe Polymorphism.
+ Class Inhabited (A : Type) : Prop := populate { _ : A }.
+ Arguments populate {_} _.
+
+ Instance prod_inhabited {A B : Type} (iA : Inhabited A)
+ (iB : Inhabited B) : Inhabited (A * B) :=
+ match iA, iB with
+ | populate x, populate y => populate (x,y)
+ end.
+End polymorphic.
diff --git a/test-suite/bugs/closed/HoTT_coq_027.v b/test-suite/bugs/closed/HoTT_coq_027.v
new file mode 100644
index 00000000..27834cc4
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_027.v
@@ -0,0 +1,94 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Asymmetric Patterns.
+Set Universe Polymorphism.
+
+Record Category (obj : Type) := { Morphism : obj -> obj -> Type }.
+
+Record Functor `(C : Category objC) `(D : Category objD) :=
+ { ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d) }.
+
+Definition TypeCat : @Category Type := @Build_Category Type (fun s d => s -> d).
+Definition SetCat : @Category Set := @Build_Category Set (fun s d => s -> d).
+
+Definition FunctorToSet `(C : @Category objC) := Functor C SetCat.
+Definition FunctorToType `(C : @Category objC) := Functor C TypeCat.
+
+(* Removing the following line, as well as the [Definition] and [Identity Coercion] immediately following it, makes the file go through *)
+Identity Coercion FunctorToType_Id : FunctorToType >-> Functor.
+
+Set Printing Universes.
+Definition FunctorTo_Set2Type `(C : @Category objC) (F : FunctorToSet C)
+: FunctorToType C.
+ refine (@Build_Functor _ C _ TypeCat
+ (fun x => F.(ObjectOf) x)
+ (fun s d m => F.(MorphismOf) _ _ m)).
+(* ??? Toplevel input, characters 8-148:
+Error:
+In environment
+objC : Type{Top.100}
+C : Category@{Top.100 Top.101} objC
+F : FunctorToSet@{Top.100 Top.101 Top.99} C
+The term
+ "{|
+ ObjectOf := fun x : objC => F x;
+ MorphismOf := fun (s d : objC) (m : Morphism@{Top.100 Top.101} C s d) =>
+ MorphismOf@{Top.100 Top.101 Top.99 Set} F s d m |}" has type
+ "Functor@{Top.104 Top.105 Top.106 Top.107} C TypeCat@{Top.108 Top.109
+ Top.110}" while it is expected to have type
+ "FunctorToType@{Top.100 Top.101 Top.102 Top.103} C"
+(Universe inconsistency: Cannot enforce Set = Top.103)).
+ *)
+Defined. (* Toplevel input, characters 0-8:
+Error:
+The term
+ "fun (objC : Type) (C : Category objC) (F : FunctorToSet C) =>
+ {|
+ ObjectOf := fun x : objC => F x;
+ MorphismOf := fun (s d : objC) (m : Morphism C s d) => MorphismOf F s d m |}"
+has type
+ "forall (objC : Type) (C : Category objC),
+ FunctorToSet C -> Functor C TypeCat" while it is expected to have type
+ "forall (objC : Type) (C : Category objC), FunctorToSet C -> FunctorToType C".
+ *)
+
+Coercion FunctorTo_Set2Type : FunctorToSet >-> FunctorToType.
+
+Record GrothendieckPair `(C : @Category objC) (F : Functor C TypeCat) :=
+ { GrothendieckC : objC;
+ GrothendieckX : F GrothendieckC }.
+
+Record SetGrothendieckPair `(C : @Category objC) (F' : Functor C SetCat) :=
+ { SetGrothendieckC : objC;
+ SetGrothendieckX : F' SetGrothendieckC }.
+
+Section SetGrothendieckCoercion.
+ Context `(C : @Category objC).
+ Variable F : Functor C SetCat.
+ Let F' := (F : FunctorToSet _) : FunctorToType _. (* The command has indeed failed with message:
+=> Anomaly: apply_coercion_args: mismatch between arguments and coercion.
+Please report. *)
+
+ Set Printing Universes.
+ Definition SetGrothendieck2Grothendieck (G : SetGrothendieckPair F) : GrothendieckPair F'
+ := {| GrothendieckC := G.(SetGrothendieckC); GrothendieckX := G.(SetGrothendieckX) : F' _ |}.
+ (* Toplevel input, characters 0-187:
+Error: Illegal application:
+The term "ObjectOf (* Top.8375 Top.8376 Top.8379 Set *)" of type
+ "forall (objC : Type (* Top.8375 *))
+ (C : Category (* Top.8375 Top.8376 *) objC) (objD : Type (* Top.8379 *))
+ (D : Category (* Top.8379 Set *) objD),
+ Functor (* Top.8375 Top.8376 Top.8379 Set *) C D -> objC -> objD"
+cannot be applied to the terms
+ "objC" : "Type (* Top.8375 *)"
+ "C" : "Category (* Top.8375 Top.8376 *) objC"
+ "Type (* Set *)" : "Type (* Set+1 *)"
+ "TypeCat (* Top.8379 Set *)" : "Category (* Top.8379 Set *) Set"
+ "F'" : "FunctorToType (* Top.8375 Top.8376 Top.8379 Set *) C"
+ "SetGrothendieckC (* Top.8375 Top.8376 Top.8379 *) G" : "objC"
+The 5th term has type "FunctorToType (* Top.8375 Top.8376 Top.8379 Set *) C"
+which should be coercible to
+ "Functor (* Top.8375 Top.8376 Top.8379 Set *) C TypeCat (* Top.8379 Set *)".
+ *)
+End SetGrothendieckCoercion.
diff --git a/test-suite/bugs/closed/HoTT_coq_028.v b/test-suite/bugs/closed/HoTT_coq_028.v
new file mode 100644
index 00000000..b0324140
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_028.v
@@ -0,0 +1,14 @@
+Goal forall (O obj : Type) (f : O -> obj) (x : O) (e : x = x)
+ (T : obj -> obj -> Type) (m : forall x0 : obj, T x0 x0),
+ match eq_sym e in (_ = y) return (T (f y) (f x)) with
+ | eq_refl => m (f x)
+ end = m (f x).
+intros.
+try case e.
+(* Toplevel input, characters 19-25:
+Error: Cannot instantiate metavariable P of type
+"forall a : O, x = a -> Prop" with abstraction
+"fun (x : O) (e : x = x) =>
+ match eq_sym e in (_ = y) return (T (f y) (f x)) with
+ | eq_refl => m (f x)
+ end = m (f x)" of incompatible type "forall x : O, x = x -> Prop". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_029.v b/test-suite/bugs/closed/HoTT_coq_029.v
new file mode 100644
index 00000000..4fd54b56
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_029.v
@@ -0,0 +1,335 @@
+Module FirstComment.
+ Set Implicit Arguments.
+ Generalizable All Variables.
+ Set Asymmetric Patterns.
+ Set Universe Polymorphism.
+
+ Reserved Notation "x # y" (at level 40, left associativity).
+ Reserved Notation "x #m y" (at level 40, left associativity).
+
+ Delimit Scope object_scope with object.
+ Delimit Scope morphism_scope with morphism.
+ Delimit Scope category_scope with category.
+
+ Record Category (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Identity : forall x, Morphism x x;
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+ Bind Scope object_scope with Object.
+ Bind Scope morphism_scope with Morphism.
+
+ Arguments Object {obj%type} C%category / : rename.
+ Arguments Morphism {obj%type} !C%category s d : rename. (* , simpl nomatch. *)
+ Arguments Identity {obj%type} [!C%category] x%object : rename.
+ Arguments Compose {obj%type} [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+
+ Bind Scope category_scope with Category.
+
+ Record Functor
+ `(C : @Category objC)
+ `(D : @Category objD)
+ := {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+
+ Record NaturalTransformation
+ `(C : @Category objC)
+ `(D : @Category objD)
+ (F G : Functor C D)
+ := {
+ ComponentsOf :> forall c, D.(Morphism) (F c) (G c)
+ }.
+
+ Definition ProductCategory
+ `(C : @Category objC)
+ `(D : @Category objD)
+ : @Category (objC * objD)%type.
+ refine (@Build_Category _
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
+ (fun o => (Identity (fst o), Identity (snd o)))
+ (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1)))).
+
+ Defined.
+
+ Infix "*" := ProductCategory : category_scope.
+
+ Record IsomorphismOf `{C : @Category objC} {s d} (m : C.(Morphism) s d) :=
+ {
+ IsomorphismOf_Morphism :> C.(Morphism) s d := m;
+ Inverse : C.(Morphism) d s
+ }.
+
+ Record NaturalIsomorphism
+ `(C : @Category objC)
+ `(D : @Category objD)
+ (F G : Functor C D)
+ := {
+ NaturalIsomorphism_Transformation :> NaturalTransformation F G;
+ NaturalIsomorphism_Isomorphism : forall x : objC, IsomorphismOf (NaturalIsomorphism_Transformation x)
+ }.
+
+ Section PreMonoidalCategory.
+ Context `(C : @Category objC).
+
+ Variable TensorProduct : Functor (C * C) C.
+
+ Let src {C : @Category objC} {s d} (_ : Morphism C s d) := s.
+ Let dst {C : @Category objC} {s d} (_ : Morphism C s d) := d.
+
+ Local Notation "A # B" := (TensorProduct (A, B)).
+ Local Notation "A #m B" := (TensorProduct.(MorphismOf) ((@src _ _ _ A, @src _ _ _ B)) ((@dst _ _ _ A, @dst _ _ _ B)) (A, B)%morphism).
+
+ Let TriMonoidalProductL_ObjectOf (abc : C * C * C) : C :=
+ (fst (fst abc) # snd (fst abc)) # snd abc.
+
+ Let TriMonoidalProductR_ObjectOf (abc : C * C * C) : C :=
+ fst (fst abc) # (snd (fst abc) # snd abc).
+
+ Let TriMonoidalProductL_MorphismOf (s d : C * C * C) (m : Morphism (C * C * C) s d) :
+ Morphism C (TriMonoidalProductL_ObjectOf s) (TriMonoidalProductL_ObjectOf d).
+ Admitted.
+
+ Let TriMonoidalProductR_MorphismOf (s d : C * C * C) (m : Morphism (C * C * C) s d) :
+ Morphism C (TriMonoidalProductR_ObjectOf s) (TriMonoidalProductR_ObjectOf d).
+ Admitted.
+
+ Definition TriMonoidalProductL : Functor (C * C * C) C.
+ refine (Build_Functor (C * C * C) C
+ TriMonoidalProductL_ObjectOf
+ TriMonoidalProductL_MorphismOf).
+ Defined.
+
+ Definition TriMonoidalProductR : Functor (C * C * C) C.
+ refine (Build_Functor (C * C * C) C
+ TriMonoidalProductR_ObjectOf
+ TriMonoidalProductR_MorphismOf).
+ Defined.
+
+ Variable Associator : NaturalIsomorphism TriMonoidalProductL TriMonoidalProductR.
+
+ Section AssociatorCoherenceCondition.
+ Variables a b c d : C.
+
+ (* going from top-left *)
+ Let AssociatorCoherenceConditionT0 : Morphism C (((a # b) # c) # d) ((a # (b # c)) # d)
+ := Associator (a, b, c) #m Identity (C := C) d.
+ Let AssociatorCoherenceConditionT1 : Morphism C ((a # (b # c)) # d) (a # ((b # c) # d))
+ := Associator (a, b # c, d).
+ Let AssociatorCoherenceConditionT2 : Morphism C (a # ((b # c) # d)) (a # (b # (c # d)))
+ := Identity (C := C) a #m Associator (b, c, d).
+ Let AssociatorCoherenceConditionB0 : Morphism C (((a # b) # c) # d) ((a # b) # (c # d))
+ := Associator (a # b, c, d).
+ Let AssociatorCoherenceConditionB1 : Morphism C ((a # b) # (c # d)) (a # (b # (c # d)))
+ := Associator (a, b, c # d).
+
+ Definition AssociatorCoherenceCondition' :=
+ Compose AssociatorCoherenceConditionT2 (Compose AssociatorCoherenceConditionT1 AssociatorCoherenceConditionT0)
+ = Compose AssociatorCoherenceConditionB1 AssociatorCoherenceConditionB0.
+ End AssociatorCoherenceCondition.
+
+ Definition AssociatorCoherenceCondition := Eval unfold AssociatorCoherenceCondition' in
+ forall a b c d : C, AssociatorCoherenceCondition' a b c d.
+ End PreMonoidalCategory.
+
+ Section MonoidalCategory.
+ Variable objC : Type.
+
+ Let AssociatorCoherenceCondition' := Eval unfold AssociatorCoherenceCondition in @AssociatorCoherenceCondition.
+
+ Record MonoidalCategory :=
+ {
+ MonoidalUnderlyingCategory :> @Category objC;
+ TensorProduct : Functor (MonoidalUnderlyingCategory * MonoidalUnderlyingCategory) MonoidalUnderlyingCategory;
+ IdentityObject : objC;
+ Associator : NaturalIsomorphism (TriMonoidalProductL TensorProduct) (TriMonoidalProductR TensorProduct);
+ AssociatorCoherent : AssociatorCoherenceCondition' Associator
+ }.
+ End MonoidalCategory.
+
+ Section EnrichedCategory.
+ Context `(M : @MonoidalCategory objM).
+ Let x : M := IdentityObject M.
+ (* Anomaly: apply_coercion_args: mismatch between arguments and coercion. Please report. *)
+ End EnrichedCategory.
+End FirstComment.
+
+Module SecondComment.
+ Set Implicit Arguments.
+ Set Universe Polymorphism.
+ Generalizable All Variables.
+
+ Record prod (A B : Type) := pair { fst : A; snd : B }.
+ Arguments fst {A B} _.
+ Arguments snd {A B} _.
+ Infix "*" := prod : type_scope.
+ Notation " ( x , y ) " := (@pair _ _ x y).
+ Record Category (obj : Type) :=
+ Build_Category {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Identity : forall x, Morphism x x;
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+ Arguments Identity {obj%type} [!C] x : rename.
+ Arguments Compose {obj%type} [!C s d d'] m1 m2 : rename.
+
+ Record > Category' :=
+ {
+ LSObject : Type;
+
+ LSUnderlyingCategory :> @Category LSObject
+ }.
+
+ Section Functor.
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+
+
+ Record Functor :=
+ {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+ End Functor.
+
+ Arguments MorphismOf {objC%type} [C] {objD%type} [D] F [s d] m : rename, simpl nomatch.
+
+ Section FunctorComposition.
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+ Context `(E : @Category objE).
+
+ Definition ComposeFunctors (G : Functor D E) (F : Functor C D) : Functor C E.
+ Admitted.
+ End FunctorComposition.
+
+ Section IdentityFunctor.
+ Context `(C : @Category objC).
+
+
+ Definition IdentityFunctor : Functor C C.
+ refine {| ObjectOf := (fun x => x);
+ MorphismOf := (fun _ _ x => x)
+ |}.
+ Defined.
+ End IdentityFunctor.
+
+ Section ProductCategory.
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+
+ Definition ProductCategory : @Category (objC * objD)%type.
+ refine (@Build_Category _
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
+ (fun o => (Identity (fst o), Identity (snd o)))
+ (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1)))).
+ Defined.
+ End ProductCategory.
+
+ Definition OppositeCategory `(C : @Category objC) : Category objC :=
+ @Build_Category objC
+ (fun s d => Morphism C d s)
+ (Identity (C := C))
+ (fun _ _ _ m1 m2 => Compose m2 m1).
+
+ Parameter FunctorCategory : forall `(C : @Category objC) `(D : @Category objD), @Category (Functor C D).
+
+ Parameter TerminalCategory : Category unit.
+
+ Section ComputableCategory.
+ Variable I : Type.
+ Variable Index2Object : I -> Type.
+ Variable Index2Cat : forall i : I, @Category (@Index2Object i).
+
+ Local Coercion Index2Cat : I >-> Category.
+
+ Definition ComputableCategory : @Category I.
+ refine (@Build_Category _
+ (fun C D : I => Functor C D)
+ (fun o : I => IdentityFunctor o)
+ (fun C D E : I => ComposeFunctors (C := C) (D := D) (E := E))).
+ Defined.
+ End ComputableCategory.
+
+ Section SmallCat.
+ Definition LocallySmallCat := ComputableCategory _ LSUnderlyingCategory.
+ End SmallCat.
+
+ Section CommaCategory.
+ Context `(A : @Category objA).
+ Context `(B : @Category objB).
+ Context `(C : @Category objC).
+ Variable S : Functor A C.
+ Variable T : Functor B C.
+
+ Record CommaCategory_Object := { CommaCategory_Object_Member :> { ab : objA * objB & C.(Morphism) (S (fst ab)) (T (snd ab)) } }.
+
+ Let SortPolymorphic_Helper (A T : Type) (Build_T : A -> T) := A.
+
+ Definition CommaCategory_ObjectT := Eval hnf in SortPolymorphic_Helper Build_CommaCategory_Object.
+ Definition Build_CommaCategory_Object' (mem : CommaCategory_ObjectT) := Build_CommaCategory_Object mem.
+ Global Coercion Build_CommaCategory_Object' : CommaCategory_ObjectT >-> CommaCategory_Object.
+
+ Definition CommaCategory : @Category CommaCategory_Object.
+ Admitted.
+ End CommaCategory.
+
+ Definition SliceCategory_Functor `(C : @Category objC) (a : C) : Functor TerminalCategory C
+ := {| ObjectOf := (fun _ => a);
+ MorphismOf := (fun _ _ _ => Identity a)
+ |}.
+
+ Definition SliceCategoryOver
+ : forall (objC : Type) (C : Category objC) (a : C),
+ Category
+ (CommaCategory_Object (IdentityFunctor C)
+ (SliceCategory_Functor C a)).
+ admit.
+ Defined.
+
+ Section CommaCategoryProjectionFunctor.
+ Context `(A : Category objA).
+ Context `(B : Category objB).
+ Context `(C : Category objC).
+
+ Variable S : (OppositeCategory (FunctorCategory A C)).
+ Variable T : (FunctorCategory B C).
+
+ Definition CommaCategoryProjection : Functor (CommaCategory S T) (ProductCategory A B).
+ Admitted.
+
+ Definition CommaCategoryProjectionFunctor_ObjectOf
+ : @SliceCategoryOver _ LocallySmallCat (ProductCategory A B)
+ :=
+ existT _
+ ((CommaCategory S T) : Category', tt)
+ (CommaCategoryProjection) :
+ CommaCategory_ObjectT (IdentityFunctor _)
+ (SliceCategory_Functor LocallySmallCat
+ (ProductCategory A B)).
+ (* Anomaly: apply_coercion_args: mismatch between arguments and coercion. Please report. *)
+ (* Toplevel input, characters 110-142:
+Error:
+In environment
+objA : Type
+A : Category objA
+objB : Type
+B : Category objB
+objC : Type
+C : Category objC
+S : OppositeCategory (FunctorCategory A C)
+T : FunctorCategory B C
+The term "ProductCategory A B:Category (objA * objB)" has type
+ "Category (objA * objB)" while it is expected to have type
+ "Object LocallySmallCat".
+ *)
+ End CommaCategoryProjectionFunctor.
+End SecondComment.
diff --git a/test-suite/bugs/closed/HoTT_coq_030.v b/test-suite/bugs/closed/HoTT_coq_030.v
new file mode 100644
index 00000000..fa5ee25c
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_030.v
@@ -0,0 +1,241 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Asymmetric Patterns.
+Set Universe Polymorphism.
+
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope functor_scope with functor.
+
+Local Open Scope category_scope.
+
+Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+Bind Scope category_scope with SpecializedCategory.
+Bind Scope object_scope with Object.
+Bind Scope morphism_scope with Morphism.
+
+Arguments Object {obj%type} C%category / : rename.
+Arguments Morphism {obj%type} !C%category s d : rename. (* , simpl nomatch. *)
+Arguments Compose {obj%type} [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+
+Record Category := {
+ CObject : Type;
+
+ UnderlyingCategory :> @SpecializedCategory CObject
+}.
+
+Definition GeneralizeCategory `(C : @SpecializedCategory obj) : Category.
+ refine {| CObject := C.(Object) |}; auto. (* Changing this [auto] to [assumption] removes the universe inconsistency. *)
+Defined.
+
+Coercion GeneralizeCategory : SpecializedCategory >-> Category.
+
+Record SpecializedFunctor
+ `(C : @SpecializedCategory objC)
+ `(D : @SpecializedCategory objD)
+ := {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+
+Section Functor.
+ Context (C D : Category).
+
+ Definition Functor := SpecializedFunctor C D.
+End Functor.
+
+Bind Scope functor_scope with SpecializedFunctor.
+Bind Scope functor_scope with Functor.
+
+Arguments SpecializedFunctor {objC} C {objD} D.
+Arguments Functor C D.
+Arguments ObjectOf {objC%type C%category objD%type D%category} F%functor c%object : rename, simpl nomatch.
+Arguments MorphismOf {objC%type} [C%category] {objD%type} [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+
+Section FunctorComposition.
+ Context `(B : @SpecializedCategory objB).
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Context `(E : @SpecializedCategory objE).
+
+ Definition ComposeFunctors (G : SpecializedFunctor D E) (F : SpecializedFunctor C D) : SpecializedFunctor C E
+ := Build_SpecializedFunctor C E
+ (fun c => G (F c))
+ (fun _ _ m => G.(MorphismOf) (F.(MorphismOf) m)).
+End FunctorComposition.
+
+Record SpecializedNaturalTransformation
+ `{C : @SpecializedCategory objC}
+ `{D : @SpecializedCategory objD}
+ (F G : SpecializedFunctor C D)
+ := {
+ ComponentsOf :> forall c, D.(Morphism) (F c) (G c)
+ }.
+
+Definition ProductCategory
+ `(C : @SpecializedCategory objC)
+ `(D : @SpecializedCategory objD)
+: @SpecializedCategory (objC * objD)%type
+ := @Build_SpecializedCategory _
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
+ (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1))).
+
+Infix "*" := ProductCategory : category_scope.
+
+Section ProductCategoryFunctors.
+ Context `{C : @SpecializedCategory objC}.
+ Context `{D : @SpecializedCategory objD}.
+
+ Definition fst_Functor : SpecializedFunctor (C * D) C
+ := Build_SpecializedFunctor (C * D) C
+ (@fst _ _)
+ (fun _ _ => @fst _ _).
+
+ Definition snd_Functor : SpecializedFunctor (C * D) D
+ := Build_SpecializedFunctor (C * D) D
+ (@snd _ _)
+ (fun _ _ => @snd _ _).
+End ProductCategoryFunctors.
+
+
+Definition OppositeCategory `(C : @SpecializedCategory objC) : @SpecializedCategory objC :=
+ @Build_SpecializedCategory objC
+ (fun s d => Morphism C d s)
+ (fun _ _ _ m1 m2 => Compose m2 m1).
+
+Section OppositeFunctor.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Variable F : SpecializedFunctor C D.
+ Let COp := OppositeCategory C.
+ Let DOp := OppositeCategory D.
+
+ Definition OppositeFunctor : SpecializedFunctor COp DOp
+ := Build_SpecializedFunctor COp DOp
+ (fun c : COp => F c : DOp)
+ (fun (s d : COp) (m : C.(Morphism) d s) => MorphismOf F (s := d) (d := s) m).
+End OppositeFunctor.
+
+Section FunctorProduct.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Context `(D' : @SpecializedCategory objD').
+
+ Definition FunctorProduct (F : Functor C D) (F' : Functor C D') : SpecializedFunctor C (D * D').
+ match goal with
+ | [ |- SpecializedFunctor ?C0 ?D0 ] =>
+ refine (Build_SpecializedFunctor
+ C0 D0
+ (fun c => (F c, F' c))
+ (fun s d m => (MorphismOf F m, MorphismOf F' m)))
+ end.
+ Defined.
+End FunctorProduct.
+
+Section FunctorProduct'.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Context `(C' : @SpecializedCategory objC').
+ Context `(D' : @SpecializedCategory objD').
+ Variable F : Functor C D.
+ Variable F' : Functor C' D'.
+
+ Definition FunctorProduct' : SpecializedFunctor (C * C') (D * D')
+ := FunctorProduct (ComposeFunctors F fst_Functor) (ComposeFunctors F' snd_Functor).
+End FunctorProduct'.
+
+(** XXX TODO(jgross): Change this to [FunctorProduct]. *)
+Infix "*" := FunctorProduct' : functor_scope.
+
+Definition TypeCat : @SpecializedCategory Type :=
+ (@Build_SpecializedCategory Type
+ (fun s d => s -> d)
+ (fun _ _ _ f g => (fun x => f (g x)))).
+
+Section HomFunctor.
+ Context `(C : @SpecializedCategory objC).
+ Let COp := OppositeCategory C.
+
+ Definition CovariantHomFunctor (A : COp) : SpecializedFunctor C TypeCat
+ := Build_SpecializedFunctor C TypeCat
+ (fun X : C => C.(Morphism) A X : TypeCat)
+ (fun X Y f => (fun g : C.(Morphism) A X => Compose f g)).
+
+ Definition hom_functor_object_of (c'c : COp * C) := C.(Morphism) (fst c'c) (snd c'c) : TypeCat.
+
+ Definition hom_functor_morphism_of (s's : (COp * C)%type) (d'd : (COp * C)%type) (hf : (COp * C).(Morphism) s's d'd) :
+ TypeCat.(Morphism) (hom_functor_object_of s's) (hom_functor_object_of d'd).
+ unfold hom_functor_object_of in *.
+ destruct s's as [ s' s ], d'd as [ d' d ].
+ destruct hf as [ h f ].
+ intro g.
+ exact (Compose f (Compose g h)).
+ Defined.
+
+ Definition HomFunctor : SpecializedFunctor (COp * C) TypeCat
+ := Build_SpecializedFunctor (COp * C) TypeCat
+ (fun c'c : COp * C => C.(Morphism) (fst c'c) (snd c'c) : TypeCat)
+ (fun X Y (hf : (COp * C).(Morphism) X Y) => hom_functor_morphism_of hf).
+End HomFunctor.
+
+Section FullFaithful.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Variable F : SpecializedFunctor C D.
+ Let COp := OppositeCategory C.
+ Let DOp := OppositeCategory D.
+ Let FOp := OppositeFunctor F.
+
+ Definition InducedHomNaturalTransformation :
+ SpecializedNaturalTransformation (HomFunctor C) (ComposeFunctors (HomFunctor D) (FOp * F))
+ := (Build_SpecializedNaturalTransformation (HomFunctor C) (ComposeFunctors (HomFunctor D) (FOp * F))
+ (fun sd : (COp * C) =>
+ MorphismOf F (s := _) (d := _))).
+End FullFaithful.
+
+Definition FunctorCategory
+ `(C : @SpecializedCategory objC)
+ `(D : @SpecializedCategory objD)
+: @SpecializedCategory (SpecializedFunctor C D).
+ refine (@Build_SpecializedCategory _
+ (SpecializedNaturalTransformation (C := C) (D := D))
+ _);
+ admit.
+Defined.
+
+Notation "C ^ D" := (FunctorCategory D C) : category_scope.
+
+Section Yoneda.
+ Context `(C : @SpecializedCategory objC).
+ Let COp := OppositeCategory C.
+
+ Section Yoneda.
+ Let Yoneda_NT s d (f : COp.(Morphism) s d) : SpecializedNaturalTransformation (CovariantHomFunctor C s) (CovariantHomFunctor C d)
+ := Build_SpecializedNaturalTransformation
+ (CovariantHomFunctor C s)
+ (CovariantHomFunctor C d)
+ (fun c : C => (fun m : C.(Morphism) _ _ => Compose m f)).
+
+ Definition Yoneda : SpecializedFunctor COp (TypeCat ^ C)
+ := Build_SpecializedFunctor COp (TypeCat ^ C)
+ (fun c : COp => CovariantHomFunctor C c : TypeCat ^ C)
+ (fun s d (f : Morphism COp s d) => Yoneda_NT s d f).
+ End Yoneda.
+End Yoneda.
+
+Section FullyFaithful.
+ Context `(C : @SpecializedCategory objC).
+
+ Set Printing Universes.
+ Check InducedHomNaturalTransformation (Yoneda C).
+ (* Error: Universe inconsistency (cannot enforce Top.865 = Top.851 because
+Top.851 < Top.869 <= Top.864 <= Top.865). *)
+End FullyFaithful.
diff --git a/test-suite/bugs/closed/HoTT_coq_032.v b/test-suite/bugs/closed/HoTT_coq_032.v
new file mode 100644
index 00000000..3f5d7b02
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_032.v
@@ -0,0 +1,22 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-xml") -*- *)
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Asymmetric Patterns.
+Set Universe Polymorphism.
+
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope functor_scope with functor.
+
+Local Open Scope category_scope.
+
+Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+(* Anomaly: Mismatched instance and context when building universe substitution.
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_034.v b/test-suite/bugs/closed/HoTT_coq_034.v
new file mode 100644
index 00000000..8d5201f6
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_034.v
@@ -0,0 +1,23 @@
+Module Short.
+ Set Universe Polymorphism.
+ Inductive relevant (A : Type) (B : Type) : Prop := .
+ Section foo.
+ Variables A B : Type.
+ Definition foo := prod (relevant A B) A.
+ End foo.
+
+ Section bar.
+ Variable A : Type.
+ Variable B : Type.
+ Definition bar := prod (relevant A B) A.
+ End bar.
+
+ Set Printing Universes.
+ Check bar nat Set : Set. (* success *)
+ Check foo nat Set : Set. (* Toplevel input, characters 6-17:
+Error:
+The term "foo (* Top.303 Top.304 *) nat Set" has type
+"Type (* Top.304 *)" while it is expected to have type
+"Set" (Universe inconsistency: Cannot enforce Top.304 = Set because Set
+< Top.304)). *)
+End Short.
diff --git a/test-suite/bugs/closed/HoTT_coq_035.v b/test-suite/bugs/closed/HoTT_coq_035.v
new file mode 100644
index 00000000..4ad2fc02
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_035.v
@@ -0,0 +1,19 @@
+Fail Check Prop : Prop. (* Prop:Prop
+ : Prop *)
+Fail Check Set : Prop. (* Set:Prop
+ : Prop *)
+Fail Check ((bool -> Prop) : Prop). (* bool -> Prop:Prop
+ : Prop *)
+Axiom proof_irrelevance : forall (P : Prop) (p1 p2 : P), p1 = p2.
+Check ((True : Prop) : Set). (* (True:Prop):Set
+ : Set *)
+Goal (forall (v : Type) (f1 f0 : v -> Prop),
+ @eq (v -> Prop) f0 f1).
+intros.
+Fail apply proof_irrelevance.
+admit.
+Defined. (* Unnamed_thm is defined *)
+Set Printing Universes.
+Check ((True : Prop) : Set). (* Toplevel input, characters 0-28:
+Error: Universe inconsistency (cannot enforce Prop <= Set because Set
+< Prop). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_036.v b/test-suite/bugs/closed/HoTT_coq_036.v
new file mode 100644
index 00000000..4c3e078a
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_036.v
@@ -0,0 +1,135 @@
+Module Version1.
+ Set Implicit Arguments.
+ Set Universe Polymorphism.
+ Generalizable All Variables.
+
+ Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj
+ }.
+
+ Record > Category :=
+ {
+ CObject : Type;
+ UnderlyingCategory :> @SpecializedCategory CObject
+ }.
+
+ Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) :=
+ {
+ ObjectOf :> objC -> objD
+ }.
+
+ Definition Functor (C D : Category) := SpecializedFunctor C D.
+
+ Parameter TerminalCategory : SpecializedCategory unit.
+
+ Definition focus A (_ : A) := True.
+
+ Definition CommaCategory_Object (A : Category) (S : Functor TerminalCategory A) : Type.
+ assert (Hf : focus ((S tt) = (S tt))) by constructor.
+ let C1 := constr:(CObject) in
+ let C2 := constr:(fun C => @Object (CObject C) C) in
+ unify C1 C2; idtac C1 C2. Show Universes.
+ progress change @CObject with (fun C => @Object (CObject C) C) in *.
+ simpl in *.
+ match type of Hf with
+ | focus ?V => exact V
+ end.
+ Defined.
+
+ Definition Build_SliceCategory (A : Category) (F : Functor TerminalCategory A) := @Build_SpecializedCategory (CommaCategory_Object F).
+ Parameter SetCat : @SpecializedCategory Set.
+
+ Set Printing Universes.
+ Check (fun (A : Category) (F : Functor TerminalCategory A) => @Build_SpecializedCategory (CommaCategory_Object F)) SetCat.
+ (* (fun (A : Category (* Top.68 *))
+ (F : Functor (* Set Top.68 *) TerminalCategory A) =>
+ {| |}) SetCat (* Top.68 *)
+ : forall
+ F : Functor (* Set Top.68 *) TerminalCategory SetCat (* Top.68 *),
+ let Object := CommaCategory_Object (* Top.68 Top.69 Top.68 *) F in
+ SpecializedCategory (* Top.69 *)
+ (CommaCategory_Object (* Top.68 Top.69 Top.68 *) F) *)
+ Check @Build_SliceCategory SetCat. (* Toplevel input, characters 0-34:
+Error: Universe inconsistency (cannot enforce Top.51 <= Set because Set
+< Top.51). *)
+End Version1.
+
+Module Version2.
+ Set Implicit Arguments.
+ Set Universe Polymorphism.
+
+ Record SpecializedCategory (obj : Type) :=
+ {
+ Object : _ := obj
+ }.
+
+ Record > Category :=
+ {
+ CObject : Type;
+ UnderlyingCategory :> @SpecializedCategory CObject
+ }.
+
+ Parameter TerminalCategory : SpecializedCategory unit.
+
+ Definition focus A (_ : A) := True.
+ Parameter ObjectOf' : forall (objC : Type) (C : SpecializedCategory objC)
+ (objD : Type) (D : SpecializedCategory objD), Prop.
+ Definition CommaCategory_Object (A : Category) : Type.
+ assert (Hf : focus (@ObjectOf' _ (@Build_Category unit TerminalCategory) _ A)) by constructor.
+ progress change CObject with (fun C => @Object (CObject C) C) in *;
+ simpl in *.
+ match type of Hf with
+ | focus ?V => exact V
+ end.
+ Defined.
+
+ Definition Build_SliceCategory := @CommaCategory_Object.
+ Parameter SetCat : @SpecializedCategory Set.
+
+ Set Printing Universes.
+ Check @Build_SliceCategory SetCat.
+End Version2.
+
+Module OtherBug.
+ Set Implicit Arguments.
+ Set Universe Polymorphism.
+
+ Record SpecializedCategory (obj : Type) :=
+ {
+ Object : _ := obj
+ }.
+
+ Record > Category :=
+ {
+ CObject : Type;
+ UnderlyingCategory :> @SpecializedCategory CObject
+ }.
+
+ Parameter TerminalCategory : SpecializedCategory unit.
+
+ Definition focus A (_ : A) := True.
+
+ Parameter ObjectOf' : forall (objC : Type) (C : SpecializedCategory objC)
+ (objD : Type) (D : SpecializedCategory objD), Prop.
+ Definition CommaCategory_Object (A : Category@{i}) : Type.
+ assert (Hf : focus (@ObjectOf' _ (@Build_Category unit TerminalCategory) _ A)) by constructor.
+ progress change CObject with (fun C => @Object (CObject C) C) in *;
+ simpl in *.
+ match type of Hf with
+ | focus ?V => exact V
+ end.
+ Defined.
+
+ Parameter SetCat : @SpecializedCategory Set.
+
+ Set Printing Universes.
+ Definition Build_SliceCategory := @CommaCategory_Object.
+ Check @CommaCategory_Object SetCat.
+ (* CommaCategory_Object (* Top.43 Top.44 Top.43 *) SetCat (* Top.43 *)
+ : Type (* Top.44 *) *)
+ Check @Build_SliceCategory SetCat.
+ (* Toplevel input, characters 0-34:
+Error: Universe inconsistency (cannot enforce Top.36 <= Set because Set
+< Top.36). *)
+End OtherBug.
diff --git a/test-suite/bugs/closed/HoTT_coq_037.v b/test-suite/bugs/closed/HoTT_coq_037.v
new file mode 100644
index 00000000..66476414
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_037.v
@@ -0,0 +1,16 @@
+Set Printing Universes.
+
+Fixpoint CardinalityRepresentative (n : nat) : Set :=
+ match n with
+ | O => Empty_set
+ | S n' => sum (CardinalityRepresentative n') unit
+ end.
+(* Toplevel input, characters 104-143:
+Error:
+In environment
+CardinalityRepresentative : nat -> Set
+n : nat
+n' : nat
+The term "(CardinalityRepresentative n' + unit)%type" has type
+ "Type (* max(Top.73, Top.74) *)" while it is expected to have type
+"Set". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_041.v b/test-suite/bugs/closed/HoTT_coq_041.v
new file mode 100644
index 00000000..79933bb8
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_041.v
@@ -0,0 +1,18 @@
+Set Printing All.
+Definition foo (s d : Prop)
+ : ((s : Set) -> (d : Set)) = ((s : Prop) -> (d : Prop))
+ := eq_refl. (* succeeds *)
+Definition bar (s d : Prop)
+ : ((fun x : Set => x) s -> (fun x : Set => x) d) = ((fun x : Prop => x) s -> (fun x : Prop => x) d)
+ := eq_refl. (* Toplevel input, characters 131-138:
+Error:
+In environment
+s : Prop
+d : Prop
+The term
+ "@eq_refl Set (forall _ : (fun x : Set => x) s, (fun x : Set => x) d)"
+has type "@eq Set (forall _ : s, d) (forall _ : s, d)"
+while it is expected to have type
+ "@eq Set (forall _ : s, d) (forall _ : s, d)"
+(cannot unify "forall _ : (fun x : Set => x) s, (fun x : Set => x) d" and
+"forall _ : (fun x : Prop => x) s, (fun x : Prop => x) d"). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_042.v b/test-suite/bugs/closed/HoTT_coq_042.v
new file mode 100644
index 00000000..6b206a2f
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_042.v
@@ -0,0 +1,27 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Generalizable All Variables.
+
+Record Category (obj : Type) := { Morphism : obj -> obj -> Type }.
+
+Definition SetCat : @Category Set := @Build_Category Set (fun s d => s -> d).
+
+Record Foo := { foo : forall A (f : Morphism SetCat A A), True }.
+
+Local Notation PartialBuild_Foo pf := (@Build_Foo (fun A f => pf A f)).
+
+Set Printing Universes.
+Let SetCatFoo' : Foo.
+ let pf := fresh in
+ let pfT := fresh in
+ evar (pfT : Prop);
+ cut pfT;
+ [ subst pfT; intro pf;
+ let t := constr:(PartialBuild_Foo pf) in
+ let t' := (eval simpl in t) in
+ exact t'
+ | ].
+ admit.
+(* Toplevel input, characters 15-20:
+Error: Universe inconsistency (cannot enforce Set <= Prop).
+ *)
diff --git a/test-suite/bugs/closed/HoTT_coq_043.v b/test-suite/bugs/closed/HoTT_coq_043.v
new file mode 100644
index 00000000..5257a032
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_043.v
@@ -0,0 +1,15 @@
+Require Import Classes.RelationClasses List Setoid.
+
+Definition RowType := list Type.
+
+Inductive RowTypeDecidable (P : forall T, relation T) `(forall T, Equivalence (P T))
+: RowType -> Type :=
+| RTDecNil : RowTypeDecidable P _ nil
+| RTDecCons : forall T Ts, (forall t0 t1 : T,
+ {P T t0 t1} + {~P T t0 t1})
+ -> RowTypeDecidable P _ Ts
+ -> RowTypeDecidable P _ (T :: Ts).
+(* Toplevel input, characters 15-378:
+Error:
+Last occurrence of "RowTypeDecidable" must have "H" as 2nd argument in
+ "RowTypeDecidable P (fun T : Type => H T) nil". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_044.v b/test-suite/bugs/closed/HoTT_coq_044.v
new file mode 100644
index 00000000..c824f53b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_044.v
@@ -0,0 +1,35 @@
+Require Import Classes.RelationClasses List Setoid.
+
+Definition eqT (T : Type) := @eq T.
+
+Set Universe Polymorphism.
+
+Definition RowType := list Type.
+
+
+Inductive Row : RowType -> Type :=
+| RNil : Row nil
+| RCons : forall T Ts, T -> Row Ts -> Row (T :: Ts).
+
+Inductive RowTypeDecidable (P : forall T, relation T) `(H : forall T, Equivalence (P T))
+: RowType -> Type :=
+| RTDecNil : RowTypeDecidable P H nil
+| RTDecCons : forall T Ts, (forall t0 t1 : T,
+ {P T t0 t1} + {~P T t0 t1})
+ -> RowTypeDecidable P H Ts
+ -> RowTypeDecidable P H (T :: Ts).
+
+
+Set Printing Universes.
+
+Fixpoint Row_eq (Ts : RowType)
+: RowTypeDecidable (@eqT) _ Ts -> forall r1 r2 : Row Ts, {@eq (Row Ts) r1 r2} + {r1 <> r2}.
+(* Toplevel input, characters 81-87:
+Error:
+In environment
+Ts : RowType (* Top.53 Coq.Init.Logic.8 *)
+r1 : Row (* Top.54 Top.55 *) Ts
+r2 : Row (* Top.56 Top.57 *) Ts
+The term "Row (* Coq.Init.Logic.8 Top.59 *) Ts" has type
+ "Type (* max(Top.58+1, Top.59) *)" while it is expected to have type
+ "Type (* Coq.Init.Logic.8 *)" (Universe inconsistency). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_045.v b/test-suite/bugs/closed/HoTT_coq_045.v
new file mode 100644
index 00000000..00588ffb
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_045.v
@@ -0,0 +1,53 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Generalizable All Variables.
+
+Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj
+ }.
+
+Record > Category :=
+ {
+ CObject : Type;
+ UnderlyingCategory :> @SpecializedCategory CObject
+ }.
+
+Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) :=
+ {
+ ObjectOf :> objC -> objD
+ }.
+
+Definition Functor (C D : Category) := SpecializedFunctor C D.
+
+Parameter TerminalCategory : SpecializedCategory unit.
+
+Definition focus A (_ : A) := True.
+
+Definition CommaCategory_Object (A : Category) (S : Functor TerminalCategory A) : Type.
+ assert (Hf : focus ((S tt) = (S tt))) by constructor.
+ let C1 := constr:(CObject) in
+ let C2 := constr:(fun C => @Object (CObject C) C) in
+ unify C1 C2.
+ progress change CObject with (fun C => @Object (CObject C) C) in *.
+ simpl in *.
+ let V := match type of Hf with
+ | focus ?V => constr:(V)
+ end
+ in exact V.
+(* Toplevel input, characters 89-96:
+Error: Illegal application:
+The term "ObjectOf" of type
+ "forall (objC : Set) (C : SpecializedCategory objC)
+ (objD : Type) (D : SpecializedCategory objD),
+ SpecializedFunctor C D -> objC -> objD"
+cannot be applied to the terms
+ "Object TerminalCategory" : "Type"
+ "TerminalCategory" : "SpecializedCategory unit"
+ "Object A" : "Type"
+ "UnderlyingCategory A" : "SpecializedCategory (CObject A)"
+ "S" : "Functor TerminalCategory A"
+ "tt" : "unit"
+The 1st term has type "Type" which should be coercible to
+"Set". *)
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_047.v b/test-suite/bugs/closed/HoTT_coq_047.v
new file mode 100644
index 00000000..29496be5
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_047.v
@@ -0,0 +1,46 @@
+Inductive nCk : nat -> nat -> Type :=
+ |zz : nCk 0 0
+ | incl { m n : nat } : nCk m n -> nCk (S m) (S n)
+ | excl { m n : nat } : nCk m n -> nCk (S m) n.
+
+Definition nCkComp { l m n : nat } :
+ nCk l m -> nCk m n -> nCk l n.
+Proof.
+ intro.
+ revert n.
+ induction H.
+ auto.
+(* ( incl w ) o zz -> contradiction *)
+ intros.
+ remember (S n) as sn.
+ destruct H0.
+ discriminate Heqsn.
+ apply incl.
+ apply IHnCk.
+ injection Heqsn.
+ intro.
+ rewrite <- H1.
+ auto.
+ apply excl.
+ apply IHnCk.
+ injection Heqsn.
+ intro. rewrite <- H1.
+ auto.
+ intros.
+ apply excl.
+ apply IHnCk.
+ auto.
+Defined.
+
+Lemma nCkEq { k l m n : nat } ( cs : nCk k l ) (ct : nCk l m) (cr : nCk m n ):
+ nCkComp cs (nCkComp ct cr) = nCkComp (nCkComp cs ct) cr.
+Proof.
+ revert m n ct cr.
+ induction cs.
+ intros. simpl. auto.
+ intros.
+ destruct n.
+ destruct m0.
+ destruct n0.
+ destruct cr.
+(* Anomaly: Evar ?nnn was not declared. Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_048.v b/test-suite/bugs/closed/HoTT_coq_048.v
new file mode 100644
index 00000000..831bb3fc
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_048.v
@@ -0,0 +1,7 @@
+(** This is not the issue of https://github.com/HoTT/coq/issues/48, but was mentioned there. *)
+Record Foo :=
+ {
+ foo := 1;
+ bar : foo = foo
+ }.
+(* Anomaly: lookup_projection: constant is not a projection. Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_049.v b/test-suite/bugs/closed/HoTT_coq_049.v
new file mode 100644
index 00000000..906ec329
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_049.v
@@ -0,0 +1,6 @@
+Require Import FunctionalExtensionality.
+
+Goal forall y, @f_equal = y.
+intro.
+apply functional_extensionality_dep.
+(* Error: Ill-typed evar instance in HoTT/coq, Anomaly: Uncaught exception Reductionops.NotASort(_). Please report. before that. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_050.v b/test-suite/bugs/closed/HoTT_coq_050.v
new file mode 100644
index 00000000..ce9b6b29
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_050.v
@@ -0,0 +1,33 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Asymmetric Patterns.
+Set Universe Polymorphism.
+Set Printing Universes.
+
+Set Printing All.
+
+Record PreCategory :=
+ {
+ Object :> Type;
+ Morphism : Object -> Object -> Type
+ }.
+
+Inductive paths A (x : A) : A -> Type := idpath : @paths A x x.
+Inductive Unit : Prop := tt. (* Changing this to [Set] fixes things *)
+Inductive Bool : Set := true | false.
+
+Definition DiscreteCategory X : PreCategory
+ := @Build_PreCategory X
+ (@paths X).
+
+Definition IndiscreteCategory X : PreCategory
+ := @Build_PreCategory X
+ (fun _ _ => Unit).
+
+Check (IndiscreteCategory Unit).
+Check (DiscreteCategory Bool).
+Definition NatCategory (n : nat) :=
+ match n with
+ | 0 => IndiscreteCategory Unit
+ | _ => DiscreteCategory Bool
+ end. (* Error: Universe inconsistency (cannot enforce Set <= Prop). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_052.v b/test-suite/bugs/closed/HoTT_coq_052.v
new file mode 100644
index 00000000..62bb9fa1
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_052.v
@@ -0,0 +1,22 @@
+Goal Type = Type.
+ Fail match goal with |- ?x = ?x => idtac end.
+Abort.
+
+Goal Prop.
+ Fail match goal with |- Type => idtac end.
+Abort.
+
+Goal Prop = Set.
+ (* This should fail *)
+ Fail match goal with |- ?x = ?x => idtac x end.
+Abort.
+
+Goal Type = Prop.
+ (* This should fail *)
+ Fail match goal with |- ?x = ?x => idtac end.
+Abort.
+
+Goal Type = Set.
+ (* This should fail *)
+ Fail match goal with |- ?x = ?x => idtac end.
+Abort.
diff --git a/test-suite/bugs/closed/HoTT_coq_053.v b/test-suite/bugs/closed/HoTT_coq_053.v
new file mode 100644
index 00000000..a14fb6aa
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_053.v
@@ -0,0 +1,50 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Set Printing Universes.
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Asymmetric Patterns.
+Set Universe Polymorphism.
+
+Inductive Unit : Type :=
+ tt : Unit.
+
+Inductive Bool : Type :=
+ | true : Bool
+ | false : Bool.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Record PreCategory :=
+ {
+ Object :> Type;
+ Morphism : Object -> Object -> Type
+ }.
+
+Definition DiscreteCategory X : PreCategory
+ := @Build_PreCategory X
+ (@paths X).
+
+Definition IndiscreteCategory X : PreCategory
+ := @Build_PreCategory X
+ (fun _ _ => Unit).
+
+Definition NatCategory (n : nat) :=
+ match n with
+ | 0 => IndiscreteCategory Unit
+ | _ => DiscreteCategory Bool
+ end.
+(* Error: Universe inconsistency (cannot enforce Set <= Prop).*)
+
+Definition NatCategory' (n : nat) :=
+ match n with
+ | 0 => (fun X => @Build_PreCategory X
+ (fun _ _ => Unit : Prop)) Unit
+ | _ => DiscreteCategory Bool
+ end.
+
+Definition NatCategory'' (n : nat) :=
+ match n with
+ | 0 => IndiscreteCategory Unit
+ | _ => DiscreteCategory Bool
+ end.
diff --git a/test-suite/bugs/closed/HoTT_coq_054.v b/test-suite/bugs/closed/HoTT_coq_054.v
new file mode 100644
index 00000000..c6879659
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_054.v
@@ -0,0 +1,94 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs") -*- *)
+Inductive Empty : Prop := .
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Arguments idpath {A a} , [A] a.
+
+Definition idmap {A : Type} : A -> A := fun x => x.
+
+Definition path_sum {A B : Type} (z z' : A + B)
+ (pq : match z, z' with
+ | inl z0, inl z'0 => z0 = z'0
+ | inr z0, inr z'0 => z0 = z'0
+ | _, _ => Empty
+ end)
+: z = z'.
+ destruct z, z', pq; exact idpath.
+Defined.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Theorem ex2_8 {A B A' B' : Type} (g : A -> A') (h : B -> B') (x y : A + B)
+ (* Fortunately, this unifies properly *)
+ (pq : match (x, y) with (inl x', inl y') => x' = y' | (inr x', inr y') => x' = y' | _ => Empty end) :
+ let f z := match z with inl z' => inl (g z') | inr z' => inr (h z') end in
+ ap f (path_sum x y pq) = path_sum (f x) (f y)
+ (* Coq appears to require *ALL* of the annotations *)
+ ((match x as x return match (x, y) with
+ (inl x', inl y') => x' = y'
+ | (inr x', inr y') => x' = y'
+ | _ => Empty
+ end -> match (f x, f y) with
+ | (inl x', inl y') => x' = y'
+ | (inr x', inr y') => x' = y'
+ | _ => Empty end with
+ | inl x' => match y as y return match y with
+ inl y' => x' = y'
+ | _ => Empty
+ end -> match f y with
+ | inl y' => g x' = y'
+ | _ => Empty end with
+ | inl y' => ap g
+ | inr y' => idmap
+ end
+ | inr x' => match y as y return match y return Prop with
+ inr y' => x' = y'
+ | _ => Empty
+ end -> match f y return Prop with
+ | inr y' => h x' = y'
+ | _ => Empty end with
+ | inl y' => idmap
+ | inr y' => ap h
+ end
+ end) pq).
+ destruct x; destruct y; destruct pq; reflexivity.
+Qed.
+(* Toplevel input, characters 1367-1374:
+Error:
+In environment
+A : Type
+B : Type
+A' : Type
+B' : Type
+g : A -> A'
+h : B -> B'
+x : A + B
+y : A + B
+pq :
+match x with
+| inl x' => match y with
+ | inl y' => x' = y'
+ | inr _ => Empty
+ end
+| inr x' => match y with
+ | inl _ => Empty
+ | inr y' => x' = y'
+ end
+end
+f :=
+fun z : A + B =>
+match z with
+| inl z' => inl (g z')
+| inr z' => inr (h z')
+end : A + B -> A' + B'
+x' : B
+y0 : A + B
+y' : B
+The term "x' = y'" has type "Type" while it is expected to have type
+"Prop" (Universe inconsistency). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_055.v b/test-suite/bugs/closed/HoTT_coq_055.v
new file mode 100644
index 00000000..92d70ad1
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_055.v
@@ -0,0 +1,53 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Set Universe Polymorphism.
+
+Inductive Empty : Prop := .
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Arguments idpath {A a} , [A] a.
+
+Definition idmap {A : Type} : A -> A := fun x => x.
+
+Definition path_sum {A B : Type} (z z' : A + B)
+ (pq : match z, z' with
+ | inl z0, inl z'0 => z0 = z'0
+ | inr z0, inr z'0 => z0 = z'0
+ | _, _ => Empty
+ end)
+: z = z'.
+
+ admit.
+Defined.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Theorem ex2_8 {A B A' B' : Type} (g : A -> A') (h : B -> B') (x y : A + B)
+
+ (pq : match (x, y) with (inl x', inl y') => x' = y' | (inr x', inr y') => x' = y' | _ => Empty end) :
+ let f z := match z with inl z' => inl (g z') | inr z' => inr (h z') end in
+ ap f (path_sum x y pq) = path_sum (f x) (f y)
+ ((match x as x return match (x, y) with
+ (inl x', inl y') => x' = y'
+ | (inr x', inr y') => x' = y'
+ | _ => Empty
+ end -> match (f x, f y) with
+ | (inl x', inl y') => x' = y'
+ | (inr x', inr y') => x' = y'
+ | _ => Empty end with
+ | inl x' => match y with
+ | inl y' => ap g
+ | inr y' => idmap
+ end
+ | inr x' => match y with
+ | inl y' => idmap
+ | inr y' => ap h
+ end
+ end) pq).
+
+Admitted.
+(* Toplevel input, characters 20-29:
+Error: Matching on term "f y" of type "A' + B'" expects 2 branches. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_056.v b/test-suite/bugs/closed/HoTT_coq_056.v
new file mode 100644
index 00000000..6e65320d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_056.v
@@ -0,0 +1,156 @@
+(* File reduced by coq-bug-finder from 10455 lines to 8350 lines, then from 7790 lines to 710 lines, then from 7790 lines to 710 lines, then from 566 lines to 340 lines, then from 191 lines to 171 lines, then from 191 lines to 171 lines. *)
+
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Reserved Notation "x ≅ y" (at level 70, no associativity).
+Reserved Notation "i ^op" (at level 3).
+Reserved Infix "∘" (at level 40, left associativity).
+Reserved Notation "F ⟨ x ⟩" (at level 10, no associativity, x at level 10).
+Reserved Notation "F ⟨ x , y ⟩" (at level 10, no associativity, x at level 10, y at level 10).
+Reserved Notation "F ⟨ ─ ⟩" (at level 10, no associativity).
+Reserved Notation "F ⟨ x , ─ ⟩" (at level 10, no associativity, x at level 10).
+Reserved Notation "F ⟨ ─ , y ⟩" (at level 10, no associativity, y at level 10).
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope functor_scope with functor.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Delimit Scope path_scope with path.
+Local Open Scope path_scope.
+
+Record PreCategory :=
+ Build_PreCategory' {
+ Object :> Type;
+ Morphism : Object -> Object -> Type
+ }.
+
+Bind Scope category_scope with PreCategory.
+
+Definition Build_PreCategory
+ Object Morphism
+ := @Build_PreCategory' Object
+ Morphism.
+
+Record Functor (C D : PreCategory) :=
+ {
+ ObjectOf :> C -> D;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+Arguments MorphismOf [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+Class Isomorphic {C : PreCategory} (s d : C) := {}.
+Definition ComposeFunctors C D E (G : Functor D E) (F : Functor C D) : Functor C E
+ := Build_Functor C E
+ (fun c => G (F c))
+ (fun _ _ m => G.(MorphismOf) (F.(MorphismOf) m)).
+
+Infix "∘" := ComposeFunctors : functor_scope.
+
+Definition IdentityFunctor C : Functor C C
+ := Build_Functor C C
+ (fun x => x)
+ (fun _ _ x => x).
+
+Notation "─" := (IdentityFunctor _) : functor_scope.
+Record NaturalTransformation C D (F G : Functor C D) :=
+ Build_NaturalTransformation' { }.
+
+Definition OppositeCategory (C : PreCategory) : PreCategory
+ := @Build_PreCategory' C
+ (fun s d => Morphism C d s).
+
+Notation "C ^op" := (OppositeCategory C) : category_scope.
+
+Definition ProductCategory (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (C * D)%type
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type).
+
+Infix "*" := ProductCategory : category_scope.
+
+Definition OppositeFunctor C D (F : Functor C D) : Functor (C ^op) (D ^op)
+ := Build_Functor (C ^op) (D ^op)
+ (ObjectOf F)
+ (fun s d => MorphismOf F (s := d) (d := s)).
+Notation "F ^op" := (OppositeFunctor F) : functor_scope.
+
+Definition FunctorProduct' C D C' D' (F : Functor C D) (F' : Functor C' D') : Functor (C * C') (D * D')
+ := admit.
+
+Global Class FunctorApplicationInterpretable
+ {C D} (F : Functor C D)
+ {argsT : Type} (args : argsT)
+ {T : Type} (rtn : T)
+ := {}.
+Definition FunctorApplicationOf {C D} F {argsT} args {T} {rtn}
+ `{@FunctorApplicationInterpretable C D F argsT args T rtn}
+ := rtn.
+
+Global Arguments FunctorApplicationOf / {C} {D} F {argsT} args {T} {rtn} {_}.
+
+Global Instance FunctorApplicationDash C D (F : Functor C D)
+: FunctorApplicationInterpretable F (IdentityFunctor C) F | 0.
+Global Instance FunctorApplicationFunctorFunctor' A B C C' D (F : Functor (A * B) D) (G : Functor C A) (H : Functor C' B)
+: FunctorApplicationInterpretable F (G, H) (F ∘ (FunctorProduct' G H))%functor | 100.
+
+Notation "F ⟨ x ⟩" := (FunctorApplicationOf F%functor x%functor) : functor_scope.
+
+Notation "F ⟨ x , y ⟩" := (FunctorApplicationOf F%functor (x%functor , y%functor)) : functor_scope.
+
+Notation "F ⟨ ─ ⟩" := (F ⟨ ( ─ ) ⟩)%functor : functor_scope.
+
+Notation "F ⟨ x , ─ ⟩" := (F ⟨ x , ( ─ ) ⟩)%functor : functor_scope.
+
+Notation "F ⟨ ─ , y ⟩" := (F ⟨ ( ─ ) , y ⟩)%functor : functor_scope.
+
+Definition FunctorCategory (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D)
+ (NaturalTransformation (C := C) (D := D)).
+
+Notation "[ C , D ]" := (FunctorCategory C D) : category_scope.
+
+Definition SetCat : PreCategory := @Build_PreCategory Type (fun x y => x -> y).
+
+Definition HomFunctor C : Functor (C^op * C) SetCat.
+admit.
+Defined.
+Definition NaturalIsomorphism (C D : PreCategory) F G := @Isomorphic [C, D] F G.
+Infix "≅" := NaturalIsomorphism : natural_transformation_scope.
+
+Local Open Scope functor_scope.
+Local Open Scope natural_transformation_scope.
+
+Section Adjunction.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Variable F : Functor C D.
+ Variable G : Functor D C.
+ Let Adjunction_Type := Eval simpl in HomFunctor D ⟨ F^op ⟨ ─ ⟩ , ─ ⟩ ≅ HomFunctor C ⟨ ─ , G ⟨ ─ ⟩ ⟩.
+ Record Adjunction := { AMateOf : Adjunction_Type }.
+End Adjunction.
+
+Section AdjunctionEquivalences.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Variable F : Functor C D.
+ Variable G : Functor D C.
+ Variable A : Adjunction F G.
+ Set Printing All.
+ Definition foo := @AMateOf C D F G A.
+(* File "./HoTT_coq_56.v", line 145, characters 37-38:
+Error:
+In environment
+C : PreCategory
+D : PreCategory
+F : Functor C D
+G : Functor D C
+A : @Adjunction C D F G
+The term "A" has type "@Adjunction C D F G" while it is expected to have type
+ "@Adjunction C D F G". *)
+End AdjunctionEquivalences.
diff --git a/test-suite/bugs/closed/HoTT_coq_057.v b/test-suite/bugs/closed/HoTT_coq_057.v
new file mode 100644
index 00000000..e72ce0c5
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_057.v
@@ -0,0 +1,33 @@
+Require Export Coq.Lists.List.
+
+Polymorphic Fixpoint LIn (A : Type) (a:A) (l:list A) : Type :=
+ match l with
+ | nil => False
+ | b :: m => (b = a) + LIn A a m
+ end.
+
+Polymorphic Inductive NTerm : Type :=
+| cterm : NTerm
+| oterm : list NTerm -> NTerm.
+
+Polymorphic Fixpoint dummy {A B} (x : list (A * B)) : list (A * B) :=
+ match x with
+ | nil => nil
+ | (_, _) :: _ => nil
+ end.
+
+Lemma foo :
+ forall v t sub vars,
+ LIn (nat * NTerm) (v, t) (dummy sub)
+ ->
+ (
+ LIn (nat * NTerm) (v, t) sub
+ *
+ notT (LIn nat v vars)
+ ).
+Proof.
+ induction sub; simpl; intros.
+ destruct H.
+ Set Printing Universes.
+ try (apply IHsub in X). (* Toplevel input, characters 5-21:
+Error: Universe inconsistency (cannot enforce Top.47 = Set). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_058.v b/test-suite/bugs/closed/HoTT_coq_058.v
new file mode 100644
index 00000000..9ce7dba9
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_058.v
@@ -0,0 +1,140 @@
+(* File reduced by coq-bug-finder from 10044 lines to 493 lines, then from 425 lines to 160 lines. *)
+Set Universe Polymorphism.
+Notation idmap := (fun x => x).
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation "x .1" := (projT1 x) (at level 3) : fibration_scope.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Delimit Scope path_scope with path.
+Local Open Scope path_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+: forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
+
+Delimit Scope equiv_scope with equiv.
+Local Open Scope equiv_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+
+Class Funext := { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+
+Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) :
+ (forall x, f x = g x) -> f = g
+ := (@apD10 A P f g)^-1.
+
+Inductive Unit : Set :=
+ tt : Unit.
+
+Definition path_prod_uncurried {A B : Type} (z z' : A * B)
+ (pq : (fst z = fst z') * (snd z = snd z'))
+: (z = z')
+ := match pq with (p,q) =>
+ match z, z' return
+ (fst z = fst z') -> (snd z = snd z') -> (z = z') with
+ | (a,b), (a',b') => fun p q =>
+ match p, q with
+ idpath, idpath => idpath
+ end
+ end p q
+ end.
+
+Definition path_prod {A B : Type} (z z' : A * B) :
+ (fst z = fst z') -> (snd z = snd z') -> (z = z')
+ := fun p q => path_prod_uncurried z z' (p,q).
+
+Definition path_prod' {A B : Type} {x x' : A} {y y' : B}
+: (x = x') -> (y = y') -> ((x,y) = (x',y'))
+ := fun p q => path_prod (x,y) (x',y') p q.
+
+Lemma path_forall_recr_beta `{Funext} A B x0 P f g e Px
+: @transport (forall a : A, B a)
+ (fun f => P f (f x0))
+ f
+ g
+ (@path_forall _ _ _ _ _ e)
+ Px
+ = @transport ((forall a, B a) * B x0)%type
+ (fun x => P (fst x) (snd x))
+ (f, f x0)
+ (g, g x0)
+ (path_prod' (@path_forall _ _ _ _ _ e) (e x0))
+ Px.
+
+ admit.
+Defined.
+Definition transport_path_prod'_beta' A B P (x x' : A) (y y' : B) (HA : x = x') (HB : y = y') (Px : P x y)
+: @transport (A * B) (fun xy => P (fst xy) (snd xy)) (x, y) (x', y') (@path_prod' A B x x' y y' HA HB) Px
+ = @transport A (fun x => P x y') x x' HA
+ (@transport B (fun y => P x y) y y' HB Px).
+ admit.
+Defined.
+Goal forall (T : Type) (T0 : T -> T -> Type)
+ (Pmor : forall s d : T, T0 s d -> Type) (x x0 : T)
+ (x1 : T0 x x0) (p : Pmor x x0 x1) (H : Funext),
+ transport
+ (fun x2 : {_ : T & Unit} -> {_ : T & Unit} =>
+ { x1 : _ & Pmor (x2 (x; tt)) .1 (x2 (x0; tt)) .1 x1})
+ (path_forall (fun c : {_ : T & Unit} => (c .1; tt)) idmap
+ (fun x2 : {_ : T & Unit} =>
+ let (x3, y) as s return ((s .1; tt) = s) := x2 in
+ match y as y0 return ((x3; tt) = (x3; y0)) with
+ | tt => idpath
+ end)) (x1; p) = (x1; p).
+intros.
+let F := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(F) end in
+let H := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(H) end in
+let X := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(X) end in
+let T := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(T) end in
+let t0 := fresh "t0" in
+let t1 := fresh "t1" in
+let T1 := lazymatch type of F with (?T -> _) -> _ => constr:(T) end in
+ evar (t1 : T1);
+ let T0 := lazymatch type of F with (forall a : ?A, @?B a) -> ?C => constr:((forall a : A, B a) -> B t1 -> C) end in
+ evar (t0 : T0);
+
+ let dummy := fresh in
+ assert (dummy : forall x0, F x0 = t0 x0 (x0 t1));
+ [ let x0 := fresh in
+ intro x0;
+ simpl in *;
+ let GL0 := lazymatch goal with |- ?GL0 = _ => constr:(GL0) end in
+ let GL0' := fresh in
+ let GL1' := fresh in
+ set (GL0' := GL0);
+
+ let arg := match GL0 with appcontext[x0 ?arg] => constr:(arg) end in
+ assert (t1 = arg) by (subst t1; reflexivity); subst t1;
+ pattern (x0 arg) in GL0';
+ match goal with
+ | [ GL0'' := ?GR _ |- _ ] => constr_eq GL0' GL0'';
+ pose GR as GL1'
+ end;
+
+ pattern x0 in GL1';
+ match goal with
+ | [ GL1'' := ?GR _ |- _ ] => constr_eq GL1' GL1'';
+ assert (t0 = GR)
+ end;
+ subst t0; [ reflexivity | reflexivity ]
+ | clear dummy ];
+ let p := fresh in
+ pose (@path_forall_recr_beta H X T t1 t0) as p;
+ simpl in *;
+ rewrite p;
+ subst t0 t1 p.
+ rewrite transport_path_prod'_beta'.
+ (* Anomaly: Uncaught exception Invalid_argument("to_constraints: non-trivial algebraic constraint between universes", _).
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_059.v b/test-suite/bugs/closed/HoTT_coq_059.v
new file mode 100644
index 00000000..9c7e394d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_059.v
@@ -0,0 +1,17 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Set Universe Polymorphism.
+
+Inductive eq {A} (x : A) : A -> Type := eq_refl : eq x x.
+Notation "a = b" := (eq a b) : type_scope.
+
+Section foo.
+ Class Funext := { path_forall :> forall A P (f g : forall x : A, P x), (forall x, f x = g x) -> f = g }.
+ Context `{Funext, Funext}.
+
+ Set Printing Universes.
+
+ (** Typeclass resolution should pick up the different instances of Funext automatically *)
+ Definition foo := (@path_forall _ _ _ (@path_forall _ Set)).
+ (* Toplevel input, characters 0-60:
+Error: Universe inconsistency (cannot enforce Top.24 <= Top.23 because Top.23
+< Top.22 <= Top.24). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_061.v b/test-suite/bugs/closed/HoTT_coq_061.v
new file mode 100644
index 00000000..26c1f963
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_061.v
@@ -0,0 +1,132 @@
+(* There are some problems in materialize_evar with local definitions,
+ as CO below; this is not completely sorted out yet, but at least
+ it fails in a smooth way at the time of today [HH] *)
+
+(* File reduced by coq-bug-finder from 9039 lines to 7786 lines, then
+ from 7245 lines to 476 lines, then from 417 lines to 249 lines,
+ then from 171 lines to 127 lines. *)
+
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope functor_scope with functor.
+Delimit Scope natural_transformation_scope with natural_transformation.
+Reserved Infix "o" (at level 40, left associativity).
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+
+Record PreCategory :=
+ {
+ Object :> Type;
+ Morphism : Object -> Object -> Type;
+
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d' where "f 'o' g" := (Compose f g)
+ }.
+Bind Scope category_scope with PreCategory.
+
+Arguments Compose [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+
+Infix "o" := Compose : morphism_scope.
+Local Open Scope morphism_scope.
+
+Record Functor (C D : PreCategory) :=
+ {
+ ObjectOf :> C -> D;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d);
+ FCompositionOf : forall s d d' (m1 : C.(Morphism) s d) (m2: C.(Morphism) d d'),
+ MorphismOf _ _ (m2 o m1) = (MorphismOf _ _ m2) o (MorphismOf _ _ m1)
+ }.
+
+Bind Scope functor_scope with Functor.
+
+Arguments MorphismOf [C%category] [D%category] F%functor [s%object d%object] m%morphism : rename, simpl nomatch.
+
+Definition ComposeFunctors C D E
+ (G : Functor D E) (F : Functor C D) : Functor C E
+ := Build_Functor C E
+ (fun c => G (F c))
+ admit
+ admit.
+
+Infix "o" := ComposeFunctors : functor_scope.
+
+Record NaturalTransformation C D (F G : Functor C D) :=
+ {
+ ComponentsOf :> forall c, D.(Morphism) (F c) (G c);
+ Commutes : forall s d (m : C.(Morphism) s d),
+ ComponentsOf d o F.(MorphismOf) m = G.(MorphismOf) m o ComponentsOf s
+ }.
+
+Generalizable All Variables.
+
+Section NTComposeT.
+
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Variables F F' F'' : Functor C D.
+
+ Variable T' : NaturalTransformation F' F''.
+ Variable T : NaturalTransformation F F'.
+ Let CO := fun c => T' c o T c.
+ Definition NTComposeT_Commutes s d (m : Morphism C s d)
+ : CO d o MorphismOf F m = MorphismOf F'' m o CO s.
+
+ admit.
+ Defined.
+ Definition NTComposeT
+ : NaturalTransformation F F''
+ := Build_NaturalTransformation F F''
+ (fun c => T' c o T c)
+ NTComposeT_Commutes.
+End NTComposeT.
+Definition NTWhiskerR C D E (F F' : Functor D E) (T : NaturalTransformation F F')
+ (G : Functor C D)
+ := Build_NaturalTransformation (F o G) (F' o G)
+ (fun c => T (G c))
+ admit.
+Global Class NTC_Composable A B (a : A) (b : B) (T : Type) (term : T) := {}.
+
+Definition NTC_Composable_term `{@NTC_Composable A B a b T term} := term.
+Notation "T 'o' U"
+ := (@NTC_Composable_term _ _ T%natural_transformation U%natural_transformation _ _ _)
+ : natural_transformation_scope.
+
+Local Open Scope natural_transformation_scope.
+
+Lemma NTWhiskerR_CompositionOf C D
+ (F G H : Functor C D)
+ (T : NaturalTransformation G H)
+ (T' : NaturalTransformation F G) B (I : Functor B C)
+: NTWhiskerR (NTComposeT T T') I = NTComposeT (NTWhiskerR T I) (NTWhiskerR T' I).
+
+ admit.
+Defined.
+Definition FunctorCategory C D : PreCategory
+ := @Build_PreCategory (Functor C D)
+ (NaturalTransformation (C := C) (D := D))
+ admit.
+
+Notation "[ C , D ]" := (FunctorCategory C D) : category_scope.
+
+Variable C : PreCategory.
+Variable D : PreCategory.
+Variable E : PreCategory.
+Fail Definition NTWhiskerR_Functorial (G : [C, D]%category)
+: [[D, E], [C, E]]%category
+ := Build_Functor
+ [C, D] [C, E]
+ (fun F => F o G)
+ (fun _ _ T => T o G)
+ (fun _ _ _ _ _ => inverse (NTWhiskerR_CompositionOf _ _ _)).
+(* Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_062.v b/test-suite/bugs/closed/HoTT_coq_062.v
new file mode 100644
index 00000000..db895316
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_062.v
@@ -0,0 +1,106 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* File reduced by coq-bug-finder from 5012 lines to 4659 lines, then from 4220 lines to 501 lines, then from 513 lines to 495 lines, then from 513 lines to 495 lines, then from 412 lines to 79 lines, then from 412 lines to 79 lines. *)
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Delimit Scope path_scope with path.
+Local Open Scope path_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing) : path_scope.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y):
+ p # (f x) = f y
+ :=
+ match p with idpath => idpath end.
+
+Class IsEquiv {A B : Type} (f : A -> B) :=
+ BuildIsEquiv {
+ equiv_inv : B -> A
+ }.
+
+Record Equiv A B :=
+ BuildEquiv {
+ equiv_fun :> A -> B ;
+ equiv_isequiv :> IsEquiv equiv_fun
+ }.
+
+Existing Instance equiv_isequiv.
+
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+
+Inductive Bool : Type := true | false.
+
+Local Open Scope equiv_scope.
+Definition equiv_path (A B : Type) (p : A = B) : A <~> B
+ := BuildEquiv _ _ (transport (fun X:Type => X) p) admit.
+
+Class Univalence :=
+ isequiv_equiv_path :> forall (A B : Type), IsEquiv (equiv_path A B) .
+
+Section Univalence.
+ Context `{Univalence}.
+ Definition path_universe_uncurried {A B : Type} (f : A <~> B) : A = B
+ := (equiv_path A B)^-1 f.
+
+ Definition path_universe {A B : Type} (f : A -> B) {feq : IsEquiv f} : (A = B)
+ := path_universe_uncurried (BuildEquiv _ _ f feq).
+End Univalence.
+
+Definition e : Equiv@{i j} Bool Bool.
+ admit.
+Defined.
+
+Definition p `{Univalence} : @paths Type Bool Bool := path_universe e.
+
+Theorem thm `{Univalence} : (forall A, ((A -> False) -> False) -> A) -> False.
+ intro f.
+ Set Printing Universes.
+ Set Printing All.
+ Show Universes.
+ pose proof (apD f p).
+ pose proof (apD f (path_universe e)).
+ admit.
+Defined. (* ??? Toplevel input, characters 0-37:
+Error:
+Unable to satisfy the following constraints:
+In environment:
+H : Univalence@{Top.144 Top.145 Top.146 Top.147 Top.148}
+f : forall (A : Type{Top.150}) (_ : forall _ : forall _ : A, False, False), A
+
+?57 : "@IsEquiv@{Top.150 Top.145} Bool Bool (equiv_fun@{Set Set} Bool Bool e)" *)
+(* Toplevel input, characters 18-19:
+Error:
+In environment
+H : Univalence (* Top.148 Top.149 Top.150 Top.151 *)
+f : forall (A : Type (* Top.153 *))
+ (_ : forall _ : forall _ : A, False, False), A
+X : @paths (* Top.155 *)
+ ((fun A : Type (* Top.153 *) =>
+ forall _ : forall _ : forall _ : A, False, False, A) Bool)
+ (@transport (* Top.154 Top.155 *) Type (* Top.153 *)
+ (fun A : Type (* Top.153 *) =>
+ forall _ : forall _ : forall _ : A, False, False, A) Bool Bool
+ (@path_universe (* Top.148 Top.150 Top.151 Top.159 Top.153 Top.154
+ Top.149 Top.153 *) H Bool Bool
+ (equiv_fun (* Top.153 Top.153 *) Bool Bool e (* Top.153 *))
+ (equiv_isequiv (* Top.153 Top.153 *) Bool Bool e (* Top.153 *)))
+ (f Bool)) (f Bool)
+The term "@p (* Top.148 Top.172 Top.151 Top.150 Top.149 *) H" has type
+ "@paths (* Top.171 *) Set Bool Bool" while it is expected to have type
+ "@paths (* Top.169 *) Type (* Top.153 *) ?62 ?63"
+(Universe inconsistency: Cannot enforce Set = Top.153)). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_063.v b/test-suite/bugs/closed/HoTT_coq_063.v
new file mode 100644
index 00000000..777f6483
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_063.v
@@ -0,0 +1,34 @@
+Set Universe Polymorphism.
+Module A.
+ Inductive paths A (x : A) : A -> Type := idpath : paths A x x.
+
+ Notation "x = y" := (paths _ x y).
+
+ Inductive IsTrunc : nat -> Type -> Type :=
+ | BuildContr : forall A (center : A) (contr : forall y, center = y), IsTrunc 0 A
+ | trunc_S : forall A n, (forall x y : A, IsTrunc n (x = y)) -> IsTrunc (S n) A.
+
+ Existing Class IsTrunc.
+
+
+ Instance is_trunc_unit : IsTrunc 0 unit.
+ Proof. apply BuildContr with (center:=tt). now intros []. Defined.
+
+ Check (_ : IsTrunc 0 unit).
+End A.
+
+Module B.
+ Fixpoint IsTrunc (n : nat) (A : Type) : Type :=
+ match n with
+ | O => True
+ | S _ => False
+ end.
+
+ Existing Class IsTrunc.
+
+ Instance is_trunc_unit : IsTrunc 0 unit.
+ Proof. exact I. Defined.
+
+ Check (_ : IsTrunc 0 unit).
+ Fail Definition foo := (_ : IsTrunc 1 unit).
+End B.
diff --git a/test-suite/bugs/closed/HoTT_coq_064.v b/test-suite/bugs/closed/HoTT_coq_064.v
new file mode 100644
index 00000000..5f0a541b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_064.v
@@ -0,0 +1,190 @@
+(* File reduced by coq-bug-finder from 279 lines to 219 lines. *)
+
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Module Export Overture.
+ Reserved Notation "g 'o' f" (at level 40, left associativity).
+
+ Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+ Arguments idpath {A a} , [A] a.
+
+ Notation "x = y :> A" := (@paths A x y) : type_scope.
+
+ Notation "x = y" := (x = y :>_) : type_scope.
+
+ Delimit Scope path_scope with path.
+
+ Local Open Scope path_scope.
+
+ Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+ Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+ : forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+
+ Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
+
+ Delimit Scope equiv_scope with equiv.
+ Local Open Scope equiv_scope.
+
+ Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+
+ Class Funext.
+ Axiom isequiv_apD10 : `{Funext} -> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) .
+ Existing Instance isequiv_apD10.
+
+ Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) :
+ (forall x, f x = g x) -> f = g
+ :=
+ (@apD10 A P f g)^-1.
+
+End Overture.
+
+Module Export Core.
+
+ Set Implicit Arguments.
+ Delimit Scope morphism_scope with morphism.
+ Delimit Scope category_scope with category.
+ Delimit Scope object_scope with object.
+
+ Record PreCategory :=
+ {
+ object :> Type;
+ morphism : object -> object -> Type;
+
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ associativity : forall x1 x2 x3 x4
+ (m1 : morphism x1 x2)
+ (m2 : morphism x2 x3)
+ (m3 : morphism x3 x4),
+ (m3 o m2) o m1 = m3 o (m2 o m1)
+ }.
+ Bind Scope category_scope with PreCategory.
+ Arguments compose [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+
+ Infix "o" := compose : morphism_scope.
+
+End Core.
+
+Local Open Scope morphism_scope.
+Record Functor (C D : PreCategory) :=
+ {
+ object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d)
+ }.
+
+Inductive Unit : Set :=
+ tt : Unit.
+
+Definition indiscrete_category (X : Type) : PreCategory
+ := @Build_PreCategory X
+ (fun _ _ => Unit)
+ (fun _ _ _ _ _ => tt)
+ (fun _ _ _ _ _ _ _ => idpath).
+
+
+Record NaturalTransformation C D (F G : Functor C D) := { components_of :> forall c, morphism D (F c) (G c) }.
+Section path_natural_transformation.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+
+ Section path.
+ Variables T U : NaturalTransformation F G.
+ Lemma path'_natural_transformation
+ : components_of T = components_of U
+ -> T = U.
+ admit.
+ Defined.
+ Lemma path_natural_transformation
+ : (forall x, T x = U x)
+ -> T = U.
+ Proof.
+ intros.
+ apply path'_natural_transformation.
+ apply path_forall; assumption.
+ Qed.
+ End path.
+End path_natural_transformation.
+Ltac path_natural_transformation :=
+ repeat match goal with
+ | _ => intro
+ | _ => apply path_natural_transformation; simpl
+ end.
+Definition comma_category A B C (S : Functor A C) (T : Functor B C)
+: PreCategory.
+ admit.
+Defined.
+Definition compose C D (F F' F'' : Functor C D)
+ (T' : NaturalTransformation F' F'') (T : NaturalTransformation F F')
+: NaturalTransformation F F''
+ := Build_NaturalTransformation F F''
+ (fun c => T' c o T c).
+
+Infix "o" := compose : natural_transformation_scope.
+
+Local Open Scope natural_transformation_scope.
+
+Definition associativity `{fs : Funext}
+ C D F G H I
+ (V : @NaturalTransformation C D F G)
+ (U : @NaturalTransformation C D G H)
+ (T : @NaturalTransformation C D H I)
+: (T o U) o V = T o (U o V).
+Proof.
+ path_natural_transformation.
+
+ apply associativity.
+Qed.
+Definition functor_category `{Funext} (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D)
+ (@NaturalTransformation C D)
+ (@compose C D)
+ (@associativity _ C D).
+
+Notation "C -> D" := (functor_category C D) : category_scope.
+
+Definition compose_functor `{Funext} (C D E : PreCategory) : object ((C -> D) -> ((D -> E) -> (C -> E))).
+ admit.
+
+Defined.
+
+Definition pullback_along `{Funext} (C C' D : PreCategory) (p : Functor C C')
+: object ((C' -> D) -> (C -> D))
+ := Eval hnf in compose_functor _ _ _ p.
+
+Definition IsColimit `{Funext} C D (F : Functor D C)
+ (x : object
+ (@comma_category (indiscrete_category Unit)
+ (@functor_category H (indiscrete_category Unit) C)
+ (@functor_category H D C)
+ admit
+ (@pullback_along H D (indiscrete_category Unit) C
+ admit))) : Type
+ := admit.
+
+Generalizable All Variables.
+Axiom fs : Funext.
+
+Section bar.
+
+ Variable D : PreCategory.
+
+ Context `(has_colimits
+ : forall F : Functor D C,
+ @IsColimit _ C D F (colimits F)).
+(* Error: Unsatisfied constraints: Top.3773 <= Set
+ (maybe a bugged tactic). *)
+End bar.
diff --git a/test-suite/bugs/closed/HoTT_coq_067.v b/test-suite/bugs/closed/HoTT_coq_067.v
new file mode 100644
index 00000000..ad32a60c
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_067.v
@@ -0,0 +1,28 @@
+Set Universe Polymorphism.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Goal forall (A : Type) (P : forall _ : A, Type) (x0 : A)
+ (p : P x0) (q : @paths (@sigT A P) (@existT A P x0 p) (@existT A P x0 p)),
+ @paths (@paths (@sigT A P) (@existT A P x0 p) (@existT A P x0 p))
+ (@idpath (@sigT A P) (@existT A P x0 p))
+ (@idpath (@sigT A P) (@existT A P x0 p)).
+ intros.
+ induction q.
+ admit.
+Qed.
+(** Error: Illegal application:
+The term "paths_rect" of type
+ "forall (A : Type) (a : A) (P : forall a0 : A, paths a a0 -> Type),
+ P a (idpath a) -> forall (y : A) (p : paths a y), P y p"
+cannot be applied to the terms
+ "{x : _ & P x}" : "Type"
+ "s" : "{x : _ & P x}"
+ "fun (a : {x : _ & P x}) (_ : paths s a) => paths (idpath a) (idpath a)"
+ : "forall a : {x : _ & P x}, paths s a -> Type"
+ "match proof_admitted return (paths (idpath s) (idpath s)) with
+ end" : "paths (idpath s) (idpath s)"
+ "s" : "{x : _ & P x}"
+ "q" : "paths (existT P x0 p) (existT P x0 p)"
+The 3rd term has type "forall a : {x : _ & P x}, paths s a -> Type"
+which should be coercible to "forall a : {x : _ & P x}, paths s a -> Type". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_068.v b/test-suite/bugs/closed/HoTT_coq_068.v
new file mode 100644
index 00000000..f1cdcbf2
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_068.v
@@ -0,0 +1,61 @@
+Generalizable All Variables.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Module success.
+ Axiom bar : nat -> Type -> Type.
+
+ Definition foo (n : nat) (A : Type) : Type :=
+ match n with
+ | O => A
+ | S n' => forall x y : A, bar n' (x = y)
+ end.
+
+ Definition foo_succ n A : foo (S n) A.
+ Admitted.
+
+ Goal forall n (X Y : Type) (y : X) (x : X), bar n (x = y).
+ intros.
+ apply (foo_succ _ _).
+ Defined.
+End success.
+
+Module failure.
+ Fixpoint bar (n : nat) (A : Type) : Type :=
+ match n with
+ | O => A
+ | S n' => forall x y : A, bar n' (x = y)
+ end.
+
+ Definition foo_succ n A : bar (S n) A.
+ Admitted.
+
+ Goal forall n (X Y : Type) (y : X) (x : X), bar n (x = y).
+ intros.
+ apply foo_succ.
+ (* Toplevel input, characters 22-34:
+Error: In environment
+n : nat
+X : Type
+Y : Type
+y : X
+x : X
+Unable to unify
+ "forall x0 y0 : ?16,
+ (fix bar (n : nat) (A : Type) {struct n} : Type :=
+ match n with
+ | 0 => A
+ | S n' => forall x y : A, bar n' (x = y)
+ end) ?15 (x0 = y0)" with
+ "(fix bar (n : nat) (A : Type) {struct n} : Type :=
+ match n with
+ | 0 => A
+ | S n' => forall x y : A, bar n' (x = y)
+ end) n (x = y)".
+*)
+ Defined.
+End failure.
diff --git a/test-suite/bugs/closed/HoTT_coq_071.v b/test-suite/bugs/closed/HoTT_coq_071.v
new file mode 100644
index 00000000..b5a5ec1b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_071.v
@@ -0,0 +1,9 @@
+Set Universe Polymorphism.
+Definition foo : True.
+ abstract exact I.
+Defined.
+Eval hnf in foo. (* Should not be [I] *)
+Goal True.
+Proof.
+ Fail unify foo I.
+Abort.
diff --git a/test-suite/bugs/closed/HoTT_coq_074.v b/test-suite/bugs/closed/HoTT_coq_074.v
new file mode 100644
index 00000000..370c7d40
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_074.v
@@ -0,0 +1,10 @@
+Monomorphic Definition U1 := Type.
+Monomorphic Definition U2 := Type.
+
+Set Printing Universes.
+Definition foo : True.
+let t1 := type of U1 in
+let t2 := type of U2 in
+idtac t1 t2;
+pose (t1 : t2). exact I.
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_077.v b/test-suite/bugs/closed/HoTT_coq_077.v
new file mode 100644
index 00000000..db3b60ed
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_077.v
@@ -0,0 +1,39 @@
+Set Implicit Arguments.
+
+Require Import Logic.
+
+Set Asymmetric Patterns.
+Set Record Elimination Schemes.
+Set Primitive Projections.
+
+Record prod (A B : Type) : Type :=
+ pair { fst : A; snd : B }.
+
+Print prod_rect.
+(** prod_rect =
+fun (A B : Type) (P : prod A B -> Type)
+ (f : forall (fst : A) (snd : B), P {| fst := fst; snd := snd |})
+ (p : prod A B) =>
+match p as p0 return (P p0) with
+| {| fst := x; snd := x0 |} => f x x0
+end
+ : forall (A B : Type) (P : prod A B -> Type),
+ (forall (fst : A) (snd : B), P {| fst := fst; snd := snd |}) ->
+ forall p : prod A B, P p
+
+Arguments A, B are implicit
+Argument scopes are [type_scope type_scope _ _ _]
+ *)
+
+(* What I really want: *)
+Definition prod_rect' A B (P : prod A B -> Type) (u : forall (fst : A) (snd : B), P (pair fst snd))
+ (p : prod A B) : P p
+ := u (fst p) (snd p).
+
+Notation typeof x := ($(let T := type of x in exact T)$) (only parsing).
+
+(* Check for eta *)
+Check eq_refl : typeof (@prod_rect) = typeof (@prod_rect').
+
+(* Check for the recursion principle I want *)
+Check eq_refl : @prod_rect = @prod_rect'.
diff --git a/test-suite/bugs/closed/HoTT_coq_078.v b/test-suite/bugs/closed/HoTT_coq_078.v
new file mode 100644
index 00000000..54cb68b0
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_078.v
@@ -0,0 +1,43 @@
+Set Implicit Arguments.
+Require Import Logic.
+
+(*Global Set Universe Polymorphism.*)
+Global Set Asymmetric Patterns.
+Local Set Primitive Projections.
+
+Local Open Scope type_scope.
+
+Record prod (A B : Type) : Type :=
+ pair { fst : A; snd : B }.
+
+Arguments pair {A B} _ _.
+
+Notation "x * y" := (prod x y) : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+
+Generalizable Variables X A B f g n.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition transport_prod' {A : Type} {P Q : A -> Type} {a a' : A} (p : a = a')
+ (z : P a * Q a)
+ : transport (fun a => P a * Q a) p z = (transport _ p (fst z), transport _ p (snd z))
+ := match p as p' return transport (fun a0 => P a0 * Q a0) p' z = (transport P p' (fst z), transport Q p' (snd z)) with
+ | idpath => idpath
+ end. (* success *)
+
+Definition transport_prod {A : Type} {P Q : A -> Type} {a a' : A} (p : a = a')
+ (z : P a * Q a)
+ : transport (fun a => P a * Q a) p z = (transport _ p (fst z), transport _ p (snd z))
+ := match p with
+ | idpath => idpath
+ end.
diff --git a/test-suite/bugs/closed/HoTT_coq_079.v b/test-suite/bugs/closed/HoTT_coq_079.v
new file mode 100644
index 00000000..e70de9ca
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_079.v
@@ -0,0 +1,16 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Inductive paths A (x : A) : A -> Type := idpath : paths x x.
+
+Notation "x = y :> A" := (@paths A x y).
+Notation "x = y" := (x = y :> _).
+
+Record foo := { x : Type; H : x = x }.
+
+Create HintDb bar discriminated.
+Hint Resolve H : bar.
+Goal forall y : foo, @x y = @x y.
+intro y.
+progress auto with bar. (* failed to progress *)
diff --git a/test-suite/bugs/closed/HoTT_coq_080.v b/test-suite/bugs/closed/HoTT_coq_080.v
new file mode 100644
index 00000000..6b07c304
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_080.v
@@ -0,0 +1,27 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Set Asymmetric Patterns.
+Set Printing Projections.
+Inductive sum A B := inl : A -> sum A B | inr : B -> sum A B.
+Inductive Empty :=.
+
+Record category :=
+ { ob :> Type;
+ hom : ob -> ob -> Type
+ }.
+
+Definition sum_category (C D : category) : category :=
+ {|
+ ob := sum (ob C) (ob D);
+ hom x y := match x, y with
+ | inl x, inl y => @hom C x y
+ | inr x, inr y => @hom D x y
+ | _, _ => Empty
+ end |}.
+
+Goal forall C D (x y : ob (sum_category C D)), Type.
+intros C D x y.
+hnf in x, y.
+exact (hom (sum_category _ _) x y).
+Defined. \ No newline at end of file
diff --git a/test-suite/bugs/closed/HoTT_coq_081.v b/test-suite/bugs/closed/HoTT_coq_081.v
new file mode 100644
index 00000000..ac27dea7
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_081.v
@@ -0,0 +1,16 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Record category (A : Type) :=
+ { ob :> Type;
+ hom : ob -> ob -> Type
+ }.
+
+Record foo { A: Type } := { C : category A; x : ob C; y :> hom _ x x }.
+Definition comp A (C : category A) (x : C) (f : hom _ x x) := f.
+
+Definition bar A (f : @foo A) := @comp _ _ _ f.
+
+(* Toplevel input, characters 0-42:
+Error: Cannot find the target class. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_082.v b/test-suite/bugs/closed/HoTT_coq_082.v
new file mode 100644
index 00000000..ccba22ca
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_082.v
@@ -0,0 +1,19 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Record category :=
+ { ob : Type }.
+
+Existing Class category. (*
+Toplevel input, characters 0-24:
+Anomaly: Mismatched instance and context when building universe substitution.
+Please report. *)
+
+Record category' :=
+ { ob' : Type;
+ hom' : ob' -> ob' -> Type }.
+
+Existing Class category'. (*
+Toplevel input, characters 0-24:
+Anomaly: Mismatched instance and context when building universe substitution.
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_083.v b/test-suite/bugs/closed/HoTT_coq_083.v
new file mode 100644
index 00000000..494b25c7
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_083.v
@@ -0,0 +1,29 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Record category :=
+ { ob : Type }.
+
+Goal forall C, ob C -> ob C.
+intros.
+generalize dependent (ob C).
+(* 1 subgoals, subgoal 1 (ID 7)
+
+ C : category
+ ============================
+ forall T : Type, T -> T
+(dependent evars:) *)
+intros T t.
+Undo 2.
+generalize dependent (@ob C).
+(* 1 subgoals, subgoal 1 (ID 6)
+
+ C : category
+ X : ob C
+ ============================
+ Type -> ob C
+(dependent evars:) *)
+intros T t.
+(* Toplevel input, characters 9-10:
+Error: No product even after head-reduction. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_084.v b/test-suite/bugs/closed/HoTT_coq_084.v
new file mode 100644
index 00000000..d007e4e2
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_084.v
@@ -0,0 +1,49 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Module success.
+ Unset Primitive Projections.
+
+ Record group :=
+ { carrier : Type;
+ id : carrier }.
+
+ Notation "1" := (id _) : g_scope.
+
+ Delimit Scope g_scope with g.
+ Bind Scope g_scope with carrier.
+
+ Section foo.
+ Variable g : group.
+ Variable comp : carrier g -> carrier g -> carrier g.
+
+ Check comp 1 1.
+ End foo.
+End success.
+
+Module failure.
+ Set Primitive Projections.
+
+ Record group :=
+ { carrier : Type;
+ id : carrier }.
+
+ Notation "1" := (id _) : g_scope.
+
+ Delimit Scope g_scope with g.
+ Bind Scope g_scope with carrier.
+
+ Section foo.
+ Variable g : group.
+ Variable comp : carrier g -> carrier g -> carrier g.
+
+ Check comp 1 1.
+ (* Toplevel input, characters 11-12:
+Error:
+In environment
+g : group
+comp : carrier g -> carrier g -> carrier g
+The term "1" has type "nat" while it is expected to have type "carrier g".
+ *)
+ End foo.
+End failure.
diff --git a/test-suite/bugs/closed/HoTT_coq_085.v b/test-suite/bugs/closed/HoTT_coq_085.v
new file mode 100644
index 00000000..041c6799
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_085.v
@@ -0,0 +1,74 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Module success.
+ Unset Primitive Projections.
+
+ Record category :=
+ { ob : Type;
+ hom : ob -> ob -> Type;
+ comp : forall x y z, hom y z -> hom x y -> hom x z }.
+
+ Delimit Scope hom_scope with hom.
+ Bind Scope hom_scope with hom.
+ Arguments hom : clear implicits.
+ Arguments comp _ _ _ _ _%hom _%hom : clear implicits.
+
+ Notation "f 'o' g" := (comp _ _ _ _ f g) (at level 40, left associativity) : hom_scope.
+
+ Record functor (C D : category) :=
+ { ob_of : ob C -> ob D;
+ hom_of : forall x y, hom C x y -> hom D (ob_of x) (ob_of y) }.
+
+ Delimit Scope functor_scope with functor.
+ Bind Scope functor_scope with functor.
+
+ Arguments hom_of _ _ _%functor _ _ _%hom.
+
+ Notation "F '_1' m" := (hom_of F _ _ m) (at level 10, no associativity) : hom_scope.
+
+ Axiom f_comp : forall C D E, functor D E -> functor C D -> functor C E.
+ Notation "f 'o' g" := (@f_comp _ _ _ f g) (at level 40, left associativity) : functor_scope.
+
+ Check ((_ o _) _1 _)%hom. (* ((?16 o ?17) _1 ?20)%hom
+ : hom ?15 (ob_of (?16 o ?17) ?18) (ob_of (?16 o ?17) ?19) *)
+End success.
+
+Module failure.
+ Set Primitive Projections.
+
+ Record category :=
+ { ob : Type;
+ hom : ob -> ob -> Type;
+ comp : forall x y z, hom y z -> hom x y -> hom x z }.
+
+ Delimit Scope hom_scope with hom.
+ Bind Scope hom_scope with hom.
+ Arguments hom : clear implicits.
+ Arguments comp _ _ _ _ _%hom _%hom : clear implicits.
+
+ Notation "f 'o' g" := (comp _ _ _ _ f g) (at level 40, left associativity) : hom_scope.
+
+ Record functor (C D : category) :=
+ { ob_of : ob C -> ob D;
+ hom_of : forall x y, hom C x y -> hom D (ob_of x) (ob_of y) }.
+
+ Delimit Scope functor_scope with functor.
+ Bind Scope functor_scope with functor.
+
+ Arguments hom_of _ _ _%functor _ _ _%hom.
+
+ Notation "F '_1' m" := (hom_of F _ _ m) (at level 10, no associativity) : hom_scope.
+ Notation "F '_2' m" := (hom_of F%functor _ _ m) (at level 10, no associativity) : hom_scope.
+
+ Axiom f_comp : forall C D E, functor D E -> functor C D -> functor C E.
+ Notation "f 'o' g" := (@f_comp _ _ _ f g) (at level 40, left associativity) : functor_scope.
+
+ Check ((_ o _) _2 _)%hom. (* ((?14 o ?15)%functor _1 ?18)%hom
+ : hom ?13 (ob_of (?14 o ?15)%functor ?16)
+ (ob_of (?14 o ?15)%functor ?17) *)
+ Check ((_ o _) _1 _)%hom. (* Toplevel input, characters 7-19:
+Error:
+The term "(?23 o ?24)%hom" has type "hom ?19 ?20 ?22"
+while it is expected to have type "functor ?25 ?26". *)
+End failure.
diff --git a/test-suite/bugs/closed/HoTT_coq_087.v b/test-suite/bugs/closed/HoTT_coq_087.v
new file mode 100644
index 00000000..265310b1
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_087.v
@@ -0,0 +1,14 @@
+Structure type : Type := Pack { ob : Type }.
+Polymorphic Record category := { foo : Type }.
+Definition FuncComp := Pack category.
+Axiom C : category.
+
+Check (C : ob FuncComp). (* OK *)
+
+Canonical Structure FuncComp.
+
+Check (C : ob FuncComp).
+(* Toplevel input, characters 15-39:
+Error:
+The term "C" has type "category" while it is expected to have type
+ "ob FuncComp". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_088.v b/test-suite/bugs/closed/HoTT_coq_088.v
new file mode 100644
index 00000000..b3e1df57
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_088.v
@@ -0,0 +1,78 @@
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Arguments paths_ind [A] a P f y p.
+Arguments paths_rec [A] a P f y p.
+Arguments paths_rect [A] a P f y p.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+(** A typeclass that includes the data making [f] into an adjoint equivalence. *)
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Record Equiv A B := BuildEquiv {
+ equiv_fun :> A -> B ;
+ equiv_isequiv :> IsEquiv equiv_fun
+}.
+
+
+Definition equiv_path (A B : Type) (p : A = B) : Equiv A B.
+Admitted.
+
+Class Univalence := {
+ isequiv_equiv_path :> forall (A B : Type), IsEquiv (equiv_path A B)
+}.
+
+Definition ua_downward_closed `{Univalence} : Univalence.
+ constructor.
+ intros A B.
+ destruct H as [H].
+ generalize (fun A B => @eisretr _ _ _ (H (A : Type) (B : Type))).
+ generalize (fun A B => @eissect _ _ _ (H (A : Type) (B : Type))).
+ let g := match goal with |- _ -> _ -> ?g => constr:(g) end in
+ let U0 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U0) end in
+ let U1 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U1) end in
+ let U2 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U2) end in
+ let U3 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U3) end in
+ let f0 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(f) end in
+ let f' := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(f') end in
+ change ((forall (A : U0) (B : U1), Sect (f0 A B) ((fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B)) A B))
+ -> (forall (A : U2) (B : U3), Sect ((fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B)) A B) (f' A B))
+ -> g);
+ generalize (fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B));
+ clear H;
+ simpl;
+ intros fi sect retr.
+ pose proof fi as fi'.
+ Set Printing All.
+ change (forall (A : Type) (B : Type) (_ : Equiv A B), @paths Type A B) in fi'.
+ (*refine (@isequiv_adjointify
+ _ _
+ _ _
+ _
+ _);
+ admit.
+ Grab Existential Variables.*)
+ admit.
+ (*destruct p.*)
+ (*specialize (H (A' : Type)).*)
+Defined.
+(* Error: Unsatisfied constraints:
+Top.62 < Top.61
+Top.64 <= Top.62
+Top.63 <= Top.62
+ (maybe a bugged tactic).*)
diff --git a/test-suite/bugs/closed/HoTT_coq_089.v b/test-suite/bugs/closed/HoTT_coq_089.v
new file mode 100644
index 00000000..2da4aff6
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_089.v
@@ -0,0 +1,44 @@
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Set Printing Universes.
+
+Inductive type_paths (A : Type) : Type -> Prop
+ := idtypepath : type_paths A A.
+Monomorphic Definition comp_type_paths := Eval compute in type_paths@{Type Type}.
+Check comp_type_paths.
+(* comp_type_paths
+ : Type (* Top.12 *) -> Type (* Top.12 *) -> Prop *)
+(* This is terrible. *)
+
+Inductive type_paths' (A : Type) : Type -> Prop
+ := idtypepath' : type_paths' A A
+ | other_type_path : False -> forall B : Type, type_paths' A B.
+Monomorphic Definition comp_type_paths' := Eval compute in type_paths'.
+Check comp_type_paths'.
+(* comp_type_paths'
+ : Type (* Top.24 *) -> Type (* Top.23 *) -> Prop *)
+(* Ok, then ... *)
+
+(** Fail if it's [U0 -> U0 -> _], but not on [U0 -> U1 -> _]. *)
+Goal Type.
+Proof.
+ match type of comp_type_paths' with
+ | ?U0 -> ?U1 -> ?R
+ => exact (@comp_type_paths' nat U0)
+ end.
+Defined.
+
+Goal Type.
+Proof.
+ match type of comp_type_paths with
+ | ?U0 -> ?U1 -> ?R
+ => exact (@comp_type_paths nat U0)
+ end.
+ (* Toplevel input, characters 110-112:
+Error:
+The term "Type (* Top.51 *)" has type "Type (* Top.51+1 *)"
+while it is expected to have type "Type (* Top.51 *)"
+(Universe inconsistency: Cannot enforce Top.51 < Top.51 because Top.51
+= Top.51)). *)
+
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_090.v b/test-suite/bugs/closed/HoTT_coq_090.v
new file mode 100644
index 00000000..5c704147
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_090.v
@@ -0,0 +1,187 @@
+(** I'm not sure if this tests what I want it to test... *)
+Set Implicit Arguments.
+Set Universe Polymorphism.
+
+Notation idmap := (fun x => x).
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Arguments paths_ind [A] a P f y p.
+Arguments paths_rec [A] a P f y p.
+Arguments paths_rect [A] a P f y p.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+(** A typeclass that includes the data making [f] into an adjoint equivalence. *)
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Arguments eisretr {A B} f {_} _.
+Arguments eissect {A B} f {_} _.
+Arguments eisadj {A B} f {_} _.
+
+
+Record Equiv A B := BuildEquiv {
+ equiv_fun :> A -> B ;
+ equiv_isequiv :> IsEquiv equiv_fun
+}.
+
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+
+(** See above for the meaning of [simpl nomatch]. *)
+Arguments concat {A x y z} p q : simpl nomatch.
+
+(** The inverse of a path. *)
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+
+(** Declaring this as [simpl nomatch] prevents the tactic [simpl] from expanding it out into [match] statements. We only want [inverse] to simplify when applied to an identity path. *)
+Arguments inverse {A x y} p : simpl nomatch.
+
+(** Note that you can use the built-in Coq tactics [reflexivity] and [transitivity] when working with paths, but not [symmetry], because it is too smart for its own good. Instead, you can write [apply symmetry] or [eapply symmetry]. *)
+
+(** The identity path. *)
+Notation "1" := idpath : path_scope.
+
+(** The composition of two paths. *)
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+
+(** The inverse of a path. *)
+Notation "p ^" := (inverse p) (at level 3) : path_scope.
+
+(** An alternative notation which puts each path on its own line. Useful as a temporary device during proofs of equalities between very long composites; to turn it on inside a section, say [Open Scope long_path_scope]. *)
+Notation "p @' q" := (concat p q) (at level 21, left associativity,
+ format "'[v' p '/' '@'' q ']'") : long_path_scope.
+
+
+(** An important instance of [paths_rect] is that given any dependent type, one can _transport_ elements of instances of the type along equalities in the base.
+
+ [transport P p u] transports [u : P x] to [P y] along [p : x = y]. *)
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+(** See above for the meaning of [simpl nomatch]. *)
+Arguments transport {A} P {x y} p%path_scope u : simpl nomatch.
+
+
+
+Instance isequiv_path {A B : Type} (p : A = B)
+ : IsEquiv (transport (fun X:Type => X) p) | 0.
+Proof.
+ refine (@BuildIsEquiv _ _ _ (transport (fun X:Type => X) p^) _ _ _);
+ admit.
+Defined.
+
+Definition equiv_path (A B : Type) (p : A = B) : Equiv A B
+ := @BuildEquiv _ _ (transport (fun X:Type => X) p) _.
+
+Arguments equiv_path : clear implicits.
+
+Definition equiv_adjointify A B (f : A -> B) (g : B -> A) (r : Sect g f) (s : Sect f g) : Equiv A B.
+Proof.
+ refine (@BuildEquiv A B f (@BuildIsEquiv A B f g r s _)).
+ admit.
+Defined.
+
+
+Set Printing Universes.
+
+Definition lift_id_type : Type.
+Proof.
+ let U0 := constr:(Type) in
+ let U1 := constr:(Type) in
+ let unif := constr:(U0 : U1) in
+ exact (forall (A : Type) (B : Type), @paths U0 A B -> @paths U1 A B).
+Defined.
+
+Definition lower_id_type : Type.
+Proof.
+ let U0 := constr:(Type) in
+ let U1 := constr:(Type) in
+ let unif := constr:(U0 : U1) in
+ exact ((forall (A : Type) (B : Type), IsEquiv (equiv_path (A : U0) (B : U0)))
+ -> forall (A : Type) (B : Type), @paths U1 A B -> @paths U0 A B).
+Defined.
+
+Definition lift_id : lift_id_type :=
+ fun A B p => match p in @paths _ _ B return @paths Type (A : Type) (B : Type) with
+ | idpath => idpath
+ end.
+
+Definition lower_id : lower_id_type.
+Proof.
+ intros ua A B p.
+ specialize (ua A B).
+ apply (@equiv_inv _ _ (equiv_path A B) _).
+ simpl.
+ pose (f := transport idmap p : A -> B).
+ pose (g := transport idmap p^ : B -> A).
+ refine (@equiv_adjointify
+ _ _
+ f g
+ _ _);
+ subst f g; unfold transport, inverse;
+ clear ua;
+ [ intro x
+ | exact match p as p in (_ = B) return
+ (forall x : (A : Type),
+ @paths (* Top.904 *)
+ A
+ match
+ match
+ p in (paths _ a)
+ return (@paths (* Top.906 *) Type (* Top.900 *) a A)
+ with
+ | idpath => @idpath (* Top.906 *) Type (* Top.900 *) A
+ end in (paths _ a) return a
+ with
+ | idpath => match p in (paths _ a) return a with
+ | idpath => x
+ end
+ end x)
+ with
+ | idpath => fun _ => idpath
+ end ].
+
+ - pose proof (match p as p in (_ = B) return
+ (forall x : (B : Type),
+ match p in (_ = a) return (a : Type) with
+ | idpath =>
+ match
+ match p in (_ = a) return (@paths Type (a : Type) (A : Type)) with
+ | idpath => idpath
+ end in (_ = a) return (a : Type)
+ with
+ | idpath => x
+ end
+ end = x)
+ with
+ | idpath => fun _ => idpath
+ end x) as p'.
+ admit.
+Defined.
+(* Error: Illegal application:
+The term "paths (* Top.96 *)" of type
+ "forall A : Type (* Top.96 *), A -> A -> Type (* Top.96 *)"
+cannot be applied to the terms
+ "Type (* Top.100 *)" : "Type (* Top.100+1 *)"
+ "a" : "Type (* Top.60 *)"
+ "A" : "Type (* Top.57 *)"
+The 2nd term has type "Type (* Top.60 *)" which should be coercible to
+ "Type (* Top.100 *)".
+ *)
diff --git a/test-suite/bugs/closed/HoTT_coq_091.v b/test-suite/bugs/closed/HoTT_coq_091.v
new file mode 100644
index 00000000..1e4497e7
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_091.v
@@ -0,0 +1,191 @@
+Set Implicit Arguments.
+
+Set Printing Universes.
+
+Set Asymmetric Patterns.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Arguments paths_ind [A] a P f y p.
+Arguments paths_rec [A] a P f y p.
+Arguments paths_rect [A] a P f y p.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+Arguments ap {A B} f {x y} p : simpl nomatch.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+(** A typeclass that includes the data making [f] into an adjoint equivalence. *)
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Arguments eisretr {A B} f {_} _.
+Arguments eissect {A B} f {_} _.
+Arguments eisadj {A B} f {_} _.
+
+
+Inductive type_eq (A : Type) : Type -> Type :=
+| type_eq_refl : type_eq A A
+| type_eq_impossible : False -> forall B : Type, type_eq A B.
+
+Definition type_eq_sym {A B} (p : type_eq A B) : type_eq B A
+ := match p in (type_eq _ B) return (type_eq B A) with
+ | type_eq_refl => type_eq_refl _
+ | type_eq_impossible f B => type_eq_impossible _ f A
+ end.
+
+Definition type_eq_sym_type_eq_sym {A B} (p : type_eq A B) : type_eq_sym (type_eq_sym p) = p
+ := match p as p return type_eq_sym (type_eq_sym p) = p with
+ | type_eq_refl => idpath
+ | type_eq_impossible f _ => idpath
+ end.
+
+Module Type LiftT.
+ Section local.
+ Let type_cast_up_type : Type.
+ Proof.
+ let U0 := constr:(Type) in
+ let U1 := constr:(Type) in
+ let unif := constr:(U0 : U1) in
+ exact (forall T : U0, { T' : U1 & type_eq T' T }).
+ Defined.
+
+ Axiom type_cast_up : type_cast_up_type.
+ End local.
+
+ Definition Lift (T : Type) := projT1 (type_cast_up T).
+ Definition lift {T} : T -> Lift T
+ := match projT2 (type_cast_up T) in (type_eq _ T') return T' -> Lift T with
+ | type_eq_refl => fun x => x
+ | type_eq_impossible bad _ => match bad with end
+ end.
+ Section equiv.
+ Definition lower' {T} : Lift T -> T
+ := match projT2 (type_cast_up T) in (type_eq _ T') return Lift T -> T' with
+ | type_eq_refl => fun x => x
+ | type_eq_impossible bad _ => match bad with end
+ end.
+ Definition lift_lower {T} (x : Lift T) : lift (lower' x) = x.
+ Proof.
+ unfold lower', lift.
+ destruct (projT2 (type_cast_up T)) as [|[]].
+ reflexivity.
+ Defined.
+ Definition lower_lift {T} (x : T) : lower' (lift x) = x.
+ Proof.
+ unfold lower', lift, Lift in *.
+ destruct (type_cast_up T) as [T' p]; simpl.
+ let y := match goal with |- ?y => constr:(y) end in
+ let P := match (eval pattern p in y) with ?f p => constr:(f) end in
+ apply (@transport _ P _ _ (type_eq_sym_type_eq_sym p)); simpl in *.
+ generalize (type_eq_sym p); intro p'; clear p.
+ destruct p' as [|[]]; simpl.
+ reflexivity.
+ Defined.
+
+ Global Instance isequiv_lift A : IsEquiv (@lift A).
+ Proof.
+ refine (@BuildIsEquiv
+ _ _
+ lift lower'
+ lift_lower
+ lower_lift
+ _).
+ compute.
+ intro x.
+ destruct (type_cast_up A) as [T' p].
+ let y := match goal with |- ?y => constr:(y) end in
+ let P := match (eval pattern p in y) with ?f p => constr:(f) end in
+ apply (@transport _ P _ _ (type_eq_sym_type_eq_sym p)); simpl in *.
+ generalize (type_eq_sym p); intro p'; clear p.
+ destruct p' as [|[]]; simpl.
+ reflexivity.
+ Defined.
+ End equiv.
+ Definition lower {A} := (@equiv_inv _ _ (@lift A) _).
+End LiftT.
+
+Module Lift : LiftT.
+ Section local.
+ Let type_cast_up_type : Type.
+ Proof.
+ let U0 := constr:(Type) in
+ let U1 := constr:(Type) in
+ let unif := constr:(U0 : U1) in
+ exact (forall T : U0, { T' : U1 & type_eq T' T }).
+ Defined.
+
+ Definition type_cast_up : type_cast_up_type
+ := fun T => existT (fun T' => type_eq T' T) T (type_eq_refl _).
+ End local.
+
+ Definition Lift (T : Type) := projT1 (type_cast_up T).
+ Definition lift {T} : T -> Lift T
+ := match projT2 (type_cast_up T) in (type_eq _ T') return T' -> Lift T with
+ | type_eq_refl => fun x => x
+ | type_eq_impossible bad _ => match bad with end
+ end.
+ Section equiv.
+ Definition lower' {T} : Lift T -> T
+ := match projT2 (type_cast_up T) in (type_eq _ T') return Lift T -> T' with
+ | type_eq_refl => fun x => x
+ | type_eq_impossible bad _ => match bad with end
+ end.
+ Definition lift_lower {T} (x : Lift T) : lift (lower' x) = x.
+ Proof.
+ unfold lower', lift.
+ destruct (projT2 (type_cast_up T)) as [|[]].
+ reflexivity.
+ Defined.
+ Definition lower_lift {T} (x : T) : lower' (lift x) = x.
+ Proof.
+ unfold lower', lift, Lift in *.
+ destruct (type_cast_up T) as [T' p]; simpl.
+ let y := match goal with |- ?y => constr:(y) end in
+ let P := match (eval pattern p in y) with ?f p => constr:(f) end in
+ apply (@transport _ P _ _ (type_eq_sym_type_eq_sym p)); simpl in *.
+ generalize (type_eq_sym p); intro p'; clear p.
+ destruct p' as [|[]]; simpl.
+ reflexivity.
+ Defined.
+
+
+ Global Instance isequiv_lift A : IsEquiv (@lift A).
+ Proof.
+ refine (@BuildIsEquiv
+ _ _
+ lift lower'
+ lift_lower
+ lower_lift
+ _).
+ compute.
+ intro x.
+ destruct (type_cast_up A) as [T' p].
+ let y := match goal with |- ?y => constr:(y) end in
+ let P := match (eval pattern p in y) with ?f p => constr:(f) end in
+ apply (@transport _ P _ _ (type_eq_sym_type_eq_sym p)); simpl in *.
+ generalize (type_eq_sym p); intro p'; clear p.
+ destruct p' as [|[]]; simpl.
+ reflexivity.
+ Defined.
+ End equiv.
+ Definition lower {A} := (@equiv_inv _ _ (@lift A) _).
+End Lift.
+(* Toplevel input, characters 15-24:
+Anomaly: Invalid argument: enforce_eq_instances called with instances of different lengths.
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_093.v b/test-suite/bugs/closed/HoTT_coq_093.v
new file mode 100644
index 00000000..38943ab3
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_093.v
@@ -0,0 +1,27 @@
+(** It would be nice if we had more lax constraint checking of inductive types, and had variance annotations on their universes *)
+Set Printing All.
+Set Printing Implicit.
+Set Printing Universes.
+Set Universe Polymorphism.
+
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+
+Notation "x = y" := (@paths _ x y) : type_scope.
+
+Section lift.
+ Let lift_type : Type.
+ Proof.
+ let U0 := constr:(Type) in
+ let U1 := constr:(Type) in
+ let unif := constr:(U0 : U1) in
+ exact (U0 -> U1).
+ Defined.
+
+ Definition Lift (A : Type@{i}) : Type@{j} := A.
+End lift.
+
+Goal forall (A : Type@{i}) (x y : A), @paths@{i} A x y -> @paths@{j} A x y.
+intros A x y p.
+compute in *. destruct p. exact idpath.
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_094.v b/test-suite/bugs/closed/HoTT_coq_094.v
new file mode 100644
index 00000000..13e0605d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_094.v
@@ -0,0 +1,9 @@
+Record PreCategory := Build_PreCategory' { object :> Type }.
+Class Foo (X : Type) := {}.
+Class Bar := {}.
+Definition functor_category `{Bar} (C D : PreCategory) `{Foo (object D)} : PreCategory.
+Admitted.
+Fail Definition functor_object_of `{Bar} (C1 C2 D : PreCategory) `{Foo (object D)}
+: functor_category C1 (functor_category C2 D) -> True.
+(** Anomaly: File "toplevel/himsg.ml", line ..., characters ...: Assertion failed.
+Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_097.v b/test-suite/bugs/closed/HoTT_coq_097.v
new file mode 100644
index 00000000..38e8007b
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_097.v
@@ -0,0 +1,5 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+Set Universe Polymorphism.
+Set Printing Universes.
+Inductive Empty : Set := .
+(* Error: Universe inconsistency. Cannot enforce Prop <= Set). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_098.v b/test-suite/bugs/closed/HoTT_coq_098.v
new file mode 100644
index 00000000..fc99daab
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_098.v
@@ -0,0 +1,63 @@
+Set Implicit Arguments.
+Generalizable All Variables.
+
+Polymorphic Record SpecializedCategory (obj : Type) := Build_SpecializedCategory' {
+ Object :> _ := obj;
+ Morphism' : obj -> obj -> Type;
+
+ Identity' : forall o, Morphism' o o;
+ Compose' : forall s d d', Morphism' d d' -> Morphism' s d -> Morphism' s d'
+}.
+
+Polymorphic Definition TypeCat : @SpecializedCategory Type
+ := (@Build_SpecializedCategory' Type
+ (fun s d => s -> d)
+ (fun _ => (fun x => x))
+ (fun _ _ _ f g => (fun x => f (g x)))).
+
+Inductive GraphIndex := GraphIndexSource | GraphIndexTarget.
+Polymorphic Definition GraphIndexingCategory : @SpecializedCategory GraphIndex.
+Admitted.
+
+Module success.
+ Section SpecializedFunctor.
+ Set Universe Polymorphism.
+ Context `(C : @SpecializedCategory objC).
+ Context `(D : @SpecializedCategory objD).
+ Unset Universe Polymorphism.
+
+ Polymorphic Record SpecializedFunctor
+ := {
+ ObjectOf' : objC -> objD;
+ MorphismOf' : forall s d, C.(Morphism') s d -> D.(Morphism') (ObjectOf' s) (ObjectOf' d)
+ }.
+ End SpecializedFunctor.
+
+ Polymorphic Definition UnderlyingGraph : SpecializedFunctor GraphIndexingCategory TypeCat.
+ Admitted.
+End success.
+
+Module success2.
+ Section SpecializedFunctor.
+ Polymorphic Context `(C : @SpecializedCategory objC).
+ Polymorphic Context `(D : @SpecializedCategory objD).
+
+ Polymorphic Record SpecializedFunctor
+ := {
+ ObjectOf' : objC -> objD;
+ MorphismOf' : forall s d, C.(Morphism') s d -> D.(Morphism') (ObjectOf' s) (ObjectOf' d)
+ }.
+ End SpecializedFunctor.
+
+ Set Printing Universes.
+ Polymorphic Definition UnderlyingGraph : SpecializedFunctor GraphIndexingCategory TypeCat.
+ (* Toplevel input, characters 73-94:
+Error:
+The term "GraphIndexingCategory (* Top.563 *)" has type
+ "SpecializedCategory (* Top.563 Set *) GraphIndex"
+while it is expected to have type
+ "SpecializedCategory (* Top.550 Top.551 *) ?7"
+(Universe inconsistency: Cannot enforce Set = Top.551)). *)
+ admit.
+ Defined.
+End success2.
diff --git a/test-suite/bugs/closed/HoTT_coq_099.v b/test-suite/bugs/closed/HoTT_coq_099.v
new file mode 100644
index 00000000..9b6ace82
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_099.v
@@ -0,0 +1,61 @@
+(* File reduced by coq-bug-finder from 138 lines to 78 lines. *)
+Set Implicit Arguments.
+Generalizable All Variables.
+Set Universe Polymorphism.
+Delimit Scope object_scope with object.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Record Category (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Identity : forall x, Morphism x x;
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+Arguments Identity {obj%type} [!C%category] x%object : rename.
+Arguments Compose {obj%type} [!C%category s%object d%object d'%object] m1%morphism m2%morphism : rename.
+Bind Scope category_scope with Category.
+
+Record Functor `(C : @Category objC) `(D : @Category objD)
+ := { ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d) }.
+
+Record NaturalTransformation `(C : @Category objC) `(D : @Category objD) (F G : Functor C D)
+ := { ComponentsOf :> forall c, D.(Morphism) (F c) (G c) }.
+
+Definition ProductCategory `(C : @Category objC) `(D : @Category objD)
+: @Category (objC * objD)%type
+ := @Build_Category _
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
+ (fun o => (Identity (fst o), Identity (snd o)))
+ (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1))).
+
+Infix "*" := ProductCategory : category_scope.
+
+Record IsomorphismOf `{C : @Category objC} {s d} (m : C.(Morphism) s d) :=
+ { IsomorphismOf_Morphism :> C.(Morphism) s d := m;
+ Inverse : C.(Morphism) d s }.
+
+Record NaturalIsomorphism `(C : @Category objC) `(D : @Category objD) (F G : Functor C D)
+ := { NaturalIsomorphism_Transformation :> NaturalTransformation F G;
+ NaturalIsomorphism_Isomorphism : forall x : objC, IsomorphismOf (NaturalIsomorphism_Transformation x) }.
+
+Section PreMonoidalCategory.
+ Context `(C : @Category objC).
+ Definition TriMonoidalProductL : Functor (C * C * C) C.
+ admit.
+ Defined.
+ Definition TriMonoidalProductR : Functor (C * C * C) C.
+ admit.
+ Defined. (** Replacing [admit. Defined.] with [Admitted.] satisfies the constraints *)
+ Variable Associator : NaturalIsomorphism TriMonoidalProductL TriMonoidalProductR.
+ (* Toplevel input, characters 15-96:
+Error: Unsatisfied constraints:
+Coq.Init.Datatypes.28 <= Coq.Init.Datatypes.29
+Top.168 <= Coq.Init.Datatypes.29
+Top.168 <= Coq.Init.Datatypes.28
+Top.169 <= Coq.Init.Datatypes.29
+Top.169 <= Coq.Init.Datatypes.28
+ (maybe a bugged tactic). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_100.v b/test-suite/bugs/closed/HoTT_coq_100.v
new file mode 100644
index 00000000..c39b7093
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_100.v
@@ -0,0 +1,151 @@
+(* File reduced by coq-bug-finder from 335 lines to 115 lines. *)
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Generalizable All Variables.
+Record Category (obj : Type) :=
+ Build_Category {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type;
+
+ Identity : forall x, Morphism x x;
+ Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
+ }.
+
+Arguments Identity {obj%type} [!C] x : rename.
+
+Arguments Compose {obj%type} [!C s d d'] m1 m2 : rename.
+Record > Category' :=
+ {
+ LSObject : Type;
+
+ LSUnderlyingCategory :> @Category LSObject
+ }.
+
+Section Functor.
+
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+ Record Functor :=
+ {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+
+End Functor.
+Section FunctorComposition.
+
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+ Context `(E : @Category objE).
+ Definition ComposeFunctors (G : Functor D E) (F : Functor C D) : Functor C E.
+
+ Admitted.
+End FunctorComposition.
+Section IdentityFunctor.
+
+ Context `(C : @Category objC).
+ Definition IdentityFunctor : Functor C C.
+
+ admit.
+ Defined.
+End IdentityFunctor.
+Section ProductCategory.
+
+ Context `(C : @Category objC).
+ Context `(D : @Category objD).
+ Definition ProductCategory : @Category (objC * objD)%type.
+
+ refine (@Build_Category _
+ (fun s d => (C.(Morphism) (fst s) (fst d) * D.(Morphism) (snd s) (snd d))%type)
+ (fun o => (Identity (fst o), Identity (snd o)))
+ (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd m2) (snd m1)))).
+ Defined.
+End ProductCategory.
+Parameter TerminalCategory : Category unit.
+
+Section ComputableCategory.
+
+ Variable I : Type.
+ Variable Index2Object : I -> Type.
+ Variable Index2Cat : forall i : I, @Category (@Index2Object i).
+ Local Coercion Index2Cat : I >-> Category.
+
+ Definition ComputableCategory : @Category I.
+
+ refine (@Build_Category _
+ (fun C D : I => Functor C D)
+ (fun o : I => IdentityFunctor o)
+ (fun C D E : I => ComposeFunctors (C := C) (D := D) (E := E))).
+ Defined.
+End ComputableCategory.
+Definition LocallySmallCat := ComputableCategory _ LSUnderlyingCategory.
+Section CommaCategory.
+
+ Context `(A : @Category objA).
+ Context `(B : @Category objB).
+ Context `(C : @Category objC).
+ Variable S : Functor A C.
+ Variable T : Functor B C.
+ Record CommaCategory_Object := { CommaCategory_Object_Member :> { ab : objA * objB & C.(Morphism) (S (fst ab)) (T (snd ab)) } }.
+
+End CommaCategory.
+Definition SliceCategory_Functor `(C : @Category objC) (a : C) : Functor TerminalCategory C
+ := {| ObjectOf := (fun _ => a);
+ MorphismOf := (fun _ _ _ => Identity a)
+ |}.
+
+Definition SliceCategoryOver
+: forall (objC : Type) (C : Category objC) (a : C),
+ Category
+ (CommaCategory_Object (IdentityFunctor C)
+ (SliceCategory_Functor C a)).
+
+ admit.
+Defined.
+Section CommaCategoryProjectionFunctor.
+
+ Context `(A : Category objA).
+ Context `(B : Category objB).
+ Let X : LocallySmallCat.
+
+ Proof.
+ hnf.
+ pose (@SliceCategoryOver _ LocallySmallCat).
+ exact (ProductCategory A B).
+ Set Printing Universes.
+ Defined.
+(* Error: Illegal application:
+The term
+ "CommaCategory_Object (* Top.306 Top.307 Top.305 Top.300 Top.305 Top.306 *)"
+of type
+ "forall (objA : Type (* Top.305 *))
+ (A : Category (* Top.306 Top.305 *) objA) (objB : Type (* Top.307 *))
+ (B : Category (* Top.300 Top.307 *) objB) (objC : Type (* Top.305 *))
+ (C : Category (* Top.306 Top.305 *) objC),
+ Functor (* Top.306 Top.305 Top.305 Top.306 *) A C ->
+ Functor (* Top.300 Top.307 Top.305 Top.306 *) B C ->
+ Type (* max(Top.307, Top.305, Top.306) *)"
+cannot be applied to the terms
+ "Category' (* Top.312 Top.311 *)" : "Type (* max(Top.311+1, Top.312+1) *)"
+ "LocallySmallCat (* Top.309 Top.310 Top.311 Top.312 Top.313 Top.314 Top.306 Top.316 Top.305 *)"
+ : "Category (* Top.306 Top.305 *) Category' (* Top.312 Top.311 *)"
+ "unit" : "Set"
+ "TerminalCategory (* Top.300 *)" : "Category (* Top.300 Set *) unit"
+ "Category' (* Top.312 Top.311 *)" : "Type (* max(Top.311+1, Top.312+1) *)"
+ "LocallySmallCat (* Top.309 Top.310 Top.311 Top.312 Top.313 Top.314 Top.306 Top.316 Top.305 *)"
+ : "Category (* Top.306 Top.305 *) Category' (* Top.312 Top.311 *)"
+ "IdentityFunctor (* Top.299 Top.302 Top.301 Top.305 Top.306 *)
+ LocallySmallCat (* Top.309 Top.310 Top.311 Top.312 Top.313 Top.314
+ Top.306 Top.316 Top.305 *)"
+ : "Functor (* Top.306 Top.305 Top.305 Top.306 *) LocallySmallCat
+ (* Top.309 Top.310 Top.311 Top.312 Top.313 Top.314 Top.306 Top.316
+ Top.305 *) LocallySmallCat (* Top.309 Top.310 Top.311 Top.312 Top.313
+ Top.314 Top.306 Top.316 Top.305 *)"
+ "SliceCategory_Functor (* Top.305 Top.306 Top.307 Top.300 *) LocallySmallCat
+ (* Top.309 Top.310 Top.311 Top.312 Top.313 Top.314 Top.306 Top.316
+ Top.305 *) a"
+ : "Functor (* Top.300 Top.307 Top.305 Top.306 *) TerminalCategory
+ (* Top.300 *) LocallySmallCat (* Top.309 Top.310 Top.311 Top.312
+ Top.313 Top.314 Top.306 Top.316 Top.305 *)"
+The 4th term has type "Category (* Top.300 Set *) unit"
+which should be coercible to "Category (* Top.300 Top.307 *) unit". *)
diff --git a/test-suite/bugs/closed/HoTT_coq_101.v b/test-suite/bugs/closed/HoTT_coq_101.v
new file mode 100644
index 00000000..9c89a6ab
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_101.v
@@ -0,0 +1,77 @@
+Set Universe Polymorphism.
+Set Implicit Arguments.
+Generalizable All Variables.
+
+Record SpecializedCategory (obj : Type) :=
+ {
+ Object :> _ := obj;
+ Morphism : obj -> obj -> Type
+ }.
+
+
+Record > Category :=
+ {
+ CObject : Type;
+
+ UnderlyingCategory :> @SpecializedCategory CObject
+ }.
+
+Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) :=
+ {
+ ObjectOf :> objC -> objD;
+ MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d)
+ }.
+
+(* Replacing this with [Definition Functor (C D : Category) :=
+SpecializedFunctor C D.] gets rid of the universe inconsistency. *)
+Section Functor.
+ Variable C D : Category.
+
+ Definition Functor := SpecializedFunctor C D.
+End Functor.
+
+Record SpecializedNaturalTransformation `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) (F G : SpecializedFunctor C D) :=
+ {
+ ComponentsOf :> forall c, D.(Morphism) (F c) (G c)
+ }.
+
+Definition FunctorProduct' `(F : Functor C D) : SpecializedFunctor C D.
+admit.
+Defined.
+
+Definition TypeCat : @SpecializedCategory Type.
+ admit.
+Defined.
+
+
+Definition CovariantHomFunctor `(C : @SpecializedCategory objC) : SpecializedFunctor C TypeCat.
+ refine (Build_SpecializedFunctor C TypeCat
+ (fun X : C => C.(Morphism) X X)
+ _
+ ); admit.
+Defined.
+
+Definition FunctorCategory `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) : @SpecializedCategory (SpecializedFunctor C D).
+ refine (@Build_SpecializedCategory _
+ (SpecializedNaturalTransformation (C := C) (D := D))).
+Defined.
+
+Definition Yoneda `(C : @SpecializedCategory objC) : SpecializedFunctor C (FunctorCategory C TypeCat).
+ match goal with
+ | [ |- SpecializedFunctor ?C0 ?D0 ] =>
+ refine (Build_SpecializedFunctor C0 D0
+ (fun c => CovariantHomFunctor C)
+ _
+ )
+ end;
+ admit.
+Defined.
+
+Section FullyFaithful.
+ Context `(C : @SpecializedCategory objC).
+ Let TypeCatC := FunctorCategory C TypeCat.
+ Let YC := (Yoneda C).
+ Set Printing Universes.
+ Check @FunctorProduct' C TypeCatC YC. (* Toplevel input, characters 0-37:
+Error: Universe inconsistency. Cannot enforce Top.187 = Top.186 because
+Top.186 <= Top.189 < Top.191 <= Top.187). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_102.v b/test-suite/bugs/closed/HoTT_coq_102.v
new file mode 100644
index 00000000..71becfd2
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_102.v
@@ -0,0 +1,29 @@
+(* File reduced by coq-bug-finder from 64 lines to 30 lines. *)
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Generalizable All Variables.
+Record SpecializedCategory (obj : Type) := { Object :> _ := obj }.
+
+Record > Category :=
+ { CObject : Type;
+ UnderlyingCategory :> @SpecializedCategory CObject }.
+
+Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) :=
+ { ObjectOf :> objC -> objD }.
+
+Definition Functor (C D : Category) := SpecializedFunctor C D.
+
+Parameter TerminalCategory : SpecializedCategory unit.
+
+Definition focus A (_ : A) := True.
+
+Definition CommaCategory_Object (A : Category) (S : Functor TerminalCategory A) : Type.
+ assert (Hf : focus ((S tt) = (S tt))) by constructor.
+ let C1 := constr:(CObject) in
+ let C2 := constr:(fun C => @Object (CObject C) C) in
+ let check := constr:(eq_refl : C1 = C2) in
+ unify C1 C2.
+ progress change CObject with (fun C => @Object (CObject C) C) in *.
+ (* not convertible *)
+ admit.
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_103.v b/test-suite/bugs/closed/HoTT_coq_103.v
new file mode 100644
index 00000000..7ecf7671
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_103.v
@@ -0,0 +1,4 @@
+Fail Check (nat : Type) : Set.
+(* Error:
+The term "nat:Type" has type "Type" while it is expected to have type
+"Set" (Universe inconsistency). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_104.v b/test-suite/bugs/closed/HoTT_coq_104.v
new file mode 100644
index 00000000..5bb7fa8c
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_104.v
@@ -0,0 +1,13 @@
+Set Implicit Arguments.
+
+Require Import Logic.
+
+Global Set Universe Polymorphism.
+Global Set Asymmetric Patterns.
+Local Set Record Elimination Schemes.
+Local Set Primitive Projections.
+
+Record prod (A B : Type) : Type :=
+ pair { fst : A; snd : B }.
+
+Check fun x : prod Set Set => eq_refl : x = pair (fst x) (snd x).
diff --git a/test-suite/bugs/closed/HoTT_coq_105.v b/test-suite/bugs/closed/HoTT_coq_105.v
new file mode 100644
index 00000000..86001d26
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_105.v
@@ -0,0 +1,32 @@
+Set Primitive Projections.
+Set Implicit Arguments.
+Set Universe Polymorphism.
+Set Asymmetric Patterns.
+
+Inductive sum A B := inl : A -> sum A B | inr : B -> sum A B.
+Inductive Empty :=.
+
+Record category :=
+ { ob :> Type;
+ hom : ob -> ob -> Type
+ }.
+Set Printing All.
+Definition sum_category (C D : category) : category :=
+ {|
+ ob := sum (ob C) (ob D);
+ hom x y := match x, y with
+ | inl x, inl y => @hom _ x y (* Toplevel input, characters 177-178:
+Error:
+In environment
+C : category
+D : category
+x : sum (ob C) (ob D)
+y : sum (ob C) (ob D)
+x0 : ob C
+y0 : ob C
+The term "x0" has type "ob C" while it is expected to have type
+"ob ?6" (unable to find a well-typed instantiation for
+"?6": cannot unify"Type" and "category"). *)
+ | inr x, inr y => @hom _ x y
+ | _, _ => Empty
+ end |}.
diff --git a/test-suite/bugs/closed/HoTT_coq_107.v b/test-suite/bugs/closed/HoTT_coq_107.v
new file mode 100644
index 00000000..c3a83627
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_107.v
@@ -0,0 +1,106 @@
+(* -*- mode: coq; coq-prog-args: ("-nois" "-emacs") -*- *)
+(* File reduced by coq-bug-finder from 4897 lines to 2605 lines, then from 2297 lines to 236 lines, then from 239 lines to 137 lines, then from 118 lines to 67 lines, then from 520 lines to 76 lines. *)
+(** Note: The bug here is the same as the #113, that is, HoTT_coq_113.v *)
+Require Import Coq.Init.Logic.
+Global Set Universe Polymorphism.
+Global Set Asymmetric Patterns.
+Set Implicit Arguments.
+
+Inductive sigT (A:Type) (P:A -> Type) : Type :=
+ existT : forall x:A, P x -> sigT P.
+
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+
+Generalizable All Variables.
+Definition admit {T} : T.
+Admitted.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+Class Contr_internal (A : Type) :=
+ BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+ }.
+
+Arguments center A {_}.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Notation Contr := (IsTrunc minus_two).
+
+Hint Extern 0 => progress change Contr_internal with Contr in * : typeclass_instances.
+
+Definition path_contr `{Contr A} (x y : A) : x = y
+ := admit.
+
+Definition path_sigma' {A : Type} (P : A -> Type) {x x' : A} {y : P x} {y' : P x'}
+ (p : x = x') (q : transport _ p y = y')
+: existT _ x y = existT _ x' y'
+ := admit.
+Instance trunc_sigma `{P : A -> Type}
+ `{IsTrunc n A} `{forall a, IsTrunc n (P a)}
+: IsTrunc n (sigT P) | 100.
+
+Proof.
+ generalize dependent A.
+ induction n; [ | admit ]; simpl; intros A P ac Pc.
+ (exists (existT _ (center A) (center (P (center A))))).
+ intros [a ?].
+ refine (path_sigma' P (contr a) (path_contr _ _)).
+Defined.
+Inductive Bool : Set := true | false.
+Definition trunc_sum' n A B `{IsTrunc n Bool, IsTrunc n A, IsTrunc n B}
+: (IsTrunc n { b : Bool & if b then A else B }).
+Proof.
+ Set Printing All.
+ Set Printing Universes.
+ refine (@trunc_sigma Bool (fun b => if b then A else B) n _ _).
+ (* Toplevel input, characters 23-76:
+Error:
+In environment
+n : trunc_index
+A : Type (* Top.193 *)
+B : Type (* Top.194 *)
+H : IsTrunc (* Set *) n Bool
+H0 : IsTrunc (* Top.193 *) n A
+H1 : IsTrunc (* Top.194 *) n B
+The term
+ "@trunc_sigma (* Top.198 Top.199 Top.200 Top.201 *) Bool
+ (fun b : Bool =>
+ match b return Type (* Top.199 *) with
+ | true => A
+ | false => B
+ end) n ?49 ?50" has type
+ "IsTrunc (* Top.200 *) n
+ (@sig (* Top.199 Top.199 *) Bool
+ (fun b : Bool =>
+ match b return Type (* Top.199 *) with
+ | true => A
+ | false => B
+ end))" while it is expected to have type
+ "IsTrunc (* Top.195 *) n
+ (@sig (* Set Top.197 *) Bool
+ (fun b : Bool =>
+ match b return Type (* Top.197 *) with
+ | true => A
+ | false => B
+ end))" (Universe inconsistency: Cannot enforce Top.197 = Set)).
+ *)
+ admit.
+Defined.
diff --git a/test-suite/bugs/closed/HoTT_coq_108.v b/test-suite/bugs/closed/HoTT_coq_108.v
new file mode 100644
index 00000000..cc304802
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_108.v
@@ -0,0 +1,127 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") -*- *)
+(* NOTE: This bug is only triggered with -load-vernac-source / in interactive mode. *)
+(* File reduced by coq-bug-finder from 139 lines to 124 lines. *)
+Set Universe Polymorphism.
+Reserved Notation "g 'o' f" (at level 40, left associativity).
+Generalizable All Variables.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+: forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+
+Definition ap11 {A B} {f g:A->B} (h:f=g) {x y:A} (p:x=y) : f x = g y.
+ admit.
+Defined.
+Class IsEquiv {A B : Type} (f : A -> B) := {}.
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+ }.
+
+Arguments center A {_}.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint nat_to_trunc_index (n : nat) : trunc_index
+ := match n with
+ | 0 => trunc_S (trunc_S minus_two)
+ | S n' => trunc_S (nat_to_trunc_index n')
+ end.
+
+Coercion nat_to_trunc_index : nat >-> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Instance istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A)
+: IsTrunc n (x = y)
+ := H x y.
+
+Notation Contr := (IsTrunc minus_two).
+
+Notation IsHSet := (IsTrunc 0).
+
+Class Funext :=
+ { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+Global Instance contr_forall `{Funext} `{P : A -> Type} `{forall a, Contr (P a)}
+: Contr (forall a, P a) | 100.
+admit.
+Defined.
+Hint Extern 0 => progress change Contr_internal with Contr in * : typeclass_instances.
+Global Instance trunc_forall `{Funext} `{P : A -> Type} `{forall a, IsTrunc n (P a)}
+: IsTrunc n (forall a, P a) | 100.
+Proof.
+ generalize dependent P.
+ induction n as [ | n' IH]; [ | admit ]; simpl; intros P ?.
+ exact _.
+Defined.
+Set Implicit Arguments.
+
+Record PreCategory :=
+ { object :> Type;
+ morphism : object -> object -> Type;
+ identity : forall x, morphism x x;
+ compose : forall s d d', morphism d d' -> morphism s d -> morphism s d';
+ trunc_morphism : forall s d, IsHSet (morphism s d) }.
+
+Existing Instance trunc_morphism.
+Infix "o" := (@compose _ _ _ _) : morphism_scope.
+Local Open Scope morphism_scope.
+
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d
+ -> morphism D (object_of s) (object_of d);
+ composition_of : forall s d d'
+ (m1 : morphism C s d) (m2: morphism C d d'),
+ morphism_of _ _ (m2 o m1)
+ = (morphism_of _ _ m2) o (morphism_of _ _ m1);
+ identity_of : forall x, morphism_of _ _ (@identity _ x)
+ = @identity _ (object_of x) }.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Section path_functor.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Local Notation path_functor'_T F G
+ := { HO : object_of F = object_of G
+ | transport (fun GO => forall s d, morphism C s d -> morphism D (GO s) (GO d))
+ HO
+ (morphism_of F)
+ = morphism_of G }
+ (only parsing).
+ Definition path_functor'_sig (F G : Functor C D) : path_functor'_T F G -> F = G.
+ Proof.
+ intros [H' H''].
+ destruct F, G; simpl in *.
+ induction H'. (* while destruct H' works *) destruct H''.
+ apply ap11; [ apply ap | ];
+ apply center; abstract exact _.
+ Set Printing Universes.
+ (* Fail Defined.*)
+ (* The command has indeed failed with message:
+=> Error: path_functor'_sig_subproof already exists. *)
+ Defined.
+(* Anomaly: Backtrack.backto 55: a state with no vcs_backup. Please report. *)
+End path_functor.
diff --git a/test-suite/bugs/closed/HoTT_coq_110.v b/test-suite/bugs/closed/HoTT_coq_110.v
new file mode 100644
index 00000000..5ec40dbc
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_110.v
@@ -0,0 +1,23 @@
+Module X.
+ Inductive paths A (x : A) : A -> Type := idpath : paths A x x.
+ Notation "x = y" := (@paths _ x y) : type_scope.
+
+ Axioms A B : Type.
+ Axiom P : A = B.
+ Definition foo : A = B.
+ abstract (rewrite <- P; reflexivity).
+ (* Error: internal_paths_rew already exists. *)
+ Defined. (* Anomaly: Uncaught exception Not_found(_). Please report. *)
+End X.
+
+Module Y.
+ Inductive paths A (x : A) : A -> Type := idpath : paths A x x.
+ Notation "x = y" := (@paths _ x y) : type_scope.
+
+ Axioms A B : Type.
+ Axiom P : A = B.
+ Definition foo : (A = B) * (A = B).
+ split; abstract (rewrite <- P; reflexivity).
+ (* Error: internal_paths_rew already exists. *)
+ Defined. (* Anomaly: Uncaught exception Not_found(_). Please report. *)
+End Y.
diff --git a/test-suite/bugs/closed/HoTT_coq_111.v b/test-suite/bugs/closed/HoTT_coq_111.v
new file mode 100644
index 00000000..3b43f31d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_111.v
@@ -0,0 +1,24 @@
+
+Module X.
+ (*Set Universe Polymorphism.*)
+ Inductive paths A (x : A) : forall _ : A, Type := idpath : paths A x x.
+ Notation "x = y" := (@paths _ x y) (at level 70, no associativity) : type_scope.
+
+ Axioms A B : Type.
+ Axiom P : A = B.
+ Definition foo : A = B.
+ abstract (rewrite <- P; reflexivity).
+ Defined.
+End X.
+
+Module Y.
+ (*Set Universe Polymorphism.*)
+ Inductive paths A (x : A) : forall _ : A, Type := idpath : paths A x x.
+ Notation "x = y" := (@paths _ x y) (at level 70, no associativity) : type_scope.
+
+ Axioms A B : Type.
+ Axiom P : A = B.
+ Definition foo : (A = B) * (A = B).
+ split; abstract (rewrite <- P; reflexivity).
+ Defined.
+End Y.
diff --git a/test-suite/bugs/closed/HoTT_coq_112.v b/test-suite/bugs/closed/HoTT_coq_112.v
new file mode 100644
index 00000000..150f2ecc
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_112.v
@@ -0,0 +1,75 @@
+(* File reduced by coq-bug-finder from 4464 lines to 4137 lines, then from 3683 lines to 118 lines, then from 124 lines to 75 lines. *)
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+ : forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : forall x, f (equiv_inv x) = x
+}.
+
+Arguments eisretr {A B} f {_} _.
+
+Record Equiv A B := BuildEquiv {
+ equiv_fun :> A -> B ;
+ equiv_isequiv :> IsEquiv equiv_fun
+}.
+
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+Local Open Scope equiv_scope.
+
+Instance isequiv_path {A B : Type} (p : A = B)
+ : IsEquiv (transport (fun X:Type => X) p) | 0
+ := admit.
+Definition equiv_path (A B : Type) (p : A = B) : A <~> B
+ := BuildEquiv _ _ (transport (fun X:Type => X) p) _.
+
+Class Univalence := {
+ isequiv_equiv_path :> forall (A B : Type), IsEquiv (equiv_path A B)
+}.
+
+Section Univalence.
+ Context `{Univalence}.
+
+ Definition path_universe_uncurried {A B : Type} (f : A <~> B) : A = B
+ := (equiv_path A B)^-1 f.
+
+ Definition path_universe {A B : Type} (f : A -> B) {feq : IsEquiv f} : (A = B)
+ := path_universe_uncurried (BuildEquiv _ _ f feq).
+
+ Set Printing Universes.
+ Definition transport_path_universe {A B : Type} (f : A -> B) {feq : IsEquiv f} (z : A)
+ : transport (fun X:Type => X) (path_universe f) z = f z
+ := apD10 (ap (equiv_fun A B) (eisretr (equiv_path A B) (BuildEquiv _ _ f feq))) z.
+ (* Toplevel input, characters 0-231:
+Error: Illegal application:
+The term "isequiv_equiv_path (* Top.1003 Top.1003 Top.1001 Top.997 *)"
+of type
+ "Univalence (* Top.1003 Top.1003 Top.1001 Top.997 *) ->
+ forall (A : Type (* Top.1003 *)) (B : Type (* Top.997 *)),
+ IsEquiv (* Top.1003 Top.1001 *)
+ (equiv_path (* Top.997 Top.1003 Top.1001 Top.1003 *) A B)"
+cannot be applied to the terms
+ "H" : "Univalence (* Top.934 Top.935 Top.936 Top.937 *)"
+ "A" : "Type (* Top.996 *)"
+ "B" : "Type (* Top.997 *)"
+The 1st term has type "Univalence (* Top.934 Top.935 Top.936 Top.937 *)"
+which should be coercible to
+ "Univalence (* Top.1003 Top.1003 Top.1001 Top.997 *)".
+ *)
diff --git a/test-suite/bugs/closed/HoTT_coq_113.v b/test-suite/bugs/closed/HoTT_coq_113.v
new file mode 100644
index 00000000..3ef531bc
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_113.v
@@ -0,0 +1,19 @@
+(* File reduced by coq-bug-finder from original input, then from 3329 lines to 153 lines, then from 118 lines to 49 lines, then from 55 lines to 38 lines, then from 46 lines to 16 lines *)
+
+Generalizable All Variables.
+Set Universe Polymorphism.
+Class Foo (A : Type) := {}.
+Definition Baz := Foo.
+Definition Bar {A B} `{Foo A, Foo B} : True.
+Proof.
+ Set Printing Universes.
+ (* [change] should give fresh universes for each [Foo] *)
+ change Foo with Baz in *.
+ admit.
+Defined.
+Definition foo := @Bar nat.
+Check @foo Set.
+(* Toplevel input, characters 26-29:
+Error:
+The term "Set" has type "Type (* Set+1 *)" while it is expected to have type
+ "Set" (Universe inconsistency: Cannot enforce Set < Set because Set = Set)). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_114.v b/test-suite/bugs/closed/HoTT_coq_114.v
new file mode 100644
index 00000000..34112833
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_114.v
@@ -0,0 +1 @@
+Inductive test : $(let U := type of Type in exact U)$ := t.
diff --git a/test-suite/bugs/closed/HoTT_coq_115.v b/test-suite/bugs/closed/HoTT_coq_115.v
new file mode 100644
index 00000000..c1e133ee
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_115.v
@@ -0,0 +1 @@
+Inductive T : let U := Type in U := t. (* Anomaly: not an arity. Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_116.v b/test-suite/bugs/closed/HoTT_coq_116.v
new file mode 100644
index 00000000..d408557d
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_116.v
@@ -0,0 +1,13 @@
+Set Universe Polymorphism.
+Section foo.
+ Let U := Type.
+ Let U' : Type.
+ Proof.
+ let U' := constr:(Type) in
+ let U_le_U' := constr:(fun x : U => (x : U')) in
+ exact U'.
+ Defined.
+ Inductive t : U' := .
+End foo.
+(* Toplevel input, characters 15-23:
+Error: No such section variable or assumption: U'. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_117.v b/test-suite/bugs/closed/HoTT_coq_117.v
new file mode 100644
index 00000000..5fbcfef4
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_117.v
@@ -0,0 +1,25 @@
+(* File reduced by coq-bug-finder from original input, then from 1461 lines to 81 lines, then from 84 lines to 40 lines, then from 50 lines to 24 lines *)
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+}.
+Class Funext := {}.
+
+Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, P x) :
+ (forall x, f x = g x) -> f = g.
+
+Admitted.
+
+Inductive Empty : Set := .
+Instance contr_from_Empty {_ : Funext} (A : Type) :
+ Contr_internal (Empty -> A) :=
+ BuildContr _
+ (Empty_rect (fun _ => A))
+ (fun f => path_forall _ f (fun x => Empty_rect _ x)).
+(* Toplevel input, characters 15-220:
+Anomaly: unknown meta ?190. Please report. *)
diff --git a/test-suite/bugs/closed/HoTT_coq_118.v b/test-suite/bugs/closed/HoTT_coq_118.v
new file mode 100644
index 00000000..14ad0e49
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_118.v
@@ -0,0 +1,35 @@
+(* File reduced by coq-bug-finder from original input, then from 5631 lines to 557 lines, then from 526 lines to 181 lines, then from 189 lines to 154 lines, then from 153 lines to 107 lines, then from 97 lines to 56 lines, then from 50 lines to 37 lines *)
+Generalizable All Variables.
+Set Universe Polymorphism.
+Definition admit {T} : T.
+Admitted.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y" := (@paths _ x y) : type_scope.
+Class Contr_internal (A : Type) := BuildContr { center : A }.
+Arguments center A {_}.
+Instance contr_paths_contr `{Contr_internal A} (x y : A) : Contr_internal (x = y) := admit.
+Inductive Unit : Set := tt.
+Instance contr_unit : Contr_internal Unit | 0 := admit.
+Record PreCategory := { morphism : Type }.
+Class IsIsomorphism {C : PreCategory} (m : morphism C) := { left_inverse : m = m }.
+Definition indiscrete_category : PreCategory := @Build_PreCategory Unit.
+Goal forall (X : Type) (_ : forall x y : X, Contr_internal (@paths X x y)) (s : X),
+ @IsIsomorphism indiscrete_category tt -> True.
+Proof.
+ intros X H s [p].
+ simpl in *.
+ assert (idpath = p).
+ clear.
+ assert (H : forall p : tt = tt, idpath = p) by (intro; exact (center _)).
+ clear H.
+ exact (center _).
+ (* Toplevel input, characters 15-32:
+Error:
+Unable to satisfy the following constraints:
+In environment:
+p : tt = tt
+
+?46 : "Contr_internal (idpath = p)"
+ *)
diff --git a/test-suite/bugs/closed/HoTT_coq_121.v b/test-suite/bugs/closed/HoTT_coq_121.v
new file mode 100644
index 00000000..cce288cf
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_121.v
@@ -0,0 +1,18 @@
+(* File reduced by coq-bug-finder from original input, then from 8249 lines to 907 lines, then from 843 lines to 357 lines, then from 351 lines to 260 lines, then from 208 lines to 162 lines, then from 167 lines to 154 lines, then from 146 lines to 72 lines, then from 82 lines to 70 lines, then from 79 lines to 49 lines, then from 59 lines to 16 lines *)
+
+Set Universe Polymorphism.
+Generalizable All Variables.
+Record hSet := BuildhSet {setT:> Type}.
+Axiom minus1Trunc : Type -> Type.
+Definition hexists {X} (P:X->Type):Type:= minus1Trunc (sigT P).
+Definition issurj {X Y} (f:X->Y) := forall y:Y, hexists (fun x => (f x) = y).
+Lemma isepi_issurj {X Y} (f:X->Y): issurj f.
+Proof.
+ intros y.
+ admit.
+Defined. (* Toplevel input, characters 15-23:
+Error: Unsatisfied constraints:
+Top.38 <= Coq.Init.Specif.7
+Top.43 <= Top.38
+Top.43 <= Coq.Init.Specif.8
+ (maybe a bugged tactic). *)
diff --git a/test-suite/bugs/closed/HoTT_coq_122.v b/test-suite/bugs/closed/HoTT_coq_122.v
new file mode 100644
index 00000000..1ba8e5c3
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_122.v
@@ -0,0 +1,25 @@
+(* File reduced by coq-bug-finder from original input, then from 669 lines to 79 lines, then from 89 lines to 44 lines *)
+Set Primitive Projections.
+Reserved Notation "g 'o' f" (at level 40, left associativity).
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Notation "x = y" := (@paths _ x y) : type_scope.
+
+Set Implicit Arguments.
+
+Record PreCategory :=
+ Build_PreCategory' {
+ object :> Type;
+ morphism : object -> object -> Type;
+
+ identity : forall x, morphism x x;
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ left_identity : forall a b (f : morphism a b), identity b o f = f
+ }.
+
+Hint Rewrite @left_identity. (* stack overflow *)
diff --git a/test-suite/bugs/closed/HoTT_coq_123.v b/test-suite/bugs/closed/HoTT_coq_123.v
new file mode 100644
index 00000000..994dff63
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_123.v
@@ -0,0 +1,171 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-indices-matter") *)
+(* File reduced by coq-bug-finder from original input, then from 4988 lines to 856 lines, then from 648 lines to 398 lines, then from 401 lines to 332 lines, then from 287 lines to 250 lines, then from 257 lines to 241 lines, then from 223 lines to 175 lines *)
+Set Universe Polymorphism.
+Set Asymmetric Patterns.
+Reserved Notation "g 'o' f" (at level 40, left associativity).
+Generalizable All Variables.
+Definition admit {T} : T.
+Admitted.
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y" := (@paths _ x y) : type_scope.
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x) : Type
+ := forall x:A, f x = g x.
+Hint Unfold pointwise_paths : typeclass_instances.
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
+Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
+: forall x, f x = g x
+ := fun x => match h with idpath => idpath end.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { equiv_inv : B -> A }.
+
+Record Equiv A B := BuildEquiv { equiv_fun :> A -> B ; equiv_isequiv :> IsEquiv equiv_fun }.
+Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
+Class Contr_internal (A : Type) := {}.
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | minus_two => Contr_internal A
+ | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Instance istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A)
+: IsTrunc n (x = y)
+ := H x y.
+
+Notation IsHSet := (IsTrunc minus_two).
+
+Class Funext :=
+ { isequiv_apD10 :> forall (A : Type) (P : A -> Type) f g, IsEquiv (@apD10 A P f g) }.
+
+Local Open Scope equiv_scope.
+
+Global Instance isequiv_inverse `{IsEquiv A B f} : IsEquiv f^-1 | 10000
+ := BuildIsEquiv B A f^-1 f.
+Instance trunc_succ `{IsTrunc n A} : IsTrunc (trunc_S n) A | 1000.
+
+admit.
+
+Defined.
+Definition trunc_equiv `(f : A -> B)
+ `{IsTrunc n A} `{IsEquiv A B f}
+: IsTrunc n B.
+ admit.
+Defined.
+Definition trunc_equiv' `(f : A <~> B) `{IsTrunc n A}
+: IsTrunc n B
+ := admit.
+Set Implicit Arguments.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+Record PreCategory :=
+ Build_PreCategory {
+ object :> Type;
+ morphism : object -> object -> Type;
+
+ identity : forall x, morphism x x;
+ compose : forall s d d',
+ morphism d d'
+ -> morphism s d
+ -> morphism s d'
+ where "f 'o' g" := (compose f g);
+
+ associativity : forall x1 x2 x3 x4
+ (m1 : morphism x1 x2)
+ (m2 : morphism x2 x3)
+ (m3 : morphism x3 x4),
+ (m3 o m2) o m1 = m3 o (m2 o m1);
+
+ left_identity : forall a b (f : morphism a b), identity b o f = f;
+ right_identity : forall a b (f : morphism a b), f o identity a = f;
+
+ trunc_morphism : forall s d, IsHSet (morphism s d)
+ }.
+Existing Instance trunc_morphism.
+
+Infix "o" := (@compose _ _ _ _) : morphism_scope.
+Delimit Scope functor_scope with functor.
+
+Local Open Scope morphism_scope.
+Record Functor (C D : PreCategory) :=
+ {
+ object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s) (object_of d)
+ }.
+
+Global Instance trunc_forall `{Funext} `{P : A -> Type} `{forall a, IsTrunc n (P a)}
+: IsTrunc n (forall a, P a) | 100.
+Proof.
+ generalize dependent P.
+ induction n as [ | n' IH]; (simpl; intros P ?).
+ - admit.
+ - pose (fun f g => trunc_equiv (@apD10 A P f g) ^-1); admit.
+Defined.
+Instance trunc_sigma `{P : A -> Type}
+ `{IsTrunc n A} `{forall a, IsTrunc n (P a)}
+: IsTrunc n (sigT P) | 100.
+admit.
+Defined.
+Record NaturalTransformation C D (F G : Functor C D) :=
+ Build_NaturalTransformation' {
+ components_of :> forall c, morphism D (F c) (G c)
+ }.
+Section path_natural_transformation.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+ Variables F G : Functor C D.
+ Lemma equiv_sig_natural_transformation
+ : { CO : forall x, morphism D (F x) (G x)
+ & forall s d (m : morphism C s d),
+ CO d o morphism_of F _ _ m = morphism_of G _ _ m o CO s }
+ <~> NaturalTransformation F G.
+
+ admit.
+ Defined.
+ Global Instance trunc_natural_transformation
+ : IsHSet (NaturalTransformation F G).
+ Proof.
+ eapply trunc_equiv'; [ exact equiv_sig_natural_transformation | ].
+ typeclasses eauto.
+ Qed.
+ Lemma path_natural_transformation (T U : NaturalTransformation F G)
+ : components_of T == components_of U
+ -> T = U.
+ admit.
+ Defined.
+End path_natural_transformation.
+Ltac path_natural_transformation :=
+ repeat match goal with
+ | _ => intro
+ | _ => apply path_natural_transformation; simpl
+ end.
+
+Section FunctorSectionCategory.
+ Context `{Funext}.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Definition category_of_sections : PreCategory.
+ Proof.
+ refine (@Build_PreCategory
+ (Functor D C)
+ (fun F G => NaturalTransformation F G)
+ admit
+ admit
+ _
+ _
+ _
+ _);
+ abstract (path_natural_transformation; admit).
+ Defined. (* Stack overflow *)
diff --git a/test-suite/bugs/closed/HoTT_coq_124.v b/test-suite/bugs/closed/HoTT_coq_124.v
new file mode 100644
index 00000000..e6e90ada
--- /dev/null
+++ b/test-suite/bugs/closed/HoTT_coq_124.v
@@ -0,0 +1,29 @@
+Set Implicit Arguments.
+Set Primitive Projections.
+
+Polymorphic Inductive eqp A (x : A) : A -> Type := eqp_refl : eqp x x.
+Monomorphic Inductive eqm A (x : A) : A -> Type := eqm_refl : eqm x x.
+
+Polymorphic Record prodp (A B : Type) : Type := pairp { fstp : A; sndp : B }.
+Monomorphic Record prodm (A B : Type) : Type := pairm { fstm : A; sndm : B }.
+
+Check eqm_refl _ : eqm (fun x : prodm Set Set => pairm (fstm x) (sndm x)) (fun x => x). (* success *)
+Check eqp_refl _ : eqp (fun x : prodm Set Set => pairm (fstm x) (sndm x)) (fun x => x). (* success *)
+Check eqm_refl _ : eqm (fun x : prodp Set Set => pairp (fstp x) (sndp x)) (fun x => x). (* Error:
+The term
+ "eqm_refl (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})"
+has type
+ "eqm (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})
+ (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})"
+while it is expected to have type
+ "eqm (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})
+ (fun x : prodp Set Set => x)". *)
+Check eqp_refl _ : eqp (fun x : prodp Set Set => pairp (fstp x) (sndp x)) (fun x => x). (* Error:
+The term
+ "eqp_refl (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})"
+has type
+ "eqp (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})
+ (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})"
+while it is expected to have type
+ "eqp (fun x : prodp Set Set => {| fstp := fstp x; sndp := sndp x |})
+ (fun x : prodp Set Set => x)". *)
diff --git a/test-suite/bugs/closed/shouldfail/1915.v b/test-suite/bugs/closed/shouldfail/1915.v
deleted file mode 100644
index a96a482c..00000000
--- a/test-suite/bugs/closed/shouldfail/1915.v
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Require Import Setoid.
-
-Goal forall x, impl True (x = 0) -> x = 0 -> False.
-intros x H E.
-rewrite H in E. \ No newline at end of file
diff --git a/test-suite/bugs/closed/shouldfail/2406.v b/test-suite/bugs/closed/shouldfail/2406.v
deleted file mode 100644
index 112ea2bb..00000000
--- a/test-suite/bugs/closed/shouldfail/2406.v
+++ /dev/null
@@ -1,3 +0,0 @@
-(* Check correct handling of unsupported notations *)
-Notation "'’'" := (fun x => x) (at level 20).
-Definition crash_the_rooster f := ’.
diff --git a/test-suite/bugs/closed/shouldsucceed/1041.v b/test-suite/bugs/closed/shouldsucceed/1041.v
deleted file mode 100644
index a5de82e0..00000000
--- a/test-suite/bugs/closed/shouldsucceed/1041.v
+++ /dev/null
@@ -1,13 +0,0 @@
-Goal Prop.
-
-pose (P:=(fun x y :Prop => y)).
-evar (Q: (forall X Y,P X Y -> Prop)) .
-
-instantiate (1:= fun _ => _ ) in (Value of Q).
-instantiate (1:= fun _ => _ ) in (Value of Q).
-instantiate (1:= fun _ => _ ) in (Value of Q).
-
-instantiate (1:=H) in (Value of Q).
-
-Admitted.
-
diff --git a/test-suite/bugs/closed/shouldsucceed/1519.v b/test-suite/bugs/closed/shouldsucceed/1519.v
deleted file mode 100644
index 66bab241..00000000
--- a/test-suite/bugs/closed/shouldsucceed/1519.v
+++ /dev/null
@@ -1,14 +0,0 @@
-Section S.
-
- Variable A:Prop.
- Variable W:A.
-
- Remark T: A -> A.
- intro Z.
- rename W into Z_.
- rename Z into W.
- rename Z_ into Z.
- exact Z.
- Qed.
-
-End S.