1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266
|
(UNSET-WATERFALL-PARALLELISM)
(ASSIGN SCRIPT-MODE T)
T
(SET-LD-PROMPT T STATE)
T
ACL2 !>>(SET-INHIBITED-SUMMARY-TYPES '(TIME STEPS))
(TIME STEPS)
ACL2 !>>(SET-INHIBIT-OUTPUT-LST '(PROOF-TREE))
(PROOF-TREE)
ACL2 !>>(SET-GAG-MODE NIL)
<state>
ACL2 !>>(SET-GUARD-CHECKING :ALL)
Leaving guard checking on, but changing value to :ALL.
ACL2 !>>(DEFUN AP (X Y)
(IF (ENDP X)
Y
(CONS (CAR X) (AP (CDR X) Y))))
The admission of AP is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of AP is described by the
theorem (OR (CONSP (AP X Y)) (EQUAL (AP X Y) Y)). We used primitive
type reasoning.
Summary
Form: ( DEFUN AP ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
AP
ACL2 !>>(AP '(1 2 3) '(4 5 6))
(1 2 3 4 5 6)
ACL2 !>>(DEFTHM AP-IS-ASSOCIATIVE
(EQUAL (AP (AP A B) C) (AP A (AP B C))))
Name the formula above *1.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. Subsumption reduces that number to two.
However, one of these is flawed and so we are left with one viable
candidate.
We will induct according to a scheme suggested by (AP A B).
This suggestion was produced using the :induction rule AP. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP A)) (:P (CDR A) B C))
(:P A B C))
(IMPLIES (ENDP A) (:P A B C))).
This induction is justified by the same argument used to admit AP.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP A))
(EQUAL (AP (AP (CDR A) B) C)
(AP (CDR A) (AP B C))))
(EQUAL (AP (AP A B) C)
(AP A (AP B C)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(EQUAL (AP (AP (CDR A) B) C)
(AP (CDR A) (AP B C))))
(EQUAL (AP (AP A B) C)
(AP A (AP B C)))).
But simplification reduces this to T, using the :definition AP, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (ENDP A)
(EQUAL (AP (AP A B) C)
(AP A (AP B C)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP A))
(EQUAL (AP (AP A B) C)
(AP A (AP B C)))).
But simplification reduces this to T, using the :definition AP and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM AP-IS-ASSOCIATIVE ...)
Rules: ((:DEFINITION AP)
(:DEFINITION ENDP)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION AP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS))
AP-IS-ASSOCIATIVE
ACL2 !>>(DEFUN LTE (X Y)
(IF (ENDP X)
T
(IF (ENDP Y)
NIL
(LTE (CDR X) (CDR Y)))))
The admission of LTE is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of LTE is described by the
theorem (OR (EQUAL (LTE X Y) T) (EQUAL (LTE X Y) NIL)).
Summary
Form: ( DEFUN LTE ...)
Rules: NIL
LTE
ACL2 !>>(LTE '(A B C) '(D E F G))
T
ACL2 !>>(LTE '(A B C) '(D E))
NIL
ACL2 !>>(THM (IMPLIES (AND (LTE A B) (LTE B C))
(LTE A C)))
Name the formula above *1.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into one derived induction
scheme.
We will induct according to a scheme suggested by (LTE A C), but modified
to accommodate (LTE B C) and (LTE A B).
These suggestions were produced using the :induction rule LTE. If
we let (:P A B C) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP A))
(NOT (ENDP C))
(:P (CDR A) (CDR B) (CDR C)))
(:P A B C))
(IMPLIES (AND (NOT (ENDP A)) (ENDP C))
(:P A B C))
(IMPLIES (ENDP A) (:P A B C))).
This induction is justified by the same argument used to admit LTE.
Note, however, that the unmeasured variables B and C are being instantiated.
When applied to the goal at hand the above induction scheme produces
five nontautological subgoals.
Subgoal *1/5
(IMPLIES (AND (NOT (ENDP A))
(NOT (ENDP C))
(LTE (CDR A) (CDR C))
(LTE A B)
(LTE B C))
(LTE A C)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/5'
(IMPLIES (AND (CONSP A)
(CONSP C)
(LTE (CDR A) (CDR C))
(LTE A B)
(LTE B C))
(LTE A C)).
But simplification reduces this to T, using the :definition LTE and
the :type-prescription rule LTE.
Subgoal *1/4
(IMPLIES (AND (NOT (ENDP A))
(NOT (ENDP C))
(NOT (LTE (CDR B) (CDR C)))
(LTE A B)
(LTE B C))
(LTE A C)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/4'
(IMPLIES (AND (CONSP A)
(CONSP C)
(NOT (LTE (CDR B) (CDR C)))
(LTE A B)
(LTE B C))
(LTE A C)).
But simplification reduces this to T, using the :definition LTE.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP A))
(NOT (ENDP C))
(NOT (LTE (CDR A) (CDR B)))
(LTE A B)
(LTE B C))
(LTE A C)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP A)
(CONSP C)
(NOT (LTE (CDR A) (CDR B)))
(LTE A B)
(LTE B C))
(LTE A C)).
But simplification reduces this to T, using the :definition LTE.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP A))
(ENDP C)
(LTE A B)
(LTE B C))
(LTE A C)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (CONSP C))
(LTE A B)
(LTE B C))
(LTE A C)).
But simplification reduces this to T, using the :definition LTE.
Subgoal *1/1
(IMPLIES (AND (ENDP A) (LTE A B) (LTE B C))
(LTE A C)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP A))
(LTE A B)
(LTE B C))
(LTE A C)).
But simplification reduces this to T, using the :definition LTE.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( THM ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION LTE)
(:DEFINITION NOT)
(:INDUCTION LTE)
(:TYPE-PRESCRIPTION LTE))
Proof succeeded.
ACL2 !>>(DEFUN INSERT (E X)
(IF (ENDP X)
(CONS E X)
(IF (LEXORDER E (CAR X))
(CONS E X)
(CONS (CAR X) (INSERT E (CDR X))))))
The admission of INSERT is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of INSERT is described by
the theorem (CONSP (INSERT E X)). We used primitive type reasoning.
Summary
Form: ( DEFUN INSERT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
INSERT
ACL2 !>>(INSERT 'BOB '(ALICE CATHY))
(ALICE BOB CATHY)
ACL2 !>>(DEFUN ISORT (X)
(IF (ENDP X)
X
(INSERT (CAR X) (ISORT (CDR X)))))
The admission of ISORT is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We could deduce no constraints on the type of ISORT.
Summary
Form: ( DEFUN ISORT ...)
Rules: NIL
ISORT
ACL2 !>>(ISORT '(BOB CATHY ALICE))
(ALICE BOB CATHY)
ACL2 !>>(DEFUN ORDERED (X)
(OR (ENDP X)
(ENDP (CDR X))
(AND (LEXORDER (CAR X) (CAR (CDR X)))
(ORDERED (CDR X)))))
The admission of ORDERED is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of ORDERED is described by
the theorem (OR (EQUAL (ORDERED X) T) (EQUAL (ORDERED X) NIL)).
Summary
Form: ( DEFUN ORDERED ...)
Rules: NIL
ORDERED
ACL2 !>>(DEFTHM ORDERED-ISORT
(ORDERED (ISORT X)))
Name the formula above *1.
Perhaps we can prove *1 by induction. One induction scheme is suggested
by this conjecture.
We will induct according to a scheme suggested by (ISORT X).
This suggestion was produced using the :induction rule ISORT. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit ISORT.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(ORDERED (ISORT (CDR X))))
(ORDERED (ISORT X))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(ORDERED (ISORT (CDR X))))
(ORDERED (ISORT X))).
This simplifies, using the :definition ISORT, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(ORDERED (ISORT (CDR X))))
(ORDERED (INSERT (CAR X) (ISORT (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/2'''
(IMPLIES (AND (CONSP (CONS X1 X2))
(ORDERED (ISORT X2)))
(ORDERED (INSERT X1 (ISORT X2)))).
This simplifies, using primitive type reasoning, to
Subgoal *1/2'4'
(IMPLIES (ORDERED (ISORT X2))
(ORDERED (INSERT X1 (ISORT X2)))).
We generalize this conjecture, replacing (ISORT X2) by IT. This produces
Subgoal *1/2'5'
(IMPLIES (ORDERED IT)
(ORDERED (INSERT X1 IT))).
Name the formula above *1.1.
Subgoal *1/1
(IMPLIES (ENDP X) (ORDERED (ISORT X))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(ORDERED (ISORT X))).
But simplification reduces this to T, using the :definitions ISORT
and ORDERED.
So we now return to *1.1, which is
(IMPLIES (ORDERED IT)
(ORDERED (INSERT X1 IT))).
Perhaps we can prove *1.1 by induction. Two induction schemes are
suggested by this conjecture. These merge into one derived induction
scheme.
We will induct according to a scheme suggested by (INSERT X1 IT).
This suggestion was produced using the :induction rules INSERT and
ORDERED. If we let (:P IT X1) denote *1.1 above then the induction
scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(:P (CDR IT) X1))
(:P IT X1))
(IMPLIES (AND (NOT (ENDP IT))
(LEXORDER X1 (CAR IT)))
(:P IT X1))
(IMPLIES (ENDP IT) (:P IT X1))).
This induction is justified by the same argument used to admit INSERT.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.
Subgoal *1.1/4
(IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(ORDERED (INSERT X1 (CDR IT)))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/4'
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(ORDERED (INSERT X1 (CDR IT)))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
This simplifies, using the :definitions INSERT and ORDERED (if-intro),
primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS
and the :type-prescription rules INSERT, LEXORDER and ORDERED, to the
following two conjectures.
Subgoal *1.1/4.2
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(ORDERED (INSERT X1 (CDR IT)))
(NOT (CONSP (CDR IT))))
(LEXORDER (CAR IT)
(CAR (INSERT X1 (CDR IT))))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, primitive type reasoning, the :forward-chaining rule
LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1.1/4.1
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(ORDERED (INSERT X1 (CDR IT)))
(LEXORDER (CAR IT) (CADR IT))
(ORDERED (CDR IT)))
(LEXORDER (CAR IT)
(CAR (INSERT X1 (CDR IT))))).
The destructor terms (CAR IT) and (CDR IT) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace IT by (CONS IT1 IT2),
(CAR IT) by IT1 and (CDR IT) by IT2. (2) Use CAR-CDR-ELIM, again,
to replace IT2 by (CONS IT3 IT4), (CAR IT2) by IT3 and (CDR IT2) by
IT4. These steps produce the following two goals.
Subgoal *1.1/4.1.2
(IMPLIES (AND (NOT (CONSP IT2))
(CONSP (CONS IT1 IT2))
(NOT (LEXORDER X1 IT1))
(ORDERED (INSERT X1 IT2))
(LEXORDER IT1 (CAR IT2))
(ORDERED IT2))
(LEXORDER IT1 (CAR (INSERT X1 IT2)))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, primitive type reasoning, the :forward-chaining rule
LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, DEFAULT-CAR,
LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription
rule LEXORDER.
Subgoal *1.1/4.1.1
(IMPLIES (AND (CONSP (CONS IT3 IT4))
(CONSP (LIST* IT1 IT3 IT4))
(NOT (LEXORDER X1 IT1))
(ORDERED (INSERT X1 (CONS IT3 IT4)))
(LEXORDER IT1 IT3)
(ORDERED (CONS IT3 IT4)))
(LEXORDER IT1 (CAR (INSERT X1 (CONS IT3 IT4))))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, primitive type reasoning, the :forward-chaining rule
LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1.1/3
(IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(NOT (ORDERED (CDR IT)))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/3'
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(NOT (ORDERED (CDR IT)))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
This simplifies, using the :definitions INSERT and ORDERED (if-intro),
primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS
and the :type-prescription rule INSERT, to the following two conjectures.
Subgoal *1.1/3.2
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(NOT (ORDERED (CDR IT)))
(NOT (CONSP (CDR IT))))
(LEXORDER (CAR IT)
(CAR (INSERT X1 (CDR IT))))).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1.1/3.1
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(NOT (ORDERED (CDR IT)))
(NOT (CONSP (CDR IT))))
(ORDERED (INSERT X1 (CDR IT)))).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1.1/2
(IMPLIES (AND (NOT (ENDP IT))
(LEXORDER X1 (CAR IT))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/2'
(IMPLIES (AND (CONSP IT)
(LEXORDER X1 (CAR IT))
(ORDERED IT))
(ORDERED (INSERT X1 IT))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rules LEXORDER and ORDERED.
Subgoal *1.1/1
(IMPLIES (AND (ENDP IT) (ORDERED IT))
(ORDERED (INSERT X1 IT))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/1'
(IMPLIES (AND (NOT (CONSP IT)) (ORDERED IT))
(ORDERED (INSERT X1 IT))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, primitive type reasoning and the :rewrite rule CDR-CONS.
That completes the proofs of *1.1 and *1.
Q.E.D.
The storage of ORDERED-ISORT depends upon the :type-prescription rule
ORDERED.
Summary
Form: ( DEFTHM ORDERED-ISORT ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:INDUCTION ISORT)
(:INDUCTION ORDERED)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CAR)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION INSERT)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION ORDERED))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION ORDERED))
ORDERED-ISORT
ACL2 !>>(DEFUN REMARKABLY-FAST-SORT (X)
(DECLARE (IGNORE X))
'(ALICE BOB CATHY))
Since REMARKABLY-FAST-SORT is non-recursive, its admission is trivial.
We observe that the type of REMARKABLY-FAST-SORT is described by the
theorem
(AND (CONSP (REMARKABLY-FAST-SORT X)) (TRUE-LISTP (REMARKABLY-FAST-SORT X))).
Summary
Form: ( DEFUN REMARKABLY-FAST-SORT ...)
Rules: NIL
REMARKABLY-FAST-SORT
ACL2 !>>(REMARKABLY-FAST-SORT '(CATHY ALICE BOB))
(ALICE BOB CATHY)
ACL2 !>>(DEFTHM ORDERED-REMARKABLY-FAST-SORT
(ORDERED (REMARKABLY-FAST-SORT X)))
ACL2 Warning [Non-rec] in ( DEFTHM ORDERED-REMARKABLY-FAST-SORT ...):
A :REWRITE rule generated from ORDERED-REMARKABLY-FAST-SORT will be
triggered only by terms containing the function symbol REMARKABLY-FAST-SORT,
which has a non-recursive definition. Unless this definition is disabled,
this rule is unlikely ever to be used.
But we reduce the conjecture to T, by the simple :definition
REMARKABLY-FAST-SORT and the :executable-counterpart of ORDERED.
Q.E.D.
The storage of ORDERED-REMARKABLY-FAST-SORT depends upon the :type-
prescription rule ORDERED.
Summary
Form: ( DEFTHM ORDERED-REMARKABLY-FAST-SORT ...)
Rules: ((:DEFINITION REMARKABLY-FAST-SORT)
(:EXECUTABLE-COUNTERPART ORDERED)
(:TYPE-PRESCRIPTION ORDERED))
Warnings: Non-rec
ORDERED-REMARKABLY-FAST-SORT
ACL2 !>>(REMARKABLY-FAST-SORT '(JIM SUSAN))
(ALICE BOB CATHY)
ACL2 !>>(INCLUDE-BOOK "sorting/perm"
:DIR :SYSTEM)
Summary
Form: ( INCLUDE-BOOK "sorting/perm" ...)
Rules: NIL
(:SYSTEM . "sorting/perm.lisp")
ACL2 !>>(PERM '(CATHY ALICE BOB)
'(ALICE BOB CATHY))
T
ACL2 !>>(PERM '(CATHY ALICE BOB)
'(CATHY CATHY ALICE))
NIL
ACL2 !>>(PE 'PERM)
11:x(INCLUDE-BOOK "sorting/perm" :DIR ...)
\
[Included books, outermost to innermost:
(:SYSTEM . "sorting/perm.lisp")
]
\
>L (DEFUN PERM (X Y)
(IF (CONSP X)
(AND (MEMB (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y)))
(NOT (CONSP Y))))
ACL2 !>>(DEFTHM PERM-ISORT (PERM (ISORT X) X))
ACL2 Warning [Double-rewrite] in ( DEFTHM PERM-ISORT ...): In a :REWRITE
rule generated from PERM-ISORT, equivalence relation PERM is maintained
at one problematic occurrence of variable X in the right-hand side,
but not at any binding occurrence of X. Consider replacing that occurrence
of X in the right-hand side with (DOUBLE-REWRITE X). See :doc double-
rewrite for more information on this issue.
Name the formula above *1.
Perhaps we can prove *1 by induction. One induction scheme is suggested
by this conjecture.
We will induct according to a scheme suggested by (ISORT X).
This suggestion was produced using the :induction rule ISORT. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit ISORT.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(PERM (ISORT (CDR X)) (CDR X)))
(PERM (ISORT X) X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(PERM (ISORT (CDR X)) (CDR X)))
(PERM (ISORT X) X)).
This simplifies, using the :definition ISORT, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(PERM (ISORT (CDR X)) (CDR X)))
(PERM (INSERT (CAR X) (ISORT (CDR X)))
X)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/2'''
(IMPLIES (AND (CONSP (CONS X1 X2))
(PERM (ISORT X2) X2))
(PERM (INSERT X1 (ISORT X2))
(CONS X1 X2))).
This simplifies, using primitive type reasoning, to
Subgoal *1/2'4'
(IMPLIES (PERM (ISORT X2) X2)
(PERM (INSERT X1 (ISORT X2))
(CONS X1 X2))).
We generalize this conjecture, replacing (ISORT X2) by IT. This produces
Subgoal *1/2'5'
(IMPLIES (PERM IT X2)
(PERM (INSERT X1 IT) (CONS X1 X2))).
Name the formula above *1.1.
Subgoal *1/1
(IMPLIES (ENDP X) (PERM (ISORT X) X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(PERM (ISORT X) X)).
But simplification reduces this to T, using the :definitions ISORT
and PERM.
So we now return to *1.1, which is
(IMPLIES (PERM IT X2)
(PERM (INSERT X1 IT) (CONS X1 X2))).
Perhaps we can prove *1.1 by induction. Two induction schemes are
suggested by this conjecture. These merge into one derived induction
scheme.
We will induct according to a scheme suggested by (INSERT X1 IT), but
modified to accommodate (PERM IT X2).
These suggestions were produced using the :induction rules INSERT and
PERM. If we let (:P IT X1 X2) denote *1.1 above then the induction
scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(:P (CDR IT) X1 (RM (CAR IT) X2)))
(:P IT X1 X2))
(IMPLIES (AND (NOT (ENDP IT))
(LEXORDER X1 (CAR IT)))
(:P IT X1 X2))
(IMPLIES (ENDP IT) (:P IT X1 X2))).
This induction is justified by the same argument used to admit INSERT.
Note, however, that the unmeasured variable X2 is being instantiated.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.
Subgoal *1.1/4
(IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(PERM (INSERT X1 (CDR IT))
(CONS X1 (RM (CAR IT) X2)))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/4'
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(PERM (INSERT X1 (CDR IT))
(CONS X1 (RM (CAR IT) X2)))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
This simplifies, using the :definitions INSERT, MEMB, PERM (if-intro)
and RM (if-intro), the :equivalence rule PERM-IS-AN-EQUIVALENCE, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule MEMB, to the following two conjectures.
Subgoal *1.1/4.2
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(PERM (INSERT X1 (CDR IT))
(CONS X1 (RM (CAR IT) X2)))
(MEMB (CAR IT) X2)
(PERM (CDR IT) (RM (CAR IT) X2))
(EQUAL (CAR IT) X1))
(PERM (INSERT X1 (CDR IT)) X2)).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1.1/4.1
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(PERM (INSERT X1 (CDR IT))
(CONS X1 (RM (CAR IT) X2)))
(MEMB (CAR IT) X2)
(PERM (CDR IT) (RM (CAR IT) X2))
(NOT (EQUAL (CAR IT) X1)))
(PERM (INSERT X1 (CDR IT))
(INSERT X1 (CDR IT)))).
But we reduce the conjecture to T, by the :executable-counterpart of
TAU-SYSTEM.
Subgoal *1.1/3
(IMPLIES (AND (NOT (ENDP IT))
(NOT (LEXORDER X1 (CAR IT)))
(NOT (PERM (CDR IT) (RM (CAR IT) X2)))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/3'
(IMPLIES (AND (CONSP IT)
(NOT (LEXORDER X1 (CAR IT)))
(NOT (PERM (CDR IT) (RM (CAR IT) X2)))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
But simplification reduces this to T, using the :definition PERM and
primitive type reasoning.
Subgoal *1.1/2
(IMPLIES (AND (NOT (ENDP IT))
(LEXORDER X1 (CAR IT))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/2'
(IMPLIES (AND (CONSP IT)
(LEXORDER X1 (CAR IT))
(PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
But simplification reduces this to T, using the :definitions INSERT,
MEMB, PERM and RM, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rules LEXORDER and MEMB.
Subgoal *1.1/1
(IMPLIES (AND (ENDP IT) (PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1.1/1'
(IMPLIES (AND (NOT (CONSP IT)) (PERM IT X2))
(PERM (INSERT X1 IT) (CONS X1 X2))).
But simplification reduces this to T, using the :definitions INSERT,
MEMB, PERM and RM, primitive type reasoning and the :rewrite rules
CAR-CONS and CDR-CONS.
That completes the proofs of *1.1 and *1.
Q.E.D.
Summary
Form: ( DEFTHM PERM-ISORT ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION MEMB)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EQUIVALENCE PERM-IS-AN-EQUIVALENCE)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:INDUCTION ISORT)
(:INDUCTION PERM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION MEMB))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION PERM) (:DEFINITION RM))
Warnings: Double-rewrite
PERM-ISORT
ACL2 !>>(DEFTHM PERM-REMARKABLY-FAST-SORT
(PERM (REMARKABLY-FAST-SORT X) X))
ACL2 Warning [Double-rewrite] in ( DEFTHM PERM-REMARKABLY-FAST-SORT
...): In a :REWRITE rule generated from PERM-REMARKABLY-FAST-SORT,
equivalence relation PERM is maintained at one problematic occurrence
of variable X in the right-hand side, but not at any binding occurrence
of X. Consider replacing that occurrence of X in the right-hand side
with (DOUBLE-REWRITE X). See :doc double-rewrite for more information
on this issue.
ACL2 Warning [Non-rec] in ( DEFTHM PERM-REMARKABLY-FAST-SORT ...):
A :REWRITE rule generated from PERM-REMARKABLY-FAST-SORT will be triggered
only by terms containing the function symbol REMARKABLY-FAST-SORT,
which has a non-recursive definition. Unless this definition is disabled,
this rule is unlikely ever to be used.
ACL2 Warning [Subsume] in ( DEFTHM PERM-REMARKABLY-FAST-SORT ...):
The previously added rule REMARKABLY-FAST-SORT subsumes a newly proposed
:REWRITE rule generated from PERM-REMARKABLY-FAST-SORT, in the sense
that the old rule rewrites a more general target. Because the new
rule will be tried first, it may nonetheless find application.
By the simple :definition REMARKABLY-FAST-SORT we reduce the conjecture
to
Goal'
(PERM '(ALICE BOB CATHY) X).
This simplifies, using the :definition PERM (if-intro) and the :executable-
counterparts of CAR, CDR and CONSP, to the following four conjectures.
Subgoal 4
(MEMB 'ALICE X).
Name the formula above *1.
Subgoal 3
(MEMB 'CATHY (RM 'BOB (RM 'ALICE X))).
Normally we would attempt to prove Subgoal 3 by induction. However,
we prefer in this instance to focus on the original input conjecture
rather than this simplified special case. We therefore abandon our
previous work on this conjecture and reassign the name *1 to the original
conjecture. (See :DOC otf-flg.)
No induction schemes are suggested by *1. Consequently, the proof
attempt has failed.
Summary
Form: ( DEFTHM PERM-REMARKABLY-FAST-SORT ...)
Rules: ((:DEFINITION PERM)
(:DEFINITION REMARKABLY-FAST-SORT)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONSP))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION PERM))
Warnings: Subsume, Non-rec and Double-rewrite
---
The key checkpoint goals, below, may help you to debug this failure.
See :DOC failure and see :DOC set-checkpoint-summary-limit.
---
*** Key checkpoints before reverting to proof by induction: ***
Subgoal 4
(MEMB 'ALICE X)
Subgoal 3
(MEMB 'CATHY (RM 'BOB (RM 'ALICE X)))
ACL2 Error [Failure] in ( DEFTHM PERM-REMARKABLY-FAST-SORT ...): See
:DOC failure.
******** FAILED ********
ACL2 !>>'(END OF DEMO 1)
(END OF DEMO 1)
ACL2 !>>(SET-GAG-MODE :GOALS)
<state>
ACL2 !>>(DEFTHM PERM-AP
(PERM (AP A B) (AP B A)))
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. We will choose arbitrarily among these.
We will induct according to a scheme suggested by (AP A B).
This suggestion was produced using the :induction rule AP. If we let
(:P A B) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP A)) (:P (CDR A) B))
(:P A B))
(IMPLIES (ENDP A) (:P A B))).
This induction is justified by the same argument used to admit AP.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
Subgoal *1/2'
Splitter note (see :DOC splitter) for Subgoal *1/2' (2 subgoals).
if-intro: ((:DEFINITION PERM))
Subgoal *1/2.2
Subgoal *1/2.2'
Subgoal *1/2.2''
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2.2
(IMPLIES (AND (CONSP A)
(PERM (AP (CDR A) B) (AP B (CDR A))))
(MEMB (CAR A) (AP B A)))
*1.1 (Subgoal *1/2.2'') is pushed for proof by induction.
])
Subgoal *1/2.1
Subgoal *1/2.1'
Subgoal *1/2.1''
Subgoal *1/2.1'''
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2.1
(IMPLIES (AND (CONSP A)
(PERM (AP (CDR A) B) (AP B (CDR A))))
(PERM (AP B (CDR A))
(RM (CAR A) (AP B A))))
*1.2 (Subgoal *1/2.1''') is pushed for proof by induction.
])
Subgoal *1/1
Subgoal *1/1'
Subgoal *1/1''
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/1''
(IMPLIES (NOT (CONSP A))
(PERM B (AP B A)))
*1.3 (Subgoal *1/1'') is pushed for proof by induction.
])
So we now return to *1.3, which is
(IMPLIES (NOT (CONSP A))
(PERM B (AP B A))).
Subgoal *1.3/3
Subgoal *1.3/2
Subgoal *1.3/1
*1.3 is COMPLETED!
Thus key checkpoint Subgoal *1/1'' is COMPLETED!
We therefore turn our attention to *1.2, which is
(PERM (AP B A2)
(RM A1 (AP B (CONS A1 A2)))).
Subgoal *1.2/2
Subgoal *1.2/2'
Splitter note (see :DOC splitter) for Subgoal *1.2/2' (4 subgoals).
if-intro: ((:DEFINITION PERM) (:DEFINITION RM))
Subgoal *1.2/2.4
Subgoal *1.2/2.4'
Subgoal *1.2/2.4''
Subgoal *1.2/2.4'''
Subgoal *1.2/2.4'4'
*1.2.1 (Subgoal *1.2/2.4'4') is pushed for proof by induction.
Subgoal *1.2/2.3
Subgoal *1.2/2.2
Subgoal *1.2/2.1
Subgoal *1.2/1
Subgoal *1.2/1'
So we now return to *1.2.1, which is
(IMPLIES (AND (CONSP L)
(PERM (AP B2 A2) (RM B1 L)))
(MEMB B1 L)).
Subgoal *1.2.1/4
Subgoal *1.2.1/3
Subgoal *1.2.1/3'
Subgoal *1.2.1/3''
Subgoal *1.2.1/3'''
Subgoal *1.2.1/3'4'
Splitter note (see :DOC splitter) for Subgoal *1.2.1/3'4' (2 subgoals).
if-intro: ((:DEFINITION PERM))
Subgoal *1.2.1/3.2
*1.2.1.1 (Subgoal *1.2.1/3.2) is pushed for proof by induction.
Subgoal *1.2.1/3.1
Subgoal *1.2.1/3.1'
*1.2.1.2 (Subgoal *1.2.1/3.1') is pushed for proof by induction.
Subgoal *1.2.1/2
Subgoal *1.2.1/2'
Subgoal *1.2.1/2''
Subgoal *1.2.1/2'''
Subgoal *1.2.1/2'4'
Subgoal *1.2.1/2'5'
*1.2.1.3 (Subgoal *1.2.1/2'5') is pushed for proof by induction.
Subgoal *1.2.1/1
So we now return to *1.2.1.3, which is
(IMPLIES (NOT (EQUAL B1 L1))
(NOT (PERM (AP B2 A2) (LIST L1)))).
Subgoal *1.2.1.3/2
Subgoal *1.2.1.3/2'
Subgoal *1.2.1.3/2''
Subgoal *1.2.1.3/2'''
Subgoal *1.2.1.3/2'4'
Subgoal *1.2.1.3/2'5'
Subgoal *1.2.1.3/2'6'
*1.2.1.3.1 (Subgoal *1.2.1.3/2'6') is pushed for proof by induction.
Subgoal *1.2.1.3/1
Subgoal *1.2.1.3/1'
Subgoal *1.2.1.3/1''
Subgoal *1.2.1.3/1'''
Subgoal *1.2.1.3/1'4'
A goal of NIL, Subgoal *1.2.1.3/1'4', has been generated! Obviously,
the proof attempt has failed.
Summary
Form: ( DEFTHM PERM-AP ...)
Rules: ((:DEFINITION AP)
(:DEFINITION ENDP)
(:DEFINITION MEMB)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EQUIVALENCE PERM-IS-AN-EQUIVALENCE)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION AP)
(:INDUCTION MEMB)
(:INDUCTION PERM)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION AP)
(:TYPE-PRESCRIPTION MEMB))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION PERM) (:DEFINITION RM))
---
The key checkpoint goals, below, may help you to debug this failure.
See :DOC failure and see :DOC set-checkpoint-summary-limit.
---
*** Key checkpoint at the top level: ***
Goal
(PERM (AP A B) (AP B A))
*** Key checkpoints under a top-level induction
before generating a goal of NIL (see :DOC nil-goal): ***
Subgoal *1/2.2
(IMPLIES (AND (CONSP A)
(PERM (AP (CDR A) B) (AP B (CDR A))))
(MEMB (CAR A) (AP B A)))
Subgoal *1/2.1
(IMPLIES (AND (CONSP A)
(PERM (AP (CDR A) B) (AP B (CDR A))))
(PERM (AP B (CDR A))
(RM (CAR A) (AP B A))))
ACL2 Error [Failure] in ( DEFTHM PERM-AP ...): See :DOC failure.
******** FAILED ********
ACL2 !>>(DEFTHM MEMB-AP
(EQUAL (MEMB E (AP A B))
(OR (MEMB E A) (MEMB E B))))
Subgoal 2
Subgoal 2'
([ A key checkpoint:
Subgoal 2'
(IMPLIES (MEMB E A) (MEMB E (AP A B)))
*1 (Subgoal 2') is pushed for proof by induction.
])
Subgoal 1
([ A key checkpoint:
Subgoal 1
(IMPLIES (NOT (MEMB E A))
(EQUAL (MEMB E (AP A B)) (MEMB E B)))
Normally we would attempt to prove Subgoal 1 by induction. However,
we prefer in this instance to focus on the original input conjecture
rather than this simplified special case. We therefore abandon our
previous work on this conjecture and reassign the name *1 to the original
conjecture. (See :DOC otf-flg.)
])
Perhaps we can prove *1 by induction. Four induction schemes are suggested
by this conjecture. Subsumption reduces that number to three. These
merge into two derived induction schemes. However, one of these is
flawed and so we are left with one viable candidate.
We will induct according to a scheme suggested by (MEMB E A), but modified
to accommodate (AP A B).
These suggestions were produced using the :induction rules AP and MEMB.
If we let (:P A B E) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(:P (CDR A) B E))
(:P A B E))
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(:P A B E))).
This induction is justified by the same argument used to admit MEMB.
When applied to the goal at hand the above induction scheme produces
three nontautological subgoals.
Subgoal *1/3
Subgoal *1/2
Subgoal *1/1
*1 is COMPLETED!
Thus key checkpoint Goal is COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM MEMB-AP ...)
Rules: ((:DEFINITION AP)
(:DEFINITION MEMB)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION AP)
(:INDUCTION MEMB)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MEMB))
MEMB-AP
ACL2 !>>(DEFTHM PERM-AP
(PERM (AP A B) (AP B A)))
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. We will choose arbitrarily among these.
We will induct according to a scheme suggested by (AP A B).
This suggestion was produced using the :induction rule AP. If we let
(:P A B) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP A)) (:P (CDR A) B))
(:P A B))
(IMPLIES (ENDP A) (:P A B))).
This induction is justified by the same argument used to admit AP.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/2''
Subgoal *1/2'''
Subgoal *1/2'4'
Subgoal *1/2'5'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2''
(IMPLIES (AND (CONSP A)
(PERM (AP (CDR A) B) (AP B (CDR A))))
(PERM (AP B (CDR A))
(RM (CAR A) (AP B A))))
*1.1 (Subgoal *1/2'5') is pushed for proof by induction.
])
Subgoal *1/1
Subgoal *1/1'
Subgoal *1/1''
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/1''
(IMPLIES (NOT (CONSP A))
(PERM B (AP B A)))
*1.2 (Subgoal *1/1'') is pushed for proof by induction.
])
So we now return to *1.2, which is
(IMPLIES (NOT (CONSP A))
(PERM B (AP B A))).
Subgoal *1.2/3
Subgoal *1.2/2
Subgoal *1.2/1
*1.2 is COMPLETED!
Thus key checkpoint Subgoal *1/1'' is COMPLETED!
We therefore turn our attention to *1.1, which is
(PERM (AP B A2)
(RM A1 (AP B (CONS A1 A2)))).
Subgoal *1.1/2
Subgoal *1.1/2'
Splitter note (see :DOC splitter) for Subgoal *1.1/2' (4 subgoals).
if-intro: ((:DEFINITION PERM) (:DEFINITION RM))
Subgoal *1.1/2.4
Subgoal *1.1/2.3
Subgoal *1.1/2.2
Subgoal *1.1/2.1
Subgoal *1.1/2.1'
Subgoal *1.1/2.1''
Subgoal *1.1/2.1'''
Subgoal *1.1/2.1'4'
Subgoal *1.1/2.1'5'
Subgoal *1.1/2.1'6'
Subgoal *1.1/2.1'7'
*1.1.1 (Subgoal *1.1/2.1'7') is pushed for proof by induction.
Subgoal *1.1/1
Subgoal *1.1/1'
So we now return to *1.1.1, which is
(IMPLIES (AND (MEMB L1 (RM A1 (AP B2 (CONS A1 A2))))
(NOT (EQUAL A1 B1))
(NOT (MEMB L1 B2)))
(MEMB L1 A2)).
Subgoal *1.1.1/4
Subgoal *1.1.1/3
Subgoal *1.1.1/2
Splitter note (see :DOC splitter) for Subgoal *1.1.1/2 (2 subgoals).
if-intro: ((:DEFINITION RM))
Subgoal *1.1.1/2.2
Subgoal *1.1.1/2.1
Subgoal *1.1.1/1
*1.1.1, *1.1 and *1 are COMPLETED!
Thus key checkpoints Subgoal *1/2'' and Goal are COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM PERM-AP ...)
Rules: ((:DEFINITION AP)
(:DEFINITION ENDP)
(:DEFINITION MEMB)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EQUIVALENCE PERM-IS-AN-EQUIVALENCE)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION AP)
(:INDUCTION MEMB)
(:INDUCTION PERM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE MEMB-AP)
(:TYPE-PRESCRIPTION MEMB))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION PERM) (:DEFINITION RM))
PERM-AP
ACL2 !>>(DEFTHM ISORT-IDEMPOTENT
(EQUAL (ISORT (ISORT X)) (ISORT X)))
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. Subsumption reduces that number to one.
We will induct according to a scheme suggested by (ISORT X).
This suggestion was produced using the :induction rule ISORT. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit ISORT.
When applied to the goal at hand the above induction scheme produces
two nontautological subgoals.
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/2''
Subgoal *1/2'''
Subgoal *1/2'4'
Subgoal *1/2'5'
Subgoal *1/2'6'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(EQUAL (ISORT (ISORT (CDR X)))
(ISORT (CDR X))))
(EQUAL (ISORT (INSERT (CAR X) (ISORT (CDR X))))
(INSERT (CAR X) (ISORT (CDR X)))))
*1.1 (Subgoal *1/2'6') is pushed for proof by induction.
])
Subgoal *1/1
Subgoal *1/1'
So we now return to *1.1, which is
(EQUAL (ISORT (INSERT X1 IT))
(INSERT X1 (ISORT IT))).
Subgoal *1.1/3
Subgoal *1.1/3'
Subgoal *1.1/3''
Subgoal *1.1/3'''
Subgoal *1.1/3'4'
Subgoal *1.1/3'5'
*1.1.1 (Subgoal *1.1/3'5') is pushed for proof by induction.
Subgoal *1.1/2
Subgoal *1.1/2'
Subgoal *1.1/2''
Subgoal *1.1/1
Subgoal *1.1/1'
So we now return to *1.1.1, which is
(IMPLIES (NOT (LEXORDER X1 IT1))
(EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2)))
(INSERT X1 (INSERT IT1 (ISORT IT2))))).
Subgoal *1.1.1/3
Subgoal *1.1.1/3'
Subgoal *1.1.1/3''
Subgoal *1.1.1/3'''
Subgoal *1.1.1/3'4'
Subgoal *1.1.1/3'5'
Subgoal *1.1.1/3'6'
Subgoal *1.1.1/3'7'
*1.1.1.1 (Subgoal *1.1.1/3'7') is pushed for proof by induction.
Subgoal *1.1.1/2
Subgoal *1.1.1/2'
Subgoal *1.1.1/2''
Subgoal *1.1.1/2'''
Subgoal *1.1.1/2'4'
Subgoal *1.1.1/2'5'
Subgoal *1.1.1/2'6'
Subgoal *1.1.1/2'7'
*1.1.1.2 (Subgoal *1.1.1/2'7') is pushed for proof by induction.
Subgoal *1.1.1/1
Subgoal *1.1.1/1'
So we now return to *1.1.1.2, which is
(IMPLIES (AND (CONSP L)
(LEXORDER X1 IT3)
(NOT (LEXORDER X1 IT1)))
(EQUAL (INSERT IT1 (INSERT X1 L))
(INSERT X1 (INSERT IT1 L)))).
Subgoal *1.1.1.2/4
Subgoal *1.1.1.2/4'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.2/4' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.2/4.2
Subgoal *1.1.1.2/4.1
Subgoal *1.1.1.2/3
Subgoal *1.1.1.2/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.2/3' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.2/3.2
Subgoal *1.1.1.2/3.1
Subgoal *1.1.1.2/2
Subgoal *1.1.1.2/2'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.2/2' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.2/2.2
Subgoal *1.1.1.2/2.1
Subgoal *1.1.1.2/1
*1.1.1.2 is COMPLETED!
We therefore turn our attention to *1.1.1.1, which is
(IMPLIES (AND (NOT (LEXORDER X1 IT3))
(EQUAL (INSERT IT1 IT0)
(INSERT X1 (INSERT IT1 IT)))
(NOT (LEXORDER X1 IT1)))
(EQUAL (INSERT IT1 (INSERT IT3 IT0))
(INSERT X1 (INSERT IT1 (INSERT IT3 IT))))).
Subgoal *1.1.1.1/4
Subgoal *1.1.1.1/4'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1/4' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1/4.2
Subgoal *1.1.1.1/4.2'
Subgoal *1.1.1.1/4.2''
Subgoal *1.1.1.1/4.2'''
*1.1.1.1.1 (Subgoal *1.1.1.1/4.2''') is pushed for proof by induction.
Subgoal *1.1.1.1/4.1
Subgoal *1.1.1.1/4.1'
Subgoal *1.1.1.1/4.1''
*1.1.1.1.2 (Subgoal *1.1.1.1/4.1'') is pushed for proof by induction.
Subgoal *1.1.1.1/3
Subgoal *1.1.1.1/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1/3' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1/3.2
Subgoal *1.1.1.1/3.2'
Subgoal *1.1.1.1/3.2''
Subgoal *1.1.1.1/3.2'''
*1.1.1.1.3 (Subgoal *1.1.1.1/3.2''') is pushed for proof by induction.
Subgoal *1.1.1.1/3.1
Subgoal *1.1.1.1/3.1'
Subgoal *1.1.1.1/3.1''
Subgoal *1.1.1.1/3.1'''
*1.1.1.1.4 (Subgoal *1.1.1.1/3.1''') is pushed for proof by induction.
Subgoal *1.1.1.1/2
Subgoal *1.1.1.1/2'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1/2' (4 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1/2.4
Subgoal *1.1.1.1/2.4'
Subgoal *1.1.1.1/2.4''
Subgoal *1.1.1.1/2.4'''
*1.1.1.1.5 (Subgoal *1.1.1.1/2.4''') is pushed for proof by induction.
Subgoal *1.1.1.1/2.3
Subgoal *1.1.1.1/2.3'
Subgoal *1.1.1.1/2.3''
Subgoal *1.1.1.1/2.3'''
*1.1.1.1.6 (Subgoal *1.1.1.1/2.3''') is pushed for proof by induction.
Subgoal *1.1.1.1/2.2
Subgoal *1.1.1.1/2.1
Subgoal *1.1.1.1/2.1'
Subgoal *1.1.1.1/2.1''
Subgoal *1.1.1.1/2.1'''
*1.1.1.1.7 (Subgoal *1.1.1.1/2.1''') is pushed for proof by induction.
Subgoal *1.1.1.1/1
Subgoal *1.1.1.1/1'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1/1' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1/1.2
*1.1.1.1.8 (Subgoal *1.1.1.1/1.2) is pushed for proof by induction.
Subgoal *1.1.1.1/1.1
*1.1.1.1.9 (Subgoal *1.1.1.1/1.1) is pushed for proof by induction.
So we now return to *1.1.1.1.9, which is
(IMPLIES (AND (NOT (CONSP IT0))
(NOT (LEXORDER X1 IT3))
(EQUAL (CONS IT1 IT0)
(INSERT X1 (INSERT IT1 IT)))
(NOT (LEXORDER X1 IT1))
(NOT (LEXORDER IT1 IT3)))
(EQUAL (LIST* IT3 IT1 IT0)
(INSERT X1 (INSERT IT1 (INSERT IT3 IT))))).
Subgoal *1.1.1.1.9/4
Subgoal *1.1.1.1.9/4'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.9/4' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.9/4.2
Subgoal *1.1.1.1.9/4.1
Subgoal *1.1.1.1.9/3
Subgoal *1.1.1.1.9/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.9/3' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.9/3.2
Subgoal *1.1.1.1.9/3.1
Subgoal *1.1.1.1.9/2
Subgoal *1.1.1.1.9/2'
Subgoal *1.1.1.1.9/2''
Subgoal *1.1.1.1.9/1
Subgoal *1.1.1.1.9/1'
*1.1.1.1.9 is COMPLETED!
We therefore turn our attention to *1.1.1.1.8, which is
(IMPLIES (AND (NOT (CONSP IT0))
(NOT (LEXORDER X1 IT3))
(EQUAL (CONS IT1 IT0)
(INSERT X1 (INSERT IT1 IT)))
(NOT (LEXORDER X1 IT1))
(LEXORDER IT1 IT3))
(EQUAL (LIST* IT1 IT3 IT0)
(INSERT X1 (INSERT IT1 (INSERT IT3 IT))))).
Subgoal *1.1.1.1.8/4
Subgoal *1.1.1.1.8/4'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.8/4' (4 subgoals).
if-intro: ((:DEFINITION INSERT)
(:REWRITE CONS-EQUAL))
Subgoal *1.1.1.1.8/4.4
Subgoal *1.1.1.1.8/4.3
Subgoal *1.1.1.1.8/4.2
Subgoal *1.1.1.1.8/4.1
Subgoal *1.1.1.1.8/3
Subgoal *1.1.1.1.8/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.8/3' (4 subgoals).
if-intro: ((:DEFINITION INSERT)
(:REWRITE CONS-EQUAL))
Subgoal *1.1.1.1.8/3.4
Subgoal *1.1.1.1.8/3.3
Subgoal *1.1.1.1.8/3.2
Subgoal *1.1.1.1.8/3.1
Subgoal *1.1.1.1.8/2
Subgoal *1.1.1.1.8/2'
Subgoal *1.1.1.1.8/1
Subgoal *1.1.1.1.8/1'
*1.1.1.1.8 is COMPLETED!
We therefore turn our attention to *1.1.1.1.7, which is
(IMPLIES (AND (LEXORDER IT3 IT2)
(NOT (LEXORDER X1 IT3))
(NOT (LEXORDER IT1 IT2))
(NOT (LEXORDER X1 IT1))
(NOT (LEXORDER IT1 IT3)))
(EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT)))
(INSERT X1 (INSERT IT1 (INSERT IT3 IT))))).
Subgoal *1.1.1.1.7/3
Subgoal *1.1.1.1.7/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.7/3' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.7/3.2
Subgoal *1.1.1.1.7/3.1
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.7/3.1 (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.7/3.1.2
Subgoal *1.1.1.1.7/3.1.1
Subgoal *1.1.1.1.7/3.1.1'
Subgoal *1.1.1.1.7/3.1.1''
Subgoal *1.1.1.1.7/3.1.1'''
*1.1.1.1.7.1 (Subgoal *1.1.1.1.7/3.1.1''') is pushed for proof by induction.
Subgoal *1.1.1.1.7/2
Subgoal *1.1.1.1.7/2'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.7/2' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.7/2.2
Subgoal *1.1.1.1.7/2.1
Subgoal *1.1.1.1.7/1
Subgoal *1.1.1.1.7/1'
So we now return to *1.1.1.1.7.1, which is
(IMPLIES (AND (NOT (LEXORDER IT3 IT4))
(EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5)))
(INSERT X1 (INSERT IT1 (INSERT IT3 IT5))))
(LEXORDER IT3 IT2)
(NOT (LEXORDER X1 IT3))
(NOT (LEXORDER IT1 IT2))
(NOT (LEXORDER X1 IT1))
(NOT (LEXORDER IT1 IT3))
(NOT (LEXORDER IT1 IT4))
(NOT (LEXORDER X1 IT4)))
(EQUAL IT3 IT4)).
Subgoal *1.1.1.1.7.1/3
Subgoal *1.1.1.1.7.1/3'
Subgoal *1.1.1.1.7.1/3''
Subgoal *1.1.1.1.7.1/3'''
Subgoal *1.1.1.1.7.1/3'4'
Subgoal *1.1.1.1.7.1/2
Subgoal *1.1.1.1.7.1/2'
Splitter note (see :DOC splitter) for Subgoal *1.1.1.1.7.1/2' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1.1.7.1/2.2
Subgoal *1.1.1.1.7.1/2.2'
Subgoal *1.1.1.1.7.1/2.2''
Subgoal *1.1.1.1.7.1/2.2'''
*1.1.1.1.7.1.1 (Subgoal *1.1.1.1.7.1/2.2''') is pushed for proof by
induction.
Subgoal *1.1.1.1.7.1/2.1
Subgoal *1.1.1.1.7.1/2.1'
Subgoal *1.1.1.1.7.1/2.1''
Subgoal *1.1.1.1.7.1/2.1'''
*1.1.1.1.7.1.2 (Subgoal *1.1.1.1.7.1/2.1''') is pushed for proof by
induction.
Subgoal *1.1.1.1.7.1/1
Subgoal *1.1.1.1.7.1/1'
Subgoal *1.1.1.1.7.1/1''
Subgoal *1.1.1.1.7.1/1'''
*1.1.1.1.7.1.3 (Subgoal *1.1.1.1.7.1/1''') is pushed for proof by induction.
So we now return to *1.1.1.1.7.1.3, which is
(IMPLIES (AND (NOT (LEXORDER IT3 IT4))
(LEXORDER IT3 IT2)
(NOT (LEXORDER X1 IT3))
(NOT (LEXORDER IT1 IT2))
(NOT (LEXORDER X1 IT1))
(NOT (LEXORDER IT1 IT3))
(NOT (LEXORDER IT1 IT4))
(NOT (LEXORDER X1 IT4)))
(EQUAL IT3 IT4)).
But the formula above is subsumed by *1.1.1.1.7.1.2, which we'll try
to prove later. We therefore regard *1.1.1.1.7.1.3 as proved (pending
the proof of the more general *1.1.1.1.7.1.2).
We next consider *1.1.1.1.7.1.2, which is
(IMPLIES (AND (LEXORDER IT3 IT6)
(NOT (LEXORDER IT3 IT4))
(NOT (LEXORDER IT1 IT6))
(LEXORDER IT3 IT2)
(NOT (LEXORDER X1 IT3))
(NOT (LEXORDER IT1 IT2))
(NOT (LEXORDER X1 IT1))
(NOT (LEXORDER IT1 IT3))
(NOT (LEXORDER IT1 IT4))
(NOT (LEXORDER X1 IT4)))
(EQUAL IT3 IT4)).
No induction schemes are suggested by *1.1.1.1.7.1.2. Consequently,
the proof attempt has failed.
Summary
Form: ( DEFTHM ISORT-IDEMPOTENT ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:INDUCTION ISORT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE CONS-EQUAL)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION INSERT)
(:TYPE-PRESCRIPTION LEXORDER))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION INSERT)
(:REWRITE CONS-EQUAL))
---
The key checkpoint goals, below, may help you to debug this failure.
See :DOC failure and see :DOC set-checkpoint-summary-limit.
---
*** Key checkpoint at the top level: ***
Goal
(EQUAL (ISORT (ISORT X)) (ISORT X))
*** Key checkpoint under a top-level induction: ***
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(EQUAL (ISORT (ISORT (CDR X)))
(ISORT (CDR X))))
(EQUAL (ISORT (INSERT (CAR X) (ISORT (CDR X))))
(INSERT (CAR X) (ISORT (CDR X)))))
ACL2 Error [Failure] in ( DEFTHM ISORT-IDEMPOTENT ...): See :DOC failure.
******** FAILED ********
ACL2 !>>(DEFTHM ISORT-IDENTITY
(IMPLIES (ORDERED X)
(EQUAL (ISORT X) X)))
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. Subsumption reduces that number to one.
We will induct according to a scheme suggested by (ORDERED X).
This suggestion was produced using the :induction rules ISORT and ORDERED.
If we let (:P X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(NOT (LEXORDER (CAR X) (CADR X))))
(:P X))
(IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(LEXORDER (CAR X) (CADR X))
(:P (CDR X)))
(:P X))
(IMPLIES (AND (NOT (ENDP X)) (ENDP (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit ORDERED.
When applied to the goal at hand the above induction scheme produces
five nontautological subgoals.
Subgoal *1/5
Subgoal *1/5'
Subgoal *1/4
Subgoal *1/4'
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/2''
Subgoal *1/1
Subgoal *1/1'
*1 is COMPLETED!
Thus key checkpoint Goal is COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM ISORT-IDENTITY ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ISORT)
(:INDUCTION ORDERED)
(:REWRITE CONS-CAR-CDR)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
ISORT-IDENTITY
ACL2 !>>(DEFTHM ISORT-IDEMPOTENT
(EQUAL (ISORT (ISORT X)) (ISORT X)))
Q.E.D.
Summary
Form: ( DEFTHM ISORT-IDEMPOTENT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE ISORT-IDENTITY)
(:REWRITE ORDERED-ISORT))
ISORT-IDEMPOTENT
ACL2 !>>(DEFTHM MEMB-CONGRUENCE
(IMPLIES (PERM A B)
(EQUAL (MEMB E A) (MEMB E B)))
:RULE-CLASSES :CONGRUENCE)
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into two derived induction
schemes. However, one of these is flawed and so we are left with one
viable candidate.
We will induct according to a scheme suggested by (MEMB E A), but modified
to accommodate (PERM A B).
These suggestions were produced using the :induction rules MEMB and
PERM. If we let (:P A B E) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(:P (CDR A) (RM (CAR A) B) E))
(:P A B E))
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(:P A B E))).
This induction is justified by the same argument used to admit MEMB.
Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.
Subgoal *1/4
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/3''
Subgoal *1/3'''
Subgoal *1/3'4'
Subgoal *1/3'5'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/3'
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(EQUAL (MEMB E (CDR A))
(MEMB E (RM (CAR A) B)))
(MEMB (CAR A) B)
(PERM (CDR A) (RM (CAR A) B)))
(EQUAL (MEMB E (CDR A)) (MEMB E B)))
*1.1 (Subgoal *1/3'5') is pushed for proof by induction.
])
Subgoal *1/2
Subgoal *1/1
So we now return to *1.1, which is
(IMPLIES (AND (NOT (EQUAL E A1)) (MEMB A1 B))
(EQUAL (MEMB E (RM A1 B)) (MEMB E B))).
Subgoal *1.1/4
Subgoal *1.1/3
Subgoal *1.1/3'
Subgoal *1.1/2
Subgoal *1.1/1
*1.1 and *1 are COMPLETED!
Thus key checkpoints Subgoal *1/3' and Goal are COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM MEMB-CONGRUENCE ...)
Rules: ((:DEFINITION MEMB)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEMB)
(:INDUCTION PERM)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MEMB))
MEMB-CONGRUENCE
ACL2 !>>(PE 'PERM-ISORT)
12 (DEFTHM PERM-ISORT (PERM (ISORT X) X))
ACL2 !>>(DEFTHM THIS-IS-NOT-A-THEOREM
(MEMB E (ISORT A)))
Goal'
([ A key checkpoint:
Goal'
(MEMB E A)
*1 (Goal') is pushed for proof by induction.
])
Perhaps we can prove *1 by induction. One induction scheme is suggested
by this conjecture.
We will induct according to a scheme suggested by (MEMB E A).
This suggestion was produced using the :induction rule MEMB. If we
let (:P A E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A E))
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(:P (CDR A) E))
(:P A E))
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(:P A E))).
This induction is justified by the same argument used to admit MEMB.
When applied to the goal at hand the above induction scheme produces
three nontautological subgoals.
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/3''
([ A key checkpoint while proving *1 (descended from Goal'):
Subgoal *1/3'
(CONSP A)
A goal of NIL, Subgoal *1/3'', has been generated! Obviously, the
proof attempt has failed.
])
Summary
Form: ( DEFTHM THIS-IS-NOT-A-THEOREM ...)
Rules: ((:CONGRUENCE MEMB-CONGRUENCE)
(:DEFINITION MEMB)
(:INDUCTION MEMB)
(:REWRITE PERM-ISORT))
---
The key checkpoint goals, below, may help you to debug this failure.
See :DOC failure and see :DOC set-checkpoint-summary-limit.
---
*** Key checkpoint at the top level: ***
Goal'
(MEMB E A)
*** Key checkpoint under a top-level induction
before generating a goal of NIL (see :DOC nil-goal): ***
Subgoal *1/3'
(CONSP A)
ACL2 Error [Failure] in ( DEFTHM THIS-IS-NOT-A-THEOREM ...): See :DOC
failure.
******** FAILED ********
ACL2 !>>'(END OF DEMO 2)
(END OF DEMO 2)
ACL2 !>>(DEFUN FIB1 (N)
(DECLARE (XARGS :GUARD (NATP N)
:VERIFY-GUARDS NIL))
(IF (ZP N)
0
(IF (EQUAL N 1)
1
(+ (FIB1 (- N 1)) (FIB1 (- N 2))))))
For the admission of FIB1 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT N). The non-trivial part of the measure conjecture is
Goal
(IMPLIES (AND (NOT (ZP N)) (NOT (EQUAL N 1)))
(O< (ACL2-COUNT (+ -2 N))
(ACL2-COUNT N))).
Goal'
Splitter note (see :DOC splitter) for Goal' (2 subgoals).
if-intro: ((:DEFINITION ACL2-COUNT)
(:DEFINITION INTEGER-ABS)
(:DEFINITION O<))
Subgoal 2
Subgoal 1
Q.E.D.
That completes the proof of the measure theorem for FIB1. Thus, we
admit this function under the principle of definition. We observe
that the type of FIB1 is described by the theorem
(AND (INTEGERP (FIB1 N)) (<= 0 (FIB1 N))). We used primitive type
reasoning.
Summary
Form: ( DEFUN FIB1 ...)
Rules: ((:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ACL2-COUNT)
(:DEFINITION INTEGER-ABS)
(:DEFINITION NOT)
(:DEFINITION O-FINP)
(:DEFINITION O<)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION ACL2-COUNT)
(:DEFINITION INTEGER-ABS)
(:DEFINITION O<))
FIB1
ACL2 !>>(FIB1 1)
1
ACL2 !>>(FIB1 2)
1
ACL2 !>>(FIB1 3)
2
ACL2 !>>(FIB1 4)
3
ACL2 !>>(FIB1 5)
5
ACL2 !>>(TIME$ (FIB1 10))
55
ACL2 !>>(TIME$ (FIB1 20))
6765
ACL2 !>>(TIME$ (FIB1 30))
832040
ACL2 !>>(TIME$ (FIB1 40))
102334155
ACL2 !>>(VERIFY-GUARDS FIB1)
Computing the guard conjecture for FIB1....
The non-trivial part of the guard conjecture for FIB1, given the :compound-
recognizer rules NATP-COMPOUND-RECOGNIZER and ZP-COMPOUND-RECOGNIZER,
primitive type reasoning and the :type-prescription rule FIB1, is
Goal
(IMPLIES (AND (NATP N)
(NOT (ZP N))
(NOT (EQUAL N 1)))
(NATP (+ -2 N))).
Goal'
Goal''
Q.E.D.
That completes the proof of the guard theorem for FIB1. FIB1 is compliant
with Common Lisp.
Summary
Form: ( VERIFY-GUARDS FIB1)
Rules: ((:COMPOUND-RECOGNIZER NATP-COMPOUND-RECOGNIZER)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION NATP)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION FIB1))
FIB1
ACL2 !>>(TIME$ (FIB1 40))
102334155
ACL2 !>>(DEFUN FIB2 (N J K)
(DECLARE (XARGS :GUARD (AND (NATP N) (NATP J) (NATP K))))
(IF (ZP N)
J
(IF (EQUAL N 1)
K
(FIB2 (- N 1) K (+ J K)))))
The admission of FIB2 is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT N). We observe that the type of FIB2 is described by the
theorem
(OR (ACL2-NUMBERP (FIB2 N J K))
(EQUAL (FIB2 N J K) J)
(EQUAL (FIB2 N J K) K)).
We used primitive type reasoning.
Computing the guard conjecture for FIB2....
The guard conjecture for FIB2 is trivial to prove, given the :compound-
recognizer rules NATP-COMPOUND-RECOGNIZER and ZP-COMPOUND-RECOGNIZER
and primitive type reasoning. FIB2 is compliant with Common Lisp.
Summary
Form: ( DEFUN FIB2 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-COMPOUND-RECOGNIZER)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
FIB2
ACL2 !>>(TIME$ (FIB2 40 0 1))
102334155
ACL2 !>>(DEFTHM FIB2-V-FIB1
(IMPLIES (AND (NATP I)
(NATP J)
(NATP K)
(<= 1 I))
(EQUAL (FIB2 I J K)
(+ (* (FIB1 (- I 1)) J)
(* (FIB1 I) K)))))
Goal'
Goal''
([ A key checkpoint:
Goal''
(IMPLIES (AND (INTEGERP I)
(<= 0 I)
(INTEGERP J)
(<= 0 J)
(INTEGERP K)
(<= 0 K)
(<= 1 I))
(EQUAL (FIB2 I J K)
(+ (* K (FIB1 I))
(* J (FIB1 (+ -1 I))))))
*1 (Goal'') is pushed for proof by induction.
])
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (FIB1 I), but modified
to accommodate (FIB2 I J K).
These suggestions were produced using the :induction rules FIB1 and
FIB2. If we let (:P I J K) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (AND (NOT (ZP I))
(NOT (EQUAL I 1))
(:P (+ -1 I) K (+ J K))
(:P (+ -2 I) J K))
(:P I J K))
(IMPLIES (AND (NOT (ZP I)) (EQUAL I 1))
(:P I J K))
(IMPLIES (ZP I) (:P I J K))).
This induction is justified by the same argument used to admit FIB1.
Note, however, that the unmeasured variables J and K are being instantiated.
When applied to the goal at hand the above induction scheme produces
26 nontautological subgoals.
Subgoal *1/26
Subgoal *1/25
Subgoal *1/24
Subgoal *1/23
Subgoal *1/22
Subgoal *1/21
Subgoal *1/20
Subgoal *1/20'
Subgoal *1/19
Subgoal *1/18
Subgoal *1/17
Subgoal *1/16
Subgoal *1/15
Subgoal *1/14
Subgoal *1/13
Subgoal *1/12
Subgoal *1/11
Subgoal *1/10
Subgoal *1/9
Subgoal *1/8
Subgoal *1/7
Subgoal *1/6
Subgoal *1/5
Subgoal *1/4
Subgoal *1/3
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/1
*1 is COMPLETED!
Thus key checkpoint Goal'' is COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM FIB2-V-FIB1 ...)
Rules: ((:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FIB1)
(:DEFINITION FIB2)
(:DEFINITION FIX)
(:DEFINITION NATP)
(:DEFINITION NOT)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIB1)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR-EQUALITIES NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FIB1)
(:INDUCTION FIB2)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-*)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DISTRIBUTIVITY)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE UNICITY-OF-1))
FIB2-V-FIB1
ACL2 !>>(DEFUN FIB (N)
(DECLARE (XARGS :GUARD (NATP N)))
(MBE :LOGIC (FIB1 N)
:EXEC (FIB2 N 0 1)))
Since FIB is non-recursive, its admission is trivial. We observe that
the type of FIB is described by the theorem
(AND (INTEGERP (FIB N)) (<= 0 (FIB N))). We used the :type-prescription
rule FIB1.
Computing the guard conjecture for FIB....
The non-trivial part of the guard conjecture for FIB, given the :executable-
counterpart of NATP, is
Goal
(IMPLIES (NATP N)
(EQUAL (FIB1 N) (FIB2 N 0 1))).
Goal'
Splitter note (see :DOC splitter) for Goal' (2 subgoals).
if-intro: ((:DEFINITION FIB2))
Subgoal 2
Subgoal 1
Q.E.D.
That completes the proof of the guard theorem for FIB. FIB is compliant
with Common Lisp.
Summary
Form: ( DEFUN FIB ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-COMPOUND-RECOGNIZER)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FIB1)
(:DEFINITION FIB2)
(:DEFINITION FIX)
(:DEFINITION NATP)
(:DEFINITION NOT)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIB1)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-LINEAR-EQUALITIES NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE COMMUTATIVITY-OF-*)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE FIB2-V-FIB1)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE UNICITY-OF-1)
(:TYPE-PRESCRIPTION FIB1))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION FIB2))
FIB
ACL2 !>>(TIME$ (FIB 5000))
3878968454388325633701916308325905312082127714646245106160597214895550139044037097010822916462210669479293452858882973813483102008954982940361430156911478938364216563944106910214505634133706558656238254656700712525929903854933813928836378347518908762970712033337052923107693008518093849801803847813996748881765554653788291644268912980384613778969021502293082475666346224923071883324803280375039130352903304505842701147635242270210934637699104006714174883298422891491273104054328753298044273676822977244987749874555691907703880637046832794811358973739993110106219308149018570815397854379195305617510761053075688783766033667355445258844886241619210553457493675897849027988234351023599844663934853256411952221859563060475364645470760330902420806382584929156452876291575759142343809142302917491088984155209854432486594079793571316841692868039545309545388698114665082066862897420639323438488465240988742395873801976993820317174208932265468879364002630797780058759129671389634214252579116872755600360311370547754724604639987588046985178408674382863125
ACL2 !>>(THM (IMPLIES (AND (NATP N) (EQUAL (FIB N) 0))
(EQUAL N 0)))
Goal'
([ A key checkpoint:
Goal'
(IMPLIES (AND (INTEGERP N)
(<= 0 N)
(EQUAL (FIB1 N) 0))
(EQUAL N 0))
*1 (Goal') is pushed for proof by induction.
])
Perhaps we can prove *1 by induction. One induction scheme is suggested
by this conjecture.
We will induct according to a scheme suggested by (FIB1 N).
This suggestion was produced using the :induction rule FIB1. If we
let (:P N) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ZP N))
(NOT (EQUAL N 1))
(:P (+ -1 N))
(:P (+ -2 N)))
(:P N))
(IMPLIES (AND (NOT (ZP N)) (EQUAL N 1))
(:P N))
(IMPLIES (ZP N) (:P N))).
This induction is justified by the same argument used to admit FIB1.
When applied to the goal at hand the above induction scheme produces
18 nontautological subgoals.
Subgoal *1/18
Subgoal *1/17
Subgoal *1/16
Subgoal *1/15
Subgoal *1/14
Subgoal *1/13
Subgoal *1/12
Subgoal *1/11
Subgoal *1/10
Subgoal *1/9
Subgoal *1/8
Subgoal *1/7
Subgoal *1/6
Subgoal *1/5
Subgoal *1/4
Subgoal *1/3
Subgoal *1/2
Subgoal *1/1
*1 is COMPLETED!
Thus key checkpoint Goal' is COMPLETED!
Q.E.D.
Summary
Form: ( THM ...)
Rules: ((:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FIB)
(:DEFINITION FIB1)
(:DEFINITION NATP)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIB1)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FIB1)
(:TYPE-PRESCRIPTION FIB1))
Proof succeeded.
ACL2 !>>(TIME$ (FIB1 40))
102334155
ACL2 !>>(MEMOIZE 'FIB1)
FIB1
ACL2 !>>(TIME$ (FIB1 5000))
3878968454388325633701916308325905312082127714646245106160597214895550139044037097010822916462210669479293452858882973813483102008954982940361430156911478938364216563944106910214505634133706558656238254656700712525929903854933813928836378347518908762970712033337052923107693008518093849801803847813996748881765554653788291644268912980384613778969021502293082475666346224923071883324803280375039130352903304505842701147635242270210934637699104006714174883298422891491273104054328753298044273676822977244987749874555691907703880637046832794811358973739993110106219308149018570815397854379195305617510761053075688783766033667355445258844886241619210553457493675897849027988234351023599844663934853256411952221859563060475364645470760330902420806382584929156452876291575759142343809142302917491088984155209854432486594079793571316841692868039545309545388698114665082066862897420639323438488465240988742395873801976993820317174208932265468879364002630797780058759129671389634214252579116872755600360311370547754724604639987588046985178408674382863125
ACL2 !>>'(END OF DEMO 3)
(END OF DEMO 3)
ACL2 !>>(INCLUDE-BOOK "centaur/gl/gl"
:DIR :SYSTEM)
Summary
Form: ( INCLUDE-BOOK "centaur/gl/gl" ...)
Rules: NIL
(:SYSTEM . "centaur/gl/gl.lisp")
ACL2 !>>(DEFUN 32* (X Y)
(LOGAND (* X Y) (- (EXPT 2 32) 1)))
Since 32* is non-recursive, its admission is trivial. We observe that
the type of 32* is described by the theorem (INTEGERP (32* X Y)).
We used the :type-prescription rule BINARY-LOGAND.
Summary
Form: ( DEFUN 32* ...)
Rules: ((:TYPE-PRESCRIPTION BINARY-LOGAND))
32*
ACL2 !>>(DEFUN FAST-LOGCOUNT-32 (V)
(LET* ((V (- V (LOGAND (ASH V -1) 1431655765)))
(V (+ (LOGAND V 858993459)
(LOGAND (ASH V -2) 858993459))))
(ASH (32* (LOGAND (+ V (ASH V -4)) 252645135)
16843009)
-24)))
Since FAST-LOGCOUNT-32 is non-recursive, its admission is trivial.
We observe that the type of FAST-LOGCOUNT-32 is described by the theorem
(INTEGERP (FAST-LOGCOUNT-32 V)). We used the :type-prescription rule
ASH.
Summary
Form: ( DEFUN FAST-LOGCOUNT-32 ...)
Rules: ((:TYPE-PRESCRIPTION ASH))
FAST-LOGCOUNT-32
ACL2 !>>(PF 'LOGCOUNT)
(EQUAL (LOGCOUNT X)
(COND ((ZIP X) 0)
((< X 0) (LOGCOUNT (LOGNOT X)))
((EVENP X)
(LOGCOUNT (NONNEGATIVE-INTEGER-QUOTIENT X 2)))
(T (+ 1
(LOGCOUNT (NONNEGATIVE-INTEGER-QUOTIENT X 2))))))
ACL2 !>>(LOGCOUNT 41)
3
ACL2 !>>(FAST-LOGCOUNT-32 41)
3
ACL2 !>>(DEF-GL-THM
FAST-LOGCOUNT-32-CORRECT
:HYP (UNSIGNED-BYTE-P 32 X)
:CONCL (EQUAL (FAST-LOGCOUNT-32 X)
(LOGCOUNT X))
:G-BINDINGS (CONS (CONS 'X (CONS (GL::G-INT 0 1 33) 'NIL))
'NIL))
ACL2 Warning [Non-rec] in ( DEFTHM FAST-LOGCOUNT-32-CORRECT ...):
A :REWRITE rule generated from FAST-LOGCOUNT-32-CORRECT will be triggered
only by terms containing the function symbol FAST-LOGCOUNT-32, which
has a non-recursive definition. Unless this definition is disabled,
this rule is unlikely ever to be used.
Subgoal 5
Subgoal 4
Subgoal 3
Subgoal 2
ACL2 Warning [Theory] in a computed hint for "Subgoal 2'": The computed
hint
(LIST NIL
'(:COMPUTED-HINT-REPLACEMENT ((AND STABLE-UNDER-SIMPLIFICATIONP #))
:IN-THEORY (UNION-THEORIES NIL (E/D** #))
:DO-NOT-INDUCT T)
STATE)
produced the non-nil result
(:COMPUTED-HINT-REPLACEMENT
((AND STABLE-UNDER-SIMPLIFICATIONP
(LET (#) (CASE-MATCH LAST #))))
:IN-THEORY
(UNION-THEORIES NIL
(E/D** ((:RULESET GL::SHAPE-SPEC-OBJ-IN-RANGE-BACKCHAIN))))
:DO-NOT-INDUCT T).
Regarding this value
(See :DOC set-iprint to be able to see elided values in this message.):
The :DEFINITION rules for the built-in functions DOUBLE-REWRITE, THE-CHECK,
CONS-WITH-HINT, IFF, FROM-DF, WORMHOLE-EVAL, MV-LIST, MINUSP, PLUSP,
ZEROP, LISTP, SYNP, CASE-SPLIT, FORCE, /=, =, RETURN-LAST, NULL, ENDP,
ATOM, NOT, IMPLIES and EQ are disabled by the theory expression
(UNION-THEORIES NIL
(E/D** ((:RULESET GL::SHAPE-SPEC-OBJ-IN-RANGE-BACKCHAIN)))),
but some expansions of their calls may still occur. See :DOC theories-
and-primitives.
ACL2 Warning [Theory] in a computed hint for "Subgoal 2'": The computed
hint
(LIST NIL
'(:COMPUTED-HINT-REPLACEMENT ((AND STABLE-UNDER-SIMPLIFICATIONP #))
:IN-THEORY (UNION-THEORIES NIL (E/D** #))
:DO-NOT-INDUCT T)
STATE)
produced the non-nil result
(:COMPUTED-HINT-REPLACEMENT
((AND STABLE-UNDER-SIMPLIFICATIONP
(LET (#) (CASE-MATCH LAST #))))
:IN-THEORY
(UNION-THEORIES NIL
(E/D** ((:RULESET GL::SHAPE-SPEC-OBJ-IN-RANGE-BACKCHAIN))))
:DO-NOT-INDUCT T).
Regarding this value
(See :DOC set-iprint to be able to see elided values in this message.):
The :EXECUTABLE-COUNTERPART rules for the built-in functions NOT, SYMBOLP,
SYMBOL-PACKAGE-NAME, SYMBOL-NAME, STRINGP, REALPART, RATIONALP, PKG-WITNESS,
PKG-IMPORTS, NUMERATOR, INTERN-IN-PACKAGE-OF-SYMBOL, IMAGPART, IF,
EQUAL, DENOMINATOR, CONS, COERCE, COMPLEX-RATIONALP, COMPLEX, CODE-CHAR,
CHARACTERP, CHAR-CODE, <, UNARY-/, BINARY-* and ACL2-NUMBERP are disabled
by the theory expression
(UNION-THEORIES NIL
(E/D** ((:RULESET GL::SHAPE-SPEC-OBJ-IN-RANGE-BACKCHAIN)))),
but some evaluations of their calls may still occur. See :DOC theories-
and-primitives.
Subgoal 2'
ACL2 Warning [Disable] in ( DEFTHM FAST-LOGCOUNT-32-CORRECT ...):
Forcing has transitioned from enabled to disabled.
See :DOC force.
Subgoal 2''
Subgoal 1
Subgoal 1'
Q.E.D.
Summary
Form: ( DEFTHM FAST-LOGCOUNT-32-CORRECT ...)
Rules: ((:DEFINITION INTEGER-RANGE-P)
(:DEFINITION UNSIGNED-BYTE-P)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EXPT)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART LEN)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE GL::SHAPE-SPEC-OBJ-IN-RANGE-BACKCHAIN-INTEGER-1)
(:TYPE-PRESCRIPTION UNSIGNED-BYTE-P))
Hint-events: ((:BY LOGCOUNT-FOR-GL-CORRECT)
(:CLAUSE-PROCESSOR GL::GLCP)
(:CLAUSE-PROCESSOR REMOVE-FIRST-HYP-CP))
Warnings: Disable, Theory and Non-rec
ACL2 !>>'(END OF DEMO 4)
(END OF DEMO 4)
ACL2 !>>(UBT! 'ISORT-IDENTITY)
14:x(DEFTHM PERM-AP ...)
ACL2 !>>(DEFUN LEQUAL (X Y)
(COND ((ATOM X) (ATOM Y))
((ATOM Y) NIL)
(T (AND (EQUAL (CAR X) (CAR Y))
(LEQUAL (CDR X) (CDR Y))))))
The admission of LEQUAL is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of LEQUAL is described by
the theorem (OR (EQUAL (LEQUAL X Y) T) (EQUAL (LEQUAL X Y) NIL)).
Summary
Form: ( DEFUN LEQUAL ...)
Rules: NIL
LEQUAL
ACL2 !>>(DEFEQUIV LEQUAL)
Subgoal 3
([ A key checkpoint:
Subgoal 3
(LEQUAL X X)
*1 (Subgoal 3) is pushed for proof by induction.
])
Subgoal 2
([ A key checkpoint:
Subgoal 2
(IMPLIES (LEQUAL X Y) (LEQUAL Y X))
Normally we would attempt to prove Subgoal 2 by induction. However,
we prefer in this instance to focus on the original input conjecture
rather than this simplified special case. We therefore abandon our
previous work on this conjecture and reassign the name *1 to the original
conjecture. (See :DOC otf-flg.)
])
Perhaps we can prove *1 by induction. Seven induction schemes are
suggested by this conjecture. Subsumption reduces that number to five.
These merge into one derived induction scheme.
We will induct according to a scheme suggested by (LEQUAL X Z), but
modified to accommodate (LEQUAL Y Z) and (LEQUAL Y X).
These suggestions were produced using the :induction rule LEQUAL.
If we let (:P X Y Z) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ATOM X))
(NOT (ATOM Z))
(NOT (EQUAL (CAR X) (CAR Z))))
(:P X Y Z))
(IMPLIES (AND (NOT (ATOM X))
(NOT (ATOM Z))
(EQUAL (CAR X) (CAR Z))
(:P (CDR X) (CDR Y) (CDR Z)))
(:P X Y Z))
(IMPLIES (AND (NOT (ATOM X)) (ATOM Z))
(:P X Y Z))
(IMPLIES (ATOM X) (:P X Y Z))).
This induction is justified by the same argument used to admit LEQUAL.
Note, however, that the unmeasured variables Y and Z are being instantiated.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.
Subgoal *1/4
Subgoal *1/4'
Splitter note (see :DOC splitter) for Subgoal *1/4' (2 subgoals).
if-intro: ((:DEFINITION LEQUAL))
Subgoal *1/4.2
Subgoal *1/4.2'
Subgoal *1/4.2''
Subgoal *1/4.2'''
Subgoal *1/4.2'4'
Subgoal *1/4.2'5'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/4.2
(IMPLIES (AND (CONSP X)
(CONSP Z)
(NOT (EQUAL (CAR X) (CAR Z))))
(LEQUAL (CDR X) (CDR X)))
*1.1 (Subgoal *1/4.2'5') is pushed for proof by induction.
])
Subgoal *1/4.1
Subgoal *1/4.1'
Subgoal *1/4.1''
Subgoal *1/4.1'''
Subgoal *1/4.1'4'
Subgoal *1/4.1'5'
Subgoal *1/4.1'6'
Subgoal *1/4.1'7'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/4.1
(IMPLIES (AND (CONSP X)
(CONSP Z)
(NOT (EQUAL (CAR X) (CAR Z)))
(CONSP Y)
(EQUAL (CAR X) (CAR Y))
(LEQUAL (CDR X) (CDR Y)))
(LEQUAL (CDR Y) (CDR X)))
*1.2 (Subgoal *1/4.1'7') is pushed for proof by induction.
])
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/2
Subgoal *1/2'
Splitter note (see :DOC splitter) for Subgoal *1/2' (2 subgoals).
if-intro: ((:DEFINITION LEQUAL))
Subgoal *1/2.2
Subgoal *1/2.2'
Subgoal *1/2.2''
Subgoal *1/2.2'''
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2.2
(IMPLIES (AND (CONSP X) (NOT (CONSP Z)))
(LEQUAL (CDR X) (CDR X)))
*1.3 (Subgoal *1/2.2''') is pushed for proof by induction.
])
Subgoal *1/2.1
Subgoal *1/2.1'
Subgoal *1/2.1''
Subgoal *1/2.1'''
Subgoal *1/2.1'4'
Subgoal *1/2.1'5'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(NOT (CONSP Z))
(CONSP Y)
(EQUAL (CAR X) (CAR Y))
(LEQUAL (CDR X) (CDR Y)))
(LEQUAL (CDR Y) (CDR X)))
*1.4 (Subgoal *1/2.1'5') is pushed for proof by induction.
])
Subgoal *1/1
Subgoal *1/1'
So we now return to *1.4, which is
(IMPLIES (LEQUAL X2 Y2) (LEQUAL Y2 X2)).
But the formula above is subsumed by *1.2, which we'll try to prove
later. We therefore regard *1.4 as proved (pending the proof of the
more general *1.2).
Subgoal *1/2.1 COMPLETED!
We next consider *1.3, which is
(LEQUAL X2 X2).
But the formula above is subsumed by *1.1, which we'll try to prove
later. We therefore regard *1.3 as proved (pending the proof of the
more general *1.1).
Subgoal *1/2.2 COMPLETED!
We next consider *1.2, which is
(IMPLIES (LEQUAL X2 Y2) (LEQUAL Y2 X2)).
Subgoal *1.2/5
Subgoal *1.2/5'
Subgoal *1.2/4
Subgoal *1.2/4'
Subgoal *1.2/3
Subgoal *1.2/3'
Subgoal *1.2/2
Subgoal *1.2/2'
Subgoal *1.2/1
Subgoal *1.2/1'
*1.2 is COMPLETED!
Thus key checkpoint Subgoal *1/4.1 is COMPLETED!
We therefore turn our attention to *1.1, which is
(LEQUAL X2 X2).
Subgoal *1.1/3
Subgoal *1.1/2
Subgoal *1.1/2'
Subgoal *1.1/1
Subgoal *1.1/1'
*1.1 and *1 are COMPLETED!
Thus key checkpoints Subgoal *1/4.2 and Goal are COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM LEQUAL-IS-AN-EQUIVALENCE ...)
Rules: ((:COMPOUND-RECOGNIZER BOOLEANP-COMPOUND-RECOGNIZER)
(:DEFINITION ATOM)
(:DEFINITION LEQUAL)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART BOOLEANP)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEQUAL)
(:TYPE-PRESCRIPTION LEQUAL))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION LEQUAL))
Summary
Form: ( MAKE-EVENT (DEFEQUIV-FORM ...))
Rules: NIL
LEQUAL-IS-AN-EQUIVALENCE
ACL2 !>>(DEFCONG LEQUAL LEQUAL (INSERT E X) 2)
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into one derived induction
scheme.
We will induct according to a scheme suggested by (INSERT E X-EQUIV),
but modified to accommodate (INSERT E X) and (LEQUAL X X-EQUIV).
These suggestions were produced using the :induction rules INSERT and
LEQUAL. If we let (:P E X X-EQUIV) denote *1 above then the induction
scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X-EQUIV))
(NOT (LEXORDER E (CAR X-EQUIV)))
(:P E (CDR X) (CDR X-EQUIV)))
(:P E X X-EQUIV))
(IMPLIES (AND (NOT (ENDP X-EQUIV))
(LEXORDER E (CAR X-EQUIV)))
(:P E X X-EQUIV))
(IMPLIES (ENDP X-EQUIV)
(:P E X X-EQUIV))).
This induction is justified by the same argument used to admit INSERT.
Note, however, that the unmeasured variable X is being instantiated.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.
Subgoal *1/4
Subgoal *1/4'
Splitter note (see :DOC splitter) for Subgoal *1/4' (2 subgoals).
if-intro: ((:DEFINITION INSERT)
(:DEFINITION LEQUAL))
Subgoal *1/4.2
Subgoal *1/4.1
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/1
Subgoal *1/1'
*1 is COMPLETED!
Thus key checkpoint Goal is COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM LEQUAL-IMPLIES-LEQUAL-INSERT-2 ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION LEQUAL)
(:DEFINITION NOT)
(:EQUIVALENCE LEQUAL-IS-AN-EQUIVALENCE)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION INSERT)
(:INDUCTION LEQUAL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION INSERT)
(:DEFINITION LEQUAL))
Summary
Form: ( MAKE-EVENT (DEFCONG-FORM ...))
Rules: NIL
LEQUAL-IMPLIES-LEQUAL-INSERT-2
ACL2 !>>(DEFCONG PERM LEQUAL (ISORT X) 1)
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into two derived induction
schemes. However, one of these is flawed and so we are left with one
viable candidate.
We will induct according to a scheme suggested by (ISORT X), but modified
to accommodate (PERM X X-EQUIV).
These suggestions were produced using the :induction rules ISORT and
PERM. If we let (:P X X-EQUIV) denote *1 above then the induction
scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X))
(:P (CDR X) (RM (CAR X) X-EQUIV)))
(:P X X-EQUIV))
(IMPLIES (ENDP X) (:P X X-EQUIV))).
This induction is justified by the same argument used to admit ISORT.
Note, however, that the unmeasured variable X-EQUIV is being instantiated.
When applied to the goal at hand the above induction scheme produces
three nontautological subgoals.
Subgoal *1/3
Subgoal *1/3'
Subgoal *1/3''
Subgoal *1/3'''
Subgoal *1/3'4'
Subgoal *1/3'5'
Subgoal *1/3'6'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/3''
(IMPLIES (AND (CONSP X)
(LEQUAL (ISORT (CDR X))
(ISORT (RM (CAR X) X-EQUIV)))
(MEMB (CAR X) X-EQUIV)
(PERM (CDR X) (RM (CAR X) X-EQUIV)))
(LEQUAL (INSERT (CAR X) (ISORT (CDR X)))
(ISORT X-EQUIV)))
*1.1 (Subgoal *1/3'6') is pushed for proof by induction.
])
Subgoal *1/2
Subgoal *1/2'
Subgoal *1/1
Subgoal *1/1'
So we now return to *1.1, which is
(IMPLIES (MEMB X1 X-EQUIV)
(LEQUAL (INSERT X1 (ISORT (RM X1 X-EQUIV)))
(ISORT X-EQUIV))).
Subgoal *1.1/3
Subgoal *1.1/3'
Splitter note (see :DOC splitter) for Subgoal *1.1/3' (2 subgoals).
if-intro: ((:DEFINITION MEMB) (:DEFINITION RM))
Subgoal *1.1/3.2
Subgoal *1.1/3.1
Subgoal *1.1/3.1'
Subgoal *1.1/3.1''
Subgoal *1.1/3.1'''
Subgoal *1.1/3.1'4'
Subgoal *1.1/3.1'5'
Subgoal *1.1/3.1'6'
*1.1.1 (Subgoal *1.1/3.1'6') is pushed for proof by induction.
Subgoal *1.1/2
Subgoal *1.1/2'
Subgoal *1.1/1
Subgoal *1.1/1'
So we now return to *1.1.1, which is
(IMPLIES (AND (MEMB X1 X-EQUIV2)
(NOT (EQUAL X1 X-EQUIV1)))
(LEQUAL (INSERT X1 (INSERT X-EQUIV1 IT))
(INSERT X-EQUIV1 (INSERT X1 IT)))).
Subgoal *1.1.1/3
Subgoal *1.1.1/3'
Splitter note (see :DOC splitter) for Subgoal *1.1.1/3' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1/3.2
Splitter note (see :DOC splitter) for Subgoal *1.1.1/3.2 (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1/3.2.2
Subgoal *1.1.1/3.2.1
Subgoal *1.1.1/3.1
Subgoal *1.1.1/2
Subgoal *1.1.1/2'
Splitter note (see :DOC splitter) for Subgoal *1.1.1/2' (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1/2.2
Splitter note (see :DOC splitter) for Subgoal *1.1.1/2.2 (4 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1/2.2.4
Subgoal *1.1.1/2.2.3
Subgoal *1.1.1/2.2.2
Subgoal *1.1.1/2.2.1
Subgoal *1.1.1/2.1
Splitter note (see :DOC splitter) for Subgoal *1.1.1/2.1 (8 subgoals).
if-intro: ((:DEFINITION INSERT)
(:DEFINITION LEQUAL))
Subgoal *1.1.1/2.1.8
Subgoal *1.1.1/2.1.8'
Subgoal *1.1.1/2.1.7
Subgoal *1.1.1/2.1.7'
Subgoal *1.1.1/2.1.6
Subgoal *1.1.1/2.1.6'
Subgoal *1.1.1/2.1.5
Subgoal *1.1.1/2.1.5'
Subgoal *1.1.1/2.1.4
Subgoal *1.1.1/2.1.3
Subgoal *1.1.1/2.1.2
Subgoal *1.1.1/2.1.2'
Subgoal *1.1.1/2.1.1
Subgoal *1.1.1/2.1.1'
Subgoal *1.1.1/1
Subgoal *1.1.1/1'
Splitter note (see :DOC splitter) for Subgoal *1.1.1/1' (4 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1.1/1.4
Subgoal *1.1.1/1.3
Subgoal *1.1.1/1.2
Subgoal *1.1.1/1.1
*1.1.1, *1.1 and *1 are COMPLETED!
Thus key checkpoints Subgoal *1/3'' and Goal are COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM PERM-IMPLIES-LEQUAL-ISORT-1 ...)
Rules: ((:CONGRUENCE LEQUAL-IMPLIES-LEQUAL-INSERT-2)
(:DEFINITION ENDP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION LEQUAL)
(:DEFINITION MEMB)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EQUIVALENCE LEQUAL-IS-AN-EQUIVALENCE)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-ANTI-SYMMETRIC)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:INDUCTION ISORT)
(:INDUCTION MEMB)
(:INDUCTION PERM)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION INSERT)
(:TYPE-PRESCRIPTION LEXORDER))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION INSERT)
(:DEFINITION LEQUAL)
(:DEFINITION MEMB)
(:DEFINITION RM))
Summary
Form: ( MAKE-EVENT (DEFCONG-FORM ...))
Rules: NIL
PERM-IMPLIES-LEQUAL-ISORT-1
ACL2 !>>(DEFTHM ISORT-IDEMPOTENT-LEQUAL
(LEQUAL (ISORT (ISORT X)) (ISORT X)))
ACL2 Warning [Double-rewrite] in ( DEFTHM ISORT-IDEMPOTENT-LEQUAL ...):
In a :REWRITE rule generated from ISORT-IDEMPOTENT-LEQUAL, equivalence
relation PERM is maintained at one problematic occurrence of variable
X in the right-hand side, but not at any binding occurrence of X.
Consider replacing that occurrence of X in the right-hand side with
(DOUBLE-REWRITE X). See :doc double-rewrite for more information on
this issue.
Q.E.D.
Summary
Form: ( DEFTHM ISORT-IDEMPOTENT-LEQUAL ...)
Rules: ((:CONGRUENCE PERM-IMPLIES-LEQUAL-ISORT-1)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:REWRITE PERM-ISORT))
Warnings: Double-rewrite
ISORT-IDEMPOTENT-LEQUAL
ACL2 !>>(DEFUN TERMINAL-MARKER (X)
(IF (CONSP X)
(TERMINAL-MARKER (CDR X))
X))
The admission of TERMINAL-MARKER is trivial, using the relation O<
(which is known to be well-founded on the domain recognized by O-P)
and the measure (ACL2-COUNT X). We observe that the type of TERMINAL-MARKER
is described by the theorem (NOT (CONSP (TERMINAL-MARKER X))).
Summary
Form: ( DEFUN TERMINAL-MARKER ...)
Rules: NIL
TERMINAL-MARKER
ACL2 !>>(DEFTHM TERMINAL-MARKER-ISORT
(EQUAL (TERMINAL-MARKER (ISORT X))
(TERMINAL-MARKER X)))
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Two induction schemes are suggested
by this conjecture. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (TERMINAL-MARKER X).
This suggestion was produced using the :induction rules ISORT and
TERMINAL-MARKER. If we let (:P X) denote *1 above then the induction
scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit
TERMINAL-MARKER. When applied to the goal at hand the above induction
scheme produces two nontautological subgoals.
Subgoal *1/2
Subgoal *1/1
Subgoal *1/1'
Subgoal *1/1''
Subgoal *1/1'''
Subgoal *1/1'4'
Subgoal *1/1'5'
([ A key checkpoint while proving *1 (descended from Goal):
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL (TERMINAL-MARKER (ISORT (CDR X)))
(TERMINAL-MARKER (CDR X))))
(EQUAL (TERMINAL-MARKER (INSERT (CAR X) (ISORT (CDR X))))
(TERMINAL-MARKER (CDR X))))
*1.1 (Subgoal *1/1'5') is pushed for proof by induction.
])
So we now return to *1.1, which is
(EQUAL (TERMINAL-MARKER (INSERT X1 IT))
(TERMINAL-MARKER IT)).
Subgoal *1.1/2
Subgoal *1.1/1
Splitter note (see :DOC splitter) for Subgoal *1.1/1 (2 subgoals).
if-intro: ((:DEFINITION INSERT))
Subgoal *1.1/1.2
Subgoal *1.1/1.1
*1.1 and *1 are COMPLETED!
Thus key checkpoints Subgoal *1/1' and Goal are COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM TERMINAL-MARKER-ISORT ...)
Rules: ((:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION TERMINAL-MARKER)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION INSERT)
(:INDUCTION ISORT)
(:INDUCTION TERMINAL-MARKER)
(:REWRITE CDR-CONS))
Splitter rules (see :DOC splitter):
if-intro: ((:DEFINITION INSERT))
TERMINAL-MARKER-ISORT
ACL2 !>>(DEFTHM LEQUAL-WITH-SAME-TERMINAL-MARKERS-ARE-EQUAL
(IMPLIES (AND (EQUAL (TERMINAL-MARKER A)
(TERMINAL-MARKER B))
(LEQUAL A B))
(EQUAL A B))
:RULE-CLASSES NIL)
*1 (the initial Goal, a key checkpoint) is pushed for proof by induction.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into one derived induction
scheme.
We will induct according to a scheme suggested by (TERMINAL-MARKER B),
but modified to accommodate (LEQUAL A B).
These suggestions were produced using the :induction rules LEQUAL and
TERMINAL-MARKER. If we let (:P A B) denote *1 above then the induction
scheme we'll use is
(AND (IMPLIES (NOT (CONSP B)) (:P A B))
(IMPLIES (AND (CONSP B) (:P (CDR A) (CDR B)))
(:P A B))).
This induction is justified by the same argument used to admit
TERMINAL-MARKER. Note, however, that the unmeasured variable A is
being instantiated. When applied to the goal at hand the above induction
scheme produces four nontautological subgoals.
Subgoal *1/4
Subgoal *1/3
Subgoal *1/2
Subgoal *1/1
*1 is COMPLETED!
Thus key checkpoint Goal is COMPLETED!
Q.E.D.
Summary
Form: ( DEFTHM LEQUAL-WITH-SAME-TERMINAL-MARKERS-ARE-EQUAL ...)
Rules: ((:DEFINITION LEQUAL)
(:DEFINITION TERMINAL-MARKER)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEQUAL)
(:INDUCTION TERMINAL-MARKER))
LEQUAL-WITH-SAME-TERMINAL-MARKERS-ARE-EQUAL
ACL2 !>>(DEFTHM ISORT-IDEMPOTENT
(EQUAL (ISORT (ISORT X)) (ISORT X))
:HINTS
(("Goal" :USE (:INSTANCE LEQUAL-WITH-SAME-TERMINAL-MARKERS-ARE-EQUAL
(A (ISORT (ISORT X)))
(B (ISORT X))))))
ACL2 Warning [Subsume] in ( DEFTHM ISORT-IDEMPOTENT ...): A newly
proposed :REWRITE rule generated from ISORT-IDEMPOTENT probably subsumes
the previously added :REWRITE rule ISORT-IDEMPOTENT-LEQUAL, in the
sense that the new rule will now probably be applied whenever the old
rule would have been.
Goal'
Q.E.D.
Summary
Form: ( DEFTHM ISORT-IDEMPOTENT ...)
Rules: ((:CONGRUENCE PERM-IMPLIES-LEQUAL-ISORT-1)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART TAU-SYSTEM)
(:REWRITE PERM-ISORT)
(:REWRITE TERMINAL-MARKER-ISORT))
Hint-events: ((:USE LEQUAL-WITH-SAME-TERMINAL-MARKERS-ARE-EQUAL))
Warnings: Subsume
ISORT-IDEMPOTENT
ACL2 !>>Bye.
|