File size: 455,299 Bytes
7ec75e2 | 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 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 | {
"CO3005-syllabus-info-0000": {
"id": "CO3005-syllabus-info-0000",
"text": "Course: Principles_of_Programming_Languages (ID: CO3005)\nCredits: 4\nSemester: 20232",
"metadata": {
"doc_type": "syllabus",
"course_id": "CO3005",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:14:53+07:00"
}
},
"CO3005-syllabus-assessments-0000": {
"id": "CO3005-syllabus-assessments-0000",
"text": "Lectures: 45 hours. Evaluation: Midterm Exam (20%), None (40%),\nTutorial: Weight: 10%.\nLabs/Practices:\nProjects: 45 hours. Weight: 30%.\nSelf-study: 90 hours.\nOthers: 20 hours.",
"metadata": {
"doc_type": "syllabus",
"course_id": "CO3005",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:14:53+07:00"
}
},
"CO3005-syllabus-raw-0000": {
"id": "CO3005-syllabus-raw-0000",
"text": "1/25/24.1:07PM DCMH.CO3005_Principles of Programming Languages HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY BK TRU'ONG DAI HOC BACH KHOA - DHQG-HCM TP.HCM DCMH.C03005.8.1 Dai Hoc Qu6c Gia TP.HCM Vietnam National University - HCMC Truong Dai Hoc Bach Khoa Ho Chi Minh City University of Technology Khoa Khoa hoc va Ky thuat Mäy tinh Faculty of Computer Science and Engineering DE CUONG HOC PHAN Course Syllabus 1. Thong tin vé hoc phan (Course information) 1.1. Thng tin tong quan (General information) - Tén hoc phan: Nguyén ly Ngon ngu Lap trinh ( Principles of Programming Languages) - Ma hoc phan (Course ID) : CO3005 - S6 tin chi (Credits): 4 (ETCS: 8 ) - Hoc ky äp dung (Applied from semester) : 20232 - Tó chüc hoc phan (Course format): Hinh thuc hoc tap Só tiét/gi Só tín chi Ghi chu (Teaching/study type) (Hours) (Credits) (Notes) Ly thuyét (LT) 45 3 (Lectures) Thao luan (ThL)/Thuc hanh tai lóp (TH) (Tutorial) Thi nghiém (TNg)/Thuc tap xuong (TT) (Labs/Practices) Bai tap l6n (BTL)/D6 án (DA) 45 1 (Projects) Tu hoc (Self-study) 90 Khac (Others) 20 Tóng cong (Total) 200 4 (Ghi chü: Cau hinh món hoc mau LT- 4b) - Ty lé dänh gia va hinh thúc kiém tra/thi (Evaluation form & ratio) Hinh thúc danh gia Ty le Hinh thüc Thoi gian (Evaluation type) (Ratio) (Format) (Duration) Thao luan (ThL)/Thuc hanh tai l6p (TH) 10% (Tutorial) Thi nghiém (Labs/Practices) Bai tap l6n (BTL)/D6 än (",
"metadata": {
"doc_type": "syllabus",
"course_id": "CO3005",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:14:53+07:00"
}
},
"CO3005-syllabus-raw-0001": {
"id": "CO3005-syllabus-raw-0001",
"text": ") Thao luan (ThL)/Thuc hanh tai l6p (TH) 10% (Tutorial) Thi nghiém (Labs/Practices) Bai tap l6n (BTL)/D6 än (DA) 30% (Projects) Kiém tra 20% Trac nghiém (cham mäy) 60 phút (minutes) (Midterm Exam) (Multiple choice (MCQ)) 268 Ly Thuong Kiét,Phuong 14,Quan 10,TP.HCM 268 Ly Thuong Kiet St., Ward 14, Dist. 10, Ho Chi Minh City, Vietnam Dién thoai: 028 3864 7256. www.hcmut.edu.vn Phone: 028 3864 7256. www.hcmut.edu.vr about:blank 1/9",
"metadata": {
"doc_type": "syllabus",
"course_id": "CO3005",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:14:53+07:00"
}
},
"-syllabus-info-0000": {
"id": "-syllabus-info-0000",
"text": "Course: Principles_of_Programming_Languages (ID: )",
"metadata": {
"doc_type": "syllabus",
"course_id": "",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_009.png",
"page_index": 8,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:15:54+07:00"
}
},
"-syllabus-raw-0000": {
"id": "-syllabus-raw-0000",
"text": "1/25/24, 1:07 PM DCMH.CO3005_Principles of Programming Languages HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY BK TRU'ONG DAI HOC BACH KHOA - DHQG-HCM TP.HCM DCMH.C03005.8.1 Bui Noi dung (Content) Hoat dong day va hoc (Lecturing) (Session) 9.4. Control abstraction 9. 5. Parameter passing mechanisms Self-study requirements for students: 12 hours 10 Chuong 10. Sinh ma L.0.3.1 [A.0.9 , A.0.8 ,A.0.2 ] 10.1. May JVM o Lec: - Cho sinh vién lam bai tap online va 10.2. Ma Jasmin giái thich 10.3. Sinh ma Jasmin cho may JVM (- Have students do the exercises online Yéu cau tu hoc d/v sinh vién: 12 gi and explain) o Stu: - Sinh vién xem truóc bai giang truóc Chapter 10. Code Generation khi lén l6p - Cau hói va bai tap lap trinh 10.1. Machine JVM trén l6p theo nh6m 10.2. Code Jasmin (- Students preview the lecture before 10.3. Generate Jasmin code for the JVM going to class - Group class programming Self-study requirements.for students: 12 hours questions and exercises) 7. Yéu cau khac vé hoc phan (Other course requirements and expectations) 8. Bien soan va cap nhat dé cuong (Editing information) - Dé cuong duoc bien soan väo nam hoc hoc ky (Syllabus edited in year-semester): 20232 - Dé cuong duoc chinh süa lan thú (Editing version) : DCMH.CO3005.8.1 - Noi dung duoc chinh sura, cap nhat, thay dói ° län gan nhät (The latest editing content): -- Tp.H6 Chi Minh, ngay 25 thäng 1 nam 2024 HCM City, January 25 2024 TRUONG KHOA CHU NHIEM BO MON CB PHU TRACH LAP DE CU",
"metadata": {
"doc_type": "syllabus",
"course_id": "",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_009.png",
"page_index": 8,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:15:54+07:00"
}
},
"-syllabus-raw-0001": {
"id": "-syllabus-raw-0001",
"text": "Tp.H6 Chi Minh, ngay 25 thäng 1 nam 2024 HCM City, January 25 2024 TRUONG KHOA CHU NHIEM BO MON CB PHU TRACH LAP DE CUONG (Dean) Head of Department) (Lecturer in-charge) 268 Ly Thung Kiét, Phung 14,Quan 10,TP.HCM 268 Ly Thuong Kiet St., Ward 14, Dist. 10, Ho Chi Minh City, Vietnam Dién thoai: 028 3864 7256. www.hcmut.edu.vn Phone: 028 3864 7256. www.hcmut.edu.vn about:blank 9/9",
"metadata": {
"doc_type": "syllabus",
"course_id": "",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_009.png",
"page_index": 8,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:15:54+07:00"
}
},
"-syllabus-raw-0002": {
"id": "-syllabus-raw-0002",
"text": "vién: 12 gi khi lén l6p - Cau hói va bai tap lap trinh trén 16p theo nh6m Chapter 9. Control Structures (- Students preview the lecture before 9.1. Expression going to class - Group class programming Q 2 Condition statement auostions andororcisos) 268 Ly Thuong Kiet,Phung 14,Quan 10,TP.HCM 268 Ly Thuong Kiet St., Ward 14, Dist. 10, Ho Chi Minh City, Vietnam Dién thoai: 028 3864 7256. www.hcmut.edu.vn Phone: 028 3864 7256. www.hcmut.edu.vr about:blank 8/9",
"metadata": {
"doc_type": "syllabus",
"course_id": "",
"source_file": "/mnt/d/Project_and_Assignment/AI_project/data_cvt/CO3005_Principles_of_Programming_Languages/Syllabus/slide_008.png",
"page_index": 7,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-12T20:15:49+07:00"
}
},
"CO3005-chapter-0-slide-000-0000": {
"id": "CO3005-chapter-0-slide-000-0000",
"text": "Introduction Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam 08,2017 Dr. Nguyen Hua Phung Introduction 1/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:20+07:00"
}
},
"CO3005-chapter-0-slide-001-0000": {
"id": "CO3005-chapter-0-slide-001-0000",
"text": "Outline Introduction Reasons to study Concepts of Programming Languages Language Evaluation Criteria Language Design Implementation Methods Dr. Nguyen Hua Phung Introduction 2/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_002.png",
"page_index": 1,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:22+07:00"
}
},
"CO3005-chapter-0-slide-002-0000": {
"id": "CO3005-chapter-0-slide-002-0000",
"text": "Lecturer In Charge o My name: Nguyen Hua Phung Email: nhphung@hcmut.edu.vn Office hour: Office hour: BKeL Facebook: Dr. Nguyen Hua Phung Introduction 4/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_003.png",
"page_index": 2,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:23+07:00"
}
},
"CO3005-chapter-0-slide-003-0000": {
"id": "CO3005-chapter-0-slide-003-0000",
"text": "References Concepts of Programming Languages, Robert W. Sebesta,12th edition, Pearson, 2019. Programming Languages: Principles And Paradigms, Maurizio Gabbrielli and Simone Martini, Springer, 2006. Programming Languages: Principles and Practices, Kenneth C. Louden, Thomson Brooks/Cole, 2003 Ngon Ngu Lap Trinh: Cac nguyen ly va mo hinh, Cao Hoang Tru, 2004. Dr. Nguyen Hua Phung Introduction 5/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_004.png",
"page_index": 3,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:25+07:00"
}
},
"CO3005-chapter-0-slide-004-0000": {
"id": "CO3005-chapter-0-slide-004-0000",
"text": "Assessment Tutorial/Lab/Online: 10% Assignment: 30% Midterm: 20% Final: 40% Note: Assignment is calculated by the following formula. A* B Assignment = 2 * A + B where A is from some given project and B is from some questions in midterm or final Dr. Nguyen Hua Phung Introduction 6/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_005.png",
"page_index": 4,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:27+07:00"
}
},
"CO3005-chapter-0-slide-005-0000": {
"id": "CO3005-chapter-0-slide-005-0000",
"text": "Objectives After complete this subject, students are able to: o describe formally lexicon and grammar of a programming language describe and explain some mechanism of a programming language implement a interpreter/compiler for a simple programming language Dr. Nguyen Hua Phung Introduction 8/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_006.png",
"page_index": 5,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:30+07:00"
}
},
"CO3005-chapter-0-slide-006-0000": {
"id": "CO3005-chapter-0-slide-006-0000",
"text": "Benefits of Studying Increased capacity to express idea Improved background for choosing appropriate languages Increased ability to learn new languages Better understanding of the significance of implementation Better use of languages that are already knowr o Overall advancement of computing Dr. Nguyen Hua Phung Introduction 9/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_007.png",
"page_index": 6,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:32+07:00"
}
},
"CO3005-chapter-0-slide-007-0000": {
"id": "CO3005-chapter-0-slide-007-0000",
"text": "Programming Domains Scientific Applications Fortran, ALGOL 60 Business Applications COBOL Artificial Intelligence LISP, Prolog Systems Programming PL/S,BLISS, Extended ALGOL, and O Web Software XHTML, JavaScript, PHP Dr. Nguyen Hua Phung Introduction 11/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_008.png",
"page_index": 7,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:33+07:00"
}
},
"CO3005-chapter-0-slide-008-0000": {
"id": "CO3005-chapter-0-slide-008-0000",
"text": "Language Characteristics Simplicity Orthogonality Support of abstraction (Control, Data) Safety Dr. Nguyen Hua Phung Introduction 12/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_009.png",
"page_index": 8,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:35+07:00"
}
},
"CO3005-chapter-0-slide-009-0000": {
"id": "CO3005-chapter-0-slide-009-0000",
"text": "Evaluation Readability Writability Reliability Cost Dr. Nguyen Hua Phung Introduction 13/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_010.png",
"page_index": 9,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:36+07:00"
}
},
"CO3005-chapter-0-slide-010-0000": {
"id": "CO3005-chapter-0-slide-010-0000",
"text": "nfluences on Language Design o Computer Architecture Von Neumann o Programming Methodologies Imperative o Machine-based Procedural o Declarative o Logic Functional o Constraint o Query-based Object-Oriented Dr. Nguyen Hua Phung Introduction 15/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_011.png",
"page_index": 10,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:38+07:00"
}
},
"CO3005-chapter-0-slide-011-0000": {
"id": "CO3005-chapter-0-slide-011-0000",
"text": "Computer Architecture Intluence Well-known computer architecture: Von Neumann Imperative languages, most dominant, because of von Neumann computers Data and programs stored in memory Memory is separate from CPU Instructions and data are piped from memory to CPU Basis for imperative languages Variables model memory cells Assignment statements model writing to memory cell Iteration is efficient Dr. Nguyen Hua Phung Introduction 16/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_012.png",
"page_index": 11,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:40+07:00"
}
},
"CO3005-chapter-0-slide-012-0000": {
"id": "CO3005-chapter-0-slide-012-0000",
"text": "Programming Methodologies lnfluences 1950s and early 1960s: Simple applications; worry about machine efficiency Late 1960s: Efficiency became important; readability better control structures Structured programming Top-down design and step-wise refinement Late 1970s: Process-oriented to data-oriented o data abstraction Middle 1980s: Object-oriented programming o Data abstraction + inheritance + polymorphism Dr. Nguyen Hua Phung Introduction 17/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_013.png",
"page_index": 12,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:42+07:00"
}
},
"CO3005-chapter-0-slide-013-0000": {
"id": "CO3005-chapter-0-slide-013-0000",
"text": "Language Paradigms Imperative (C, Pascal) o Central features are variables, assignment statements, and iteration Functional (LISP, Scheme, Haskel, Ocaml, Scala) Main means of making computations is by applying functions to given parameters o Logic (Prolog) Rule-based (rules are specified in no particular order) Object-oriented (Java, C++, Scala) Data abstraction, inheritance, late binding Markup (XHTML,XML) o New; not a programming per se, but used to specify the layout of information in Web documents Dr. Nguyen Hua Phung Introduction 18/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_014.png",
"page_index": 13,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:44+07:00"
}
},
"CO3005-chapter-0-slide-014-0000": {
"id": "CO3005-chapter-0-slide-014-0000",
"text": "Language Design Trade-Offs Reliability vs. cost of execution o Conflicting criteria . Example: Java demands all references to array elements be checked for proper indexing but that leads to increased execution costs Readability vs. writability Another conflicting criteria Example: APL provides many powerful operators (and a large number of new symbols), allowing complex computations to be written in a compact program but at the cost of poor readability Writability (flexibility) vs. reliability o Another conflicting criteria o Example: C++ pointers are powerful and very flexible but not reliably used Dr. Nguyen Hua Phung Introduction 19/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_015.png",
"page_index": 14,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:47+07:00"
}
},
"CO3005-chapter-0-slide-015-0000": {
"id": "CO3005-chapter-0-slide-015-0000",
"text": "mplementation Methods Compilation Programs are entirely translated into machine language and then executed Pure Interpretation Programs are translated and executed line-by-line Hybrid Implementation Systems A compromise between compilers and pure interpreters Just-in-time Compiler A compiler inside an interpreter compiles just hot methods Dr. Nguyen Hua Phung Introduction 21/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_016.png",
"page_index": 15,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:50+07:00"
}
},
"CO3005-chapter-0-slide-016-0000": {
"id": "CO3005-chapter-0-slide-016-0000",
"text": "mplementation Methods Source - ( Compiler Execution Result Data Source Interpreter Result Data Source Compiler Interpreter Result Data Dr. Nguyen Hua Phung Introduction 22/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_017.png",
"page_index": 16,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:52+07:00"
}
},
"CO3005-chapter-0-slide-017-0000": {
"id": "CO3005-chapter-0-slide-017-0000",
"text": "Compilation Phases source program lexical analyzer syntax analyzer 4 front end semantic analyzer intermediate code generator code optimizer back end code generator target program Dr. Nguyen Hua Phung Introduction 24/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_018.png",
"page_index": 17,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:54+07:00"
}
},
"CO3005-chapter-0-slide-018-0000": {
"id": "CO3005-chapter-0-slide-018-0000",
"text": "Related Programs o Preprocessor Assembler Linker Loader Debugger Editor Dr. Nguyen Hua Phung Introduction 25/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_019.png",
"page_index": 18,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:56+07:00"
}
},
"CO3005-chapter-0-slide-019-0000": {
"id": "CO3005-chapter-0-slide-019-0000",
"text": "Summary What are still in your mind? Dr. Nguyen Hua Phung Introduction 26/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_0/slide_020.png",
"page_index": 19,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:56+07:00"
}
},
"CO3005-chapter-1-slide-020-0000": {
"id": "CO3005-chapter-1-slide-020-0000",
"text": "Case Study: Python Introduction Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam 08,2020 Dr. Nguyen Hua Phung Case Study:Python 1/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_001.png",
"page_index": 20,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:15:58+07:00"
}
},
"CO3005-chapter-1-slide-021-0000": {
"id": "CO3005-chapter-1-slide-021-0000",
"text": "ntroduction popular programming language created by Guido van Rossum, released in 1991. used in many areas: web, software, big data, system scripting,... originally implemented in hybrid model readability: new line to complete a command indentation to define scope static scoping and dynamically typed Dr. Nguyen Hua Phung Case Study: Python 2/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_002.png",
"page_index": 21,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:00+07:00"
}
},
"CO3005-chapter-1-slide-022-0000": {
"id": "CO3005-chapter-1-slide-022-0000",
"text": "Example C = 3 def gt(n) : if (n 0 or n return 1 else : return n * gt(n-1) print(gt(c)) def foo(a): return a * c print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 3/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_003.png",
"page_index": 22,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:02+07:00"
}
},
"CO3005-chapter-1-slide-023-0000": {
"id": "CO3005-chapter-1-slide-023-0000",
"text": "Example C = 3 def gt(n) : if (n == 0 or n == 1 return main 1 else : c 3 return n + gt(n-1) gt > code of gt print(gt(c)) def foo(a): return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_004.png",
"page_index": 23,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:05+07:00"
}
},
"CO3005-chapter-1-slide-024-0000": {
"id": "CO3005-chapter-1-slide-024-0000",
"text": "Example C = 3 def gt(n) : i f (n == 0 or n == 1 return 1 main else : c 3 return n + gt(n-1) gt > code of gt print(gt(c)) def foo(a): return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_005.png",
"page_index": 24,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:08+07:00"
}
},
"CO3005-chapter-1-slide-025-0000": {
"id": "CO3005-chapter-1-slide-025-0000",
"text": "Example C = 3 def gt(n) : gt if (n == 0 or n == 1) : n return 1 else : rv return gt(n-1) main n * print(gt(c)) C 3 def foo(a): gt > code of gt return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_006.png",
"page_index": 25,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:12+07:00"
}
},
"CO3005-chapter-1-slide-026-0000": {
"id": "CO3005-chapter-1-slide-026-0000",
"text": "Example gt C = 3 n 2 def gt(n) : if (n == 0 or n == 1) : rv return 1 gt else : n return n * gt(n-1) rv print(gt(c)) main def foo(a): c 3 return a * C print(foo(2)) gt > code of gt Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_007.png",
"page_index": 26,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:15+07:00"
}
},
"CO3005-chapter-1-slide-027-0000": {
"id": "CO3005-chapter-1-slide-027-0000",
"text": "Example gt n 1 C = 3 rv def gt(n): gt if (n == 0 or n 1) : == n 2 return 1 else : rv return n * gt(n-1) gt print(gt(c)) n def foo(a): rv return a * C main print(foo(2)) c 3 gt > code of gt Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_008.png",
"page_index": 27,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:19+07:00"
}
},
"CO3005-chapter-1-slide-028-0000": {
"id": "CO3005-chapter-1-slide-028-0000",
"text": "Example gt n 1 C = 3 rv def gt(n): gt if (n == 0 or n == 1) : n 2 return 1 else : rv return n * gt(n-1) gt print(gt(c)) n def foo(a): rv return a * C main print(foo(2)) c 3 gt > code of gt Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_009.png",
"page_index": 28,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:22+07:00"
}
},
"CO3005-chapter-1-slide-029-0000": {
"id": "CO3005-chapter-1-slide-029-0000",
"text": "Example gt C = 3 n 2 def gt(n) : if (n == 0 or n == 1) : rv return 1 gt else : n return n * gt(n-1) rv print(gt(c)) main def foo(a): c 3 return a * C print(foo(2)) gt > code of gt Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_010.png",
"page_index": 29,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:25+07:00"
}
},
"CO3005-chapter-1-slide-030-0000": {
"id": "CO3005-chapter-1-slide-030-0000",
"text": "Example C = 3 def gt(n) : gt if (n == 0 or n == 1) : n return 1 rv 6 else : return n * gt(n-1) main print(gt(c)) C 3 def foo(a): gt > code of gt return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_011.png",
"page_index": 30,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:29+07:00"
}
},
"CO3005-chapter-1-slide-031-0000": {
"id": "CO3005-chapter-1-slide-031-0000",
"text": "Example C = 3 def gt(n) : if (n == 0 or n 1 : print == return 1 6 else : main return n + gt(n-1) c 3 print(gt(c)) gt > code of gt def foo(a): return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_012.png",
"page_index": 31,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:32+07:00"
}
},
"CO3005-chapter-1-slide-032-0000": {
"id": "CO3005-chapter-1-slide-032-0000",
"text": "Example C = 3 def gt(n) : if (n == 0 or n == 1 main return 1 c 3 else : gt code of gt return n gt(n-1) 1 + print(gt(c)) foo > code of foo def foo(a): return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_013.png",
"page_index": 32,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:35+07:00"
}
},
"CO3005-chapter-1-slide-033-0000": {
"id": "CO3005-chapter-1-slide-033-0000",
"text": "Example C = 3 def gt(n) : if (n == 0 or n == 1 main return 1 c 3 else : gt code of gt return n gt(n-1) 1 + print(gt(c)) foo > code of foo def foo(a): return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_014.png",
"page_index": 33,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:38+07:00"
}
},
"CO3005-chapter-1-slide-034-0000": {
"id": "CO3005-chapter-1-slide-034-0000",
"text": "Example C = 3 foo def gt(n) : if (n == 1) : a 2 0 or n == return 1 rv else : main return n + gt(n-1) c 3 print(gt(c)) gt > code of gt def foo(a): foo > code of foo return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_015.png",
"page_index": 34,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:42+07:00"
}
},
"CO3005-chapter-1-slide-035-0000": {
"id": "CO3005-chapter-1-slide-035-0000",
"text": "Example C = 3 foo def gt(n) : if (n == 1 : a 2 0 or n == return 1 rv 6 else : main return n * gt(n-1) c 3 print(gt(c)) gt > code of gt def foo(a): foo > code of foo return a * c print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_016.png",
"page_index": 35,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:45+07:00"
}
},
"CO3005-chapter-1-slide-036-0000": {
"id": "CO3005-chapter-1-slide-036-0000",
"text": "Example C = 3 def gt(n) : print if (n == 0 or n 6 return 1 main else : c 3 return n + gt(n-1) print(gt(c)) gt > code of gt def foo(a): foo > code of foo return a * C print(foo(2)) Dr. Nguyen Hua Phung Case Study:Python 4/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_017.png",
"page_index": 36,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:47+07:00"
}
},
"CO3005-chapter-1-slide-037-0000": {
"id": "CO3005-chapter-1-slide-037-0000",
"text": "Basic Things Variables: Like variables in C++ [a-zA-Z 1[a-zA-Z0-9 1* case-sensitive keep a pointer to an object declared by an assigment to the variable Comments: Line comment: # Block comment: 11I111 111111 Dr. Nguyen Hua Phung Case Study:Python 5/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_018.png",
"page_index": 37,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:50+07:00"
}
},
"CO3005-chapter-1-slide-038-0000": {
"id": "CO3005-chapter-1-slide-038-0000",
"text": "Statements Assignments: o a = 23 a,b = b,a (swap) a = b = c = 23 pass statement: like empty statement in C++ if statement: use indentation for sub-statements if <exp>: <stmt-list > (elif <exp>: <stmt-list >)* (else : <stmt-list >)? no dangling-else Dr. Nguyen Hua Phung Case Study:Python 6/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_019.png",
"page_index": 38,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:52+07:00"
}
},
"CO3005-chapter-1-slide-039-0000": {
"id": "CO3005-chapter-1-slide-039-0000",
"text": "Loop Statements while: loop when the condition is true while <exp>: <stmt-list > [else : <stmt-list >1 else block is executed when <exp> becomes false o for: iterates over a sequence for <var> in <sequence>: <stmt-list > [else : <stmt-list >1 else block is executed after iterating all elements of <sequence> break: like C++ => terminating the loop continue:like C++ => ignoring the rest of the <stmt-list> Dr. Nguyen Hua Phung Case Study: Python 7/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_020.png",
"page_index": 39,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:54+07:00"
}
},
"CO3005-chapter-1-slide-040-0000": {
"id": "CO3005-chapter-1-slide-040-0000",
"text": "Example for x in range(1,11): if (x == 8): break print(x) else: print(\"loop, full\") Dr. Nguyen Hua Phung Case StudyPython 8/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_021.png",
"page_index": 40,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:56+07:00"
}
},
"CO3005-chapter-1-slide-041-0000": {
"id": "CO3005-chapter-1-slide-041-0000",
"text": "Functions User-defined function: def <function name>(<parameters>) : <stmt-list> Dr. Nguyen Hua Phung Case Study:Python 9/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_022.png",
"page_index": 41,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:57+07:00"
}
},
"CO3005-chapter-1-slide-042-0000": {
"id": "CO3005-chapter-1-slide-042-0000",
"text": "Functions User-defined function: def <function name>(<parameters>) : <stmt-list> o Example def giaithua(n) : if n == 0 or n == 1: return 1 else: return n * giaitthua(n-1) Dr. Nguyen Hua Phung Case Study:Python 9/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_023.png",
"page_index": 42,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:16:59+07:00"
}
},
"CO3005-chapter-1-slide-043-0000": {
"id": "CO3005-chapter-1-slide-043-0000",
"text": "Functions User-defined function: def <function name>(<parameters>) : <stmt-list> o Example def giaithua(n) : if n == 0 or n == 1: return 1 else: return n * giaitthua(n-1) Built-in functions or libraries: import <module> from <module> import <items> from <module> import * Dr. Nguyen Hua Phung Case Study:Python 9/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_024.png",
"page_index": 43,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:01+07:00"
}
},
"CO3005-chapter-1-slide-044-0000": {
"id": "CO3005-chapter-1-slide-044-0000",
"text": "Functions o User-defined function: def <function name>(<parameters>) : <stmt-list> o Example def giaithua(n) : if n == 0 or n == 1 : return 1 else: return n * giaitthua(n-1) Built-in functions or libraries: import <module> from <module> import <items> from <module> import * Example import functools functools.reduce(lambda x,y:x + y,[1,2,3] Dr. Nguyen Hua Phung Case Study: Python 9/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_025.png",
"page_index": 44,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:03+07:00"
}
},
"CO3005-chapter-1-slide-045-0000": {
"id": "CO3005-chapter-1-slide-045-0000",
"text": "References I [1] Python Tutorial, http: w3schools.com/python,10 08 2020 [2] Python Programming Language, https ://www . geeksforgeeks.org/python-programming-language/. 1008 2020. [3] Python Tutorial, https://www.tutorialspoint.com/python,10 082020 [4] Introduction to Python 3, https://realpython.com/python-introduction/,1008 2020. Dr. Nguyen Hua Phung Case Study:Python 10/1",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_1/slide_026.png",
"page_index": 45,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:05+07:00"
}
},
"CO3005-chapter-2-slide-046-0000": {
"id": "CO3005-chapter-2-slide-046-0000",
"text": "Lexical Analysis Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam 08,2016 Dr. Nguyen Hua Phung Lexical Analysis 1/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_001.png",
"page_index": 46,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:06+07:00"
}
},
"CO3005-chapter-2-slide-047-0000": {
"id": "CO3005-chapter-2-slide-047-0000",
"text": "Outline ntroduction Roles Implementation Use ANTLR to generate Lexer Dr. Nguyen Hua Phung Lexical Analysis 2/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_002.png",
"page_index": 47,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:08+07:00"
}
},
"CO3005-chapter-2-slide-048-0000": {
"id": "CO3005-chapter-2-slide-048-0000",
"text": "Compilation Phases source program lexical analyzer syntax analyzer 4 front end semantic analyzer intermediate code generator code optimizer back end code generator target program Dr. Nguyen Hua Phung Lexical Analysis 4/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_003.png",
"page_index": 48,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:10+07:00"
}
},
"CO3005-chapter-2-slide-049-0000": {
"id": "CO3005-chapter-2-slide-049-0000",
"text": "Lexical Analysis Like a word extractor in= i n = in o Like a spell checker I ogog to socholsochol Like a classification 1 am a student pronoun verb article noun Dr. Nguyen Hua Phung Lexical Analysis 6/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_004.png",
"page_index": 49,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:12+07:00"
}
},
"CO3005-chapter-2-slide-050-0000": {
"id": "CO3005-chapter-2-slide-050-0000",
"text": "Lexical Analysis Roles ldentify lexemes: substrings of the source program that belong to a grammar unit Return tokens: a lexical category of lexemes Ignore spaces such as blank, newline, tab Record the position of tokens that are used in next phases Dr. Nguyen Hua Phung Lexical Analysis 7/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_005.png",
"page_index": 50,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:13+07:00"
}
},
"CO3005-chapter-2-slide-051-0000": {
"id": "CO3005-chapter-2-slide-051-0000",
"text": "Example on Lexeme and Token e S u + 0 ldsum - value / 100; Lexemes Kind of Tokens result IDENT = ASSIGN OP oldsum IDENT SUBSTRACT OP value IDENT / DlV OP 100 INT LIT . SEMICOLON 7 Dr. Nguyen Hua Phung Lexical Analysis 8/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_006.png",
"page_index": 51,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:16+07:00"
}
},
"CO3005-chapter-2-slide-052-0000": {
"id": "CO3005-chapter-2-slide-052-0000",
"text": "How to build a lexical analyzer? How to build a lexical analysis for English? o 65000 words Simply build a dictionary: {(I,pronoun);(We,pronoun);(am,verb),...} Extract, search, compare But for a programming language? o How many words? o Identifiers: abc, cab, Abc, aBc, cAb, .. Integers: 1, 10, 120, 20, 210, ... Too many words to build a dictionary, so how? o Apply rules for each kind of word (token) Dr. Nguyen Hua Phung Lexical Analysis 11/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_007.png",
"page_index": 52,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:18+07:00"
}
},
"CO3005-chapter-2-slide-053-0000": {
"id": "CO3005-chapter-2-slide-053-0000",
"text": "Rule Representations o Finite Automata o Deterministic Finite Automata o Nondeterministic Finite Automata o Regular Expressions Dr. Nguyen Hua Phung Lexical Analysis 12/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_008.png",
"page_index": 53,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:20+07:00"
}
},
"CO3005-chapter-2-slide-054-0000": {
"id": "CO3005-chapter-2-slide-054-0000",
"text": "Finite Automata a a a .. Input Tape Head (Read only) 93 92 qn q1 qo Finite Control Dr. Nguyen Hua Phung Lexical Analysis 13/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_009.png",
"page_index": 54,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:22+07:00"
}
},
"CO3005-chapter-2-slide-055-0000": {
"id": "CO3005-chapter-2-slide-055-0000",
"text": "State Diagram a a b start 9o 91 b Input: abaabb Current state Read New State a qo b 91 91 a 91 91 a 91 91 b 00 b 91 Dr. Nguyen Hua Phung Lexical Analysis 14/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_010.png",
"page_index": 55,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:25+07:00"
}
},
"CO3005-chapter-2-slide-056-0000": {
"id": "CO3005-chapter-2-slide-056-0000",
"text": "Deterministic Finite Automata Definition Deterministic Finite Automaton(DFA) is a 5-tuple M =(K,,,s,F) where o K = a finite set of state = alphabet s E K = the initial state F C K = the set of final states o = a transition function from K x to K Dr. Nguyen Hua Phung Lexical Analysis 15/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_011.png",
"page_index": 56,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:27+07:00"
}
},
"CO3005-chapter-2-slide-057-0000": {
"id": "CO3005-chapter-2-slide-057-0000",
"text": "Example M =(K,,,s,F) where K={qo,q1} Z={a,b} s=90 F={q1} and K (K,) a 9o b 91 91 a 91 91 b 9o a a b V start 91 b Dr. Nguyen Hua Phung Lexical Analysis 16/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_012.png",
"page_index": 57,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:30+07:00"
}
},
"CO3005-chapter-2-slide-058-0000": {
"id": "CO3005-chapter-2-slide-058-0000",
"text": "Nondeterministic Finite Automata o Permit several possible \"next states\" for a given combination of current state and input symbol Accept the empty string e in state diagram Help simplifying the description of automata o Every NFA is equivalent to a DFA Dr. Nguyen Hua Phung Lexical Analysis 17/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_013.png",
"page_index": 58,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:32+07:00"
}
},
"CO3005-chapter-2-slide-059-0000": {
"id": "CO3005-chapter-2-slide-059-0000",
"text": "Example Language L = ({ab} U{aba}) a start 91 b a b 92 Dr. Nguyen Hua Phung Lexical Analysis 18/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_014.png",
"page_index": 59,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:33+07:00"
}
},
"CO3005-chapter-2-slide-060-0000": {
"id": "CO3005-chapter-2-slide-060-0000",
"text": "Example Language L = ({ab} U{aba}) a start - qo 91 E b a 92 Dr. Nguyen Hua Phung Lexical Analysis 19/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_015.png",
"page_index": 60,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:35+07:00"
}
},
"CO3005-chapter-2-slide-061-0000": {
"id": "CO3005-chapter-2-slide-061-0000",
"text": "Regular Expression (regex) Describe regular sets of strings Symbols other than () 1 * stand for themselves Use e for an empty string Concatenation a = First part matches a, second part p Union a6 = Match a or 6 Kleene star a* = 0 or more matches of a Use ) for grouping Dr. Nguyen Hua Phung Lexical Analysis 20/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_016.png",
"page_index": 61,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:37+07:00"
}
},
"CO3005-chapter-2-slide-062-0000": {
"id": "CO3005-chapter-2-slide-062-0000",
"text": "Example RE Language 0 {0} => 01 {01} => 01 => {0,1} 0(01) => {00,01} (01)(01) => {00,01,10,11} 0* {E,0,00,000,0000,...} (01)* => {E,0,1,00,01,10,11,000,001,...] Dr. Nguyen Hua Phung Lexical Analysis 21/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_017.png",
"page_index": 62,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:40+07:00"
}
},
"CO3005-chapter-2-slide-063-0000": {
"id": "CO3005-chapter-2-slide-063-0000",
"text": "Example (iI)(fF) Keyword if of language Pascal IF If iF 0 E(0123456789)* An E followed by a (possibly empty) sequence of digits E123 E9 0 E Dr. Nguyen Hua Phung Lexical Analysis 22/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_018.png",
"page_index": 63,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:42+07:00"
}
},
"CO3005-chapter-2-slide-064-0000": {
"id": "CO3005-chapter-2-slide-064-0000",
"text": "Regular Expression and Finite Automata a b start ab a C start b E E a start a* E E E Dr. Nguyen Hua Phung Lexical Analysis 24/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_019.png",
"page_index": 64,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:44+07:00"
}
},
"CO3005-chapter-2-slide-065-0000": {
"id": "CO3005-chapter-2-slide-065-0000",
"text": "Convenience Notation a+ = one or more (i.e. aa*) a? = 0 or 1 (i.e. (a e)) [xyz]= xyz [x-y]= all characters from x to y, e.g. [0-9] = all ASCll digits [x-y]= all characters other than [x-y] o . matches any character Dr. Nguyen Hua Phung Lexical Analysis 25/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_020.png",
"page_index": 65,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:45+07:00"
}
},
"CO3005-chapter-2-slide-066-0000": {
"id": "CO3005-chapter-2-slide-066-0000",
"text": "Example (01234) [0-4] => (aghm) [aghm] => 0123456789)(0123456789) [0-9]+ Ee)(+-E)(0123456789)+ [Ee][+-]?[0-9]+ Dr. Nguyen Hua Phung Lexical Analysis 26/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_021.png",
"page_index": 66,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:47+07:00"
}
},
"CO3005-chapter-2-slide-067-0000": {
"id": "CO3005-chapter-2-slide-067-0000",
"text": "ANTLR [1] ANother Tool for Language Recognition Terence Parr, Professor of CS at the Uni. San Francisco powertul parser/lexer generator Dr. Nguyen Hua Phung Lexical Analysis 29/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_022.png",
"page_index": 67,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:49+07:00"
}
},
"CO3005-chapter-2-slide-068-0000": {
"id": "CO3005-chapter-2-slide-068-0000",
"text": "Lexer /** * Filename : Hello.g4 */ lexer grammar Hello ; // match any digits INT: [0-9]+; // Hexadecimal number HEX: 0[Xx][0-9A-Fa-f]+; // match lower-case identifiers ID : [a-z]+ ; // skip spaces, tabs, newlines WS : [ trn]+ -> skip ; Dr. Nguyen Hua Phung Lexical Analysis 30/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_023.png",
"page_index": 68,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:51+07:00"
}
},
"CO3005-chapter-2-slide-069-0000": {
"id": "CO3005-chapter-2-slide-069-0000",
"text": "Lexical Analyzer Input Tape Look ahead 13 Token r2 rn with longest prefix match r1 ro Lexical Analyzer Dr. Nguyen Hua Phung Lexical Analysis 31/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_024.png",
"page_index": 69,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:53+07:00"
}
},
"CO3005-chapter-2-slide-070-0000": {
"id": "CO3005-chapter-2-slide-070-0000",
"text": "Summary A lexical analyzer is a pattern matcher that isolates small-scale parts of a program o Lexical rules are represented by Regular expressions or Finite Automata. o How to write a lexical analyzer (lexer) in ANTLR Dr. Nguyen Hua Phung Lexical Analysis 32/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_025.png",
"page_index": 70,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:54+07:00"
}
},
"CO3005-chapter-2-slide-071-0000": {
"id": "CO3005-chapter-2-slide-071-0000",
"text": "References I [1] ANTLR, http:antlr.org,19 08 2016. Dr. Nguyen Hua Phung Lexical Analysis 33/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_2/slide_026.png",
"page_index": 71,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:55+07:00"
}
},
"CO3005-chapter-3-slide-072-0000": {
"id": "CO3005-chapter-3-slide-072-0000",
"text": "Syntax Analysis Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn HCMC University of Technology, Viet Nam 07,2019 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 1/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_001.png",
"page_index": 72,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:57+07:00"
}
},
"CO3005-chapter-3-slide-073-0000": {
"id": "CO3005-chapter-3-slide-073-0000",
"text": "Outline Introduction to Syntax Analysis Context-free grammar Write a grammar Some issues Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 2/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_002.png",
"page_index": 73,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:17:59+07:00"
}
},
"CO3005-chapter-3-slide-074-0000": {
"id": "CO3005-chapter-3-slide-074-0000",
"text": "Introdution Roles read the sequence of tokens produce as output a parse tree or abstract syntax tree (AST) o give error messages when detecting syntax errors token parse source lexical syntax - tree / program analyzer analyzer AST get next token symbol table Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 4/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_003.png",
"page_index": 74,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:02+07:00"
}
},
"CO3005-chapter-3-slide-075-0000": {
"id": "CO3005-chapter-3-slide-075-0000",
"text": "Example Source program: a = b * 4 Lexer output (parser input): ID ASSIGN ID MULOP INTLIT Parser output: <assign-stmt> ID ASSIGN <term> <term> MULOP Ib INTLIT Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 5/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_004.png",
"page_index": 75,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:04+07:00"
}
},
"CO3005-chapter-3-slide-076-0000": {
"id": "CO3005-chapter-3-slide-076-0000",
"text": "Regular Expression Can we use regular expression to express the following language? L={a\"bhn> 0} Example In programming languages, there are some symmetric structure o (((...))) the number of ( must be equal to that of ) o repeat ... repeat ... until ... until Dr. Nguyen Hua Phung nhphung@hcmut . .edu.vn Syntax Analysis 7/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_005.png",
"page_index": 76,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:06+07:00"
}
},
"CO3005-chapter-3-slide-077-0000": {
"id": "CO3005-chapter-3-slide-077-0000",
"text": "Recursive Structure More generally, programming languages have many recursive structures Example <expr> ::= <expr> + <expr> <stmt> ::= if <expr> then <stmt> else <stmt> Regular expressions cannot describe this kind of structure We need o A mean to describe this kind of language o A method to detect if a seguence of tokens is valid or invalid regarding to this kind of language Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Syntax Analysis 8/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_006.png",
"page_index": 77,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:09+07:00"
}
},
"CO3005-chapter-3-slide-078-0000": {
"id": "CO3005-chapter-3-slide-078-0000",
"text": "Context-free grammar A context-free grammar (CFG) consists of o A set of terminals T o A set of non-terminals N o A start symbol S E N o A set of productions P A production p E P is in the form: X -> a where X e N and a is a sequence of symbols in T and/or N Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 9/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_007.png",
"page_index": 78,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:10+07:00"
}
},
"CO3005-chapter-3-slide-079-0000": {
"id": "CO3005-chapter-3-slide-079-0000",
"text": "Example CFG for simple integer expressions consists of: o Set of terminals (tokens):{ADDOP, MULOP, INTLIT, LB RB} Set of non-terminals:{<exp>} Start symbol: <exp> Set of productions: <exp> <exp> ADDOP <exp> <exp> <exp> MULOP <exp> <exp> INTLIT <exp> LB <exp> RB Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 10/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_008.png",
"page_index": 79,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:13+07:00"
}
},
"CO3005-chapter-3-slide-080-0000": {
"id": "CO3005-chapter-3-slide-080-0000",
"text": "Example CFG for simple integer expressions consists of: o Set of terminals (tokens):{ADDOP, MULOP, INTLIT, LB RB} Set of non-terminals:{<exp>} Start symbol: <exp> Set of productions: <exp> <exp> ADDOP <exp> 1 <exp> MULOP <exp> 1 INTLIT 1 LB <exp> RB Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 11/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_009.png",
"page_index": 80,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:15+07:00"
}
},
"CO3005-chapter-3-slide-081-0000": {
"id": "CO3005-chapter-3-slide-081-0000",
"text": "Derivation How to know the language which a CFG describe? Language Generation 1 Start with the string containing only the start symbol Replace any non-terminal symbol X in the string with the right-hand side of some production X - a Repeat (2) until there are no non-terminals in the string Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 12/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_010.png",
"page_index": 81,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:17+07:00"
}
},
"CO3005-chapter-3-slide-082-0000": {
"id": "CO3005-chapter-3-slide-082-0000",
"text": "Example Grammar <exp> <exp> ADDOP <exp> (1) 1 <exp> MULOP <exp> (2) LB<exp> RB (3) 1 INTLIT (4) Derivation 21 <exp> <exp> MULOP <exp> (4) INTLIT MULOP <exp> INTLIT MULOP <exp> ADDOP <exp> (4) INTLIT MULOP INTLIT ADDOP <exp> 4 INTLIT MULOP INTLIT ADDOP INTLIT Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 13/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_011.png",
"page_index": 82,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:20+07:00"
}
},
"CO3005-chapter-3-slide-083-0000": {
"id": "CO3005-chapter-3-slide-083-0000",
"text": "Context-free language Let G be a context-free grammar with start symbol S. The language L(G) generated from G is: { a1a2...an ai e T and S a1a2...an} Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 14/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_012.png",
"page_index": 83,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:21+07:00"
}
},
"CO3005-chapter-3-slide-084-0000": {
"id": "CO3005-chapter-3-slide-084-0000",
"text": "Language Recognization CFG is a good mean to describe PL, but: Not only check if a string is valid but also its parse tree o how to handle gracefully error Parse Tree Start symbol as the parse tree's root For a production X - Y Y?...Yn, add children Y1 Y2... Yn to node X Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 15/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_013.png",
"page_index": 84,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:23+07:00"
}
},
"CO3005-chapter-3-slide-085-0000": {
"id": "CO3005-chapter-3-slide-085-0000",
"text": "Example Source: 12 * (4 + 5) Parser input: INTLIT MULOP LB INTLIT ADDOP INTLIT RB Parser output: <exp> <exp> MULOP <exp> INTLIT LB <exp> RB <exp$ ADDOP <exp> INTLIT INTLIT Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 16/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_014.png",
"page_index": 85,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:24+07:00"
}
},
"CO3005-chapter-3-slide-086-0000": {
"id": "CO3005-chapter-3-slide-086-0000",
"text": "Some tricks Based on the language specification Try to find out the hierarchy structure of a language Focus on the order of syntax units instead of their meaning or other constraints Use recursion to describe something occurring many times o Use recursion to describe nested structures Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 18/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_015.png",
"page_index": 86,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:26+07:00"
}
},
"CO3005-chapter-3-slide-087-0000": {
"id": "CO3005-chapter-3-slide-087-0000",
"text": "Based on language specification Each language has its own specification which sometimes differs from common sense o Smalltalk has the same precedence for all binary operators a+ b* c=((a+ b) *c) C specifies >, < , >= , <= higher priority than ==, !- while Pascal lets these operators same priority Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 19/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_016.png",
"page_index": 87,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:29+07:00"
}
},
"CO3005-chapter-3-slide-088-0000": {
"id": "CO3005-chapter-3-slide-088-0000",
"text": "Hierarchy Structure program declaration function variable constant parameter statement declaration declaration declaration type idlist expression Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 20/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_017.png",
"page_index": 88,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:31+07:00"
}
},
"CO3005-chapter-3-slide-089-0000": {
"id": "CO3005-chapter-3-slide-089-0000",
"text": "Example program program declaration variable decl declaration function const decl type_decl variable constant parameter idlist statement declaration declaration declaration function para_decl stmt type idlist expression exp Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 21/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_018.png",
"page_index": 89,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:33+07:00"
}
},
"CO3005-chapter-3-slide-090-0000": {
"id": "CO3005-chapter-3-slide-090-0000",
"text": "Just the order, not other constraints o CFG just helps to describe the order of tokens CFG cannot be used to describe type constraints Some other kinds of constraints such as scope, name resolution,... cannot be solved by CFG Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 22/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_019.png",
"page_index": 90,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:35+07:00"
}
},
"CO3005-chapter-3-slide-091-0000": {
"id": "CO3005-chapter-3-slide-091-0000",
"text": "Example 2.1 Constant Declaration: Each constant declaration has the form. <identifier> = <expression> ; The <expression> will be discussed later in the Expression section. Note that the expression in a constant declaration must be evaluated statically, so it cannot include a variable or a method invocation. For example: My1stCons = 1 + 5; MyndCons = 2 *My1stCons, Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 23/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_020.png",
"page_index": 91,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:37+07:00"
}
},
"CO3005-chapter-3-slide-092-0000": {
"id": "CO3005-chapter-3-slide-092-0000",
"text": "One vs Many Some language structures may contain unlimited list of elements: o A variable declaration may have a list of identifiers a, c10, b: integer; o A function declaration may have a list of parameter function foo(a:integer; b:real) o A block may have many statements inside begin c := 1; m := 10; end Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 24/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_021.png",
"page_index": 92,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:39+07:00"
}
},
"CO3005-chapter-3-slide-093-0000": {
"id": "CO3005-chapter-3-slide-093-0000",
"text": "Write grammar rule for <many> Use recursion to describe <many> based on <one> <many> <one> <many'> 1 <non recursive case> <many'> [<separator>] <one> <many'> E <separation>: symbol is used to separate elements in a list a, c10, d: integer function foo(a:integer;b:real) <non recursive case>: the minimum number of elements ir the list <one> if there is at least one element - if the list may be empty For example, listid ID tailid ID tailid COMMA ID tailid E Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Syntax Analysis 25/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_022.png",
"page_index": 93,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:43+07:00"
}
},
"CO3005-chapter-3-slide-094-0000": {
"id": "CO3005-chapter-3-slide-094-0000",
"text": "Nested structures In programming languages, there are many nested structures: o There may be a function declaration in a function declaration o A statement may appear inside another statement. A block may appear inside another block An expression may be an operand of another expressior Use recursion to describe a nested structures, for example <stmt> lF <exp> THEN <stmt> ELSE <stmt> 1 WHILE <exp> DO <stmt> 1 Dr. Nguyen Hua Phung nhphung@hcmut .edu. vn Syntax Analysis 26/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_023.png",
"page_index": 94,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:45+07:00"
}
},
"CO3005-chapter-3-slide-095-0000": {
"id": "CO3005-chapter-3-slide-095-0000",
"text": "Extended Backus-Naur Form(EBNF EBNF allow to use operators in regular expression in RHs higher expressiveness often supported by top-down parsing generators BNF EBNF (RHS) ANTLR <exp> <exp>'+' <term> exp: 1 <exp> '-' <term> <term> (('+'I'-') <term>) term (('+'l'-') term)*; 1 <term> <else> ELSE <stmt> else: (ELSE <stmt>)? 1 (\"else\" stmt)?; <idlist> ID ', idlist idlist: ID (; ID)* 1 ID ID (\",\" ID)* ; Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 27/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_024.png",
"page_index": 95,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:49+07:00"
}
},
"CO3005-chapter-3-slide-096-0000": {
"id": "CO3005-chapter-3-slide-096-0000",
"text": "Ambiguous grammar When more than one parse tree can be found for a string of tokens, the grammar is ambiguous Ambiguity makes the meaning of some programs ill-defined Example: INTLIT ADDOP INTLIT MULOP INTLIT <exp> <exp> <exp> MULOP <exp> <exp> ADDOP <exp> <exp> ADDOP <exp> INTLIT INTLIT <exp> MULOP <exp> INTLIT INTLIT INTLIT INTLIT ADDOP calculated first MULOP calculated first Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 29/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_025.png",
"page_index": 96,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:52+07:00"
}
},
"CO3005-chapter-3-slide-097-0000": {
"id": "CO3005-chapter-3-slide-097-0000",
"text": "Disambiguous ambiguous grammar o Rewrite the grammar unambiguously o In some grammar tools, there are disambiguating declarations <exp> <exp> ADDOP <exp>l<exp> MULOP <exp> 1 INTLIT LB <exp> RB The recursive term <exp> appeared in both sides of ADDOP and MULOP is the source of ambiguity. o Removing one recursive term in right hand side of productions can disambiguous the grammar. <exp> <exp> ADDOP <term><exp> MULOP <term> 1 <term> <term> INTLIT 1 LB <exp> RB Dr. Nguyen Hua Phung nhphung@hcmut .edu . vn Syntax Analysis 30/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_026.png",
"page_index": 97,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:55+07:00"
}
},
"CO3005-chapter-3-slide-098-0000": {
"id": "CO3005-chapter-3-slide-098-0000",
"text": "Operator Association o A binary operator o is left-associated (or right-associated) when the left (or right) operator o in expression x o x o x is calculated first. For example, 9 - 5- 2= 6= 2 The operator side where the recursive term appears will determine the association of the operator For example, if ADDOP is left-associated, the grammar should be <exp> -> <exp> ADDOP <term> if ADDOP is right-associated, the grammar should be <exp> <term> ADDOP <exp> Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Syntax Analysis 31/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_027.png",
"page_index": 98,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:18:57+07:00"
}
},
"CO3005-chapter-3-slide-099-0000": {
"id": "CO3005-chapter-3-slide-099-0000",
"text": "Operator Precedence To priorize opterators, the left hand sides (lhs) of the rules where these operators appear should be different if operator 0 has higher priority than operator o2, 0's lhs is generated by oz's Ihs For example, <exp> - <exp> ADDOP <term> 1 <term> <term> <term> MULOP <factor> 1 <factor> <factor> - INTLIT 1 LB <exp> RB Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 32/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_028.png",
"page_index": 99,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:00+07:00"
}
},
"CO3005-chapter-3-slide-100-0000": {
"id": "CO3005-chapter-3-slide-100-0000",
"text": "If Statement <stmt> lF <exp> THEN <stmt> ELSE <stmt> 1 lF <exp> THEN <stmt> <other> Draw parse tree for input lF <exp> THEN lF <exp> THEN <other> ELSE <other> <stmt> IF <exp> THEN <stmt> ELSE <other> IF <exp> TH'EN <other> or IF <exp> THEN IF <exp> THEN <other> ELSE<other> Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Syntax Analysis 33/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_029.png",
"page_index": 100,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:03+07:00"
}
},
"CO3005-chapter-3-slide-101-0000": {
"id": "CO3005-chapter-3-slide-101-0000",
"text": "Disambiguous grammar of if statement Natural if-statement grammar <stmt> lF <exp> THEN <stmt> ELSE <stmt> 1 lF <exp> THEN <stmt> <other> Unambiguous if-statement grammar <stmt> - <matchStmt> <unmatchStmt> <matchStmt> lF <exp> THEN <matchStmt> ELSE <matchStmt> 1 <other> <unmatchStmt> lF <exp> THEN <stmt> IF <exp> THEN <matchStmt> ELSE <unmatchStmt> Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 34/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_030.png",
"page_index": 101,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:07+07:00"
}
},
"CO3005-chapter-3-slide-102-0000": {
"id": "CO3005-chapter-3-slide-102-0000",
"text": "Declarations in grammar tools Some grammar tools has declarations to disambiguous grammar Write grammar in natural format and use declarations to disambiguous it For example,ANTLR has use option <assoc=left>, <assoc=right> for left- and right associativity, respectively. the order of these declarations makes the order of operator precedence Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 35/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_031.png",
"page_index": 102,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:10+07:00"
}
},
"CO3005-chapter-3-slide-103-0000": {
"id": "CO3005-chapter-3-slide-103-0000",
"text": "Example in ANTLR main : expr EOL r expr .. LB expr RB ADDOP expr // highest expr MULOP expr //default: left-assoc expr ADDOP expr <assoc=right> expr '=' expr // lowest, right-assoc INT ID Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 36/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_032.png",
"page_index": 103,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:11+07:00"
}
},
"CO3005-chapter-3-slide-104-0000": {
"id": "CO3005-chapter-3-slide-104-0000",
"text": "Summary o Context-free grammar: only one non-terminal symbol or the LHS Some issues when writing a CFG o ambiguous - dis-ambiguous o operator association : operator precedence Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Syntax Analysis 37/37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_3/slide_033.png",
"page_index": 104,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:13+07:00"
}
},
"CO3005-chapter-4-slide-105-0000": {
"id": "CO3005-chapter-4-slide-105-0000",
"text": "Object-Oriented Programming Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam 08,2016 Dr. Nguyen Hua Phung Object-Oriented Programming 1/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_001.png",
"page_index": 105,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:14+07:00"
}
},
"CO3005-chapter-4-slide-106-0000": {
"id": "CO3005-chapter-4-slide-106-0000",
"text": "Outline OOP Introduction Case Study: Scala Case Study: Python Dr. Nguyen Hua Phung Object-Oriented Programming 2/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_002.png",
"page_index": 106,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:15+07:00"
}
},
"CO3005-chapter-4-slide-107-0000": {
"id": "CO3005-chapter-4-slide-107-0000",
"text": "Object-Oriented Programming Goals Programs as collections of collaborating objects Object has public interface, hidden implementation Objects are classfied according to their behavior Objects may represent real-world entities or entities that produce services for a program o Objects may be reusable across programs Dr. Nguyen Hua Phung Object-Oriented Programming 4/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_003.png",
"page_index": 107,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:17+07:00"
}
},
"CO3005-chapter-4-slide-108-0000": {
"id": "CO3005-chapter-4-slide-108-0000",
"text": "ntroduction To OOP Languages There are many object-oriented programming (OOP) languages o Some are pure OOP language (e.g., Smalltalk) Newer languages do not support other paradigms but use their imperative structures (e.g., Java and Ct) Some support procedural and data-oriented programming (e.g., Ada and C++). Some support functional program (e.g., Scala) Dr. Nguyen Hua Phung Object-Oriented Programming 5/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_004.png",
"page_index": 108,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:20+07:00"
}
},
"CO3005-chapter-4-slide-109-0000": {
"id": "CO3005-chapter-4-slide-109-0000",
"text": "Some Important Features of OOP o Abstract data types Encapsulation Information Hiding Class Hierarchy Inheritance o Polymorphism - Dynamic Binding Dr. Nguyen Hua Phung Object-Oriented Programming 6/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_005.png",
"page_index": 109,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:21+07:00"
}
},
"CO3005-chapter-4-slide-110-0000": {
"id": "CO3005-chapter-4-slide-110-0000",
"text": "Data Abstraction An abstract data type is data type that satisfies the following two conditions: o Encapsulation: Attributes and operations are combined in a single syntactic unit compiled separately o Information Hiding: The access to members are controlled Reliability increased Dr. Nguyen Hua Phung Object-Oriented Programming 7/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_006.png",
"page_index": 110,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:23+07:00"
}
},
"CO3005-chapter-4-slide-111-0000": {
"id": "CO3005-chapter-4-slide-111-0000",
"text": "nformation Hiding 9.7 data structure internal data - operation interface operation interface data operation Dr. Nguyen Hua Phung Object-Oriented Programming 8/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_007.png",
"page_index": 111,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:25+07:00"
}
},
"CO3005-chapter-4-slide-112-0000": {
"id": "CO3005-chapter-4-slide-112-0000",
"text": "ADT Example Operations on a stack: Client code: create(stack) destroy(stack) create(stk1) : push(stk1, color1); empty(stack) push(stk1, color2); push(stack,element) if (! empty(stk1)) temp = top(stk1) : pop(stack) top(stack) Implementation can be adjacent or linked list. Client: don't care! Dr. Nguyen Hua Phung Object-Oriented Programming 9/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_008.png",
"page_index": 112,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:27+07:00"
}
},
"CO3005-chapter-4-slide-113-0000": {
"id": "CO3005-chapter-4-slide-113-0000",
"text": "Class Hierarchy A class may have some Subclasses A class may have one/many Superclass(es Animal 4 Fish Mammal WingedAnimal 4 Whale Dog Cat Bat Dr. Nguyen Hua Phung Object-Oriented Programming 10/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_009.png",
"page_index": 113,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:29+07:00"
}
},
"CO3005-chapter-4-slide-114-0000": {
"id": "CO3005-chapter-4-slide-114-0000",
"text": "nheritance A subclass is able to inherit non-private members of its superclasses A subclass can add its own members and override its inherited members Single vs. multiple inheritance Inheritance increases the reusability in OOP Dr. Nguyen Hua Phung Object-Oriented Programming 11/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_010.png",
"page_index": 114,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:31+07:00"
}
},
"CO3005-chapter-4-slide-115-0000": {
"id": "CO3005-chapter-4-slide-115-0000",
"text": "Example of Inheritance x,y Point draw() move(newX,newY) 4 radius Circle draw() Dr. Nguyen Hua Phung Object-Oriented Programming 12/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_011.png",
"page_index": 115,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:32+07:00"
}
},
"CO3005-chapter-4-slide-116-0000": {
"id": "CO3005-chapter-4-slide-116-0000",
"text": "Diamond Problem in Multiple Inheritance A B C D if D inherits from B and C different versions of the same behaviour, which version will be effective in D? this problem, called diamond problem, is solved differently in different OO language is there the diamond problem in Java? Dr. Nguyen Hua Phung Object-Oriented Programming 13/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_012.png",
"page_index": 116,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:34+07:00"
}
},
"CO3005-chapter-4-slide-117-0000": {
"id": "CO3005-chapter-4-slide-117-0000",
"text": "Class vs. Object; Method vs. Message Class vs. Object o A class defines the abstract characteristics of a thing o its attributes or properties and o its behaviors or methods or features A Dog has fur and is able to bark An object is a particular instance of a class. Lassie is a dog Method vs. Message o A method describes a behavior of an object. A dog can bark A message is a process at which a method of an object is invoked. Lassie barks Dr. Nguyen Hua Phung Object-Oriented Programming 14/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_013.png",
"page_index": 117,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:37+07:00"
}
},
"CO3005-chapter-4-slide-118-0000": {
"id": "CO3005-chapter-4-slide-118-0000",
"text": "Polymorphism Polymorphism: different objects can respond to the same message in different ways. x,y Point draw() radius Circle draw( p.draw() o Dynamic binding Dr. Nguyen Hua Phung Object-Oriented Programming 15/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_014.png",
"page_index": 118,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:39+07:00"
}
},
"CO3005-chapter-4-slide-119-0000": {
"id": "CO3005-chapter-4-slide-119-0000",
"text": "Other Concepts There are two kinds of variables in a class: o Class variables Instance variables o There are two kinds of methods in a class: Class methods - accept messages to the class Instance methods - accept messages to objects Abstract class vs. Concrete class: Abstract Class - no instance Concrete Class - able to have its instances Dr. Nguyen Hua Phung Object-Oriented Programming 16/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_015.png",
"page_index": 119,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:42+07:00"
}
},
"CO3005-chapter-4-slide-120-0000": {
"id": "CO3005-chapter-4-slide-120-0000",
"text": "Scala Programming Language Invented by Martin Ordesky at EPFL, Lausanne, Switzerland. EScala Similar to Java Work smoothly with Java Run on Java Virtual Machine OOP + FP Include lexer and parser generator Dr. Nguyen Hua Phung Object-Oriented Programming 18/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_016.png",
"page_index": 120,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:43+07:00"
}
},
"CO3005-chapter-4-slide-121-0000": {
"id": "CO3005-chapter-4-slide-121-0000",
"text": "Classes and Objects in Scala Class class [1] abstract class [5] trait [2] case class [3] Object new <class name> <case class name> object Dr. Nguyen Hua Phung Object-Oriented Programming 19/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_017.png",
"page_index": 121,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:45+07:00"
}
},
"CO3005-chapter-4-slide-122-0000": {
"id": "CO3005-chapter-4-slide-122-0000",
"text": "Example [7] class Rational(n:Int , d: Int){ require(d != 0) private val g = gcd(n.abs, d.abs) private def gcd(a: Int , b: Int): Int = if (b == 0) a eIse gcd(b, a % b) val numer = n g val denom = d / g g def this(n: Int) = this(n, 1) def + (that : Rational): Rational : new Rational( numer * that.denom + that.numer * denom, denom * that.denom override def toString = numer +\"/\"+ denom 1 Dr. Nguyen Hua Phung Object-Oriented Programming 20/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_018.png",
"page_index": 122,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:48+07:00"
}
},
"CO3005-chapter-4-slide-123-0000": {
"id": "CO3005-chapter-4-slide-123-0000",
"text": "Example on Abstract class [4] abstract class Element { def contents : Array[String] //no body: abstract val height = contents.length val width = if (height == 0) 0 else contents(0).length 1 class ArrayElement(conts : Array [ String ]) extends Element { def contents : Array[String] = conts 1 class LineElement(s : String) extends ArrayElement(Array(s) { override def width = s.length override def height = 1 1 Dr. Nguyen Hua Phung Object-Oriented Programming 21/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_019.png",
"page_index": 123,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:51+07:00"
}
},
"CO3005-chapter-4-slide-124-0000": {
"id": "CO3005-chapter-4-slide-124-0000",
"text": "Example on Object [1] object Element { def elem(contents : Array[ String D) : Element = new ArrayElement(contents) def elem(line : String ) : Element = new LineElement(line) 1 val space = Element.elem(\" \" val hello = Element.elem(Array(\"hello\",\"world\")) Which kind of Element will be assigned to space and hello? Dr. Nguyen Hua Phung Object-Oriented Programming 22/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_020.png",
"page_index": 124,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:53+07:00"
}
},
"CO3005-chapter-4-slide-125-0000": {
"id": "CO3005-chapter-4-slide-125-0000",
"text": "Example on Case Class [3] abstract class Expr case class Var(name: String) extends Expr case class Number(num: Double) extends Expr case class UnOp(operator : String , arg : Expr) extends Expr case class BinOp(operator : String : Ieft : Expr, right : Expr) extends Expr val v = Var(\"x\") val op = BinOp(\"+\", Number(1), v) v.name op.left Dr. Nguyen Hua Phung Object-Oriented Programming 23/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_021.png",
"page_index": 125,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:56+07:00"
}
},
"CO3005-chapter-4-slide-126-0000": {
"id": "CO3005-chapter-4-slide-126-0000",
"text": "Example 1 on Traits [9 Reusability: abstract class Bird trait Flying { def flyMess: String def fly() = println(flyMess) 1 trait Swimming { def swim0 = printIn (\"I'm swimming\") 1 class Penguin extends Bird with Swimming class Hawk extends Bird with Swimming with Flying { val flyMess = \"I'm a good fIyer\" 1 class Frigatebird extends Bird with Flying { val flyMess = \"I'm an excellent fIyer\" 1 Dr. Nguyen Hua Phung Object-Oriented Programming 24/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_022.png",
"page_index": 126,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:19:59+07:00"
}
},
"CO3005-chapter-4-slide-127-0000": {
"id": "CO3005-chapter-4-slide-127-0000",
"text": "Example 2 on Traits [2] Stackable Modifications: abstract class IntQueue { def getO: Int def put(x: Int):Unit} class BasiclntQueue extends IntQueue private val buf = new ArrayBuffer[Int] def get( = buf.remove(0) def put(x: Int):Unit= { buf += x }} trait Doubling extends IntQueue { abstract override def put(x:Int {super.put(2*x)}} trait Incrementing extends IntQueue { abstract override def put(x:Int) {super.put(x+1)}} val queue = new BasiclntQueue with Incrementing with Doubling queue.put(10) queue.getO //??? Trait Linearization: Doubling-> Incrementing-> BasiclntQueue-> IntQueue-> AnyRef-> Any Dr. Nguyen Hua Phung Object-Oriented Programming 25/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_023.png",
"page_index": 127,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:02+07:00"
}
},
"CO3005-chapter-4-slide-128-0000": {
"id": "CO3005-chapter-4-slide-128-0000",
"text": "Trait Linearization: Resolving Diamond Problem in Scala A class extends just a single class but is able to have many \"with\" traits If these traits have the same method, which method is inherited Solution in Scala: Trait linearization Take the first extended trait/class and write its complete inherited hierarchy in vertical form, store this hierarchy as X Take the next trait/class after the with clause, write its complete hierarchy and cancel the classes or traits that are repeated in hierarchy X. Add the remaining traits/classes to the front of the hierarchy X. Go to step 2 and repeat the process, until no trait/class is left out. Place the class itself in front of hierarchy as head for which the hierarchy is being written. Dr. Nguyen Hua Phung Object-Oriented Programming 26/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_024.png",
"page_index": 128,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:04+07:00"
}
},
"CO3005-chapter-4-slide-129-0000": {
"id": "CO3005-chapter-4-slide-129-0000",
"text": "Example on Trait Linearization trait A { def name: String trait B extends A { override def name: String =\"class b\" 1 trait C extends A { override def name: String =\"class c\" 1 class D extends B with C {} var class d = new D println(class_d.name) B: B->A->AnyRef->Any o C: C->A->AnyRef->Any C->B->A->AnyRef->Any o D: D->C->B->A->AnyRef->Any Dr. Nguyen Hua Phung Object-Oriented Programming 27/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_025.png",
"page_index": 129,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:07+07:00"
}
},
"CO3005-chapter-4-slide-130-0000": {
"id": "CO3005-chapter-4-slide-130-0000",
"text": "Scala Hierarchy [8] Subtype View aia.Anyw scala.AnyFie caia.Doubi scala.Unit acain.Ficat scala.Boolea java.lang.String acala.Cha scala.Liat scala.in scala.Option ..(otherScalaclasses.. acaia.Dyte la.Nul Dr. Nguyen Hua Phung Object-Oriented Programming 28/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_026.png",
"page_index": 130,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:10+07:00"
}
},
"CO3005-chapter-4-slide-131-0000": {
"id": "CO3005-chapter-4-slide-131-0000",
"text": "Access Modifiers [6] in Scala protected private protected[<name>] private[<name>] Example, package Assignment protected[Assignment] val field1 = 100 private[this] val field2 = 2; Dr. Nguyen Hua Phung Object-Oriented Programming 29/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_027.png",
"page_index": 131,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:11+07:00"
}
},
"CO3005-chapter-4-slide-132-0000": {
"id": "CO3005-chapter-4-slide-132-0000",
"text": "OOP in Python Class vs. Object Instance vs. static fields Instance, Class, Static methods Encapsulation Inheritance Polymorphism Dr. Nguyen Hua Phung Object-Oriented Programming 31/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_028.png",
"page_index": 132,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:13+07:00"
}
},
"CO3005-chapter-4-slide-133-0000": {
"id": "CO3005-chapter-4-slide-133-0000",
"text": "Class vs. Object Class is a user-defined prototype for an obiect class <Clsname>: => Clsname: name of the class ' Optional. class. .documentation, string <class suite > => fields, methods Object: an instance of the class class Employee : Common_baseclassforallemployees empCount = 0 => empCount: static field def init ( self ,n,s) :=>constructor self.name = n =>name: instance fiela self.salary = s =>salary: instance field Employee .empCount += 1 obj = Employee(\"Nam\",30) => create object Dr. Nguyen Hua Phung Object-Oriented Programming 32/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_029.png",
"page_index": 133,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:16+07:00"
}
},
"CO3005-chapter-4-slide-134-0000": {
"id": "CO3005-chapter-4-slide-134-0000",
"text": "nstance Methods Instance Method: method belongs to the instance class Employee : def displayEmployee( self ) : =>firstparam- eter for instance print( \"Name,:-\", self .name, , Salary : \", self.salary T1 obj = Employee(\"Nam\",30) obj.displayEmployee ( =>obj is passed to self able to access to instance fields through first parameter and : => self.name able to access to static field through class name and : => Employee.empCount Dr. Nguyen Hua Phung Object-Oriented Programming 33/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_030.png",
"page_index": 134,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:18+07:00"
}
},
"CO3005-chapter-4-slide-135-0000": {
"id": "CO3005-chapter-4-slide-135-0000",
"text": "Class and Static Methods class Employee : @classmethod =>to define class methoa def create(cls,n,s): =>first parameter for class print( cls . empCount) =>access to static fields return cls(n,s) @staticmethod =>to define static methoa def isHighSal(s): =>no parameter for class if s > 8: =>unable to access any fields print(\"High_Salary\") obj = Employee.create(\"Nam\",30) =>Employeeis passed to cls Employee.isHighSal(30 =>Employee is used to re- solve Dr. Nguyen Hua Phung Object-Oriented Programming 34/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_031.png",
"page_index": 135,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:22+07:00"
}
},
"CO3005-chapter-4-slide-136-0000": {
"id": "CO3005-chapter-4-slide-136-0000",
"text": "nformation Hiding to hide fields and methods based on name ot tields and methods Protected: prefix by a single underscore (_example) Private: prefix by a double underscores (_example) o Public: begin with a letter Dr. Nguyen Hua Phung Object-Oriented Programming 35/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_032.png",
"page_index": 136,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:23+07:00"
}
},
"CO3005-chapter-4-slide-137-0000": {
"id": "CO3005-chapter-4-slide-137-0000",
"text": "Class Hierarchy Python 3: root is object Multiple Inheritance class <clsname>(<parent >(,<parent >)*)?: For example, class A : => superclass is object class Rectangle(Parallelogram) : => superclass is Parallelogram class Square(Rhombus, Rectangle ) : => superclasses are Rhombus and Rectangle Dr. Nguyen Hua Phung Object-Oriented Programming 36/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_033.png",
"page_index": 137,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:25+07:00"
}
},
"CO3005-chapter-4-slide-138-0000": {
"id": "CO3005-chapter-4-slide-138-0000",
"text": "Inheritance Subclass inherits non-private fields and methods from super-classes Diamond problem A B C D Method Resolution Order: determine search sequence of a class Dr. Nguyen Hua Phung Object-Oriented Programming 37/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_034.png",
"page_index": 138,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:27+07:00"
}
},
"CO3005-chapter-4-slide-139-0000": {
"id": "CO3005-chapter-4-slide-139-0000",
"text": "Method Resolution Order (MRO) MRO is used to determine search sequence L(M) of class M o L(object) = [object] o L(M(A,B,C)) = [M] + merge(L(A),L(B),L(C),[A,B,C] merge([H171],[H272],[H373] o Step 1: if H1 is a good head which is NOT in the tail of other lists, take H out as an output, remove H out of all lists, back to Step 1. Step 2: if H1 is not a good head, check if H2 is a good head. If it is, apply Step1 for H2. If it is not, check for Ha and so on. If there is no good head, give an error. Dr. Nguyen Hua Phung Object-Oriented Programming 38/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_035.png",
"page_index": 139,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:30+07:00"
}
},
"CO3005-chapter-4-slide-140-0000": {
"id": "CO3005-chapter-4-slide-140-0000",
"text": "Example A . B(A) C(A) D(B,C) L(A) =[A,object] L(B) = [B] + merge(L(A),[A]) = [B,A,object] L(C) = [C] + merge(L(A),[A]) = [C,A,object] L(D) = [D]+merge(L(B),L(C),[B,C]) = [D,B,C,A,object] merge([B,A,o],[C,A,o],[B,C1) => o B is a good head => [B]+merge([A,o],[C,A,o],[C] o A is NOT a good head, check C, and C is a good head => [B,C] + merge([A,o],[A,o],[]) A is a good head => [B,C,A] + merge([o],[o],[] o o is a good head => [B,C,A,o] Dr. Nguyen Hua Phung Object-Oriented Programming 39/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_036.png",
"page_index": 140,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:33+07:00"
}
},
"CO3005-chapter-4-slide-141-0000": {
"id": "CO3005-chapter-4-slide-141-0000",
"text": "super, isinstance, type super0 => refer to the superclass class A: def foo(self,x): 2 3 print(x) class B(A) : 4 def foo(self,x) : 5 super.foo(x) 6 B(O.foo(3) =>3 isinstance(o,T) => check if object o is of type T class A: pass class B(A): pass x = B(O) isinstance(x,B) => Trueisinstance(x,A) => Truetype(x) is B => Truetype(x) is A => False type(o) => return the type of object o Dr. Nguyen Hua Phung Object-Oriented Programming 40/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_037.png",
"page_index": 141,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:35+07:00"
}
},
"CO3005-chapter-4-slide-142-0000": {
"id": "CO3005-chapter-4-slide-142-0000",
"text": "Polymorphism Overloading: def func(param1,param2=0) : pass func(1,2) func(\"asbc\") o Universal Polymorphism: Parametric Polymorphism Subtyping Polymorphism class A: class A: def func1(self): def func1(self): print(\"A\") print(\"A\") def func2(self): pass def func2(self): pass class B: class B(A) : def func1(self): def func1(self): print(\"B\") print(\"B\") for x in [AO,BO]: for x in [AO,BO]: x.func1O) x.func10) x.func20 x.func20) Dr. Nguyen Hua Phung Object-Oriented Programming 41/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_038.png",
"page_index": 142,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:39+07:00"
}
},
"CO3005-chapter-4-slide-143-0000": {
"id": "CO3005-chapter-4-slide-143-0000",
"text": "Some other issues id0: address of the specified object x,y,z = 3,3,4 id(x) => address of object 3 which x points to id(y) => same above address => x, y -> same object id(z) => z points to different object is vs. == o is: True just when they are same object ==: True even when they are different obiects but their attributes are equal x,y = [1,2,3],[1,2,3] x is y => False id(x) == id(y) => False x == y=> True Dr. Nguyen Hua Phung Object-Oriented Programming 42/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_039.png",
"page_index": 143,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:42+07:00"
}
},
"CO3005-chapter-4-slide-144-0000": {
"id": "CO3005-chapter-4-slide-144-0000",
"text": "Some other issues o Context manager by with statement with <expression> as <variable>: <stmt-list> <expression> must return an obiect which has enter and exit methods The with statement is executed like: <variable> = <expression> <variable>.__enter_0 <stmt list> <variable>..exit_0 exit method is always executed before the control goes out of the <stmt list> used for managing resources: file, database,.. with open('abc.txt','r') as f: print(f.read0) f.closed => True Dr. Nguyen Hua Phung Object-Oriented Programming 43/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_040.png",
"page_index": 144,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:44+07:00"
}
},
"CO3005-chapter-4-slide-145-0000": {
"id": "CO3005-chapter-4-slide-145-0000",
"text": "Summary What are still in your mind? Dr. Nguyen Hua Phung Object-Oriented Programming 44/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_041.png",
"page_index": 145,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:45+07:00"
}
},
"CO3005-chapter-4-slide-146-0000": {
"id": "CO3005-chapter-4-slide-146-0000",
"text": "References I [1] Classes and Objects, http://www.artima.com/pins1ed/ classes-and-objects.html,19 062014. [2] Traits,http://www.artima.com/pinsled/traits.html, 19 06 2014. [3] Case Class and Pattern Matching, http://www.artima. com/ pinsled/case-classes-and-pattern-matching.html, 19 06 2014. [4] Abstract Members, http: //www.artima.com/pinsled/abstract-members.html 19 06 2014. [5] Compositions and Inheritance, http://www.artima. com/ pinsled/composition-and-inheritance.html,19 06 2014. [6] Packages and Imports, http://www.artima.com/pins1ed/ packages-and-imports.html, 19 062014. Dr. Nguyen Hua Phung Object-Oriented Programming 45/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_042.png",
"page_index": 146,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:48+07:00"
}
},
"CO3005-chapter-4-slide-147-0000": {
"id": "CO3005-chapter-4-slide-147-0000",
"text": "References Il [7] Functional Objects, http://www.artima.com/pins1ed/ functional-objects.html,19 062014. [8] Scala Hierarchy, http : //www.artima.com/pinsled/scalas-hierarchy.html 19 062014. [9] Learning Scala part seven -Traits, http:// joelabrahamsson. com/learning-scala-part-seven-traits/,19 062014. [10] Object-Oriented Programming in Python 3, https://realpython.com/ python3-object-oriented-programming/, 01-10-2020 [11] Python - Object-Oriented, https ://realpython. com/ python3-object-oriented-programming/, 01-10-2020 [12] The Python 2.3 Method Resolution Order, https : //www.python.org/download/releases/2.3/mro/, 01-10-2020. Dr. Nguyen Hua Phung Object-Oriented Programming 46/46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_4/slide_043.png",
"page_index": 147,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:52+07:00"
}
},
"CO3005-chapter-5-slide-148-0000": {
"id": "CO3005-chapter-5-slide-148-0000",
"text": "Functional Programming Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam 10,2020 Dr. Nguyen Hua Phung Functional Programming 1/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_001.png",
"page_index": 148,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:53+07:00"
}
},
"CO3005-chapter-5-slide-149-0000": {
"id": "CO3005-chapter-5-slide-149-0000",
"text": "Outline FP Introduction Higher-order Functions Immutability Case Study: Python Dr. Nguyen Hua Phung Functional Programming 2/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_002.png",
"page_index": 149,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:54+07:00"
}
},
"CO3005-chapter-5-slide-150-0000": {
"id": "CO3005-chapter-5-slide-150-0000",
"text": "Functional Programming Function are values, i.e., a function can be Value Function Anonymous 3 X =>x + 1 Assigned to a variable X = 3 f = x => x + 1 Passed as input/output f(3) f(x => x + 1) parameter 3 + 4 f o g Created dynamically Dr. Nguyen Hua Phung Functional Programming 4/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_003.png",
"page_index": 150,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:56+07:00"
}
},
"CO3005-chapter-5-slide-151-0000": {
"id": "CO3005-chapter-5-slide-151-0000",
"text": "Fundamental Theory Imperative languages => Von Neumann Architecture o Efficiency o Functional languages => Lambda Calculus o A solid theoretical basis that is also closer to the user, but relatively unconcerned with the architecture of the machines on which programs will rur Dr. Nguyen Hua Phung Functional Programming 5/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_004.png",
"page_index": 151,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:20:59+07:00"
}
},
"CO3005-chapter-5-slide-152-0000": {
"id": "CO3005-chapter-5-slide-152-0000",
"text": "Mathematical Functions o A mathematical function is a mapping of members of one set, called the domain set, to another set, called the range set A lambda expression specifies the parameter(s) and an expression in the following form to express an anonymous function A(x) x * x * x like the function cube cube(x) = x * x * x o Lambda expressions are applied to parameter(s) by placing the parameter(s) after the expression ((x) x * x * x)(2) which evaluates to 8 Dr. Nguyen Hua Phung Functional Programming 6/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_005.png",
"page_index": 152,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:01+07:00"
}
},
"CO3005-chapter-5-slide-153-0000": {
"id": "CO3005-chapter-5-slide-153-0000",
"text": "Higher-order Functions o A higher-order function is one that either takes functions as parameters or yields a function as its result, or both o For example, o Function composition o Apply-to-all Forall/Exists Insert-left/Insert-right Functions as parameters Closures Dr. Nguyen Hua Phung Functional Programming 8/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_006.png",
"page_index": 153,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:03+07:00"
}
},
"CO3005-chapter-5-slide-154-0000": {
"id": "CO3005-chapter-5-slide-154-0000",
"text": "Function Composition A function that takes two functions as parameters and yields a function whose value is the first actual parameter function applied to the application of the second f o g = f : (g : x) For f(x) = x + 2; g(x) = x * x; f o g (x)= x * x + 2 Example in Scala, val (x:Double) => x + 2 val g= (x:Double) => x * x val h = f compose g h(3) val k = f andThen k(3) Dr. Nguyen Hua Phung Functional Programming 9/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_007.png",
"page_index": 154,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:06+07:00"
}
},
"CO3005-chapter-5-slide-155-0000": {
"id": "CO3005-chapter-5-slide-155-0000",
"text": "Apply-to-all A functional form that takes a single function as a parameter and yields a list of values obtained by applying the given function to each element of a list of parameters af :< X1,X2, ...,Xn >=< f : X1, f : X2, ..., f : X2 > For h(x)=x*x => ah:(1,2,3) yields (1,4,9) Example in Scala, List(2,3,4) .map((x:Int) => x * x def inc (x:Int) = x + 1 List(4,5,6).map(inc) Dr. Nguyen Hua Phung Functional Programming 10/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_008.png",
"page_index": 155,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:09+07:00"
}
},
"CO3005-chapter-5-slide-156-0000": {
"id": "CO3005-chapter-5-slide-156-0000",
"text": "Forall/Exists A functional form that o takes a single predicate function as a parameter and yields a value obtained by applying the given function to each element of a list of parameters and take the and/or of the results Vf :< x1,X2,..,Xn >=Nf:Xj 3f :< X1,X2,i.,Xn >=Uf : Xj Example in Scala, def isEqualToThree(x:Int) = x == 3 List(2,3,4) .forall(isEqualToThree) // yield false List(2,3,4) .exists(isEqualToThree // yield true Dr. Nguyen Hua Phung Functional Programming 11/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_009.png",
"page_index": 156,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:11+07:00"
}
},
"CO3005-chapter-5-slide-157-0000": {
"id": "CO3005-chapter-5-slide-157-0000",
"text": "Filter A functional form that o takes a single predicate function as a parameter and yields a value that includes elements from the list parameter on which the given function returns true Bf :< X1,X2,.,Xn >=< xif : Xi= T > Dr. Nguyen Hua Phung Functional Programming 12/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_010.png",
"page_index": 157,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:12+07:00"
}
},
"CO3005-chapter-5-slide-158-0000": {
"id": "CO3005-chapter-5-slide-158-0000",
"text": "nsert Left / Insert Right /f :< Xo >,< X1,X2,...,Xn > f :< Xo >,< X1,X2,...,Xn > f f Xn X1 f f f X2 Xn-1 f X0 X1 Xn X0 Dr. Nguyen Hua Phung Functional Programming 13/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_011.png",
"page_index": 158,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:14+07:00"
}
},
"CO3005-chapter-5-slide-159-0000": {
"id": "CO3005-chapter-5-slide-159-0000",
"text": "nsert Left / Insert Right (cont'd) Example in Scala List(2,3,4) .foldLeft(0) ((a,b => a+b) // yield 9 List(2,3,4) .foldLeft(1) ((a,b) => a*b /7 j yield 24 List(2,3,4) .foldLeft(\"A\") ((a,b) => a + b)) // yield \"A234\" List(2,3,4) .foldRight(\"A\") ((a,b => a + b // yield \"234A\" Dr. Nguyen Hua Phung Functional Programming 14/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_012.png",
"page_index": 159,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:17+07:00"
}
},
"CO3005-chapter-5-slide-160-0000": {
"id": "CO3005-chapter-5-slide-160-0000",
"text": "Functions as Parameters In user-defined functions, functions can be passed as parameters. def apply(x:Int)(f:Int=>Int = f(x) val inc1 = (x:Int) => x + 1 val s sq = (x:Int) => x * x val fl = List(incl,sq fl.map(apply(3) //yield List(4,9) Dr. Nguyen Hua Phung Functional Programming 16/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_013.png",
"page_index": 160,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:20+07:00"
}
},
"CO3005-chapter-5-slide-161-0000": {
"id": "CO3005-chapter-5-slide-161-0000",
"text": "Closure [1] \"An object is data with functions. A closure is a function with data.\" - John D. Cook def power(exp:Double = (x:Double :) => math.pow(x,exp) val square = power(2) square(4 //yield 16.0 val cube = power(3) cube(3 //yield 27.0 Closure = function + binding of its free variables Dr. Nguyen Hua Phung Functional Programming 17/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_014.png",
"page_index": 161,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:22+07:00"
}
},
"CO3005-chapter-5-slide-162-0000": {
"id": "CO3005-chapter-5-slide-162-0000",
"text": "Currying functions [2 f:X1 x X x...x Xn -yY curry: f : X1 -? X2 -...-> Xn -> Y Example in Scala def add(x:Int, y:Int) = x + Y add(1,3) add(1 add(1) (3) def plus(x:Int) (y:Int) = x + Y plus(1) (3) val incl = plus(l) - inc1(3) val addCurried = (add ) .curried val plusUncurried = Function.uncurried(plus -) Read more on Partially Applied Functions [2] Dr. Nguyen Hua Phung Functional Programming 18/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_015.png",
"page_index": 162,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:24+07:00"
}
},
"CO3005-chapter-5-slide-163-0000": {
"id": "CO3005-chapter-5-slide-163-0000",
"text": "Immutability Immutable: Cannot change In Java, strings are immutable \"Hello\".toUpper0 doesn't change \"Hello\" but returns a new string \"HELLO\" In Scala, val is immutable val num = 12 num = 10 // wrong Pure functional programming: No mutations Don't mutate-always return the result as a new value Functions that don't mutate state are inherently parallelizable Dr. Nguyen Hua Phung Functional Programming 20/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_016.png",
"page_index": 163,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:26+07:00"
}
},
"CO3005-chapter-5-slide-164-0000": {
"id": "CO3005-chapter-5-slide-164-0000",
"text": "Example on Immutability abstract class IntStack def push(x: Int) : IntStack = new IntNonEmptyStack(x, this def isEmpty: Boolean def top: Int def pop: IntStack class StackEmpty extends IntStack def isEmpty = true def top = error(\"EmptyStack.top\") def l pop = error(\"EmptyStack.pop\") class IntNonEmptyStack(elem: Int, rest: IntStack) extends IntStack def isEmpty = false def top = elem def pop = rest Dr. Nguyen Hua Phung Functional Programming 21/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_017.png",
"page_index": 164,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:30+07:00"
}
},
"CO3005-chapter-5-slide-165-0000": {
"id": "CO3005-chapter-5-slide-165-0000",
"text": "Functional Programming Immutable Data Structures lambda function First-class functions High-order functions: map, filter, reduce Closure Decorator Dr. Nguyen Hua Phung Functional Programming 23/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_018.png",
"page_index": 165,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:31+07:00"
}
},
"CO3005-chapter-5-slide-166-0000": {
"id": "CO3005-chapter-5-slide-166-0000",
"text": "Functional Programming This is a style of programming that avoids side effects by performing computation o through the evaluation of pure functions : relying heavily on immutable data structures Benefits of functional programming: o Pure functions are easier to reason about Testing is easier Debugging is easier Programs are more bulletproof Parallel/Concurrent programming is easier Dr. Nguyen Hua Phung Functional Programming 24/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_019.png",
"page_index": 166,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:33+07:00"
}
},
"CO3005-chapter-5-slide-167-0000": {
"id": "CO3005-chapter-5-slide-167-0000",
"text": "mmutable Data Structures o Apply immutable data types in Python o Number (int,float,complex) Boolean (bool) String (str) Sequence (tuple, range) (1,'a',True) Set (frozenset) x = frozenset({1'a',True}) Mapping (collections.namedtuple) Student = collections.namedtuple('Student',['name','age'] x = Student('Vinh',14) x.name Apply immutable operations on mutable data types o + instead of extend0 [1,2,3] + [4,5] Dr. Nguyen Hua Phung Functional Programming 25/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_020.png",
"page_index": 167,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:35+07:00"
}
},
"CO3005-chapter-5-slide-168-0000": {
"id": "CO3005-chapter-5-slide-168-0000",
"text": "Lambda tunction : Syntax: lambda (<param>(, <param) *) ?: <exp> For example, lambda a,b: a + b (lambda a,b: a + b) (3,4) => 7 x = lambda a,b: a + b x(3,4 => 7) Anonymous function Any number of parameters Body is just one expression Used in high-order functions Dr. Nguyen Hua Phung Functional Programming 26/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_021.png",
"page_index": 168,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:38+07:00"
}
},
"CO3005-chapter-5-slide-169-0000": {
"id": "CO3005-chapter-5-slide-169-0000",
"text": "First-class function o A function is treated as any other value, i.e. it is o assigned to a variable def foo(a,b) : pass x = foo x(3,4) passed into another function as a parameter def foo(f,x): return f(x) foo(lambda a: a ** 2, 4) => 16 o returned as a value def f(x) : def g(y) : return x * y return m = f(3) m(4 => 12 Dr. Nguyen Hua Phung Functional Programming 27/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_022.png",
"page_index": 169,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:41+07:00"
}
},
"CO3005-chapter-5-slide-170-0000": {
"id": "CO3005-chapter-5-slide-170-0000",
"text": "High-order functions: map, filter, reduce map(<function>,<sequence>): apply <function> to each element of <seguence> and return an iterator cels = [36.5, 37, 37.5, 38, 39] fahr = list(map(lambda c: (float(9 / 5 * c) + 32,cels) => [97.7, 98.6, 99.5, 100.4, 102.2]1ist(map(1am x,y: : x + y,[1,2,3],[4,5,6,7]) => [5,7,9] filter(<function>,<sequence>) return an iterator that contains elements in <sequence> for which <function> returns True list(filter(lambda c: c % 2 == 1,[0,1,2,3,4,5 [1,3,5] reduce(<function>,<sequence>G<initial>)?): if <sequence> is [s1,s2,s3], reduce return function(function(s1,s2),s3) or function(function(function(<initial>,s1),s2),ss from functools import reduce Dr. Nguyen Hua Phung Functional Programming 28/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_023.png",
"page_index": 170,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:44+07:00"
}
},
"CO3005-chapter-5-slide-171-0000": {
"id": "CO3005-chapter-5-slide-171-0000",
"text": "Closure o Closure is a function object together with an environment (binding ot its free data) def power(y) : def inner(x) : return x ** y return inner square= power(2 square(5 => 25 Dr. Nguyen Hua Phung Functional Programming 29/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_024.png",
"page_index": 171,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:45+07:00"
}
},
"CO3005-chapter-5-slide-172-0000": {
"id": "CO3005-chapter-5-slide-172-0000",
"text": "Decorator o Decorator allows to modify the behavior of function or class without permanently modifying it. @log decorator def foo(x,y) : def foo(x,y) : return x*y return x*y foo = log_decorator(foo) print(foo(3,4) => 12 print(foo(3,4)) deflog_decorator(func) : def inner(*arg) : print(func._ name_ +\" is running\") return func(*arg) return inner Dr. Nguyen Hua Phung Functional Programming 30/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_025.png",
"page_index": 172,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:47+07:00"
}
},
"CO3005-chapter-5-slide-173-0000": {
"id": "CO3005-chapter-5-slide-173-0000",
"text": "Summary Functional programming languages use function application, conditional expressions, recursion, and functional forms to control program execution instead of imperative features such as variables and assignments Purely functional languages have advantages over imperative alternatives, but their lower efficiency on existing machine architectures has prevented them from enjoying widespread use Dr. Nguyen Hua Phung Functional Programming 31/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_026.png",
"page_index": 173,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:50+07:00"
}
},
"CO3005-chapter-5-slide-174-0000": {
"id": "CO3005-chapter-5-slide-174-0000",
"text": "References I [1] Methods and Closures, http://www.artima.com/pins1ed/ functions-and-closures.html,19 062014. [2] Function Currying in Scala, http://www.codecommit.com/ blog/scala/function-currying-in-scala, 19 062014. [3] Case classes and pattern matching. http://www.artima.com/pinsled/ case-classes-and-pattern-matching.html, 19 062014. [4] Control Abstraction, http://www.artima.com/pins1ed/ control-abstraction.html,19 062014. Dr. Nguyen Hua Phung Functional Programming 32/33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_5/slide_027.png",
"page_index": 174,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:52+07:00"
}
},
"CO3005-chapter-6-slide-175-0000": {
"id": "CO3005-chapter-6-slide-175-0000",
"text": "Abstract Syntax Tree Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn HCMC University of Technology, Viet Nam October 23, 2020 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 1/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_001.png",
"page_index": 175,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:53+07:00"
}
},
"CO3005-chapter-6-slide-176-0000": {
"id": "CO3005-chapter-6-slide-176-0000",
"text": "Abstract Syntax Tree (AST) Definition o tree representation of the abtract syntax structure of source code. o differ from concrete syntax tree (parse tree) by some details ignored o help subsequence phases not depend on parse process <ifstmt> Parse Tree IF <exp> THEN <stmt1> ELSE <stmt2> <ifstmt> AST <exp> <stmt1> <stmt2> Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Abstract Syntax Tree 3/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_002.png",
"page_index": 176,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:21:56+07:00"
}
},
"CO3005-chapter-6-slide-177-0000": {
"id": "CO3005-chapter-6-slide-177-0000",
"text": "Example exp exp + term term term term * factfact fact - (exp)lIDN <exp> 4 * (5 + 3) <term> 4 <term> <fact> 5 3 N(4) <exp> + <term> <term> <fact> <fact> N(5) N(3) Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 4/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_003.png",
"page_index": 177,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:00+07:00"
}
},
"CO3005-chapter-6-slide-178-0000": {
"id": "CO3005-chapter-6-slide-178-0000",
"text": "AST for an expression in Scala Expression AST trait Exp case class BinExp(op:String,e1:Exp,e2:Exp) extends Exp case class UnaExp(op:String,e:Exp) extends Exp case class Lit(i:Int) extends Exp <exp> 4 * (5 + 3) <term> BinExp e1 e2 <term> Lit BinExp <fact> e1 e2 4 <exp> + <term> 4 Lit + Lit <term> <fact> <fact> 3 5 3 5 BinExp(\"*\",Lit(4),BinExp(\"+\",Lit(5),Lit(3))) Dr. Nguyen Hua Phung nhphung@hcmut Abstract Syntax Tree 5/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_004.png",
"page_index": 178,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:03+07:00"
}
},
"CO3005-chapter-6-slide-179-0000": {
"id": "CO3005-chapter-6-slide-179-0000",
"text": "Generated Classes by ANTLR A grammar => a class A nonterminal => an inner class grammar MC; class MCParser { prog 1 : stmt+ : class ProgContext stmt : assign l ifstmt : assign : ID ASSIGN exp SEMI ; class StmtContext ifstmt: IF exp THEN stmt class AssignContext ELSE stmt ; class IfstmtContext exp class ExpContext : term (ADDOP term)*; class TermContext term : ID 1 INTLIT } l LP exp RP ; Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Abstract Syntax Tree 8/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_005.png",
"page_index": 179,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:06+07:00"
}
},
"CO3005-chapter-6-slide-180-0000": {
"id": "CO3005-chapter-6-slide-180-0000",
"text": "Example a=a+4 : ProgContext StmtContext grammar MC; prog : stmt+ : stmt : assign 1 ifstmt ; AssignContext assign : ID ASSIGN exp SEMI ; ifstmt: IF exp THEN stmt ELSE stmt ; ID ASSlGN ExpContext SEMI exp : term (ADDOP term)+ term : ID I INTLIT 1 LP exp RP ; TermContext ADDOP TermContext ID INTLIT Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 9/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_006.png",
"page_index": 180,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:10+07:00"
}
},
"CO3005-chapter-6-slide-181-0000": {
"id": "CO3005-chapter-6-slide-181-0000",
"text": "Access Children on Parse Tree Each symbol on RHS => one or two methods in the inner class class AssignContext { TerminalNode IDO {...} assign : ID ASSIGN exp SEMI ; TerminaINode ASSIGNO {:::} ExpContext exp0 {...} TerminalNode SEMI { . : : class StmtContext { stmt: assign l ifstmt : AssignContext assignO {. IfsmtContext ifstmtO {.::} Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 10/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_007.png",
"page_index": 181,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:12+07:00"
}
},
"CO3005-chapter-6-slide-182-0000": {
"id": "CO3005-chapter-6-slide-182-0000",
"text": "Multiple Appearance of Symbol in RHS Same symbol appears many times in RHS => 2 methods class IfstmtContext { List<StmtContext> stmtO) ifstmt : IF exp THEN stmt StmtContext stmt(int i {...} ELSE stmt ; ExpContext exp( {...} TerminaINode IF O{...} class ProgContext { prog : stmt+ : List<StmtContext> stmtO {...} StmtContext stmt(int i) {...} Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Abstract Syntax Tree 12/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_008.png",
"page_index": 182,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:14+07:00"
}
},
"CO3005-chapter-6-slide-183-0000": {
"id": "CO3005-chapter-6-slide-183-0000",
"text": "Some useful methods RuleContext getChild(int i): ith child if (assign(!=null) stmt : assign //do something on assign( else ifstmt ; //do same thing on ifstmt( //do something on getChild(0) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 14/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_009.png",
"page_index": 183,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:15+07:00"
}
},
"CO3005-chapter-6-slide-184-0000": {
"id": "CO3005-chapter-6-slide-184-0000",
"text": "Some useful methods int getChildCountO: number of children if (getChildCount( == 3 term : ID //do something on exp( INTLIT else LP exp RP; //do something on getChild(0 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 15/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_010.png",
"page_index": 184,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:17+07:00"
}
},
"CO3005-chapter-6-slide-185-0000": {
"id": "CO3005-chapter-6-slide-185-0000",
"text": "Visitor Generated by ANTLR Use option -visitor Method accept generated in each inner class <grammar name>+Visitor.java and <grammar name>+BaseVisitor.java generated grammar MC; => MCVisitor.java;MCBaseVisitor.java Each nonterminal symbol a => visitA(ctx:AContext) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 16/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_011.png",
"page_index": 185,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:19+07:00"
}
},
"CO3005-chapter-6-slide-186-0000": {
"id": "CO3005-chapter-6-slide-186-0000",
"text": "Example: MCVisitor interface MCVisitor<T> extends ParseTreeVisitor<T> T visitProg(MCParser.ProgContext ctx); T visitStmt (MCParser. StmtContext ctx) ; visitAssign(MCParser.AssignContext ctx); visitIfstmt (MCParser.IfstmtContext ctx) ; visitExp(MCParser.ExpContext ctx) : T visitTerm (MCParser.TermContext ctx ) ; 1 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 17/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_012.png",
"page_index": 186,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:22+07:00"
}
},
"CO3005-chapter-6-slide-187-0000": {
"id": "CO3005-chapter-6-slide-187-0000",
"text": "Example: In2Pos in Scala /* term: 1D 1 1NTL1T 1 LP exp RP*/ override def visitTerm(ctx :TermContext) = if (ctx.getChildCount( == 3) ctx.expO.accept(this) else ctx.getChild(0).getText /*exp: term (ADDOP term)* */ override def visitExp(ctx:ExpContext) = { val 1en = ctx.ADDOP.size(O var res = ctx.term(o).accept(this) for (i <- 1 to len) res = res + \" + ctx.term(i).accept(this) + . ctx.ADDOP(i -1).getText res Dr. Nguyen Hua Phung nhphung@hcmut .edu.vn Abstract Syntax Tree 18/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_013.png",
"page_index": 187,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:24+07:00"
}
},
"CO3005-chapter-6-slide-188-0000": {
"id": "CO3005-chapter-6-slide-188-0000",
"text": "Naming Right Hand Size To distinguish RHS, naming all RHS of a nonterminal exp: ID #ident visitldent(ctx:ldentContext) INTLIT #Iit visitLit(ctx:LitContext) LP exp RP #pexp visitPexp(ctx :PexpContext) exp ADD exp #addexp visitAddexp(ctx :AddexpContext) exp MUL exp #mulexp visitMulexp(ctx :MulExpContext) There is no visitExp anymore Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 19/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_014.png",
"page_index": 188,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:27+07:00"
}
},
"CO3005-chapter-6-slide-189-0000": {
"id": "CO3005-chapter-6-slide-189-0000",
"text": "AST for MC trait AST case class Prog(sl:List[Stmt]) extends AST trait Stmt extends AST case class Assign(id:String,e:Exp) extends Stmt case class IfStmt(e:Exp,s1 :Stmt,s2:Stmt) extends Stmt trait Exp extends AST case class BinOp(op:String,e1:Exp,e2:Exp) extends Exp case class ld(id:String) extends Exp case class Intlit(lit:Int) extends Exp Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 20/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_015.png",
"page_index": 189,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:30+07:00"
}
},
"CO3005-chapter-6-slide-190-0000": {
"id": "CO3005-chapter-6-slide-190-0000",
"text": "AST Generation Visitor /* term: 1D 1 1NTL1T 1 LP exp RP*/ override def visitTerm(ctx :TermContext) = if (ctx.getChildCount( == 3) ctx.expO.accept(this) else if (ctx.lD != null ld(ctx.ID.getText) else IntIit (ctx.INTLIT.getText.tolnt) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 21/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_016.png",
"page_index": 190,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:31+07:00"
}
},
"CO3005-chapter-6-slide-191-0000": {
"id": "CO3005-chapter-6-slide-191-0000",
"text": "AST Generation Visitor (cont) /* exp: term (ADDOP term)* */ /* case class BinOp(op:String,e1:Exp,e2:Exp extends Exp override def visitExp(ctx:ExpContext) = { val len = ctx.ADDOP.size() var res = c ctx.term(o).accept(this) for (i <- 1 to Ien) res = BinOp( ctx.ADDOP(i -1).getText, res.aslnstanceOf[Exp] ctx.term(i).accept(this).aslnstanceOf[Exp] res 3 + 4 - 5 => res = IntLit(3) res = BinOp(\"+\",IntLit(3),IntLit(4)) res = BinOp(\"-\",BinOp(\"+\",IntLit(3),IntLit(4)),IntLit(5)) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 22/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_017.png",
"page_index": 191,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:34+07:00"
}
},
"CO3005-chapter-6-slide-192-0000": {
"id": "CO3005-chapter-6-slide-192-0000",
"text": "AST Generation Visitor in Python /* term: 1D l 1NTL1T 1 LP exp RP*/ def visitTerm(self,ctx): if ctx.getChildCountO == 3: return ctx.expQ. accept(self) elif ctx.ID(): return Id(ctx.IDO.getText()) else : return IntLit(int(ctx.INTLITO.getTextO)) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 23/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_018.png",
"page_index": 192,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:36+07:00"
}
},
"CO3005-chapter-6-slide-193-0000": {
"id": "CO3005-chapter-6-slide-193-0000",
"text": "AST Generation Visitor in Python(cont /*exp: term (ADDOP term)* */ /* class BinOp(Exp): #op:String,e1:Exp,e2:Exp */ def visitExp(self,ctx): addsize = len(ctx.ADDOPO) res = ctx.term(o).accept(self) for i in range(1,addsize+1): res = BinOp( ctx.ADDOP(i-1).getText( res, ctx.term(i).accept(self)) return res Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 24/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_019.png",
"page_index": 193,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:38+07:00"
}
},
"CO3005-chapter-6-slide-194-0000": {
"id": "CO3005-chapter-6-slide-194-0000",
"text": "AST Generation Visitor in Python(cont) /*exp: term (ADDOP term)* */ /* class BinOp(Exp): #op:String,e1:Exp,e2:Exp */ /* 3 + 4 - 5 */ def visitExp(self,ctx): return reduce(lambda acc, ele : BinOp(ele [0].getText(), acc , ele[1].accept(self)) , zip(ctx.ADDOPO,ctx.termO[1:], # [(+,4),(-, ctx.term(0).accept(self)) Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 25/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_020.png",
"page_index": 194,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:41+07:00"
}
},
"CO3005-chapter-6-slide-195-0000": {
"id": "CO3005-chapter-6-slide-195-0000",
"text": "Summary AST vs. Parse tree AST representation in Scala how to build AST in Scala Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Abstract Syntax Tree 26/26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_6/slide_021.png",
"page_index": 195,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:42+07:00"
}
},
"CO3005-chapter-7-slide-196-0000": {
"id": "CO3005-chapter-7-slide-196-0000",
"text": "Name, Binding and Scope Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn HCMC University of Technology, Viet Nam November 7, 2020 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 1/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_001.png",
"page_index": 196,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:44+07:00"
}
},
"CO3005-chapter-7-slide-197-0000": {
"id": "CO3005-chapter-7-slide-197-0000",
"text": "Name o Name - character string used to represent something else o identifiers, operators (+, &, *). Use symbol instead of address to refer an entity Abstraction Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 3/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_002.png",
"page_index": 197,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:46+07:00"
}
},
"CO3005-chapter-7-slide-198-0000": {
"id": "CO3005-chapter-7-slide-198-0000",
"text": "Binding Definition Binding - the operation of associating two things Binding time - the moment when the binding is performed Some issues Early binding vs. Late binding Static binding vs. Dynamic binding Polymorphism - A name is bound to more than one entity Alias - Many names are bound to one entity Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 4/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_003.png",
"page_index": 198,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:49+07:00"
}
},
"CO3005-chapter-7-slide-199-0000": {
"id": "CO3005-chapter-7-slide-199-0000",
"text": "Binding Time Language design time Language implementation time Programming time Compilation time Linking time Load time Runtime Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 5/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_004.png",
"page_index": 199,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:51+07:00"
}
},
"CO3005-chapter-7-slide-200-0000": {
"id": "CO3005-chapter-7-slide-200-0000",
"text": "object Lifetime Object - any entity in the program. Obiect lifetime - the period between the obiect creation and destruction. Binding lifetime p Dangling reference p = new int; q = p; delete p; q *q; Leak memory - Garbage p = new int; p = null; Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 7/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_005.png",
"page_index": 200,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:53+07:00"
}
},
"CO3005-chapter-7-slide-201-0000": {
"id": "CO3005-chapter-7-slide-201-0000",
"text": "Object Allocation Static Static Stack Dynamic Stack Explicit Heap Dynamic o Implicit Heap Dynamic Heap Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 8/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_006.png",
"page_index": 201,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:55+07:00"
}
},
"CO3005-chapter-7-slide-202-0000": {
"id": "CO3005-chapter-7-slide-202-0000",
"text": "Scope Definition Scope of a binding is the textual region of the program in which the binding is effective Static vs. Dynamic Static scope, or lexical scope, is determined during compilation o Current binding - in the block most closely surround o Global scope o Local static scope Dynamic scope is determined at runtime. Current binding - the most recently execution but not destroyed Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 11/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_007.png",
"page_index": 202,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:22:57+07:00"
}
},
"CO3005-chapter-7-slide-203-0000": {
"id": "CO3005-chapter-7-slide-203-0000",
"text": "Blocks Definition A block is a textual region, which can contain declarations to that region Example, procedure foo () 1 var x:integer ; int x; begin x = 1; x := 1; } end ; Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 12/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_008.png",
"page_index": 203,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:00+07:00"
}
},
"CO3005-chapter-7-slide-204-0000": {
"id": "CO3005-chapter-7-slide-204-0000",
"text": "Staic Scope Rules for Blocks o A reference to an identifier is always bound to its most local declaration o A declaration is invisible outside the block in which it appears Declarations in enclosing blocks are visible in inner blocks, unless they have been re-declared Blocks may be named and its name declaration is considered as a local declaration of outer block Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 13/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_009.png",
"page_index": 204,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:02+07:00"
}
},
"CO3005-chapter-7-slide-205-0000": {
"id": "CO3005-chapter-7-slide-205-0000",
"text": "Example on Static scope var A, B, C: real; //1 procedure Sub1 (A: real);//2 var D: real: procedure Sub2 (C: real): Variable Scope var D: real; A:real //1 Main begin B:real //1 Main, Sub1, C:= C+B: : Sub2 end; C:real //1 Main, Sub1 begin A:real //2 Sub1,Sub2 Sub2(B); .. end; begin Sub1(A); . . end. Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 14/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_010.png",
"page_index": 205,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:05+07:00"
}
},
"CO3005-chapter-7-slide-206-0000": {
"id": "CO3005-chapter-7-slide-206-0000",
"text": "Example on Dynamic Scope procedure Big is X : Real; procedure Sub1 is X : Integer; X in Sub2 ? begin - of Sub1 Calling chain: Big -> Sub1 -> Sub2 end; - of Sub1 X => X:Integer in Sub1 procedure Sub2 is Calling chain: begin - of Sub2 Big -> Sub2 .X.. X = X:Real in Big end; - of Sub2 begin - of Big end; - of Big Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 15/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_011.png",
"page_index": 206,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:07+07:00"
}
},
"CO3005-chapter-7-slide-207-0000": {
"id": "CO3005-chapter-7-slide-207-0000",
"text": "Referencing Environment o The referencing environment of a statement is the collection of all names that are visible to the statement o In a static-scoped language, it is the local names plus all of the visible names in all of the enclosing scopes o In a dynamic-scoped language, the referencing environment is the local bindings plus all visible bindings in all active subprograms Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 16/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_012.png",
"page_index": 207,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:10+07:00"
}
},
"CO3005-chapter-7-slide-208-0000": {
"id": "CO3005-chapter-7-slide-208-0000",
"text": "Example on Static-scoped Language var A, B, C: real; //1 procedure Sub1 (A: real);//2 var D: real: procedure Sub2 (C: real); Function Referencing var D: real; Environment begin Main A,B,C,Sub1 C:= C+B; . Sub1 A, B, C, D, end; Sub1,Sub2 begin Sub2(B); .. Sub2 A, B,C, D, end; Sub1,Sub2 begin Sub1(A); . . end. Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 17/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_013.png",
"page_index": 208,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:12+07:00"
}
},
"CO3005-chapter-7-slide-209-0000": {
"id": "CO3005-chapter-7-slide-209-0000",
"text": "Example on Dynamic-scoped Language main > sub2 y s sub2 > sub1 void sub1{ c 01 b 03 b 05 a 07 int a, b; d 02 c 04 c 06 b 08 } /* end of sub1 */ void sub20 { int b, c; Frame Referencing Environment sub1: main c->o1,d->o2 } /* end of sub2 */ sub2 b-> o3,c-> o4, void main( { d->o2 int c, d; sub2 b->o5,c->o6, d->o2 sub20; sub1 a->o7,b-> o8. } /* end of main */ c->o6,d->o2 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 18/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_014.png",
"page_index": 209,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:16+07:00"
}
},
"CO3005-chapter-7-slide-210-0000": {
"id": "CO3005-chapter-7-slide-210-0000",
"text": "Functions def <func-name>(<parameter-list >) : <stmt-list > nested function pass-by-value (pointer) matched by position and by name default value arbitrary parameters arbitrary keyword parameters return statement Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 20/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_015.png",
"page_index": 210,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:18+07:00"
}
},
"CO3005-chapter-7-slide-211-0000": {
"id": "CO3005-chapter-7-slide-211-0000",
"text": "Nested Functions def outer(x) : y = x + 1 def inner(z): return z + 1 return inner(y) print(outer(3) =>5 print(inner(2)) =>wrong o inner function is visible inside outer but invisible outside outer Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 21/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_016.png",
"page_index": 211,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:20+07:00"
}
},
"CO3005-chapter-7-slide-212-0000": {
"id": "CO3005-chapter-7-slide-212-0000",
"text": "Match by position and by name def foo(param1, param2 = 0): print(param1, param2 print(foo(1,2)) =>12 print(foo(param2 = 2,param1 = 1)) =>12 print(foo(1)) =>10 Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 22/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_017.png",
"page_index": 212,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:22+07:00"
}
},
"CO3005-chapter-7-slide-213-0000": {
"id": "CO3005-chapter-7-slide-213-0000",
"text": "Arbitrary Arguments, *args def my_func(*kids): print(\"My third child is\" + kids[2] my_func('Tuong', 'Ca', 'Mam', 'Muoi' o Allow arbitrary number of arguments Access the parameter as a tuple o Define after normal parameters Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 23/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_018.png",
"page_index": 213,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:23+07:00"
}
},
"CO3005-chapter-7-slide-214-0000": {
"id": "CO3005-chapter-7-slide-214-0000",
"text": "Arbitrary keyword Arguments, **kwargs def my_func(**rec): for x,y in rec.itemsQ: print(x,y) my_func(ho='nguyen',ten='thi ha', namsinh=1996,mssv='0123456') o Allow arbitrary number of keyword arguments Access the parameter as a dictionary o Define after normal and arbitrary parameters Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 24/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_019.png",
"page_index": 214,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:25+07:00"
}
},
"CO3005-chapter-7-slide-215-0000": {
"id": "CO3005-chapter-7-slide-215-0000",
"text": "Return Statement Syntax: return (<exp> (, <exp>)*)? Example: def my_func(x): x = 2 return x,x+2 a,b = my_func(0) print(a,b) =>24 Stop executing of a function call and return the result If no expression after return, None is returned If many expressions after return, a tup/e is returned Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 25/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_020.png",
"page_index": 215,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:28+07:00"
}
},
"CO3005-chapter-7-slide-216-0000": {
"id": "CO3005-chapter-7-slide-216-0000",
"text": "Scope o Read: Block rule, where a function is a block Local Nonlocal J Global o Built-in or imported environments Write: global, nonlocal Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 26/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_021.png",
"page_index": 216,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:30+07:00"
}
},
"CO3005-chapter-7-slide-217-0000": {
"id": "CO3005-chapter-7-slide-217-0000",
"text": "Scope Example from functools import * => imported env. x = 3 => global def f O : y = 4 => nonlocal of g def g(): t = 2 => local of g print(z) declaration of z is looked firstly in local environment W and then in nonlocal environments that enclose the local and then in global environment o and lastly in imported environments Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 27/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_022.png",
"page_index": 217,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:33+07:00"
}
},
"CO3005-chapter-7-slide-218-0000": {
"id": "CO3005-chapter-7-slide-218-0000",
"text": "global Example x,y = 1 3,4 1 => x,y: global def f O: 2 3 x = 2 => x: local of f return x + y => x: local of f;y global 4 5 def gO) : global x 6 x = 2 => x: global return 2 + x 8 f () 10 print(x) => 3 g() 11 print(x) => 2 12 firstly assigning to a variable makes the declaration of the variable in the current environment o to assign to a global variable in a function, the declaration of global is required Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 28/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_023.png",
"page_index": 218,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:36+07:00"
}
},
"CO3005-chapter-7-slide-219-0000": {
"id": "CO3005-chapter-7-slide-219-0000",
"text": "nonlocal Example x,y = 3,4 => x,y: global def f O: 2 3 x,z = 2,5 => x,z: local of f def g(): 4 5 nonlocal x x = 2 * y 6 => x: nonlocal=>local of f;y:global 7 return z + x => x,z:nonlocal=>local of f; 8 print(g()) => 13 print(x) => 8 9 f () 10 print(x) => 3 11 o like global but for nonlocal variables Dr.Nguyen Hua Phung nhphung@hcmut.edu.vn Name,Binding and Scope 29/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_024.png",
"page_index": 219,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:40+07:00"
}
},
"CO3005-chapter-7-slide-220-0000": {
"id": "CO3005-chapter-7-slide-220-0000",
"text": "Summary [1] Name Binding Scope Referencing Environment Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 30/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_025.png",
"page_index": 220,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:41+07:00"
}
},
"CO3005-chapter-7-slide-221-0000": {
"id": "CO3005-chapter-7-slide-221-0000",
"text": "References l , Maurizio Gabbrielli and Simone Martini, Programming Languages: Principles and Paradigms, Chapter 4, Springer, 2010. Dr. Nguyen Hua Phung nhphung@hcmut.edu.vn Name, Binding and Scope 31/31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_7/slide_026.png",
"page_index": 221,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:42+07:00"
}
},
"CO3005-chapter-8-slide-222-0000": {
"id": "CO3005-chapter-8-slide-222-0000",
"text": "Data Types Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam November 13,2020 Dr. Nguyen Hua Phung Data Types 1/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_001.png",
"page_index": 222,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:43+07:00"
}
},
"CO3005-chapter-8-slide-223-0000": {
"id": "CO3005-chapter-8-slide-223-0000",
"text": "Outline Scalar Types Built-in Types User-Defined Ordinal Types Composite Types Array Types String Types Record Types Union Types Set Types Pointer and Reference Types Recursive Type Type Checking Case Study: Python Dr. Nguyen Hua Phung Data Types 2/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_002.png",
"page_index": 223,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:45+07:00"
}
},
"CO3005-chapter-8-slide-224-0000": {
"id": "CO3005-chapter-8-slide-224-0000",
"text": "ntroduction A data type is o a homogeneous collection of values and o a set of operations which manipulate these values o Uses of type system: . Conceptual organization Error detection Implementation Dr. Nguyen Hua Phung Data Types 3/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_003.png",
"page_index": 224,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:47+07:00"
}
},
"CO3005-chapter-8-slide-225-0000": {
"id": "CO3005-chapter-8-slide-225-0000",
"text": "Iype System A type system consists of: The set of predefined types The mechanisms to define a new type The mechanisms for the control of types: o Type equivalence Type compatibility Type inference The specification which type constraints are statically or dynamically checked Dr. Nguyen Hua Phung Data Types 4/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_004.png",
"page_index": 225,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:50+07:00"
}
},
"CO3005-chapter-8-slide-226-0000": {
"id": "CO3005-chapter-8-slide-226-0000",
"text": "Scalar Types Scalar Types are o atomic used to compose another types sometimes supported directly by hardware booleans, characters, integers, floating-point, fixed-point, complex, void, enumerations, intervals,.. >Skip Scalar Types Dr. Nguyen Hua Phung Data Types 6/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_005.png",
"page_index": 226,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:51+07:00"
}
},
"CO3005-chapter-8-slide-227-0000": {
"id": "CO3005-chapter-8-slide-227-0000",
"text": "Integer Languages may support several sizes of integer o Java's signed integer sizes: byte, short, int, long Some languages include unsigned integers Supported directly by hardware: a string of bits To represent negative numbers: two's complement Dr. Nguyen Hua Phung Data Types 7/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_006.png",
"page_index": 227,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:53+07:00"
}
},
"CO3005-chapter-8-slide-228-0000": {
"id": "CO3005-chapter-8-slide-228-0000",
"text": "-loating-Point Model real numbers, but only as approximations Languages for scientific use support at least two floating-point types (e.g., float and double) Precision and range lEEE Floating-Point Standard 754 Dr. Nguyen Hua Phung Data Types 8/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_007.png",
"page_index": 228,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:55+07:00"
}
},
"CO3005-chapter-8-slide-229-0000": {
"id": "CO3005-chapter-8-slide-229-0000",
"text": "IEEE-754 Sign bit 8 bits 23 bits S Exponent Fraction Single precision 11 bits 52 bits s Exponent Mantissa Double precision Dr. Nguyen Hua Phung Data Types 9/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_008.png",
"page_index": 229,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:56+07:00"
}
},
"CO3005-chapter-8-slide-230-0000": {
"id": "CO3005-chapter-8-slide-230-0000",
"text": "Decimal o For business applications (money o Essential to COBOL o C#offers a decimal data type Store a fixed number of decimal digits Advantage: accuracy Disadvantage: limited range, wastes memory Dr. Nguyen Hua Phung Data Types 10/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_009.png",
"page_index": 230,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:23:59+07:00"
}
},
"CO3005-chapter-8-slide-231-0000": {
"id": "CO3005-chapter-8-slide-231-0000",
"text": "Boolean Simplest of all Range of values: two elements, one for \"true\" and one for \"false o Could be implemented as bits, but often as bytes Dr. Nguyen Hua Phung Data Types 11/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_010.png",
"page_index": 231,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:00+07:00"
}
},
"CO3005-chapter-8-slide-232-0000": {
"id": "CO3005-chapter-8-slide-232-0000",
"text": "Character Stored as numeric codings Most commonly used coding: ASCll o An alternative, 16-bit coding: Unicode o Includes characters from most natural languages Originally used in Java C# and JavaScript also support Unicode Dr. Nguyen Hua Phung Data Types 12/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_011.png",
"page_index": 232,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:02+07:00"
}
},
"CO3005-chapter-8-slide-233-0000": {
"id": "CO3005-chapter-8-slide-233-0000",
"text": "User-Defined Ordinal Types An ordinal type is one in which the range of possible values can be easily associated with the set of positive integers Examples of primitive ordinal types in Java integer char boolean Dr. Nguyen Hua Phung Data Types 13/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_012.png",
"page_index": 233,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:03+07:00"
}
},
"CO3005-chapter-8-slide-234-0000": {
"id": "CO3005-chapter-8-slide-234-0000",
"text": "Enumeration Types All possible values, which are named constants, are provided in the definition o C# example enum days {Mon, Tue, Wed, Thu, Fri, Sat, Sun}; days myDay = Mon, yourDay = Tue; o Design issues: Is an enumeration constant allowed to appear in more than one type definition? Are enumeration values coerced to integer? Are any other types coerced to an enumeration type? Dr. Nguyen Hua Phung Data Types 14/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_013.png",
"page_index": 234,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:05+07:00"
}
},
"CO3005-chapter-8-slide-235-0000": {
"id": "CO3005-chapter-8-slide-235-0000",
"text": "Enumeration Type (2) Readability . no need to code a color as a number Reliability 1 operations (don't allow colors to be added) o No enumeration variable can be assigned a value outside its defined range Better support for enumeration than C++: enumeration type variables are not coerced into integer types Implemented as integers Dr. Nguyen Hua Phung Data Types 15/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_014.png",
"page_index": 235,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:08+07:00"
}
},
"CO3005-chapter-8-slide-236-0000": {
"id": "CO3005-chapter-8-slide-236-0000",
"text": "Subrange Type an ordered contiguous subsequence of an ordinal type type pos = 0 .. MAXINT: Subrange types behave as their parent types; can be used as for variables and array indices type sv = array[1 .. 50] of string, Subrange types are the parent types with code inserted (by the compiler) to restrict assignments to subrange variables Dr. Nguyen Hua Phung Data Types 16/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_015.png",
"page_index": 236,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:10+07:00"
}
},
"CO3005-chapter-8-slide-237-0000": {
"id": "CO3005-chapter-8-slide-237-0000",
"text": "Composite Types An object in composite type contains many components which can be accessed individually component's type may be the same (homogeneous or different (heterogeneous) the number of components may be fixed or changed there may be operations on structured-type object or its components there may be component insertion/removal operations there may be creation/destruction operations Dr. Nguyen Hua Phung Data Types 18/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_016.png",
"page_index": 237,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:12+07:00"
}
},
"CO3005-chapter-8-slide-238-0000": {
"id": "CO3005-chapter-8-slide-238-0000",
"text": "Array Types Collection of homogeneous data elements Each element is identified by its position relative to the first element and referenced using subscript expression array_name (index expression list) -> an element o What type are legal for subscripts? Pascal, Ada: any ordinal type (integer, boolean, char, enumeration) o Others: subrange of integers Are subscripting expressions range checked? Most contemporary languages do not specify range checking but Java, ML, C# o Unusual case: Perl >Skip Array Type Dr. Nguyen Hua Phung Data Types 19/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_017.png",
"page_index": 238,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:15+07:00"
}
},
"CO3005-chapter-8-slide-239-0000": {
"id": "CO3005-chapter-8-slide-239-0000",
"text": "Subscript Binding and Array Categories Static static int x[10]; Fixed Stack-dynamic int x[10]; //inside a function Stack-dynamic cin >n; int x[n]; o Fixed Heap-dynamic int[] x = new int[10]; Heap-dynamic cin >n; int[] x = new int[n], Dr. Nguyen Hua Phung Data Types 20/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_018.png",
"page_index": 239,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:17+07:00"
}
},
"CO3005-chapter-8-slide-240-0000": {
"id": "CO3005-chapter-8-slide-240-0000",
"text": "Array lnitialization Some language allow initialization at the time of storage allocation o C, C++, Java, C# example int list [] ={4, 5, 7, 83} Character strings in C and C++ char name [ = \"freddie\": Arrays of strings in C and C++ char *names [] = {\"Bob\" \"Jake\", \"Joe\"}, Java initialization of String objects String[] names = {\"Bob\", \"Jake\", \"Joe\"}, Dr. Nguyen Hua Phung Data Types 21/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_019.png",
"page_index": 240,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:20+07:00"
}
},
"CO3005-chapter-8-slide-241-0000": {
"id": "CO3005-chapter-8-slide-241-0000",
"text": "Rectangular and Jagged Arrays o C, C++, Java, C#: jagged arrays myArray[3][7] Fortran, Ada, C#: rectangular array myArray[3,7] rectangular jagged Dr. Nguyen Hua Phung Data Types 22/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_020.png",
"page_index": 241,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:21+07:00"
}
},
"CO3005-chapter-8-slide-242-0000": {
"id": "CO3005-chapter-8-slide-242-0000",
"text": "Slices A slice is some substructure of an array; nothing more than a referencing mechanism o Slices are only useful in languages that have array operations E.g. Python vector =/2, 4, 6, 8, 10, 12, 14, 16 mat = [[1, 2, 3],[4, 5, 6],[7, 8, 9]] vector[3:6], mat[1], mat[0][0:2] Dr. Nguyen Hua Phung Data Types 23/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_021.png",
"page_index": 242,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:23+07:00"
}
},
"CO3005-chapter-8-slide-243-0000": {
"id": "CO3005-chapter-8-slide-243-0000",
"text": "Implementation of Arrays o Access function maps subscript expressions to an address in the array Single-dimensioned: list of adjacent memory cells Access function for single-dimensioned arrays: address(list[k]) = address(list[lower bound]) + ((k-lower_bound) * element_size) Dr. Nguyen Hua Phung Data Types 24/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_022.png",
"page_index": 243,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:25+07:00"
}
},
"CO3005-chapter-8-slide-244-0000": {
"id": "CO3005-chapter-8-slide-244-0000",
"text": "Accessing Two-dimensional Arrays a[0,0] a[0,0] a[0,1] a[1,0] a[0,2] a[2,0] a[1,0] a[0,1] a[1,1] a[1,1] a[1,2] a[2,1] Row-major order Column-major order used in most languages used in Fortran Dr. Nguyen Hua Phung Data Types 25/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_023.png",
"page_index": 244,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:27+07:00"
}
},
"CO3005-chapter-8-slide-245-0000": {
"id": "CO3005-chapter-8-slide-245-0000",
"text": "Accessing Two-dimensional Arrays Row-major order : Location (a[i,j]) = a + (((i - row_Ib) * n) + (j - col_Ib)) * E where a is address of a[row_lb,col_lb] and E is element size 1 2 ...j-1 j ... n 1 2 ... i-1 i ... m Dr. Nguyen Hua Phung Data Types 26/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_024.png",
"page_index": 245,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:29+07:00"
}
},
"CO3005-chapter-8-slide-246-0000": {
"id": "CO3005-chapter-8-slide-246-0000",
"text": "Compile-time Descriptors Multidimensional array Element type Index type Array Number of dimensions Element type Index range 1 Index type Index lower bound ... Index upper bound Index range n Address Address Single dimensional array Multi-dimensional array Dr. Nguyen Hua Phung Data Types 27/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_025.png",
"page_index": 246,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:32+07:00"
}
},
"CO3005-chapter-8-slide-247-0000": {
"id": "CO3005-chapter-8-slide-247-0000",
"text": "Associative Arrays An associative array is an unordered collection of data elements that are indexed by an equal number of values called keys For example, dt = [(\"name\",\"John\");(\"age\",\"28\");(\"address\",\"1 John st.\")] dt[\"name\"] = \"John\" dt[\"address\"] => \"1 John st.\" o User defined keys must be stored Similar to Map in Scala Design issues: What is the form of references to elements Dr. Nguyen Hua Phung Data Types 28/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_026.png",
"page_index": 247,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:34+07:00"
}
},
"CO3005-chapter-8-slide-248-0000": {
"id": "CO3005-chapter-8-slide-248-0000",
"text": "String Types Values are sequences of characters Design issues: Is it a primitive type or just a special kind of array? . Should the length of strings be static or dynamic? Typical operations Assignment Comparison (=, >, etc.) Concatenation Substring reference Pattern matching (regular expression) Skip String Type Dr. Nguyen Hua Phung Data Types 29/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_027.png",
"page_index": 248,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:36+07:00"
}
},
"CO3005-chapter-8-slide-249-0000": {
"id": "CO3005-chapter-8-slide-249-0000",
"text": "String Length Options Static: String length is fixed at compiling time Python, Java String class o compile-time descriptor Limited Dynamic: String length may be changed but less than a limit o C,C++ o run-time descriptor Dynamic: String length may be changed without any limit o Perl, JavaScript run-time descriptor; linked list Ada supports all three string length options Dr. Nguyen Hua Phung Data Types 30/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_028.png",
"page_index": 249,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:39+07:00"
}
},
"CO3005-chapter-8-slide-250-0000": {
"id": "CO3005-chapter-8-slide-250-0000",
"text": "Descriptor Limited dynamic string Static string Maximum length String length Current length Address Address Compile-time descriptor Run-time descriptor for static length strings for limited dynamic length strings Dr. Nguyen Hua Phung Data Types 31/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_029.png",
"page_index": 250,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:41+07:00"
}
},
"CO3005-chapter-8-slide-251-0000": {
"id": "CO3005-chapter-8-slide-251-0000",
"text": "Record Types o A record: o heterogeneous aggregate of data elements o individual elements are identified by names o Popular in most languages, OO languages use objects as records Design issues: o What is the syntactic form of references to the field? o Are elliptical references allowed Skip Record Type Dr. Nguyen Hua Phung Data Types 32/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_030.png",
"page_index": 251,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:43+07:00"
}
},
"CO3005-chapter-8-slide-252-0000": {
"id": "CO3005-chapter-8-slide-252-0000",
"text": "Definition of Records in Ada Record structures are indicated in an orthogonal way type Emp_Name_Type is record First: String (1..20), Mid: String (1..10); Last: String (1..20); end record; type Emp_Rec_Type is record Emp Name: Emp Name_Type, Hourly_Rate: Float; end record; Emp_Rec: Emp_Rec_Type; Dr. Nguyen Hua Phung Data Types 33/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_031.png",
"page_index": 252,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:45+07:00"
}
},
"CO3005-chapter-8-slide-253-0000": {
"id": "CO3005-chapter-8-slide-253-0000",
"text": "References to Records Notation: o Dot-notation: Emp Rec.Emp Name.Mia Keyword-based: Mid OF Emp_Name OF Emp_Rec o Format: Fully qualified references: include all record names Elliptical references: may leave out some record names as long as reference is unambiguous Mid, Mid OF Emp Name, Mid OF Emp_Rec Dr. Nguyen Hua Phung Data Types 34/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_032.png",
"page_index": 253,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:47+07:00"
}
},
"CO3005-chapter-8-slide-254-0000": {
"id": "CO3005-chapter-8-slide-254-0000",
"text": "Operations in Records Assignment is very common if the types are identical Ada allows record comparison Ada records can be initialized with aggregate literals COBOL provides MOVE CORRESPONDING Copies fields which have the same name Dr. Nguyen Hua Phung Data Types 35/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_033.png",
"page_index": 254,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:50+07:00"
}
},
"CO3005-chapter-8-slide-255-0000": {
"id": "CO3005-chapter-8-slide-255-0000",
"text": "Evaluation Straight forward and safe design Comparison of arrays and records Arrays Records homogenous heterogeneous elements are pro- elements are pro- cessed in the same cessed in different way way dynamic subscripting static subscripting Dr. Nguyen Hua Phung Data Types 36/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_034.png",
"page_index": 255,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:52+07:00"
}
},
"CO3005-chapter-8-slide-256-0000": {
"id": "CO3005-chapter-8-slide-256-0000",
"text": "mplementation of Record Type Record Name Type Field 1 Offset .. ... Name Type Field n Offset Address Dr. Nguyen Hua Phung Data Types 37/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_035.png",
"page_index": 256,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:54+07:00"
}
},
"CO3005-chapter-8-slide-257-0000": {
"id": "CO3005-chapter-8-slide-257-0000",
"text": "Data Alignment b-byte aligned A b-byte aligned object has an address that is a multiple of b bytes. Example A char (one byte) will be 1-byte aligned A short (two bytes) will be 2-byte aligned A int (four bytes) will be 4-byte aligned. A long (four bytes) will be 4-byte aligned. A float (four bytes) will be 4-byte aligned. Dr. Nguyen Hua Phung Data Types 38/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_036.png",
"page_index": 257,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:56+07:00"
}
},
"CO3005-chapter-8-slide-258-0000": {
"id": "CO3005-chapter-8-slide-258-0000",
"text": "Data structure Padding Padding when a structure member is followed by a member with a larger alignment requirement, or at the end of the structure to make the structure size be multiple of the biggest member size. struct MyStruct { char data1 : int data2; char data3; short data4; char data5; }; What is the size of the above struct? Dr. Nguyen Hua Phung Data Types 39/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_037.png",
"page_index": 258,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:24:58+07:00"
}
},
"CO3005-chapter-8-slide-259-0000": {
"id": "CO3005-chapter-8-slide-259-0000",
"text": "Union Types A union is a type whose variables are allowed to store different type values at different times during execution type Shape is (Circle, Triangle, Rectangle); type Colors is (Red, Green, Blue); type Figure (Form: Shape) is record Filled: Boolean; Color: Colors; case Form is when Circle => Diameter: Float; when Triangle => Leftside, Rightside: Integer, Angle: Float; when Rectangle => Side1, Side2: Integer, end case; end record: Skip Union Type Dr. Nguyen Hua Phung Data Types 40/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_038.png",
"page_index": 259,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:01+07:00"
}
},
"CO3005-chapter-8-slide-260-0000": {
"id": "CO3005-chapter-8-slide-260-0000",
"text": "Ada Union Type Illustrated rectangle: side1, side2 circle: diameter triangle: leftside, rightside, angle Discriminant(form) color filled Dr. Nguyen Hua Phung Data Types 41/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_039.png",
"page_index": 260,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:02+07:00"
}
},
"CO3005-chapter-8-slide-261-0000": {
"id": "CO3005-chapter-8-slide-261-0000",
"text": "Design issues Should type checking be required? Discriminated vs. Free Union Fortran, C, and C++ provide union constructs in which there is no language support for type checking the union in these languages is called free union Type checking of unions reguire that each union include a type indicator called a discriminant o Supported by Ada Should unions be embedded in records? Dr. Nguyen Hua Phung Data Types 42/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_040.png",
"page_index": 261,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:04+07:00"
}
},
"CO3005-chapter-8-slide-262-0000": {
"id": "CO3005-chapter-8-slide-262-0000",
"text": "Example union { x.bt[0] x.bt[1] int data; char bt[2] 12 7A } x; x.data = 0x7A12: x.data cout << x.bt[0] << endl;//18 cout << x.bt[1] << endl;//122 Dr. Nguyen Hua Phung Data Types 43/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_041.png",
"page_index": 262,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:05+07:00"
}
},
"CO3005-chapter-8-slide-263-0000": {
"id": "CO3005-chapter-8-slide-263-0000",
"text": "Evaluation ot Unions o Potentially unsafe construct in some languages o Do not allow type checking Java and C# do not support unions Reflective of growing concerns for safety in programming language Dr. Nguyen Hua Phung Data Types 44/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_042.png",
"page_index": 263,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:07+07:00"
}
},
"CO3005-chapter-8-slide-264-0000": {
"id": "CO3005-chapter-8-slide-264-0000",
"text": "Set Types x: set of 1..10; y: set of char; represent the concept of set has operators: membership, union, intersection. different,... implemented by bit chain or hash table. Dr. Nguyen Hua Phung Data Types 45/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_043.png",
"page_index": 264,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:09+07:00"
}
},
"CO3005-chapter-8-slide-265-0000": {
"id": "CO3005-chapter-8-slide-265-0000",
"text": "Pointer Types int *ptr; A pointer type variable has a range of values that consists of memory addresses and a special value nil Provide the power of indirect addressing o Provide a way to manage dynamic memory A pointer can be used to access a location in the area where storage is dynamically created (usually called a heap) Skip Pointer Type Dr. Nguyen Hua Phung Data Types 46/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_044.png",
"page_index": 265,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:12+07:00"
}
},
"CO3005-chapter-8-slide-266-0000": {
"id": "CO3005-chapter-8-slide-266-0000",
"text": "Pointer Operations Two fundamental operations: assignment and dereferencing Assignment is used to set a pointer variable's value to some useful address int *p,*q; p= q Dereferencing yields the value stored at the location represented by the pointer's value o Dereferencing can be explicit or implicit C++ uses an explicit operation via j = *ptr sets j to the value located at ptr Dr. Nguyen Hua Phung Data Types 47/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_045.png",
"page_index": 266,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:14+07:00"
}
},
"CO3005-chapter-8-slide-267-0000": {
"id": "CO3005-chapter-8-slide-267-0000",
"text": "Pointer Dereferencing lllustrated 7080 An anonymous 206 dynamic variable ptr 7080 206 The dereferencing operation j = *ptr Dr. Nguyen Hua Phung Data Types 48/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_046.png",
"page_index": 267,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:16+07:00"
}
},
"CO3005-chapter-8-slide-268-0000": {
"id": "CO3005-chapter-8-slide-268-0000",
"text": "Problems with Pointers Dangling pointers (dangerous) o A pointer points to a heap-dynamic variable that has been de-allocated Lost heap-dynamic variable o An allocated heap-dynamic variable that is no longer accessible to the user program (often called garbage) Dr. Nguyen Hua Phung Data Types 49/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_047.png",
"page_index": 268,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:17+07:00"
}
},
"CO3005-chapter-8-slide-269-0000": {
"id": "CO3005-chapter-8-slide-269-0000",
"text": "Pointers in C and C++ int *ptr ; int count, init : ptr = &init ; count = *ptr : Extremely flexible but must be used with care Pointers can point at any variable regardless of when it was allocated o Used for dynamic storage management and addressing Dr. Nguyen Hua Phung Data Types 50/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_048.png",
"page_index": 269,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:20+07:00"
}
},
"CO3005-chapter-8-slide-270-0000": {
"id": "CO3005-chapter-8-slide-270-0000",
"text": "Pointers in C and C++ Pointer arithmetic is possible int Iist [10l int *ptr ; ptr = Iist : *(ptr + 1) *(ptr + index) ptr [index] Explicit dereferencing and address-of operators Domain type need not be fixed (void *) void * can point to any type and can be type checked (cannot be de-referenced) Dr. Nguyen Hua Phung Data Types 51/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_049.png",
"page_index": 270,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:22+07:00"
}
},
"CO3005-chapter-8-slide-271-0000": {
"id": "CO3005-chapter-8-slide-271-0000",
"text": "Pointer Operations o Pointer points to a record in C/C++ Explicit: (*p).name Implicit: p -> name Management of heap use explicit allocation o C: function malloc o C++: new and delete operators Dr. Nguyen Hua Phung Data Types 52/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_050.png",
"page_index": 271,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:23+07:00"
}
},
"CO3005-chapter-8-slide-272-0000": {
"id": "CO3005-chapter-8-slide-272-0000",
"text": "Design lssues of Pointers What are the scope of and lifetime of a pointer variable? What is the lifetime of a heap-dynamic variable? Are pointers restricted as to the type of value to which they can point? Are pointers used for dynamic storage management indirect addressing, or both? Should the language support pointer types, reference types, or both? Dr. Nguyen Hua Phung Data Types 53/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_051.png",
"page_index": 272,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:25+07:00"
}
},
"CO3005-chapter-8-slide-273-0000": {
"id": "CO3005-chapter-8-slide-273-0000",
"text": "Reference Types int A; int &rA = A; A = 1; cout << rA << endI; rA++; cout << A << endI Pointers refer to an address, references refer to object or value o C++ includes a special kind of pointer type called a reference type that is used primarily for formal parameters o Java extends C++'s reference variables and allows them to replace pointers entirely C# includes both the references of Java and the pointers of C++ Dr. Nguyen Hua Phung Data Types 54/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_052.png",
"page_index": 273,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:28+07:00"
}
},
"CO3005-chapter-8-slide-274-0000": {
"id": "CO3005-chapter-8-slide-274-0000",
"text": "References vs. Pointers in C++ Reference Type Pointer int A; int A; int& rA = A; int* pA = &A; rA=> A *pA => A N/A pA++ cannot reseated pA =&B cannot be null pA = null cannot be uninitialized int* pA Dr. Nguyen Hua Phung Data Types 55/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_053.png",
"page_index": 274,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:31+07:00"
}
},
"CO3005-chapter-8-slide-275-0000": {
"id": "CO3005-chapter-8-slide-275-0000",
"text": "Evaluation of Pointers Dangling pointers and garbage are big problems o Pointers are like goto's-they widen the range of cells that can be accessed by a variable Essential in some kinds of programming applications. e.g. device drivers Using references provide some of the flexibility and capabilities of pointers, without the hazards Dr. Nguyen Hua Phung Data Types 56/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_054.png",
"page_index": 275,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:32+07:00"
}
},
"CO3005-chapter-8-slide-276-0000": {
"id": "CO3005-chapter-8-slide-276-0000",
"text": "Representations of Pointers Most computers use single values Intel microprocessors use segment and offset Dr. Nguyen Hua Phung Data Types 57/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_055.png",
"page_index": 276,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:33+07:00"
}
},
"CO3005-chapter-8-slide-277-0000": {
"id": "CO3005-chapter-8-slide-277-0000",
"text": "Dangling Pointer Problem Tombstone: extra heap cell that is a pointer to the heap-dynamic variable The actual pointer variable points only at tombstones o When heap-dynamic variable de-allocated, tombstone remains but set to nil o Costly in time and space Locks-and-keys: Pointer values are represented as (key, address) pairs o Heap-dynamic variables are represented as variable plus cell for integer lock value When heap-dynamic variable allocated, lock value is created and placed in lock cell and key cell of pointer Dr. Nguyen Hua Phung Data Types 58/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_056.png",
"page_index": 277,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:36+07:00"
}
},
"CO3005-chapter-8-slide-278-0000": {
"id": "CO3005-chapter-8-slide-278-0000",
"text": "Blank Dr. Nguyen Hua Phung Data Types 59/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_057.png",
"page_index": 278,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:37+07:00"
}
},
"CO3005-chapter-8-slide-279-0000": {
"id": "CO3005-chapter-8-slide-279-0000",
"text": "Recursive Type A value of a recursive type can contain a (reference to) value of the same type. type int_list = {int val; int list next;} {3,{43,{-1,{6,null}}}} type char_tree = {char val ; char tree left : char_tree right;} {A,{B,{C,null,null},{D,{E,null,null},null}}, {F,null,null}} Dr. Nguyen Hua Phung Data Types 60/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_058.png",
"page_index": 279,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:40+07:00"
}
},
"CO3005-chapter-8-slide-280-0000": {
"id": "CO3005-chapter-8-slide-280-0000",
"text": "Example on Ocaml type char_btree Tree of char * char_btree * char_btree l Null Tree('A',Tree'B',Tree('C',Null ,Null) Tree('D', Tree('E',Null,Null) Null)), Tree('F\",Null,Null)) type 'a btree = Tree of 'a * 'a btree * 'a btree l Null Tree(4,Tree(3,Null,Null),Tree(6,Null,Null)) Dr. Nguyen Hua Phung Data Types 61/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_059.png",
"page_index": 280,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:42+07:00"
}
},
"CO3005-chapter-8-slide-281-0000": {
"id": "CO3005-chapter-8-slide-281-0000",
"text": "Iype Expression: Motivation Example x : array [1..10l of record a : array [5..10] of integer ; b: l record c : real : d: array[1..3] of real; end ; d: string [3]: end ; Dr. Nguyen Hua Phung Data Types 63/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_060.png",
"page_index": 281,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:44+07:00"
}
},
"CO3005-chapter-8-slide-282-0000": {
"id": "CO3005-chapter-8-slide-282-0000",
"text": "Type Expressions A basic type is a type expression. boolean, char, integer, float, void, subrange A type name is a type expression. A type constructor applied to type expressions is a type expression. Including: Arrays: array(I,T) where I: index type, T:element type Products:T1 x T2 o Records: record((name1 x T1) x (name2 x T2 X... Pointers: pointer(T) o Functions: T1 -> T2 A type variable is a type expression Dr. Nguyen Hua Phung Data Types 64/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_061.png",
"page_index": 282,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:46+07:00"
}
},
"CO3005-chapter-8-slide-283-0000": {
"id": "CO3005-chapter-8-slide-283-0000",
"text": "Example int => int typedef int siso; = siso int t[101; => array(0..9,int int foo(int a,float b) = (int x float) -? int struct int a;int b => record((a x int) x (b x int) int *p => pointer(int) template <class T> struct vd T a; T b[3]; => record((a x T) x (b x array(0..2,T))) Dr. Nguyen Hua Phung Data Types 65/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_062.png",
"page_index": 283,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:48+07:00"
}
},
"CO3005-chapter-8-slide-284-0000": {
"id": "CO3005-chapter-8-slide-284-0000",
"text": "Type Checking Definition Type checking is the activity of ensuring that a program respects the rules imposed by the type system o Static type checking is performed in compiling time. It is often applied for static type binding languages. o Dynamic type checking is performed in running time. It is often applied for dynamic type binding languages Some features in static type binding language that cannot be type checked during compiling time Dr. Nguyen Hua Phung Data Types 67/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_063.png",
"page_index": 284,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:50+07:00"
}
},
"CO3005-chapter-8-slide-285-0000": {
"id": "CO3005-chapter-8-slide-285-0000",
"text": "Iype Interence Definition Type inference is the ability of a compiler to deduce type information of program unit. Example on Scala def add(x:Int) = x + 1 Return type of function add is inferred to be Int Mechanism o Assign type (built-in or variable type)to leaf nodes in AST. o Generate type constraints in each internal node in AST. Resolve these type constraints Dr. Nguyen Hua Phung Data Types 68/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_064.png",
"page_index": 285,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:53+07:00"
}
},
"CO3005-chapter-8-slide-286-0000": {
"id": "CO3005-chapter-8-slide-286-0000",
"text": "lype Equivalence o an operand of one type can be substituted for one of the other type without coercion Two approaches: Equivalence by name: same type name type Celsius = Float ; type Fahrenheit = Float : o Structural equivalence: same structure type A = record type B = record field1 : integer ; field1 : integer : field2 : real: field2 : real : end end Dr. Nguyen Hua Phung Data Types 70/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_065.png",
"page_index": 286,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:55+07:00"
}
},
"CO3005-chapter-8-slide-287-0000": {
"id": "CO3005-chapter-8-slide-287-0000",
"text": "Static Type Checking for Structural Eguivalence function sequiv(Type s,Type t):boolean begin if (s and t are the same basic type) then return true : else if (s = array(s1,s2) and t = array(t1,t2) then return sequiv(s1,t1) and sequiv(s2,t2); else if (s = s1 x s2 and t = t1 x t2) then return sequiv(s1,t1) and sequiv(s2,t2); else if (s = pointer(s1) and t = pointer(t1)) then return sequiv(s1,t1); else if (s = s1 -> s2 and t = t1 -> t2) then return sequiv(s1,t1) ; else return false ; Dr. Nguyen Hua Phung Data Types 71/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_066.png",
"page_index": 287,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:25:58+07:00"
}
},
"CO3005-chapter-8-slide-288-0000": {
"id": "CO3005-chapter-8-slide-288-0000",
"text": "Type Compatibility Definition Type T is compatible with type S if a value of type T is permitted in any context where a value of type S is admissible Example, int and float A type T is compatible with type S when: o T is equivalence to S Values of T form a subset of values of S All operations on S are permitted on T Values of T correspond in a canonical fashion to values of S. (int and float) Values of T can transform to some values of S Dr. Nguyen Hua Phung Data Types 72/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_067.png",
"page_index": 288,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:01+07:00"
}
},
"CO3005-chapter-8-slide-289-0000": {
"id": "CO3005-chapter-8-slide-289-0000",
"text": "Iype Conversion Definition Type conversion is conversing a value of this type to a value of another type Implicit conversion - coercion o Explicit conversion - cast Dr. Nguyen Hua Phung Data Types 73/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_068.png",
"page_index": 289,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:02+07:00"
}
},
"CO3005-chapter-8-slide-290-0000": {
"id": "CO3005-chapter-8-slide-290-0000",
"text": "Polymorphism Definition Monomorphic: any language object has a unique type Polymorphic: the same object can have more thar one type Example, +: int x int -> int or float x float -> float Kind of Polymorphism o Ad hoc polymorphism - Overloading Universal Polymorphism Parametric polymorphism (swap(T& x,T& y)) Subtyping polymorphism (in OOP) Dr. Nguyen Hua Phung Data Types 74/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_069.png",
"page_index": 290,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:04+07:00"
}
},
"CO3005-chapter-8-slide-291-0000": {
"id": "CO3005-chapter-8-slide-291-0000",
"text": "Example of Parametric Polymorphism template<typename T> void swap (T& x, T& y){ T tmp = x; x = y; y = tmp; int a = 5, b = 3; swap(a,b); cout << a << \"..\" << b << endI; Dr. Nguyen Hua Phung Data Types 75/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_070.png",
"page_index": 291,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:06+07:00"
}
},
"CO3005-chapter-8-slide-292-0000": {
"id": "CO3005-chapter-8-slide-292-0000",
"text": "Example of Subtyping Polymorphism class Polygon public : virtual float getArea( = 0; class Rectangle : public Polygon public : float getArea() return height * width ; private : float height,width ; class Triangle : public Polygon public : float getArea() fIoat p = (a + b + c) / 2; return sqrt(p*(p-a)*(p-b)*(p-c)); private : float a,b,c; Shape *s; s = (...) ? new Rectangle(3,4 : new Triangle(3,4,5): s->getArea O ; Dr. Nguyen Hua Phung Data Types 76/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_071.png",
"page_index": 292,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:10+07:00"
}
},
"CO3005-chapter-8-slide-293-0000": {
"id": "CO3005-chapter-8-slide-293-0000",
"text": "Built-in Data Types o Scalar Data Types o Number: int (normal, octal-0o, hexa-0x, bin-0b), float Boolean: bool o Composite Data Types Number: complex (yj) => real(), imag() String: str Sequence: list, tuple, range Mapping: dict Set: set, frozenset Dr. Nguyen Hua Phung Data Types 80/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_072.png",
"page_index": 293,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:11+07:00"
}
},
"CO3005-chapter-8-slide-294-0000": {
"id": "CO3005-chapter-8-slide-294-0000",
"text": "mmutable vs. Mutable Data Type Immutable Data Types: cannot modify their contents o Number (int,float,complex) Boolean (bool) String (str) Sequence (tuple, range) Set (frozenset) Mutable Data Types: able to modify their contents Sequence (list) Mapping (dict) Set (set) Dr. Nguyen Hua Phung Data Types 81/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_073.png",
"page_index": 294,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:13+07:00"
}
},
"CO3005-chapter-8-slide-295-0000": {
"id": "CO3005-chapter-8-slide-295-0000",
"text": "Python Lists o Like array but more flexible o Lists are ordered [1,2,3] == [1,3,2] => False o Lists can contain any arbitrary objects x = [1,'a',2.3,[4,[6],5]] o List elements can be accessed by index x[0] => 1 x[1:3] => ['a', 2.3] x[3][1][0] => 6 Lists are mutable and dynamic. x[0] = 2 => x -> 2,a',2.3,[4,[61,5]'c'] x[1:4] = [4,5,6] => x ->[2,4,5,6,c'] x.append(12) => x -> [2,4,5,6,c',12] del x[0] => x -> [4,5,6,c',12] Dr. Nguyen Hua Phung Data Types 82/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_074.png",
"page_index": 295,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:16+07:00"
}
},
"CO3005-chapter-8-slide-296-0000": {
"id": "CO3005-chapter-8-slide-296-0000",
"text": "List Comprehension o Motivation: create a list from another list lst1=[[1,2,3],[4,5],[6,7,8,9]] Ist = [] lst2 = [] for ele in <another list> for ele in Ist1 : lst.append(<expression> st2.append(sum(ele) o Syntax Ist = [<expression> for ele in <another list> (if <condition)?] Mapping lst2 = [sum(ele) for ele in lst1] => [6,9,30] Mapping with filtering lst2 = [sum(ele) for ele in lst1 if len(ele) > 2] => [6,30] Nested lst2 = [ele for row in lst1 for ele in row] =>[1,2,3,4,5,6,7,8,9] Dr. Nguyen Hua Phung Data Types 83/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_075.png",
"page_index": 296,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:18+07:00"
}
},
"CO3005-chapter-8-slide-297-0000": {
"id": "CO3005-chapter-8-slide-297-0000",
"text": "Indexing and Slicing x = [1,2,a','c',4.3] o Indexing: return an element Start from 0 x[0] => 1 Accept negative, where -1 is the last element x[-1] => 4.3 Slicing: return a list [start? : last? (: step)?] o x[1:3] =>[2'a'] x[1:] => [2,a',c',4.3] x[:-1] => [1,2'a',c'] x[:] => [1,2,a',c',4.3] x[1:4:2] =>[2'c'] x[::2] => [1,a',4.3] o x[::-1] => [4.3,c',a',2,1] Dr. Nguyen Hua Phung Data Types 84/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_076.png",
"page_index": 297,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:21+07:00"
}
},
"CO3005-chapter-8-slide-298-0000": {
"id": "CO3005-chapter-8-slide-298-0000",
"text": "Python Tuples and Ranges o Tuples are like Lists except for two following properties: o Enclosed by instead of [] o immutable o Ranges are immutable sequences of integers . generated by range(start?,stop,step?) list(range(5) =>[0,1,2,3,4] list(range(1,5) =>[1,2,3,4] list(range(1,5,2)) =>[1,3] accessed by index range(1,5)[3] => 4 o used in for loop for x in range(1,5,2): print(x) Dr. Nguyen Hua Phung Data Types 85/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_077.png",
"page_index": 298,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:24+07:00"
}
},
"CO3005-chapter-8-slide-299-0000": {
"id": "CO3005-chapter-8-slide-299-0000",
"text": "Python Dictionaries is mapping from from keys to values like struct but: o keys => any hashable type, values => any type x = ['fname': 'Teo', 'age': 5o, 3: {2.78: 'float ',True:'bool'}} access by key enclosed in [] mutable and dynamic x['fname'] = 'Ty' ' => replace 'Teo' by 'Ty x[3][True] => 'bool' x[4] = 'four => add new component del x[3] => remove component 3 x ->{'fname':'Ty''age':50,4:'four'} Operators and Built-in functions: read https://realpython.com/python-dicts/ Dr. Nguyen Hua Phung Data Types 86/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_078.png",
"page_index": 299,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:26+07:00"
}
},
"CO3005-chapter-8-slide-300-0000": {
"id": "CO3005-chapter-8-slide-300-0000",
"text": "Sets and Frozenset Sets are o unordered with unique elements {1,2,3} =={1,3,2} => True {1,2,3} =={1,2,2,3,1} } =>True - heterogeneous type x = {1,'abc',True} o dynamic but elements of sets are immutable x.add(4) =>{1'abc',True,4} x.remove('abc') =>{1,True,4} o Operators and Methods: read https://realpython.com/python-sets/ o Frozen sets are like sets except they are immutable x = frozenset({1,'abc',True} Dr. Nguyen Hua Phung Data Types 87/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_079.png",
"page_index": 300,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:30+07:00"
}
},
"CO3005-chapter-8-slide-301-0000": {
"id": "CO3005-chapter-8-slide-301-0000",
"text": "Summary [1] Type system is mainly used to error detection Primitive type Structure type Type checking Dr. Nguyen Hua Phung Data Types 88/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_080.png",
"page_index": 301,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:31+07:00"
}
},
"CO3005-chapter-8-slide-302-0000": {
"id": "CO3005-chapter-8-slide-302-0000",
"text": "References Maurizio Gabbrielli and Simone Martini, Programming Languages: Principles and Paradigms, Chapter 8, Springer. 2010. Dr. Nguyen Hua Phung Data Types 89/89",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_8/slide_081.png",
"page_index": 302,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:33+07:00"
}
},
"CO3005-chapter-9-slide-303-0000": {
"id": "CO3005-chapter-9-slide-303-0000",
"text": "JVM and Jasmin Dr. Nguyen Hua Phung Faculty of CSE HCMUT",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_001.png",
"page_index": 303,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:34+07:00"
}
},
"CO3005-chapter-9-slide-304-0000": {
"id": "CO3005-chapter-9-slide-304-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 2",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_002.png",
"page_index": 304,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:37+07:00"
}
},
"CO3005-chapter-9-slide-305-0000": {
"id": "CO3005-chapter-9-slide-305-0000",
"text": "Our Compiler source code Scanner 1 Sequence of tokens Parser AST Semantic analyzer Symbol AST table Code generation Jasmin code (*.j) Java Bytecode Assembler Java Byte code (*.class) Java Virtual Machine CSE - HCMUT JVM and Jasmin 3",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_003.png",
"page_index": 305,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:40+07:00"
}
},
"CO3005-chapter-9-slide-306-0000": {
"id": "CO3005-chapter-9-slide-306-0000",
"text": "Programming Java Environment compile-time environment run-time environment Your program 's source fles Your program 's class fles A.java B.java C.java A.class B.class C.class Your class fles Java Java move Virtual compiler locally Vachine or though a network A.class B.class C.class Object.class String. class Your program 's class fles Java APl's classfles From [1] CSE - HCMUT JVM and Jasmin 4",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_004.png",
"page_index": 306,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:46+07:00"
}
},
"CO3005-chapter-9-slide-307-0000": {
"id": "CO3005-chapter-9-slide-307-0000",
"text": "source programs Java programs Our Compiler Java Compiler Java Byte Code Assembler Java virtual machine CSE - HCMUT JVM and Jasmin 5",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_005.png",
"page_index": 307,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:48+07:00"
}
},
"CO3005-chapter-9-slide-308-0000": {
"id": "CO3005-chapter-9-slide-308-0000",
"text": "Why Jasmin ? Jasmin is a Java assembler - adopts a one-to-one mapping - operation codes are represented by mnemonic - Example: .line 4 public class VD{ iconst 0 public void main(String[] args) t istore 2 .line 5 int a,b; iload 2 b = 0; iconst 2 imul a = b* 2 + 40; bipush 40 iadd istore 1 CSE - HCMUT JVM and Jasmin 6",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_006.png",
"page_index": 308,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:52+07:00"
}
},
"CO3005-chapter-9-slide-309-0000": {
"id": "CO3005-chapter-9-slide-309-0000",
"text": "Java Byte Code ca fe ba be 00 00 00 31 00 1b 0a 00 05 00 0e 09 00 0f 00 10 0a 00 11 00 12 07 00 13 07 00 14 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29 56 01 00 04 43 6f 64 65 01 00 0f4c 69 6e 65 4e 75 6d 62 65 72 54 61 62 6c 65 01 00 04 6d 61 69 6e 01 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56 01 00 0a 53 6f 75 72 63 65 46 69 6c 65 01 00 07 56 44 2e 6a 61 76 61 0c 00 06 00 07 07 00 15 0c 00 16 00 17 07 00 18 0c 00 19 00 1a 01 00 02 56 44 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 53 79 73 74 65 6d 01 00 03 6f 75 74 01 00 15 4c 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 3b 01 00 13 6a 61 76 61 2",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_007.png",
"page_index": 309,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:57+07:00"
}
},
"CO3005-chapter-9-slide-309-0001": {
"id": "CO3005-chapter-9-slide-309-0001",
"text": "6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 3b 01 00 13 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 01 00 07 70 72 69 6e 74 6c 6e 01 00 04 28 49 29 56 00 21 00 04 00 05 00 00 00 00 00 02 00 01 00 06 00 07 00 01 00 08 00 00 00 1d 00 01 00 01 00 00 00 05 2a b7 00 01 b1 00 00 00 01 00 09 00 00 00 06 00 01 00 00 00 01 00 09 00 0a 00 0b 00 01 00 08 00 00 00 35 00 02 00 03 00 00 00 11 03 3d 1c 05 68 10 28 60 3c b2 00 02 1b b6 00 03 61 00 00 00 01 0009 00 00 00 12 00 04 00 00 00 04 00 02 00 05 00 09 00 06 00 10 00 07 00 01 00 0c 00 00 00 02 00 0d CSE - HCMUT JVM and Jasmin 7",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_007.png",
"page_index": 309,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:26:57+07:00"
}
},
"CO3005-chapter-9-slide-310-0000": {
"id": "CO3005-chapter-9-slide-310-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 8",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_008.png",
"page_index": 310,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:00+07:00"
}
},
"CO3005-chapter-9-slide-311-0000": {
"id": "CO3005-chapter-9-slide-311-0000",
"text": "Virtual Machine Java BKIT programs Java programs compiling compiling Java bytecode running running Java Virtual Jaya Virtual Jaya Virtual Machine for Machine for Machine for Linux Windows your television Linux Windows Your Television CSE - HCMUT JVM and Jasmin 9",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_009.png",
"page_index": 311,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:03+07:00"
}
},
"CO3005-chapter-9-slide-312-0000": {
"id": "CO3005-chapter-9-slide-312-0000",
"text": "JVM = stack-based machine A stack for each method The stack is used to store operands and results of an expression. It is also used to pass argument and receive returned value. Code generation for a stack-based machine is easier than that for a register-based one. CSE - HCMUT JVM and Jasmin 10",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_010.png",
"page_index": 312,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:06+07:00"
}
},
"CO3005-chapter-9-slide-313-0000": {
"id": "CO3005-chapter-9-slide-313-0000",
"text": "Internal Architecture of JVM class class.files loader subsystem native method Java pc heap method area stacks registers stacks runtime data areas native native methoa execution methoa interface engine libraries From [1] CSE - HCMUT JVM and Jasmin 11",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_011.png",
"page_index": 313,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:10+07:00"
}
},
"CO3005-chapter-9-slide-314-0000": {
"id": "CO3005-chapter-9-slide-314-0000",
"text": "a and Heap Method Area class object class object data object data class object object data object class class data object class data object data object method area heap From [1] 12 CSE - HCMUT JVM and Jasmin",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_012.png",
"page_index": 314,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:14+07:00"
}
},
"CO3005-chapter-9-slide-315-0000": {
"id": "CO3005-chapter-9-slide-315-0000",
"text": "Java Stacks thread 1 thread 2 thread 3 thread 1 stack stack stack frame frame frame thread 3 + + stack stack stack thread 2 frame frame frame stack stack frame frame thread 3 stack frame native method pc registers Java stacks stacks From [1] CSE - HCMUT JVM and Jasmin 13",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_013.png",
"page_index": 315,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:18+07:00"
}
},
"CO3005-chapter-9-slide-316-0000": {
"id": "CO3005-chapter-9-slide-316-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 14",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_014.png",
"page_index": 316,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:21+07:00"
}
},
"CO3005-chapter-9-slide-317-0000": {
"id": "CO3005-chapter-9-slide-317-0000",
"text": "Data Types Type Range Description boolean {0,1} z byte -27 to 27 - 1, inclusive B short -215 to 215 - 1, inclusive s int -231 to 231 - 1, inclusive 1 long -263 to 263 - 1, inclusive L char 16 bit usigned Unicode (0 to 216 -1) C float 32-bit lEEE 754 single-precision float F double 64-bit lEEE 754 double-precision float D returnAddress address of an opcode within the same method class reference Lclass-name; interface reference Linter-name; array reference [l..[component- type void V CSE - HCMUT JVM and Jasmin 15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_015.png",
"page_index": 317,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:26+07:00"
}
},
"CO3005-chapter-9-slide-318-0000": {
"id": "CO3005-chapter-9-slide-318-0000",
"text": "Example Java language type JVM description Object Ljava/lang/Object String Ljava/lang/String String [] [Ljava/lang/String int [] float [] [] [[F void main(String [] args) ([Ljava/lang/String;)V int gcd(int a,int b) (II)I char foo(float a,Object b) (FLjava/lang/Object;)C CSE - HCMUT JVM and Jasmin 16",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_016.png",
"page_index": 318,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:30+07:00"
}
},
"CO3005-chapter-9-slide-319-0000": {
"id": "CO3005-chapter-9-slide-319-0000",
"text": "Example (cont'd) public class GetType { public static void main(String [] args) { Object a = new ObjectO int [] b = new int[10] float[l[] c = new float[2][3] String d = \"csds\"; System.out.println(\"The class name of a is \"+ a.getClassO) System.out.println(\"The class name of b is \" + b.getClassO): System.out.println(\"The class name of c is \" + c.getClassO) System.out.println(\"The class name of d is \" + d.getClassO): CSE - HCMUT JVM and Jasmin 17",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_017.png",
"page_index": 319,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:34+07:00"
}
},
"CO3005-chapter-9-slide-320-0000": {
"id": "CO3005-chapter-9-slide-320-0000",
"text": "Example (cont'd) boolean, byte, char and short are implemented as int public class IntTypes { method public static public static void main([Ljava/lang/String;)V main(String argv[]) { .line 3 boolean z = true; iconst 1 istore 1 byte b = 1; .line 4 short s = 2; iconst 1 char c = 'a'; istore 2 .line 5 iconst 2 istore 3 .line 6 bipush 97 istore 4 Label0: .line 8 return end method CSE - HCMUT JVM and Jasmin 18",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_018.png",
"page_index": 320,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:38+07:00"
}
},
"CO3005-chapter-9-slide-321-0000": {
"id": "CO3005-chapter-9-slide-321-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 19",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_019.png",
"page_index": 321,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:41+07:00"
}
},
"CO3005-chapter-9-slide-322-0000": {
"id": "CO3005-chapter-9-slide-322-0000",
"text": "Operand Stack Accessed by pushing and popping values - storing operands and receiving the operations' results - passing arguments and receiving method results Integral expression: a = b * 2 + 40; Jasmin code iload 2 // load variable 2 onto op stack iconst 2 // push constant 2 onto op stack imul // pop 2 values on top of stack, multiple them and push the result onto stack bipush 4. // push 40 onto stack iadd // pop 2 values on top of stack, calculate and push the result onto stack istore 1 // pop the value on top of stack and assign it to variable 1 CSE - HCMUT JVM and Jasmin 20",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_020.png",
"page_index": 322,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:45+07:00"
}
},
"CO3005-chapter-9-slide-323-0000": {
"id": "CO3005-chapter-9-slide-323-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 21",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_021.png",
"page_index": 323,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:47+07:00"
}
},
"CO3005-chapter-9-slide-324-0000": {
"id": "CO3005-chapter-9-slide-324-0000",
"text": "Local Variable Array 1. A new local variable array is created each time a method is called 2. Local variables addressed by indexing, starting from 0 3. Instance methods: slot 0 given to this Parameters (if any) given consecutive indices, starting from 1 The indices allocated to the other variables in any order 4. Class methods: Parameters (if any) given consecutive indices, starting from 0 The indices allocated to the other variables in any order 5. One slot can hold a value of boolean, byte, char, short. int, float,reference and returnAdrress 6. One pair of slots can hold a value of long and double From [2] CSE - HCMUT JVM and Jasmin 22",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_022.png",
"page_index": 324,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:52+07:00"
}
},
"CO3005-chapter-9-slide-325-0000": {
"id": "CO3005-chapter-9-slide-325-0000",
"text": "Example 1 public static void foo( { .line 7 iconst 1 int a,b,c; istore 0 ll a a= 1; .line 8 b = 2; iconst 2 istore 1 ll b c=(a+b)*3; .line 9 iload 0 iload 1 iadd iconst 3 imul istore 2 ll c CSE - HCMUT JVM and Jasmin 23",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_023.png",
"page_index": 325,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:27:56+07:00"
}
},
"CO3005-chapter-9-slide-326-0000": {
"id": "CO3005-chapter-9-slide-326-0000",
"text": "Example 2 public void foo0 { .var 0 is this LVD2: from Label0 to Label1 int a,b,c; .line 7 a = 1; iconst 1 istore 1 ll a b = 2; .line 8 c=(a+b)*3; iconst 2 istore 2 ll b .line 9 iload 1 iload 2 iadd iconst 3 imul istore 3 ll c CSE - HCMUT JVM and Jasmin 24",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_024.png",
"page_index": 326,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:00+07:00"
}
},
"CO3005-chapter-9-slide-327-0000": {
"id": "CO3005-chapter-9-slide-327-0000",
"text": "Example 3 .line 6 iconst 1 public void foo{ istore 1 ll a int a = 1; .line 7 ldc2 w 2 long b = 2; Istore 2 l/ 2,3 for b int c = 3; .line 8 long d = (a + b) * c; iconst 3 istore 4 ll c .line 9 iload 1 i2l // conversion lload 2 ladd iload 4 i2l // conversion Imul Istore 5 l/ 5,6 for d CSE - HCMUT JVM and Jasmin 25",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_025.png",
"page_index": 327,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:03+07:00"
}
},
"CO3005-chapter-9-slide-328-0000": {
"id": "CO3005-chapter-9-slide-328-0000",
"text": "Outline Our compiler Java Virtual Machine - Data types Operand stack - Local variable array - Instructions CSE - HCMUT JVM and Jasmin 26",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_026.png",
"page_index": 328,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:06+07:00"
}
},
"CO3005-chapter-9-slide-329-0000": {
"id": "CO3005-chapter-9-slide-329-0000",
"text": "Jasmin Instructions 1. Arithmetic Instructions 2. Load and store instructions 3.0 Control transfer instructions 4. Type conversion instructions 5.0 Operand stack management instructions Object creation and manipulation 7. Method invocation instructions 8. Throwing instructions (not used) 9. Implementing finally (not used) 10. Synchronisation (not used) JVM and Jasmin 27 CSE - HCMUT",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_027.png",
"page_index": 329,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:10+07:00"
}
},
"CO3005-chapter-9-slide-330-0000": {
"id": "CO3005-chapter-9-slide-330-0000",
"text": "Arithmetic Instructions Add: iadd, ladd, fadd, dadd. Subtract: isub, Isub, fsub, dsub Multiply: imul, Imul, fmul, dmul. Divide: idiv, Idiv, fdiv, ddiv. Remainder: irem, Irem, frem, drem Negate: ineg, Ineg, fneg, dneg. Shift: ishl, ishr, iushr, Ishl, Ishr, lushr. Bitwise OR: ior, lor. Bitwise AND: iand, land. Bitwise exclusive OR: ixor, Ixor Local yariable increment: iinc. Comparison: dcmpg, dcmpl, fcmpg, fcmpl, Icmp From ($3.11.3,[3] CSE - HCMUT JVM and Jasmin 28",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_028.png",
"page_index": 330,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:13+07:00"
}
},
"CO3005-chapter-9-slide-331-0000": {
"id": "CO3005-chapter-9-slide-331-0000",
"text": "Load and Store Load a local variable onto the operand stack: iload, iload <n>, => n:0..3, used for int, boolean, byte, char or short Iload, lload <n>, => n:0..3, used for long fload, fload <n>, => n:0..3, used for float dload, dload <n>, => n:0..3, used for double aload, aload <n>, => n:0..3, used for a reference Taload. > T:b,s,i,I,f,d,c,a Store a value from the operand stack into a local variable: istore, istore <n> n:0..3, used for int, boolean, byte, char or short Istore, Istore <n> n:0..3, used for long fstore, fstore <n> n:0..3, used for float dstore, dstore <n> n:0..3, used for double astore, astore <n> n:0..3, used for a reference and returnAddress Tastore. > T:b,s,i,I,f,d,c,a From ($11.3.2,[3] CSE - HCMUT JVM and Jasmin 29",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_029.png",
"page_index": 331,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:17+07:00"
}
},
"CO3005-chapter-9-slide-332-0000": {
"id": "CO3005-chapter-9-slide-332-0000",
"text": "Load and Store (cont'd) Load a constant onto the operand stack: bipush, => for an integer constant from -27 to 27 - 1 sipush, -> for an integer constant from -215 to 215 - 1 Idc, -> for a constant that is an integer, float or a quoted string ldc w, ldc2 w, > for a constant that is a long or a double aconst null, => for a null iconst m1 => for -1 iconst <i> -> for 0, ...,5 Iconst - </> > for 0,1 fconst <f> > for 0.0.1.0 and 2.0 dconst <d>. =>for 0.0,1.0 From ($11.3.2,[3] CSE - HCMUT JVM and Jasmin 30",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_030.png",
"page_index": 332,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:22+07:00"
}
},
"CO3005-chapter-9-slide-333-0000": {
"id": "CO3005-chapter-9-slide-333-0000",
"text": "Example 4 .line 6 .line 10 int a = 1 : iconst 1 iload 1 istore 1 iload 2 int b = 100: .line 7 imul int c = 1000; bipush 100 iload 3 istore 2 iadd int d = 40000: .line 8 iload 4 sipush 1000 isub int e=a* b + c- d istore 3 istore 5 .line 9 ldc 40000 istore 4 CSE - HCMUT JVM and Jasmin 31",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_031.png",
"page_index": 333,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:25+07:00"
}
},
"CO3005-chapter-9-slide-334-0000": {
"id": "CO3005-chapter-9-slide-334-0000",
"text": "Example 5 float a = 1.0F : .line 6 .line 10 fconst 1 fload 1 float b = 2.0F; fstore 1 fload 2 .line 7 fmul float c = 3.0F: fconst 2 fload 3 float d = 4.0F: fstore 2 fadd .line 8 fload 4 float e = a * b + c - d. ldc 3.0 fsub fstore 3 fstore 5 .line 9 ldc 4.0 fstore 4 CSE - HCMUT JVM and Jasmin 32",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_032.png",
"page_index": 334,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:29+07:00"
}
},
"CO3005-chapter-9-slide-335-0000": {
"id": "CO3005-chapter-9-slide-335-0000",
"text": "Example 6 a[0] = 100; .line 8 aload 0 // push address of array referred by a b = a[1] iconst 0 // push 0 bipush 100 // push 100 iastore // a[0] = 100 .line 9 aload 0 // push address of array referred by a iconst 1 // push 1 iaload // pop a and 1, push a[1] istore 1 // store to b CSE - HCMUT JVM and Jasmin 33",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_033.png",
"page_index": 335,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:33+07:00"
}
},
"CO3005-chapter-9-slide-336-0000": {
"id": "CO3005-chapter-9-slide-336-0000",
"text": "Control Transfer Instructions Unconditional branch goto, goto_w, jsr, jsr w, ret. Conditional branch: ifeq, iflt, ifle, ifne, ifgt, ifge, = compare an integer to zero ifnull, ifnonnull, -> compare a reference to null if_icmpeq, if_icmpne, if_icmplt, if_icmpgt, if_icmple, if icmpge, > compare two integers if acmpeq, if_acmpne. > compare two references Compound conditional branch: tableswitch, lookupswitch. From ($3.11.7,[3] CSE - HCMUT JVM and Jasmin 34",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_034.png",
"page_index": 336,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:36+07:00"
}
},
"CO3005-chapter-9-slide-337-0000": {
"id": "CO3005-chapter-9-slide-337-0000",
"text": "Example 7 int a,b,c; .line 7 iload 0 // push a if (a> b) iload 1 l/ push b if icmple Label0 c = 1: .line 8 else iconst 1 istore 2 // c = 1 c = 2; goto Label1 Label0: .line 10 iconst 2 istore 2 // c = 2 Label1 : CSE - HCMUT JVM and Jasmin 35",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_035.png",
"page_index": 337,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:41+07:00"
}
},
"CO3005-chapter-9-slide-338-0000": {
"id": "CO3005-chapter-9-slide-338-0000",
"text": "Example 8 float a,b; int c .line 7 fload 0 l/ push a if (a > b) fload 1 l/ push b fcmpl // pop a,b, push 1 if a > b, 0 otherwise c = 1: ifle Label0 // goto Label0 if top <= 0 else line 8 iconst 1 c = 2; istore 2 goto Label1 Label0: .line 10 iconst 2 istore 2 Label1 : CSE - HCMUT JVM and Jasmin 36",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_036.png",
"page_index": 338,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:44+07:00"
}
},
"CO3005-chapter-9-slide-339-0000": {
"id": "CO3005-chapter-9-slide-339-0000",
"text": "fcmpg and fcmpl 1 if value 1 > value 2 value 2 value 1 if value 1 == value 2 0 If either is NaN, fcmpg pushes 1 and fcmpl pushes -1 if value 1 < value 2 CSE - HCMUT JVM and Jasmin 37",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_037.png",
"page_index": 339,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:47+07:00"
}
},
"CO3005-chapter-9-slide-340-0000": {
"id": "CO3005-chapter-9-slide-340-0000",
"text": "Type Conversion Instructions i2l, i2f, i2d, l2f, I2d, and f2d. Only i2f is used in MP compiler 1 .line 6 iconst 1 int b = 1: istore 0 .line 7 float a = b; iload 0 i2f fstore 1 CSE - HCMUT JVM and Jasmin 38",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_038.png",
"page_index": 340,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:50+07:00"
}
},
"CO3005-chapter-9-slide-341-0000": {
"id": "CO3005-chapter-9-slide-341-0000",
"text": "Operand Stack Management Instructions dup duplicate the stack top operand remove the stack top operand pop value value value value dup pop used when translating a = b = used when translating 1: others: pop2, dup2, swap,... CSE - HCMUT JVM and Jasmin 39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_039.png",
"page_index": 341,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:54+07:00"
}
},
"CO3005-chapter-9-slide-342-0000": {
"id": "CO3005-chapter-9-slide-342-0000",
"text": "Example 10 .line 7 int a,b,c; iconst 1 dup a=b=c= 1: istore 2 dup istore 1 istore 0 int a,b,c; .line 7 iconst 1 (a = 2); iconst 2 1 + dup istore 0 iadd In MC, not in Java pop CSE - HCMUT JVM and Jasmin 40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_040.png",
"page_index": 342,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:28:57+07:00"
}
},
"CO3005-chapter-9-slide-343-0000": {
"id": "CO3005-chapter-9-slide-343-0000",
"text": "Object Creation and Manipulation Create a new class instance: new. Create a new array: newarray, anewarray multianewarray. Access fields of classes (static fields, known as class variables) and fields of class instances (non-static fields known as instance variables): getfield, putfield, getstatic putstatic. Load an array component onto the operand stack: baload, caload, saload, iaload, laload, faload, daload aaload. Store a value from the operand stack as an array component: bastore, castore, sastore, iastore, lastore. fastore, dastore, aastore. CSE - HCMUT JVM and Jasmin 41",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_041.png",
"page_index": 343,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:02+07:00"
}
},
"CO3005-chapter-9-slide-344-0000": {
"id": "CO3005-chapter-9-slide-344-0000",
"text": "Example 11 BKOOL: .line 6 bipush 10 a:integer[10]; newarray int astore 0 a[0] = a[1] + 2; .line 7 aload 0 iconst 0 aload 0 iconst 1 iaload Java: iconst 2 int a[] = new int [10], iadd iastore a[0] = a[1] + 2; CSE - HCMUT JVM and Jasmin 42",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_042.png",
"page_index": 344,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:05+07:00"
}
},
"CO3005-chapter-9-slide-345-0000": {
"id": "CO3005-chapter-9-slide-345-0000",
"text": "Field Instructions getstatic pustatic <field_spec> <descriptor> getfield putfield E.g. getstatic java.lang.System.out Ljava/io/PrintStream field type class name field name CSE - HCMUT JVM and Jasmin 43",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_043.png",
"page_index": 345,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:08+07:00"
}
},
"CO3005-chapter-9-slide-346-0000": {
"id": "CO3005-chapter-9-slide-346-0000",
"text": "Example 12 new VD12 public class VD12 { dup static int a; invokespecial VD12/<init>OV int b; astore 1 iconst 1 static VD12 c; putstatic VD12.a l VD12 d; aload 1 public static void getstatic VD12.a ! main(String[] arg) iconst 1 VD12 e; iadd e = new VD12O putfield VD12.b l aload 1 a= 1: new VD12 e.b = a+ 1: dup e.d = new VD12O invokespecial VD12/<init>OV c = e.d; putfield VD12.d LVD12: aload 1 getfield VD12.d LVD12: putstatic VD12.c LVD12 CSE - HCMUT JVM and Jasmin 44",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_044.png",
"page_index": 346,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:13+07:00"
}
},
"CO3005-chapter-9-slide-347-0000": {
"id": "CO3005-chapter-9-slide-347-0000",
"text": "Method Invocation Instructions invokestatic invokevirtual <method-spec> invokespecial the constructor method <init> - a private method a method in a super class invokeinterface <method-spec> <num-args> invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V class name method name type desc CSE - HCMUT JVM and Jasmin 45",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_045.png",
"page_index": 347,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:16+07:00"
}
},
"CO3005-chapter-9-slide-348-0000": {
"id": "CO3005-chapter-9-slide-348-0000",
"text": "Method Invocation Instructions (cont'd) arg n arg n arg 2 arg 1 arg 1 result (if any) objref result (if any) invokestatic invokevirtual/invokespecial invokevirtual: based on the real type of objref invokestatic: based on the static class CSE - HCMUT JVM and Jasmin 46",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_046.png",
"page_index": 348,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:20+07:00"
}
},
"CO3005-chapter-9-slide-349-0000": {
"id": "CO3005-chapter-9-slide-349-0000",
"text": "Example 13 public class VD13 { public static void main(String[] arg) { goo(new VD13(); float foo(int a, float b) { return a + b, static void goo(VD13 x){ x.foo(1,2.3F); CSE - HCMUT JVM and Jasmin 47",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_047.png",
"page_index": 349,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:22+07:00"
}
},
"CO3005-chapter-9-slide-350-0000": {
"id": "CO3005-chapter-9-slide-350-0000",
"text": "Example 13 (cont'd) public static void main(String[] arg) { goo(new VD13O); .method public static main([Ljava/lang/String;)V .limit stack 2 limit locals 1 .var 0 is arg0 [Ljava/lang/String; from Label0 to Label1 .line 3 new VD13 dup invokespecial VD13/<init>OV invokestatic VD13/goo(LVD13;)V objref .line 4 objref return end method CSE - HCMUT JVM and Jasmin 48",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_048.png",
"page_index": 350,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:26+07:00"
}
},
"CO3005-chapter-9-slide-351-0000": {
"id": "CO3005-chapter-9-slide-351-0000",
"text": "Example 13 (cont'd) .method static goo(LVD13;)V static void goo(VD13 x) { .limit stack 3 x.foo(1,2.3F); Jimit locals 1 .var 0 is arg0 LVD13; from Label0 to Label1 .line 9 aload 0 2.3 iconst 1 ldc 2.3 1 invokevirtual VD13/foo(IF)F pop ob$ref Label1 : .line 10 return end method CSE - HCMUT JVM and Jasmin 49",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_049.png",
"page_index": 351,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:30+07:00"
}
},
"CO3005-chapter-9-slide-352-0000": {
"id": "CO3005-chapter-9-slide-352-0000",
"text": "Method Return All methods in Java are terminated by a return instruction - return void - ireturn int,short,char,boolean, byte - freturn float Ireturn long - dreturn double - areturn reference CSE - HCMUT JVM and Jasmin 50",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_050.png",
"page_index": 352,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:33+07:00"
}
},
"CO3005-chapter-9-slide-353-0000": {
"id": "CO3005-chapter-9-slide-353-0000",
"text": "Example 13 (cont'd) .method foo(IF)F float foo(int a, float b) { limit stack 2 return a + b; limit locals 3 .var 0 is this LVD13: from Label0 to Label1 .var 1 is arg0 I from Label0 to Label1 .var 2 is arg1 F from Label0 to Label1 Label0: iload 1 i2f fload 2 fadd b Label1: freturn a ab .end method CSE - HCMUT JVM and Jasmin 51",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_051.png",
"page_index": 353,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:37+07:00"
}
},
"CO3005-chapter-9-slide-354-0000": {
"id": "CO3005-chapter-9-slide-354-0000",
"text": "Jasmin Directives > .source <source.java> > .class <the current class> .super <the super class> >.limit > .method <the method description> > .field <the field description> >.end > .var <the variable description> > .line <the line number in source code> CSE - HCMUT JVM and Jasmin 52",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_052.png",
"page_index": 354,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:41+07:00"
}
},
"CO3005-chapter-9-slide-355-0000": {
"id": "CO3005-chapter-9-slide-355-0000",
"text": "Example 14 public class VD14 { .source VD14.java int a; class public VD14 static int b; .super java/lang/Objec .field a I public static void .field static b main(String[] arg) { (new VD14O).foo(1,2.3F); float foo(int a, float b) { return a * b; CSE - HCMUT JVM and Jasmin 53",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_053.png",
"page_index": 355,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:44+07:00"
}
},
"CO3005-chapter-9-slide-356-0000": {
"id": "CO3005-chapter-9-slide-356-0000",
"text": "Example 14 (cont'd) public class VD14 f method public <init>OV int a; .limit stack 1 limit locals 1 static int b; .var 0 is this LVD14; from Label0 to Label1 public static void Label0: main(String[] arg) { .line 1 new aload 0 VD14O).foo(1,2.3F); invokespecial java/lang/Object/<init>OV Label1: return float foo(int a, float b) { end method return a * b; CSE - HCMUT JVM and Jasmin 54",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_054.png",
"page_index": 356,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:48+07:00"
}
},
"CO3005-chapter-9-slide-357-0000": {
"id": "CO3005-chapter-9-slide-357-0000",
"text": "Example 14 (cont'd) public class VD14 f .method public static main([Ljava/lang/String;)V int a; .limit stack 3 limit locals 1 static int b; .var 0 is arg0 [Ljava/lang/String; from Label0 to Label1 public static void Label0: main(String[] arg) { .line 5 new new VD14 VD14O).foo(1,2.3F); dup invokespecial VD14/<init>(V iconst 1 ldc 2.3 float foo(int a, float b) { invokevirtual VD14/foo(lF)F return a * b; pop Label1 : .line 6 return .end method CSE - HCMUT JVM and Jasmin 55",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_055.png",
"page_index": 357,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:53+07:00"
}
},
"CO3005-chapter-9-slide-358-0000": {
"id": "CO3005-chapter-9-slide-358-0000",
"text": "Example 14 (cont'd) public class VD14 f .method foo(IF)F int a; limit stack 2 limit locals 3 static int b; .var 0 is this LVD14: from Label0 to Label1 .var 1 is arg0 I from Label0 to Label1 public static void .var 2 is arg1 F from Label0 to Label1 main(String[] arg) { (new Label0: VD14O).foo(1,2.3F); .line 8 iload 1 i2f fload 2 float foo(int a, float b) { fmul return a * b; Label1: freturn end method CSE - HCMUT JVM and Jasmin 56",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_056.png",
"page_index": 358,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:29:57+07:00"
}
},
"CO3005-chapter-9-slide-359-0000": {
"id": "CO3005-chapter-9-slide-359-0000",
"text": "References [1] Bill Venner, Inside the Java Virtual Machine http://www.artima.com/insidejvm/ed2/ [2] J.Xue, Prog. Lang. and Compiler, http://www.cse.unsw.edu.au/cs3131 [3] Java Virtual Machine Specification, http://java.sun.com/docs/books/vmspec/ [4] Jasmin Home Page, http://jasmin.sourceforge.net/ CSE - HCMUT JVM and Jasmin 57",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_9/slide_057.png",
"page_index": 359,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:01+07:00"
}
},
"CO3005-chapter-10-slide-360-0000": {
"id": "CO3005-chapter-10-slide-360-0000",
"text": "Code Generation Dr. Phung Nguyen Faculty of Computer Science and Engineering University of Technology HCMC Vietnam National University November 25, 2020 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 1/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_001.png",
"page_index": 360,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:02+07:00"
}
},
"CO3005-chapter-10-slide-361-0000": {
"id": "CO3005-chapter-10-slide-361-0000",
"text": "Outline Translation to a stack-based machine 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 2/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_002.png",
"page_index": 361,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:04+07:00"
}
},
"CO3005-chapter-10-slide-362-0000": {
"id": "CO3005-chapter-10-slide-362-0000",
"text": "Code Generation Design Machine-Independent Code Generation Frame Intermediate Code Generation Machine-Dependent Code Generation 590 Code Generation November 25.2020 3/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_003.png",
"page_index": 362,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:05+07:00"
}
},
"CO3005-chapter-10-slide-363-0000": {
"id": "CO3005-chapter-10-slide-363-0000",
"text": "Machine-Dependent Code Generation Generating specified machine code E.g.: emitLDC(20) -> \"Idc 20' Implemented in JasminCode Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 4/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_004.png",
"page_index": 363,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:06+07:00"
}
},
"CO3005-chapter-10-slide-364-0000": {
"id": "CO3005-chapter-10-slide-364-0000",
"text": "ntermediate Code Generation Depend on both language and machine 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_005.png",
"page_index": 364,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:08+07:00"
}
},
"CO3005-chapter-10-slide-365-0000": {
"id": "CO3005-chapter-10-slide-365-0000",
"text": "ntermediate Code Generation Depend on both language and machine Select instructions Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_006.png",
"page_index": 365,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:10+07:00"
}
},
"CO3005-chapter-10-slide-366-0000": {
"id": "CO3005-chapter-10-slide-366-0000",
"text": "ntermediate Code Generation Depend on both language and machine xemitlLOAD Select instructions emitREADVAR Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_007.png",
"page_index": 366,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:11+07:00"
}
},
"CO3005-chapter-10-slide-367-0000": {
"id": "CO3005-chapter-10-slide-367-0000",
"text": "ntermediate Code Generation Depend on both language and machine xemitILOAD Select instructions emitREADVAR >emitFLOAD Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_008.png",
"page_index": 367,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:14+07:00"
}
},
"CO3005-chapter-10-slide-368-0000": {
"id": "CO3005-chapter-10-slide-368-0000",
"text": "ntermediate Code Generation Depend on both language and machine xemitILOAD Select instructions emitREADVAR >emitFLOAD Select data obiects Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_009.png",
"page_index": 368,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:15+07:00"
}
},
"CO3005-chapter-10-slide-369-0000": {
"id": "CO3005-chapter-10-slide-369-0000",
"text": "ntermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data obiects Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_010.png",
"page_index": 369,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:17+07:00"
}
},
"CO3005-chapter-10-slide-370-0000": {
"id": "CO3005-chapter-10-slide-370-0000",
"text": "ntermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data obiects Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_011.png",
"page_index": 370,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:19+07:00"
}
},
"CO3005-chapter-10-slide-371-0000": {
"id": "CO3005-chapter-10-slide-371-0000",
"text": "ntermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data obiects Simulate the execution of the machine Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_012.png",
"page_index": 371,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:21+07:00"
}
},
"CO3005-chapter-10-slide-372-0000": {
"id": "CO3005-chapter-10-slide-372-0000",
"text": "Intermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data obiects Simulate the execution of the machine < emitICONST -> pushO Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_013.png",
"page_index": 372,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:23+07:00"
}
},
"CO3005-chapter-10-slide-373-0000": {
"id": "CO3005-chapter-10-slide-373-0000",
"text": "Intermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data obiects Simulate the execution of the machine 4 emitICONST - pushO 4 emitISTORE -> popO Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_014.png",
"page_index": 373,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:25+07:00"
}
},
"CO3005-chapter-10-slide-374-0000": {
"id": "CO3005-chapter-10-slide-374-0000",
"text": "Intermediate Code Generation Depend on both language and machine zemitILOAD(index) Select instructions emitREADVAR(a >emitFLOAD(index Select data objects Simulate the execution of the machine 4 emitICONST - pushO 4 emitISTORE -> popO Implemented in class Emitter Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 5/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_015.png",
"page_index": 374,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:27+07:00"
}
},
"CO3005-chapter-10-slide-375-0000": {
"id": "CO3005-chapter-10-slide-375-0000",
"text": "Directives Generation APls emitVAR(self,index, varName, inType, fromLabel, toLabel .var 0 is this Lio; from Label0 to Label1 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_016.png",
"page_index": 375,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:29+07:00"
}
},
"CO3005-chapter-10-slide-376-0000": {
"id": "CO3005-chapter-10-slide-376-0000",
"text": "Directives Generation APls emitVAR(self,index, varName, inType, fromLabel, toLabel .var 0 is this Lio; from Label0 to Label1 emitATTRIBUTE(self, lexeme, inType, isFinal, value = None field public static writer Ljava/io/Writer; Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_017.png",
"page_index": 376,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:31+07:00"
}
},
"CO3005-chapter-10-slide-377-0000": {
"id": "CO3005-chapter-10-slide-377-0000",
"text": "Directives Generation APls emitVAR(self,index, varName, inType, fromLabel, toLabel) .var 0 is this Lio; from Label0 to Label1 emitATTRIBUTE(self, lexeme, inType, isFinal, value = None field public static writer Ljava/io/Writer; emitMETHOD(self, lexeme, inType, isStatic) method public foo(I)l Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_018.png",
"page_index": 377,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:33+07:00"
}
},
"CO3005-chapter-10-slide-378-0000": {
"id": "CO3005-chapter-10-slide-378-0000",
"text": "Directives Generation APIs emitVAR(self,index, varName, inType, fromLabel, toLabel .var 0 is this Lio; from Label0 to Label1 emitATTRIBUTE(self, lexeme, inType, isFinal, value = None field public static writer Ljava/io/Writer; emitMETHOD(self, lexeme, inType, isStatic) .method public foo(I)l emitENDMETHOD(self, frame .limit stack 1 .limit locals 1 .end method Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_019.png",
"page_index": 378,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:35+07:00"
}
},
"CO3005-chapter-10-slide-379-0000": {
"id": "CO3005-chapter-10-slide-379-0000",
"text": "Directives Generation APIs emitVAR(self,index, varName, inType, fromLabel, toLabel .var 0 is this Lio; from Label0 to Label1 emitATTRIBUTE(self, lexeme, inType, isFinal, value = None field public static writer Ljava/io/Writer; emitMETHOD(self, lexeme, inType, isStatic .method public foo(I)l emitENDMETHOD(self, frame .limit stack 1 .limit locals 1 .end method emitPROLOG(self, name, parent .source io.java class public io .super java/lang/Object 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_020.png",
"page_index": 379,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:38+07:00"
}
},
"CO3005-chapter-10-slide-380-0000": {
"id": "CO3005-chapter-10-slide-380-0000",
"text": "Directives Generation APIs emitVAR(self,index, varName, inType, fromLabel, toLabel .var 0 is this Lio; from Label0 to Label1 emitATTRIBUTE(self, lexeme, inType, isFinal, value = None field public static writer Ljava/io/Writer; emitMETHOD(self, lexeme, inType, isStatic .method public foo(I)l emitENDMETHOD(self, frame) .limit stack 1 .limit locals 1 .end method emitPROLOG(self, name, parent) source io.java .class public ic .super java/lang/Object emitEPILOG(self) 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 6/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_021.png",
"page_index": 380,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:41+07:00"
}
},
"CO3005-chapter-10-slide-381-0000": {
"id": "CO3005-chapter-10-slide-381-0000",
"text": "Type class IntType(Type) class FloatType(Type) class StringType(Type) class VoidType(Type) class BoolType(Type) class ClassType(Type): # cname:str class ArrayType(Type): # eleType:Type,dimen:List[int class MType(Type): # partype:List[Type],rettype:Type Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 7/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_022.png",
"page_index": 381,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:43+07:00"
}
},
"CO3005-chapter-10-slide-382-0000": {
"id": "CO3005-chapter-10-slide-382-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_023.png",
"page_index": 382,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:45+07:00"
}
},
"CO3005-chapter-10-slide-383-0000": {
"id": "CO3005-chapter-10-slide-383-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, Iexeme, inType, frame) => imul, fmul, idiv, fdiv Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_024.png",
"page_index": 383,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:46+07:00"
}
},
"CO3005-chapter-10-slide-384-0000": {
"id": "CO3005-chapter-10-slide-384-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, lexeme, inType, frame) => imul, fmul, idiv, fdiv emitDlV(self, frame) => idiv Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_025.png",
"page_index": 384,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:48+07:00"
}
},
"CO3005-chapter-10-slide-385-0000": {
"id": "CO3005-chapter-10-slide-385-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, Iexeme, inType, frame) => imul, fmul, idiv, fdiv emitDlV(self, frame) => idiv emitMOD(self, frame) => irem Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_026.png",
"page_index": 385,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:50+07:00"
}
},
"CO3005-chapter-10-slide-386-0000": {
"id": "CO3005-chapter-10-slide-386-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, lexeme, inType, frame) => imul, fmul, idiv, fdiv emitDlV(self, frame) => idiv emitMOD(self, frame) => irem emitANDOP(self, frame) => iand Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_027.png",
"page_index": 386,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:52+07:00"
}
},
"CO3005-chapter-10-slide-387-0000": {
"id": "CO3005-chapter-10-slide-387-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, lexeme, inType, frame) => imul, fmul, idiv, fdiv emitDlV(self, frame) => idiv emitMOD(self, frame) => irem emitANDOP(self, frame) => iand emitOROP(self,frame) => ior Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_028.png",
"page_index": 387,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:54+07:00"
}
},
"CO3005-chapter-10-slide-388-0000": {
"id": "CO3005-chapter-10-slide-388-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, lexeme, inType, frame) => imul, fmul, idiv, fdiv emitDlV(self, frame) => idiv emitMOD(self, frame) => irem emitANDOP(self,frame) => iand emitOROP(self,frame) => ior emitREOP(self, op, inType, frame) => code for >, < >=, <=, Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_029.png",
"page_index": 388,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:56+07:00"
}
},
"CO3005-chapter-10-slide-389-0000": {
"id": "CO3005-chapter-10-slide-389-0000",
"text": "Operation Generation APls emitADDOP(self, lexeme, inType, frame) => iadd, fadd, isub, fsub emitMULOP(self, lexeme, inType, frame) => imul, fmul, idiv, fdiv emitDIV(self, frame) => idiv emitMOD(self, frame) => irem emitANDOP(self, frame) => iand emitOROP(self, frame) => ior emitREOP(self, op, inType, frame) => code for >, < >=, <=, emitRELOP(self, op, inType, trueLabel, falseLabel, frame) => code for condition in if statement Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 8/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_030.png",
"page_index": 389,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:30:58+07:00"
}
},
"CO3005-chapter-10-slide-390-0000": {
"id": "CO3005-chapter-10-slide-390-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_031.png",
"page_index": 390,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:00+07:00"
}
},
"CO3005-chapter-10-slide-391-0000": {
"id": "CO3005-chapter-10-slide-391-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_032.png",
"page_index": 391,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:01+07:00"
}
},
"CO3005-chapter-10-slide-392-0000": {
"id": "CO3005-chapter-10-slide-392-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifa]store Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_033.png",
"page_index": 392,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:03+07:00"
}
},
"CO3005-chapter-10-slide-393-0000": {
"id": "CO3005-chapter-10-slide-393-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifa]store emitASTORE(self, inType, frame) => ifaastore Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_034.png",
"page_index": 393,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:05+07:00"
}
},
"CO3005-chapter-10-slide-394-0000": {
"id": "CO3005-chapter-10-slide-394-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifastore emitASTORE(self, inType, frame) => [ifa]astore emitGETSTATIC(self, lexeme, inType, frame) => getstatic Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_035.png",
"page_index": 394,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:07+07:00"
}
},
"CO3005-chapter-10-slide-395-0000": {
"id": "CO3005-chapter-10-slide-395-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifastore emitASTORE(self, inType, frame) => [ifa]astore emitGETSTATIC(self, lexeme, inType, frame) => getstatic emitGETFIELD(self, lexeme, inType, frame) => getfield Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_036.png",
"page_index": 395,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:10+07:00"
}
},
"CO3005-chapter-10-slide-396-0000": {
"id": "CO3005-chapter-10-slide-396-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifastore emitASTORE(self, inType, frame) => [ifa]astore emitGETSTATIC(self, lexeme, inType, frame) => getstatic emitGETFIELD(self, lexeme, inType, frame) => getfield emitPUTSTATIC(self, lexeme, inType, frame) => putstatic Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_037.png",
"page_index": 396,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:12+07:00"
}
},
"CO3005-chapter-10-slide-397-0000": {
"id": "CO3005-chapter-10-slide-397-0000",
"text": "Read/Write Variables APls emitREADVAR(self, name, inType, index, frame) => [ifalload emitALOAD(self, inType, frame)) => [ifa]aload emitWRITEVAR(self, name, inType, index, frame) => [ifastore emitASTORE(self, inType, frame) => [ifa]astore emitGETSTATIC(self, lexeme, inType, frame) => getstatic emitGETFIELD(self, lexeme, inType, frame) => getfield emitPUTSTATIC(self, lexeme, inType, frame) => putstatic emitPUTFIELD(self, lexeme, inType, frame) => putfield Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 9/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_038.png",
"page_index": 397,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:15+07:00"
}
},
"CO3005-chapter-10-slide-398-0000": {
"id": "CO3005-chapter-10-slide-398-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_039.png",
"page_index": 398,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:16+07:00"
}
},
"CO3005-chapter-10-slide-399-0000": {
"id": "CO3005-chapter-10-slide-399-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_040.png",
"page_index": 399,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:17+07:00"
}
},
"CO3005-chapter-10-slide-400-0000": {
"id": "CO3005-chapter-10-slide-400-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_041.png",
"page_index": 400,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:19+07:00"
}
},
"CO3005-chapter-10-slide-401-0000": {
"id": "CO3005-chapter-10-slide-401-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input,frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_042.png",
"page_index": 401,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:21+07:00"
}
},
"CO3005-chapter-10-slide-402-0000": {
"id": "CO3005-chapter-10-slide-402-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_043.png",
"page_index": 402,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:23+07:00"
}
},
"CO3005-chapter-10-slide-403-0000": {
"id": "CO3005-chapter-10-slide-403-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType, frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_044.png",
"page_index": 403,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:26+07:00"
}
},
"CO3005-chapter-10-slide-404-0000": {
"id": "CO3005-chapter-10-slide-404-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) = iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) >invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_045.png",
"page_index": 404,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:28+07:00"
}
},
"CO3005-chapter-10-slide-405-0000": {
"id": "CO3005-chapter-10-slide-405-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) = iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle emitDUP(self,frame) => dup 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_046.png",
"page_index": 405,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:30+07:00"
}
},
"CO3005-chapter-10-slide-406-0000": {
"id": "CO3005-chapter-10-slide-406-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label,frame) => ifle emitDUP(self,frame) => dup emitPOP(self,frame) => pop 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_047.png",
"page_index": 406,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:33+07:00"
}
},
"CO3005-chapter-10-slide-407-0000": {
"id": "CO3005-chapter-10-slide-407-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) = iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle emitDUP(self,frame) => dup emitPOP(self,frame) => pop emitl2F(self, frame) => i2f 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_048.png",
"page_index": 407,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:35+07:00"
}
},
"CO3005-chapter-10-slide-408-0000": {
"id": "CO3005-chapter-10-slide-408-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle emitDUP(self,frame) => dup emitPOP(self,frame) => pop emitl2F(self, frame) => i2f emitRETURN(self, inType, frame) => return, ireturn 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_049.png",
"page_index": 408,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:38+07:00"
}
},
"CO3005-chapter-10-slide-409-0000": {
"id": "CO3005-chapter-10-slide-409-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType, frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle emitDUP(self,frame) => dup emitPOP(self,frame) => pop emitl2F(self, frame) => i2f emitRETURN(self, inType, frame) => return, ireturn emitLABEL(self, label, frame) => Label 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_050.png",
"page_index": 409,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:41+07:00"
}
},
"CO3005-chapter-10-slide-410-0000": {
"id": "CO3005-chapter-10-slide-410-0000",
"text": "Other APls emitPUSHICONST(self, input, frame) => iconst, bipush, sipush, Idc emitPUSHFCONST(self, input, frame) => fconst, Idc emitINVOKESTATIC(self, lexeme, inType, frame) => invokestatic emitINVOKESPECIAL(self, frame, lexeme=None, inType=None) > invokespecial emitINVOKEVIRTUAL(self, lexeme, inType,frame) = invokevirtual emitIFTRUE(self, label, frame) => ifgt emitIFFALSE(self, label, frame) => ifle emitDUP(self,frame) => dup emitPOP(self,frame) => pop emitl2F(self, frame) => i2f emitRETURN(self, inType, frame) = return, ireturn emitLABEL(self, label, frame) => Label emitGOTO(self, label, frame) => goto 290 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 10/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_051.png",
"page_index": 410,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:43+07:00"
}
},
"CO3005-chapter-10-slide-411-0000": {
"id": "CO3005-chapter-10-slide-411-0000",
"text": "Frame Tools are used to manage information used to generate code for a method Labels: are valid in the body of a method < getNewLabelO: return a new label Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_052.png",
"page_index": 411,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:45+07:00"
}
},
"CO3005-chapter-10-slide-412-0000": {
"id": "CO3005-chapter-10-slide-412-0000",
"text": "Frame Tools are used to manage information used to generate code for a method Labels: are valid in the body of a method < getNewLabelO: return a new label 4 getStartLabelO: return the beginning label of a scope Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_053.png",
"page_index": 412,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:47+07:00"
}
},
"CO3005-chapter-10-slide-413-0000": {
"id": "CO3005-chapter-10-slide-413-0000",
"text": "Frame Tools are used to manage information used to generate code for a method Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope getEndLabelO: return the end label of a scope Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_054.png",
"page_index": 413,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:50+07:00"
}
},
"CO3005-chapter-10-slide-414-0000": {
"id": "CO3005-chapter-10-slide-414-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 g getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_055.png",
"page_index": 414,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:53+07:00"
}
},
"CO3005-chapter-10-slide-415-0000": {
"id": "CO3005-chapter-10-slide-415-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope 1 getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come getBreakLabelO: return the label where a break should come Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_056.png",
"page_index": 415,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:55+07:00"
}
},
"CO3005-chapter-10-slide-416-0000": {
"id": "CO3005-chapter-10-slide-416-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope 1 getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come getBreakLabelO: return the label where a break should come < enterScope() Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_057.png",
"page_index": 416,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:31:59+07:00"
}
},
"CO3005-chapter-10-slide-417-0000": {
"id": "CO3005-chapter-10-slide-417-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come 1 g getBreakLabelO: return the label where a break should come 4 enterScopeO 4 exitScope( Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_058.png",
"page_index": 417,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:02+07:00"
}
},
"CO3005-chapter-10-slide-418-0000": {
"id": "CO3005-chapter-10-slide-418-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come getBreakLabelO: return the label where a break should come 4 enterScopeO 4 exitScopeO 4 enterLoopO Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_059.png",
"page_index": 418,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:05+07:00"
}
},
"CO3005-chapter-10-slide-419-0000": {
"id": "CO3005-chapter-10-slide-419-0000",
"text": "Frame Tools are used to manage information used to generate code for a method . Labels: are valid in the body of a method 4 getNewLabelO: return a new label getStartLabelO: return the beginning label of a scope getEndLabelO: return the end label of a scope getContinueLabelO: return the label where a continue should come getBreakLabelO: return the label where a break should come 4 enterScope( 4 exitScope( A 6 enterLoopO < exitLoopO Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 11/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_060.png",
"page_index": 419,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:08+07:00"
}
},
"CO3005-chapter-10-slide-420-0000": {
"id": "CO3005-chapter-10-slide-420-0000",
"text": "Frame (cont'd) Local variable array 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_061.png",
"page_index": 420,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:10+07:00"
}
},
"CO3005-chapter-10-slide-421-0000": {
"id": "CO3005-chapter-10-slide-421-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_062.png",
"page_index": 421,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:12+07:00"
}
},
"CO3005-chapter-10-slide-422-0000": {
"id": "CO3005-chapter-10-slide-422-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndex(: return the size of the local variable array 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_063.png",
"page_index": 422,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:14+07:00"
}
},
"CO3005-chapter-10-slide-423-0000": {
"id": "CO3005-chapter-10-slide-423-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndexO: return the size of the local variable array Operand stack Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_064.png",
"page_index": 423,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:15+07:00"
}
},
"CO3005-chapter-10-slide-424-0000": {
"id": "CO3005-chapter-10-slide-424-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndexO: return the size of the local variable array Operand stack 4 pushO: simulating a push execution Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_065.png",
"page_index": 424,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:17+07:00"
}
},
"CO3005-chapter-10-slide-425-0000": {
"id": "CO3005-chapter-10-slide-425-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndexO: return the size of the local variable array Operand stack 4 pushO: simulating a push execution 4 popO: simulating a pop execution Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_066.png",
"page_index": 425,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:20+07:00"
}
},
"CO3005-chapter-10-slide-426-0000": {
"id": "CO3005-chapter-10-slide-426-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndexO: return the size of the local variable array Operand stack 4 pushO: simulating a push execution 4 popO: simulating a pop execution 4 getMaxOpStackSizeO: return the max size of the operand stack Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_067.png",
"page_index": 426,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:22+07:00"
}
},
"CO3005-chapter-10-slide-427-0000": {
"id": "CO3005-chapter-10-slide-427-0000",
"text": "Frame (cont'd) Local variable array 4 getNewlndexO: return a new index for a variable getMaxlndexO: return the size of the local variable array Operand stack 4 pushO: simulating a push execution 4 popO: simulating a pop execution 4 getMaxOpStackSizeO: return the max size of the operand stack Implemented in class Frame Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 12/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_068.png",
"page_index": 427,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:24+07:00"
}
},
"CO3005-chapter-10-slide-428-0000": {
"id": "CO3005-chapter-10-slide-428-0000",
"text": "Machine-Independent Code Generation Based on the source language Use facilities of Frame and Intermediate Code Generation (Emitter Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 13/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_069.png",
"page_index": 428,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:25+07:00"
}
},
"CO3005-chapter-10-slide-429-0000": {
"id": "CO3005-chapter-10-slide-429-0000",
"text": "BKlT-Java mapping A source program Java class A global variable a static field A function a static method A parameter a parameter A local variable a local variable An expression an expression A statement a statement An invocation an invocation 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 14/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_070.png",
"page_index": 429,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:28+07:00"
}
},
"CO3005-chapter-10-slide-430-0000": {
"id": "CO3005-chapter-10-slide-430-0000",
"text": "Summary Use BCEL to know which code should be generated 590 Dr. Phung Nguyen (University of Technology Code Generation November 25,2020 15/ 15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_071.png",
"page_index": 430,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:30+07:00"
}
},
"CO3005-chapter-10-slide-431-0000": {
"id": "CO3005-chapter-10-slide-431-0000",
"text": "Summary Use BCEL to know which code should be generated Generate code for expressions first 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 15/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_072.png",
"page_index": 431,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:31+07:00"
}
},
"CO3005-chapter-10-slide-432-0000": {
"id": "CO3005-chapter-10-slide-432-0000",
"text": "Summary Use BCEL to know which code should be generated Generate code for expressions first Generate code for statements later 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 15/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_073.png",
"page_index": 432,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:33+07:00"
}
},
"CO3005-chapter-10-slide-433-0000": {
"id": "CO3005-chapter-10-slide-433-0000",
"text": "Summary Use BCEL to know which code should be generated Generate code for expressions first Generate code for statements later Good luck 590 Dr. Phung Nguyen (University of Technology Code Generation November 25.2020 15/15",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_10/slide_074.png",
"page_index": 433,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:34+07:00"
}
},
"CO3005-chapter-11-slide-434-0000": {
"id": "CO3005-chapter-11-slide-434-0000",
"text": "Sequence Control Dr. Nguyen Hua Phung HCMC University of Technology, Viet Nam December 7, 2020 Dr. Nguyen Hua Phung Sequence Contro 1/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_001.png",
"page_index": 434,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:36+07:00"
}
},
"CO3005-chapter-11-slide-435-0000": {
"id": "CO3005-chapter-11-slide-435-0000",
"text": "Outline Expressions Statements Program Units Dr. Nguyen Hua Phung Sequence Contro 2/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_002.png",
"page_index": 435,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:37+07:00"
}
},
"CO3005-chapter-11-slide-436-0000": {
"id": "CO3005-chapter-11-slide-436-0000",
"text": "Expressions o An expression is a syntactic entity whose evaluation either : o produces a value o fails to terminate -> undefined o Examples 4 + 3* 2 (a+ b) * (c - a) (b!= 0) ?(a/b) : 0 Dr. Nguyen Hua Phung Sequence Contro 4/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_003.png",
"page_index": 436,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:39+07:00"
}
},
"CO3005-chapter-11-slide-437-0000": {
"id": "CO3005-chapter-11-slide-437-0000",
"text": "Expressions (cont'd) Expression Evaluation Mechanism Expressions have functional composition nature (a+ b) * (c - d) + a b c d Expression Syntax Infix Prefix o Postfix Dr. Nguyen Hua Phung Sequence Control 5/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_004.png",
"page_index": 437,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:41+07:00"
}
},
"CO3005-chapter-11-slide-438-0000": {
"id": "CO3005-chapter-11-slide-438-0000",
"text": "nfix Notation (a+ b) * (c - d) Good for binary operators Used in most imperative programming language More than two operands? (b != 0) ? (a/b) : 0 o Smalltalk: myBox displayOn: myScreen at: 100@50 Dr. Nguyen Hua Phung Sequence Contro 6/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_005.png",
"page_index": 438,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:43+07:00"
}
},
"CO3005-chapter-11-slide-439-0000": {
"id": "CO3005-chapter-11-slide-439-0000",
"text": "Precedence 3 + 4 * 5 = 23, not 35 Evaluation priorities in mathematics Programming languages define their own precedence levels based on mathematics o A bit different precedence rules among languages can be confusing Dr. Nguyen Hua Phung Sequence Contro 7/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_006.png",
"page_index": 439,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:46+07:00"
}
},
"CO3005-chapter-11-slide-440-0000": {
"id": "CO3005-chapter-11-slide-440-0000",
"text": "Associativity If operators have the same level of precedence, then apply associativity rules Mostly left-to-right, except exponentiation operator An expression contains only one operator o Mathematics: associative Computer : optimization but potential problems o 1020 * 1020* 10-20 Dr. Nguyen Hua Phung Sequence Contro 8/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_007.png",
"page_index": 440,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:47+07:00"
}
},
"CO3005-chapter-11-slide-441-0000": {
"id": "CO3005-chapter-11-slide-441-0000",
"text": "Parentheses o Alter the precedence and associativity (A + B) * C Using parentheses, a language can even omit precedence and associativity rules o APL Advantage: simple Disadvantage: writability and readability Dr. Nguyen Hua Phung Sequence Contro 9/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_008.png",
"page_index": 441,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:49+07:00"
}
},
"CO3005-chapter-11-slide-442-0000": {
"id": "CO3005-chapter-11-slide-442-0000",
"text": "Conditional Expressions If statement if (count == 0) average else average = sum / count; Conditional Expression average = (count == 0) ? 0 : sum / count; o C-based languages, Perl, JavaScript, Ruby Dr. Nguyen Hua Phung Sequence Control 10/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_009.png",
"page_index": 442,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:52+07:00"
}
},
"CO3005-chapter-11-slide-443-0000": {
"id": "CO3005-chapter-11-slide-443-0000",
"text": "Prefix Notation Polish Prefix: * + a b - c d Cambridge Polish Prefix: (* (+ a b) (- c d) Normal Prefix: *(+(a,b),-(c,d)) o Derived from mathematical function f(x,y) Parentheses and precedence is no required. provided the -arity of operator is known Mostly see in unary operators o LISP: (append a b c my_list) Dr. Nguyen Hua Phung Sequence Contro 11/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_010.png",
"page_index": 443,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:54+07:00"
}
},
"CO3005-chapter-11-slide-444-0000": {
"id": "CO3005-chapter-11-slide-444-0000",
"text": "Posttix Notation Polish Postfix: a b + c d - * Cambridge Polish Postfix: ((a b +) (c d -) *) Normal Postfix: ((a,b)+,(c,d)-)* o Common usage: factorial operator (5!) o Used in intermediate code by some compilers o PostScript: (Hello World!) show Dr. Nguyen Hua Phung Sequence Contro 12/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_011.png",
"page_index": 444,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:55+07:00"
}
},
"CO3005-chapter-11-slide-445-0000": {
"id": "CO3005-chapter-11-slide-445-0000",
"text": "Operand Evaluation Order C program int a = 5; int fun1( { a = 17; return 3; } void main() a = a + fun10; } What is the value of a? 8 20 Reason: Side-effect on the operand of the expression Dr. Nguyen Hua Phung Sequence Contro 13/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_012.png",
"page_index": 445,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:32:58+07:00"
}
},
"CO3005-chapter-11-slide-446-0000": {
"id": "CO3005-chapter-11-slide-446-0000",
"text": "Evaluation Mechanisms o Eager evaluation First evaluate all operands . Then operators o How about a == 0 ? b : b/ a Lazy evaluation - Pass the un-evaluated operands to the operator Operator decide which operands are reguired . Much more expensive than eager Lazy for conditional, eager for the rest Dr. Nguyen Hua Phung Sequence Contro 14/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_013.png",
"page_index": 446,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:01+07:00"
}
},
"CO3005-chapter-11-slide-447-0000": {
"id": "CO3005-chapter-11-slide-447-0000",
"text": "Short-Circuit Evaluation (a == 0) ll (b/a > 2) If the first operand is evaluated as true, the second will be short-circuited Otherwise, \"divide by zero' How about (a> b) ll (b++/ 3) ? Some languages provide two sets of boolean operators: short- and non short-circuit o Ada: \"and\", \"or\" versus \"and then\", \"or else' Dr. Nguyen Hua Phung Sequence Control 15/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_014.png",
"page_index": 447,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:03+07:00"
}
},
"CO3005-chapter-11-slide-448-0000": {
"id": "CO3005-chapter-11-slide-448-0000",
"text": "Statements A statement is a syntactic entity whose evaluation: o does not return a value, but o changes the state of the system o Example a = 5; print \"pippo\" begin ... end Dr. Nguyen Hua Phung Sequence Contro 17/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_015.png",
"page_index": 448,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:05+07:00"
}
},
"CO3005-chapter-11-slide-449-0000": {
"id": "CO3005-chapter-11-slide-449-0000",
"text": "Assignment Statements leftExpr AssignOperator rightExpr address? value? 5 5 Evaluate left or right first is up to implementers Dr. Nguyen Hua Phung Sequence Contro 18/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_016.png",
"page_index": 449,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:06+07:00"
}
},
"CO3005-chapter-11-slide-450-0000": {
"id": "CO3005-chapter-11-slide-450-0000",
"text": "Assignment Statements C-based languages consider assignment as an expression while ((ch = getchar() != EOF) Introduce compound and unary assignment operators (+=, -=, ++, -) Increasing code legibility o Avoiding unforeseen side effects Dr. Nguyen Hua Phung Sequence Contro 19/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_017.png",
"page_index": 450,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:08+07:00"
}
},
"CO3005-chapter-11-slide-451-0000": {
"id": "CO3005-chapter-11-slide-451-0000",
"text": "Control Structures o Control statements . Selecting among alternative control flow paths - Causing the repeated execution of sequences of statements Control structure is a control statement and the collection of its controlled statements Dr. Nguyen Hua Phung Sequence Contro 20/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_018.png",
"page_index": 451,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:10+07:00"
}
},
"CO3005-chapter-11-slide-452-0000": {
"id": "CO3005-chapter-11-slide-452-0000",
"text": "Two-way Selection if control_expression then clause else clause o Proved to be fundamental and essential parts ot all programming languages Dr. Nguyen Hua Phung Sequence Contro 21/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_019.png",
"page_index": 452,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:12+07:00"
}
},
"CO3005-chapter-11-slide-453-0000": {
"id": "CO3005-chapter-11-slide-453-0000",
"text": "Dangling else if (sum == 0) if (count == 0) result = 0i else result = 1; Solution: including block in every cases Not all languages have this problem Fortran 95, Ada, Ruby: use a special word to end the statement Python: indentation matters Dr. Nguyen Hua Phung Sequence Control 22/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_020.png",
"page_index": 453,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:14+07:00"
}
},
"CO3005-chapter-11-slide-454-0000": {
"id": "CO3005-chapter-11-slide-454-0000",
"text": "Multiple-Selection Allows the selection of one of any number of statements or statement groups Perl, Python: don't have this lssues: . Type of selector expression? How are selectable segments specified? Execute only one segment or multiple segments? How are case values specified? What if values fall out of selectable segments? Dr. Nguyen Hua Phung Sequence Contro 23/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_021.png",
"page_index": 454,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:16+07:00"
}
},
"CO3005-chapter-11-slide-455-0000": {
"id": "CO3005-chapter-11-slide-455-0000",
"text": "Case Study: C Type must be int Exact value - Stmt sequences switch (index) - Block case 1 case 3 : odd += 1: sumodd += index; break; Multiple segments exited by break case 2 case 4 even += 1 ; sumeven += index; break; default printf(\"Error in.,switch\"). } for unrepresented values Dr. Nguyen Hua Phung Seguence Contro 24/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_022.png",
"page_index": 455,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:20+07:00"
}
},
"CO3005-chapter-11-slide-456-0000": {
"id": "CO3005-chapter-11-slide-456-0000",
"text": "Case Study : Pascal Integer or character - Single statement case exp of - Block 1 : clause A multiple values, 2,7 clause B subrange 3..5 clause C 10 : clause D else clause E end for unrepresented values Dr. Nguyen Hua Phung Sequence Contro 25/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_023.png",
"page_index": 456,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:22+07:00"
}
},
"CO3005-chapter-11-slide-457-0000": {
"id": "CO3005-chapter-11-slide-457-0000",
"text": "terative Statements Cause a statement or collection of statements to be executed zero, one or more times Essential for the power of the computer Programs would be huge and inflexible . Large amounts of time to write . Mammoth amounts of memory to store Design questions: o How is iteration controlled? o Logic, counting Where should the control appear in the loop? Pretest and posttest Dr. Nguyen Hua Phung Sequence Control 26/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_024.png",
"page_index": 457,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:24+07:00"
}
},
"CO3005-chapter-11-slide-458-0000": {
"id": "CO3005-chapter-11-slide-458-0000",
"text": "Counter-Controlled Loops o Counter-controlled loops must have: o Loop variable Initial and terminal values Stepsize Dr. Nguyen Hua Phung Sequence Contro 27/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_025.png",
"page_index": 458,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:26+07:00"
}
},
"CO3005-chapter-11-slide-459-0000": {
"id": "CO3005-chapter-11-slide-459-0000",
"text": "Case Study: Algol-based General form Semantic constant [define end_save] end save := last i = first for i:=first to last by step loop: do loop body if i > end save goto out end [loop body] Known number of iterations i := i + step before executing goto loop out: [undefine end_save] Dr. Nguyen Hua Phung Sequence Contro 28/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_026.png",
"page_index": 459,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:28+07:00"
}
},
"CO3005-chapter-11-slide-460-0000": {
"id": "CO3005-chapter-11-slide-460-0000",
"text": "Case study: C General form Semantic expr_1 loop: for (expr_1 ; expr_2; expr_3) if expr_2 = 0 goto out loop,body [loop body] expr_3 goto loop Can be infinite loop out: ... Dr. Nguyen Hua Phung Sequence Contro 29/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_027.png",
"page_index": 460,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:30+07:00"
}
},
"CO3005-chapter-11-slide-461-0000": {
"id": "CO3005-chapter-11-slide-461-0000",
"text": "Logically Controlled Loops Repeat based on Boolean expression rather than a counter Are more general than counter-controlled Design issues: . Should the control be pretest or posttest? Should the logically controlled loop be a special form of a counting loop or a separate statement? Dr. Nguyen Hua Phung Sequence Control 30/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_028.png",
"page_index": 461,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:32+07:00"
}
},
"CO3005-chapter-11-slide-462-0000": {
"id": "CO3005-chapter-11-slide-462-0000",
"text": "Case Study: C Forms Semantics loop: while (ctrl_expr) if ctrl_expr is false loop body goto out [loop body] goto loop out:... do loop: loop body [loop body] while (ctrl_expr); if ctrl_expr goto loop Dr. Nguyen Hua Phung Seguence Contro 31/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_029.png",
"page_index": 462,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:34+07:00"
}
},
"CO3005-chapter-11-slide-463-0000": {
"id": "CO3005-chapter-11-slide-463-0000",
"text": "User-Located Loop Control Programmer can choose a location for loop contro rather than top or bottom Simple design: infinite loops but include user-located loop exits Languages have exit statements: break and continue o A need for restricted goto statement Dr. Nguyen Hua Phung Sequence Contro 32/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_030.png",
"page_index": 463,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:35+07:00"
}
},
"CO3005-chapter-11-slide-464-0000": {
"id": "CO3005-chapter-11-slide-464-0000",
"text": "Case Study: C while (sum < 1000) { getnext(value) ; if (value < 0 break; sum += value; o What if we replace break by continue? Dr. Nguyen Hua Phung Sequence Contro 33/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_031.png",
"page_index": 464,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:37+07:00"
}
},
"CO3005-chapter-11-slide-465-0000": {
"id": "CO3005-chapter-11-slide-465-0000",
"text": "teration Based on Data Structures o Controlled by the number of elements in a data structure Iterator: o Called at the beginning of each iteration . Returns an element each time it is called in some specific order o Pre-defined or user-defined iterator Dr. Nguyen Hua Phung Sequence Contro 34/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_032.png",
"page_index": 465,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:39+07:00"
}
},
"CO3005-chapter-11-slide-466-0000": {
"id": "CO3005-chapter-11-slide-466-0000",
"text": "Case Study: Java ArrayList al = new ArrayList O); Iterator it = al.iterator O; while (it .hasNextO { Object element = it .nextO ; Dr. Nguyen Hua Phung Sequence Contro 35/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_033.png",
"page_index": 466,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:41+07:00"
}
},
"CO3005-chapter-11-slide-467-0000": {
"id": "CO3005-chapter-11-slide-467-0000",
"text": "Case Study: Ci String[] strList = {\"Bob\",\"Carol\",\"Ted\"}; foreach (String name in strList) Console.WriteLine(\"Name:{0}\", name); Dr. Nguyen Hua Phung Sequence Contro 36/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_034.png",
"page_index": 467,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:43+07:00"
}
},
"CO3005-chapter-11-slide-468-0000": {
"id": "CO3005-chapter-11-slide-468-0000",
"text": "Unconditional Branching Unconditional branch, or goto, is the most powerful statement for controlling the flow of execution of a program's statements Dangerous: difficult to read, as the result, highly unreliable and costly to maintain Structured programming: say no to goto Java, Python, Ruby: no goto It still exists in form of loop exit, but they are severely restricted gotos. Dr. Nguyen Hua Phung Sequence Control 37/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_035.png",
"page_index": 468,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:45+07:00"
}
},
"CO3005-chapter-11-slide-469-0000": {
"id": "CO3005-chapter-11-slide-469-0000",
"text": "Program Units to be continued Dr. Nguyen Hua Phung Sequence Contro 39/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_036.png",
"page_index": 469,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:46+07:00"
}
},
"CO3005-chapter-11-slide-470-0000": {
"id": "CO3005-chapter-11-slide-470-0000",
"text": "Summary o Expressions - Operator precedence and associativity Side effects Statements Assignment Selection Statement o Loop structures Dr. Nguyen Hua Phung Sequence Contro 40/40",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_11/slide_037.png",
"page_index": 470,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:47+07:00"
}
},
"CO3005-chapter-12-slide-471-0000": {
"id": "CO3005-chapter-12-slide-471-0000",
"text": "Control Abstraction Dr.. Nguyen Hua Phung HCMC University of Technology, Viet Nam 09,2013 Dr.. Nguyen Hua Phung Control Abstraction 1/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_001.png",
"page_index": 471,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:48+07:00"
}
},
"CO3005-chapter-12-slide-472-0000": {
"id": "CO3005-chapter-12-slide-472-0000",
"text": "Outline Subprogram Definition Subprogram Mechanisms Simple Call Return Recursie Call Exception Parameter Passing Higher-order Funtions Dr.. Nguyen Hua Phung ControlAbstractior 2/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_002.png",
"page_index": 472,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:50+07:00"
}
},
"CO3005-chapter-12-slide-473-0000": {
"id": "CO3005-chapter-12-slide-473-0000",
"text": "Outline Subprogram Definition Subprogram Mechanisms Simple Call Return Recursie Call Exception Parameter Passing Higher-order Funtions Dr.. Nguyen Hua Phung Control Abstraction 3/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_003.png",
"page_index": 473,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:52+07:00"
}
},
"CO3005-chapter-12-slide-474-0000": {
"id": "CO3005-chapter-12-slide-474-0000",
"text": "Subprogram Definition Subprogram definition consists of: o Specification Subprogram name Parameters input + output order type parameter passing mechanisms: by value, by reference, by name,.. Behaviour of the subprogram Implementation: Local data Collection of statements as subprogram body Dr.. Nguyen Hua Phung Control Abstraction 4/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_004.png",
"page_index": 474,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:54+07:00"
}
},
"CO3005-chapter-12-slide-475-0000": {
"id": "CO3005-chapter-12-slide-475-0000",
"text": "Example def apply(interval : Int , repeats : Boolean = true) (op: => Unit) { val timeOut = new javax.swing.AbstractActionO { def actionPerformed (e: java.awt.event.ActionEvent) = op } val t = new javax.swing.Timer(interval , timeOut) t.setRepeats(repeats) t.start() 1 Dr.. Nguyen Hua Phung Control Abstraction 5/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_005.png",
"page_index": 475,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:56+07:00"
}
},
"CO3005-chapter-12-slide-476-0000": {
"id": "CO3005-chapter-12-slide-476-0000",
"text": "Example def apply(interval: Int , repeats : Boolean = true) (op: => Unit) { val timeOut = new javax.swing.AbstractActionO { def actionPerformed (e: java.awt.event.ActionEvent) = op } val t = new javax.swing.Timer(interval , timeOut) t .setRepeats(repeats) t.start0 1 How many subprogram definitions are there in the above code? How many parameters are there in each subprogram definition? Dr.. Nguyen Hua Phung Control Abstraction 5/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_006.png",
"page_index": 476,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:33:59+07:00"
}
},
"CO3005-chapter-12-slide-477-0000": {
"id": "CO3005-chapter-12-slide-477-0000",
"text": "Subprogram Activation An activation of a subprogram: is created when the subprogram is invoked is destroyed when the subprogram completed its execution Dr.. Nguyen Hua Phung Control Abstraction 6/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_007.png",
"page_index": 477,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:01+07:00"
}
},
"CO3005-chapter-12-slide-478-0000": {
"id": "CO3005-chapter-12-slide-478-0000",
"text": "Subprogram Activation An activation of a subprogram: is created when the subprogram is invoked is destroyed when the subprogram completed its execution An activation includes Static part: Code segment o Dynamic part: Activation record o formal parameters local data return address other links Dr.. Nguyen Hua Phung Control Abstraction 6/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_008.png",
"page_index": 478,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:03+07:00"
}
},
"CO3005-chapter-12-slide-479-0000": {
"id": "CO3005-chapter-12-slide-479-0000",
"text": "Outline Subprogram Definition Subprogram Mechanisms 0 Simple Call Return Recursie Call Exception Parameter Passing Higher-order Funtions Dr.. Nguyen Hua Phung Control Abstraction 7/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_009.png",
"page_index": 479,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:04+07:00"
}
},
"CO3005-chapter-12-slide-480-0000": {
"id": "CO3005-chapter-12-slide-480-0000",
"text": "Subprogram Mechanisms Simple Call-Return Recursive Call Exception Processing Handler Coroutines Scheduled Subprograms Tasks Dr.. Nguyen Hua Phung Control Abstraction 8/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_010.png",
"page_index": 480,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:06+07:00"
}
},
"CO3005-chapter-12-slide-481-0000": {
"id": "CO3005-chapter-12-slide-481-0000",
"text": "Exercise int mul (Node root) f if (root == null) return 1: else root.val * mul(root.left) mul(root.right); * Rewrite the above function to short-circuit the traversal if val of a node in the binary tree is 0? Dr.. Nguyen Hua Phung Control Abstraction 9/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_011.png",
"page_index": 481,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:08+07:00"
}
},
"CO3005-chapter-12-slide-482-0000": {
"id": "CO3005-chapter-12-slide-482-0000",
"text": "Simple Call-Return Basic Features No recursion Explicit Call Site Single Entry Point Immediate Control Passing Single Execution Dr.. Nguyen Hua Phung Control Abstractior 10/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_012.png",
"page_index": 482,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:10+07:00"
}
},
"CO3005-chapter-12-slide-483-0000": {
"id": "CO3005-chapter-12-slide-483-0000",
"text": "Recursive Call Be able to call recursive Direct Recursice Call Indirect Recursive Call (Mutual Recursive) Other features same as Simple Call-Return Dr.. Nguyen Hua Phung Control Abstractior 11/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_013.png",
"page_index": 483,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:11+07:00"
}
},
"CO3005-chapter-12-slide-484-0000": {
"id": "CO3005-chapter-12-slide-484-0000",
"text": "Exception Processing Handler o May have no explicit call site Dr.. Nguyen Hua Phung Control Abstractior 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_014.png",
"page_index": 484,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:12+07:00"
}
},
"CO3005-chapter-12-slide-485-0000": {
"id": "CO3005-chapter-12-slide-485-0000",
"text": "Exception Processing Handler May have no explicit call site o Used in Dr.. Nguyen Hua Phung Control Abstraction 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_015.png",
"page_index": 485,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:13+07:00"
}
},
"CO3005-chapter-12-slide-486-0000": {
"id": "CO3005-chapter-12-slide-486-0000",
"text": "Exception Processing Handler May have no explicit call site o Used in Event-Driven Programming Dr.. Nguyen Hua Phung Control Abstraction 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_016.png",
"page_index": 486,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:15+07:00"
}
},
"CO3005-chapter-12-slide-487-0000": {
"id": "CO3005-chapter-12-slide-487-0000",
"text": "Exception Processing Handler May have no explicit call site o Used in Event-Driven Programming Error Handler Dr.. Nguyen Hua Phung Control Abstraction 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_017.png",
"page_index": 487,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:16+07:00"
}
},
"CO3005-chapter-12-slide-488-0000": {
"id": "CO3005-chapter-12-slide-488-0000",
"text": "Exception Processing Handler May have no explicit call site o Used in Event-Driven Programming Error Handler Dr.. Nguyen Hua Phung Control Abstraction 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_018.png",
"page_index": 488,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:17+07:00"
}
},
"CO3005-chapter-12-slide-489-0000": {
"id": "CO3005-chapter-12-slide-489-0000",
"text": "Exception Processing Handler May have no explicit call site o Used in Event-Driven Programming Error Handler Example, class EmptyExcp extends Throwable {int x=0;}; int average(int[] V) throws EmptyExcp(){ if (length(V)==0) throws new EmptyExcp(); else }; try{. average(W) ; 1 catch (EmptyExcp e) {write(\"Array_empty\"); Dr.. Nguyen Hua Phung Control Abstractior 12/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_019.png",
"page_index": 489,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:20+07:00"
}
},
"CO3005-chapter-12-slide-490-0000": {
"id": "CO3005-chapter-12-slide-490-0000",
"text": "Exception Mechanisms A language must specify. which exceptions can be handled and how they can be defined how an exception can be raised how an exception can be handled Dr.. Nguyen Hua Phung Control Abstractior 13/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_020.png",
"page_index": 490,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:22+07:00"
}
},
"CO3005-chapter-12-slide-491-0000": {
"id": "CO3005-chapter-12-slide-491-0000",
"text": "How an exception can be defined Java: subclass of Throwable Ada: values of a special type C++: any value Dr.. Nguyen Hua Phung Control Abstraction 14/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_021.png",
"page_index": 491,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:24+07:00"
}
},
"CO3005-chapter-12-slide-492-0000": {
"id": "CO3005-chapter-12-slide-492-0000",
"text": "How an exception can be raised Raising exception By user interaction (Click, MouseMove, TextChange, ...) Dr.. Nguyen Hua Phung Control Abstraction 15/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_022.png",
"page_index": 492,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:25+07:00"
}
},
"CO3005-chapter-12-slide-493-0000": {
"id": "CO3005-chapter-12-slide-493-0000",
"text": "How an exception can be raised Raising exception By user interaction (Click, MouseMove, TextChange, ...) By operating system Dr.. Nguyen Hua Phung Control Abstraction 15/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_023.png",
"page_index": 493,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:26+07:00"
}
},
"CO3005-chapter-12-slide-494-0000": {
"id": "CO3005-chapter-12-slide-494-0000",
"text": "How an exception can be raised Raising exception By user interaction (Click, MouseMove, TextChange, ...) By operating system By an object (Timer) Dr.. Nguyen Hua Phung Control Abstractior 15/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_024.png",
"page_index": 494,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:28+07:00"
}
},
"CO3005-chapter-12-slide-495-0000": {
"id": "CO3005-chapter-12-slide-495-0000",
"text": "How an exception can be raised Raising exception By user interaction (Click, MouseMove, TextChange, ...) By operating system By an object (Timer) By programmer (throw ) Dr.. Nguyen Hua Phung Control Abstractior 15/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_025.png",
"page_index": 495,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:30+07:00"
}
},
"CO3005-chapter-12-slide-496-0000": {
"id": "CO3005-chapter-12-slide-496-0000",
"text": "Example in Scala object Timer { def apply(interval: Int , repeats : Boolean = true (op: => Unit) { val timeOut = new javax.swing.AbstractAction( { def actionPerformed (e: java.awt.event.ActionEvent) = op val t = new javax.swing.Timer(interval , timeOut t . setRepeats(repeats) t.start0 } Timer(2000) { println(\"Timer went off\") } Timer(10000, false) { println(\"10 seconds are over!\") Dr.. Nguyen Hua Phung Control Abstraction 16/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_026.png",
"page_index": 496,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:33+07:00"
}
},
"CO3005-chapter-12-slide-497-0000": {
"id": "CO3005-chapter-12-slide-497-0000",
"text": "How an exception can be handled Define the protected block to intercept the exception for being handled Define exception handler associated with the protected block Dr.. Nguyen Hua Phung ControlAbstractior 17/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_027.png",
"page_index": 497,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:34+07:00"
}
},
"CO3005-chapter-12-slide-498-0000": {
"id": "CO3005-chapter-12-slide-498-0000",
"text": "How an exception can be handled Define the protected b/ock to intercept the exception for being handled Define exception handler associated with the protected block Termination Semantic non-resumable (common) + stack unwinding resumable o at the statement causing the error after the statement causing the error Dr.. Nguyen Hua Phung Control Abstraction 17/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_028.png",
"page_index": 498,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:36+07:00"
}
},
"CO3005-chapter-12-slide-499-0000": {
"id": "CO3005-chapter-12-slide-499-0000",
"text": "Coroutines A coroutine may postpone its execution and control is back to caller. Its execution later is resumed at the place it postponed. A B resume B resume A resume B resume A resume B resume A Dr.. Nguyen Hua Phung Control Abstraction 18/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_029.png",
"page_index": 499,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:39+07:00"
}
},
"CO3005-chapter-12-slide-500-0000": {
"id": "CO3005-chapter-12-slide-500-0000",
"text": "Tasks able to execute concurrently with other tasks run on multi-processor machine or single processor machine using time sharing Dr.. Nguyen Hua Phung Control Abstraction 19/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_030.png",
"page_index": 500,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:41+07:00"
}
},
"CO3005-chapter-12-slide-501-0000": {
"id": "CO3005-chapter-12-slide-501-0000",
"text": "Tasks able to execute concurrently with other tasks run on multi-processor machine or single processor machine using time sharing Issue? Dr.. Nguyen Hua Phung Control Abstractior 19/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_031.png",
"page_index": 501,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:42+07:00"
}
},
"CO3005-chapter-12-slide-502-0000": {
"id": "CO3005-chapter-12-slide-502-0000",
"text": "Tasks able to execute concurrently with other tasks run on multi-processor machine or single processor machine using time sharing Issue? o Synchronization Race condition o Deadlock Communication Dr.. Nguyen Hua Phung ControlAbstractior 19/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_032.png",
"page_index": 502,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:44+07:00"
}
},
"CO3005-chapter-12-slide-503-0000": {
"id": "CO3005-chapter-12-slide-503-0000",
"text": "Example in Scala val pa = (0 until 10000).toArray.par pa.map(_ + 1) pa map{ v => if (v % 2 == 0) v eIse -v } pa.fold(0) 1+ var a = 0 pa foreach { a +=- Dr.. Nguyen Hua Phung Control Abstractior 20/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_033.png",
"page_index": 503,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:45+07:00"
}
},
"CO3005-chapter-12-slide-504-0000": {
"id": "CO3005-chapter-12-slide-504-0000",
"text": "Scheduled subprograms The execution of callee is NOT started when it is invoked scheduled by time CALL A AT TIME = CURRENT TIME + 10 scheduled by priority CALL B WlTH PRIORlTY 7 Controlled by a scheduler Dr.. Nguyen Hua Phung Control Abstractior 21/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_034.png",
"page_index": 504,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:47+07:00"
}
},
"CO3005-chapter-12-slide-505-0000": {
"id": "CO3005-chapter-12-slide-505-0000",
"text": "Outline Subprogram Definition Subprogram Mechanisms Simple Call Return Recursie Call Exception Parameter Passing Higher-order Funtions Dr.. Nguyen Hua Phung Control Abstraction 22/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_035.png",
"page_index": 505,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:49+07:00"
}
},
"CO3005-chapter-12-slide-506-0000": {
"id": "CO3005-chapter-12-slide-506-0000",
"text": "Formal and Actual Parameter Definition o Formal parameters:int foo(float x,bool& y) : just a simple name close to a variable declaration combine with symbols relating to parameter passing mechanism Actual parameters/Arguments:foo(4*a,b an expression Dr.. Nguyen Hua Phung Control Abstraction 23/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_036.png",
"page_index": 506,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:51+07:00"
}
},
"CO3005-chapter-12-slide-507-0000": {
"id": "CO3005-chapter-12-slide-507-0000",
"text": "Formal and Actual Parameter Definition o Formal parameters:int foo(float x,bool& y): just a simple name close to a variable declaration C combine with symbols relating to parameter passing mechanism o Actual parameters/Arguments:foo(4*a,b o an expression Formal-Actual Corresponding by position int foo(float a,int b) = foo(x+1,y-2) o by name int foo(float a,int b) foo(b = x+1, a = y-2) Dr.. Nguyen Hua Phung Control Abstraction 23/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_037.png",
"page_index": 507,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:53+07:00"
}
},
"CO3005-chapter-12-slide-508-0000": {
"id": "CO3005-chapter-12-slide-508-0000",
"text": "Parameter Passing Input-Output o By value-result By reference By name Input Only o By value . By constant reference o Output Only By result As a result of a function Dr.. Nguyen Hua Phung Control Abstractior 24/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_038.png",
"page_index": 508,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:55+07:00"
}
},
"CO3005-chapter-12-slide-509-0000": {
"id": "CO3005-chapter-12-slide-509-0000",
"text": "nput-Output Parameters Pass by value-result Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_039.png",
"page_index": 509,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:55+07:00"
}
},
"CO3005-chapter-12-slide-510-0000": {
"id": "CO3005-chapter-12-slide-510-0000",
"text": "nput-Output Parameters Pass by value-result caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_040.png",
"page_index": 510,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:57+07:00"
}
},
"CO3005-chapter-12-slide-511-0000": {
"id": "CO3005-chapter-12-slide-511-0000",
"text": "nput-Output Parameters Pass by value-result findMax(a,b) => int findMax(int x,int y) {...} caller callee value a 5 5 x value b 6 6 y Dr.. Nguyen Hua Phung ControlAbstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_041.png",
"page_index": 511,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:34:59+07:00"
}
},
"CO3005-chapter-12-slide-512-0000": {
"id": "CO3005-chapter-12-slide-512-0000",
"text": "nput-Output Parameters Pass by value-result int findMax(int x,int y) {...} caller callee a 5 7 x b 6 8 y Dr.. Nguyen Hua Phung ControlAbstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_042.png",
"page_index": 512,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:01+07:00"
}
},
"CO3005-chapter-12-slide-513-0000": {
"id": "CO3005-chapter-12-slide-513-0000",
"text": "nput-Output Parameters Pass by value-result findMax(a,b) int findMax(int x,int y) {...} caller callee value a 7 7 x value b 8 8 y Dr.. Nguyen Hua Phung ControlAbstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_043.png",
"page_index": 513,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:03+07:00"
}
},
"CO3005-chapter-12-slide-514-0000": {
"id": "CO3005-chapter-12-slide-514-0000",
"text": "nput-Output Parameters Pass by value-result caller a 7 b 8 Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_044.png",
"page_index": 514,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:04+07:00"
}
},
"CO3005-chapter-12-slide-515-0000": {
"id": "CO3005-chapter-12-slide-515-0000",
"text": "nput-Output Parameters Pass by value-result o Pass by reference Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_045.png",
"page_index": 515,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:05+07:00"
}
},
"CO3005-chapter-12-slide-516-0000": {
"id": "CO3005-chapter-12-slide-516-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_046.png",
"page_index": 516,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:06+07:00"
}
},
"CO3005-chapter-12-slide-517-0000": {
"id": "CO3005-chapter-12-slide-517-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference findMax(a,b) => int findMax(int& x,int& y) {...} caller callee address a 5 x address b 6 y Dr.. Nguyen Hua Phung ControlAbstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_047.png",
"page_index": 517,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:08+07:00"
}
},
"CO3005-chapter-12-slide-518-0000": {
"id": "CO3005-chapter-12-slide-518-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference int findMax(int& x,int& y) {...} caller callee a 5 x b 6 y Dr.. Nguyen Hua Phung Control Abstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_048.png",
"page_index": 518,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:10+07:00"
}
},
"CO3005-chapter-12-slide-519-0000": {
"id": "CO3005-chapter-12-slide-519-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference int findMax(int& x,int& y) {...} caller callee a 7 x b 8 y Dr.. Nguyen Hua Phung Control Abstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_049.png",
"page_index": 519,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:12+07:00"
}
},
"CO3005-chapter-12-slide-520-0000": {
"id": "CO3005-chapter-12-slide-520-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference findMax(a,b) < caller a 7 b 8 Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_050.png",
"page_index": 520,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:13+07:00"
}
},
"CO3005-chapter-12-slide-521-0000": {
"id": "CO3005-chapter-12-slide-521-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference Pass by name Dr.. Nguyen Hua Phung Control Abstraction 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_051.png",
"page_index": 521,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:15+07:00"
}
},
"CO3005-chapter-12-slide-522-0000": {
"id": "CO3005-chapter-12-slide-522-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference Pass by name findMax(a,b) => int findMax(int=> x,int=> y) {...} Dr.. Nguyen Hua Phung Control Abstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_052.png",
"page_index": 522,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:16+07:00"
}
},
"CO3005-chapter-12-slide-523-0000": {
"id": "CO3005-chapter-12-slide-523-0000",
"text": "nput-Output Parameters Pass by value-result Pass by reference Pass by name int findMax(int=> x,int=> y) {...} a = x b = y Dr.. Nguyen Hua Phung Control Abstractior 25/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_053.png",
"page_index": 523,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:17+07:00"
}
},
"CO3005-chapter-12-slide-524-0000": {
"id": "CO3005-chapter-12-slide-524-0000",
"text": "Exercise void swap(int x, int y) { int t = x; x = y; y = t : } void mainO f int a[] = {2, 1, 0}; i = 0; swap(i,a[i]); cout << i << a[0] << a[1] << a[2]; } Dr.. Nguyen Hua Phung ControlAbstractior 26/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_054.png",
"page_index": 524,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:20+07:00"
}
},
"CO3005-chapter-12-slide-525-0000": {
"id": "CO3005-chapter-12-slide-525-0000",
"text": "nput Only Parameters o Pass by value Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_055.png",
"page_index": 525,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:21+07:00"
}
},
"CO3005-chapter-12-slide-526-0000": {
"id": "CO3005-chapter-12-slide-526-0000",
"text": "nput Only Parameters o Pass by value caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_056.png",
"page_index": 526,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:22+07:00"
}
},
"CO3005-chapter-12-slide-527-0000": {
"id": "CO3005-chapter-12-slide-527-0000",
"text": "nput Only Parameters Pass by value findMax(a,b) => int findMax(int x,int y) {...} caller callee value a 5 5 x value b 6 6 y Dr.. Nguyen Hua Phung ControlAbstractior 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_057.png",
"page_index": 527,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:24+07:00"
}
},
"CO3005-chapter-12-slide-528-0000": {
"id": "CO3005-chapter-12-slide-528-0000",
"text": "nput Only Parameters Pass by value int findMax(int x,int y) {...} caller callee a 5 7 x b 6 8 y Dr.. Nguyen Hua Phung ControlAbstractior 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_058.png",
"page_index": 528,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:25+07:00"
}
},
"CO3005-chapter-12-slide-529-0000": {
"id": "CO3005-chapter-12-slide-529-0000",
"text": "nput Only Parameters Pass by value findMax(a,b) < caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_059.png",
"page_index": 529,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:27+07:00"
}
},
"CO3005-chapter-12-slide-530-0000": {
"id": "CO3005-chapter-12-slide-530-0000",
"text": "nput Only Parameters o Pass by value Pass by constant reference Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_060.png",
"page_index": 530,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:28+07:00"
}
},
"CO3005-chapter-12-slide-531-0000": {
"id": "CO3005-chapter-12-slide-531-0000",
"text": "nput Only Parameters Pass by value Pass by constant reference caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_061.png",
"page_index": 531,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:30+07:00"
}
},
"CO3005-chapter-12-slide-532-0000": {
"id": "CO3005-chapter-12-slide-532-0000",
"text": "nput Only Parameters Pass by value Pass by constant reference findMax(a,b) => int findMax(const int& x,const int& y){...} caller callee address a 5 x address b 6 y Dr.. Nguyen Hua Phung Control Abstraction 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_062.png",
"page_index": 532,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:32+07:00"
}
},
"CO3005-chapter-12-slide-533-0000": {
"id": "CO3005-chapter-12-slide-533-0000",
"text": "nput Only Parameters Pass by value Pass by constant reference int findMax(const int& x,const int& y) {...} caller callee a 5 x b 6 y Dr.. Nguyen Hua Phung ControlAbstractior 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_063.png",
"page_index": 533,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:34+07:00"
}
},
"CO3005-chapter-12-slide-534-0000": {
"id": "CO3005-chapter-12-slide-534-0000",
"text": "nput Only Parameters Pass by value Pass by constant reference int findMax(const int& x,const int& y) {...} caller callee a 5 x b 6 y Dr.. Nguyen Hua Phung ControlAbstractior 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_064.png",
"page_index": 534,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:35+07:00"
}
},
"CO3005-chapter-12-slide-535-0000": {
"id": "CO3005-chapter-12-slide-535-0000",
"text": "nput Only Parameters Pass by value Pass by constant reference findMax(a,b) caller a 5 b 6 Dr.. Nguyen Hua Phung ControlAbstractior 27/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_065.png",
"page_index": 535,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:37+07:00"
}
},
"CO3005-chapter-12-slide-536-0000": {
"id": "CO3005-chapter-12-slide-536-0000",
"text": "Output Only Parameters o Pass by result Dr.. Nguyen Hua Phung Control Abstraction 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_066.png",
"page_index": 536,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:37+07:00"
}
},
"CO3005-chapter-12-slide-537-0000": {
"id": "CO3005-chapter-12-slide-537-0000",
"text": "Output Only Parameters Pass by result caller a 5 b 6 Dr.. Nguyen Hua Phung Control Abstraction 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_067.png",
"page_index": 537,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:39+07:00"
}
},
"CO3005-chapter-12-slide-538-0000": {
"id": "CO3005-chapter-12-slide-538-0000",
"text": "Output Only Parameters Pass by result findMax(a,b) => int findMax(int x,int y) {...} caller callee a 5 x b 6 y Dr.. Nguyen Hua Phung Control Abstractior 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_068.png",
"page_index": 538,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:41+07:00"
}
},
"CO3005-chapter-12-slide-539-0000": {
"id": "CO3005-chapter-12-slide-539-0000",
"text": "Output Only Parameters Pass by result int findMax(int x,int y) {...} caller callee a 5 3 x b 6 4 y Dr.. Nguyen Hua Phung ControlAbstractior 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_069.png",
"page_index": 539,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:43+07:00"
}
},
"CO3005-chapter-12-slide-540-0000": {
"id": "CO3005-chapter-12-slide-540-0000",
"text": "Output Only Parameters Pass by result findMax(a,b) caller value a 3 3 value b 4 4 Dr.. Nguyen Hua Phung ControlAbstractior 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_070.png",
"page_index": 540,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:44+07:00"
}
},
"CO3005-chapter-12-slide-541-0000": {
"id": "CO3005-chapter-12-slide-541-0000",
"text": "Output Only Parameters Pass by result As a result of a function Dr.. Nguyen Hua Phung Control Abstraction 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_071.png",
"page_index": 541,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:45+07:00"
}
},
"CO3005-chapter-12-slide-542-0000": {
"id": "CO3005-chapter-12-slide-542-0000",
"text": "Output Only Parameters Pass by result As a result of a function int foo0 ... return 0; No actual parameter: foo0 + 1 Dr.. Nguyen Hua Phung Control Abstraction 28/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_072.png",
"page_index": 542,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:47+07:00"
}
},
"CO3005-chapter-12-slide-543-0000": {
"id": "CO3005-chapter-12-slide-543-0000",
"text": "Exercise type VECT = array [1..3] of integer ; type VECTPTR = @VECT: procedure SUB1 : var A,B:VECT:P,Q:VECTPTR: begin A[1] := 7;A[2l := 8; A[3l := S 9: B[1] := 7;b[2] := 8; B[3] := 9: P := @A; Q := @B; SUB2(P,Q) ; end ; procedure SUB2(R:VECTPTR;var S:VECTPTR) begin R[1] := R[1] + 10; // 1 S[1] := S[1] + 10; // 2 if ... then R := S; // 3 else S := R; // 4 end ; Dr.. Nguyen Hua Phung Control Abstraction 29/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_073.png",
"page_index": 543,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:51+07:00"
}
},
"CO3005-chapter-12-slide-544-0000": {
"id": "CO3005-chapter-12-slide-544-0000",
"text": "Exercise (cont'd) Which storage (variable) is changed and what is its new value after changing after the following instruction is executed? a. // 1 // 2 // 3 // 4 d. Dr.. Nguyen Hua Phung ControlAbstractior 30/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_074.png",
"page_index": 544,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:53+07:00"
}
},
"CO3005-chapter-12-slide-545-0000": {
"id": "CO3005-chapter-12-slide-545-0000",
"text": "Outline Subprogram Definition Subprogram Mechanisms Simple Call Return Recursie Call Exception Parameter Passing Higher-order Funtions Dr.. Nguyen Hua Phung Control Abstraction 31/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_075.png",
"page_index": 545,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:54+07:00"
}
},
"CO3005-chapter-12-slide-546-0000": {
"id": "CO3005-chapter-12-slide-546-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions o as its input parameters (fairly common) Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_076.png",
"page_index": 546,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:56+07:00"
}
},
"CO3005-chapter-12-slide-547-0000": {
"id": "CO3005-chapter-12-slide-547-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions as its input parameters (tairly common) as its out parameters (less common - but required in functional programming) Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_077.png",
"page_index": 547,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:57+07:00"
}
},
"CO3005-chapter-12-slide-548-0000": {
"id": "CO3005-chapter-12-slide-548-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions as its input parameters (tairly common) as its out parameters (less common - but required in functional programming) Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_078.png",
"page_index": 548,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:35:59+07:00"
}
},
"CO3005-chapter-12-slide-549-0000": {
"id": "CO3005-chapter-12-slide-549-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions as its input parameters (fairly common) as its out parameters (less common - but required in functional programming) Example, in stdlib.h of C, there is a built-in sorting function void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_079.png",
"page_index": 549,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:01+07:00"
}
},
"CO3005-chapter-12-slide-550-0000": {
"id": "CO3005-chapter-12-slide-550-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions as its input parameters (fairly common) as its out parameters (less common - but required in functional programming) Example, in stdlib.h of C, there is a built-in sorting function void qsort(void *base, size t nmemb, size t size , int(*compar)(const void *, const void *)); int int_sorter(const void *first_arg ,const void *second_arg) int first = *(int*)first_arg: int second = *(int*)second_arg : if (first < second) return -1; else if (first == second) return 0; else return 1: 1 Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_080.png",
"page_index": 550,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:03+07:00"
}
},
"CO3005-chapter-12-slide-551-0000": {
"id": "CO3005-chapter-12-slide-551-0000",
"text": "Higher-order Functions A function is higher-order when it accepts functions as its input parameters (fairly common) as its out parameters (less common - but required in functional programming) Example, in stdlib.h of C, there is a built-in sorting function void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); int main( { int array[10],i ; /* fil1 array */ for ( i = 0; i < 10; ++i ) array[i] = 10 - i ; qsort(array, 1o, sizeof(int),int_sorter); for (i = 0; i < 10; ++i) printf (\"%dn\" ,array[i]); 1 Dr.. Nguyen Hua Phung Control Abstraction 32/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_081.png",
"page_index": 551,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:06+07:00"
}
},
"CO3005-chapter-12-slide-552-0000": {
"id": "CO3005-chapter-12-slide-552-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_082.png",
"page_index": 552,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:07+07:00"
}
},
"CO3005-chapter-12-slide-553-0000": {
"id": "CO3005-chapter-12-slide-553-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, int x = 1: int f(int y){ return x+y; } int g (int h(int b)){ int x = 2: return h(3) + x; //shallow binding 1 [int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_083.png",
"page_index": 553,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:10+07:00"
}
},
"CO3005-chapter-12-slide-554-0000": {
"id": "CO3005-chapter-12-slide-554-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Static scope: z = int x = 1; int f(int y){ return x+y; } int g (int h(int b){ int x = 2; return h(3) + x; //shallow binding 1 [int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_084.png",
"page_index": 554,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:12+07:00"
}
},
"CO3005-chapter-12-slide-555-0000": {
"id": "CO3005-chapter-12-slide-555-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Static scope: z = 6 int x = 1; int f(int y){ return x+y; } int g (int h(int b){ int x = 2; return h(3) + x; //shallow binding 1 [int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_085.png",
"page_index": 555,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:14+07:00"
}
},
"CO3005-chapter-12-slide-556-0000": {
"id": "CO3005-chapter-12-slide-556-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Dynamic scope + Deep binding: z = int x = 1; int f(int y){ return x+y; } int g (int h(int b)){ int x = 2; return h(3) + x; //shallow binding } {int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_086.png",
"page_index": 556,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:16+07:00"
}
},
"CO3005-chapter-12-slide-557-0000": {
"id": "CO3005-chapter-12-slide-557-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Dynamic scope + Deep binding: z = 9 int x = 1; int f(int y){ return x+y; } int g (int h(int b)){ int x = 2; return h(3) + x; //shallow binding 1 {int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_087.png",
"page_index": 557,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:20+07:00"
}
},
"CO3005-chapter-12-slide-558-0000": {
"id": "CO3005-chapter-12-slide-558-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Dynamic scope + Shallow binding: z = int x = 1; int f(int y){ return x+y; } int g (int h(int b)){ int x = 2; return h(3) + x; //shallow binding 1 [int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_088.png",
"page_index": 558,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:22+07:00"
}
},
"CO3005-chapter-12-slide-559-0000": {
"id": "CO3005-chapter-12-slide-559-0000",
"text": "Functions as Parameters What is non-local environment? o Deep binding Shallow binding Example, Dynamic scope + Shallow binding: z = 7 int x = 1; int f(int y){ return x+y; } int g (int h(int b)){ int x = 2; return h(3) + x; //shallow binding 1 [int x = 4; int z = g(f); //deep binding 1 Skip Scala Example Dr.. Nguyen Hua Phung Control Abstraction 33/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_089.png",
"page_index": 559,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:23+07:00"
}
},
"CO3005-chapter-12-slide-560-0000": {
"id": "CO3005-chapter-12-slide-560-0000",
"text": "Exercise var X:real : procedure SUB2(X,Y: real;function F(U: real): real) ; var Z: real : begin Z := abs(X - Y) ; Z := (F(X) + F(Y))* Z 1 2; write(Z); // ??? in static-scoping language procedure SUB1 : var Y: real : function FUNC(V: real ) : real : begin FUNC := X * V + Y: begin Y := 1: SUB2(0,1,FUNC) ; begin X := 3; SUB1 ; end . Dr.. Nguyen Hua Phung Control Abstraction 34/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_090.png",
"page_index": 560,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:26+07:00"
}
},
"CO3005-chapter-12-slide-561-0000": {
"id": "CO3005-chapter-12-slide-561-0000",
"text": "Example in Scala object FileMatcher { private def filesHere (new java.io.File (\".\")).listFiles def filesEnding(query: String) = for (file <- filesHere; if f ile .getName.endsWith(query)) yield file} def filesContaining(query: String) = for (file <- filesHere; if file .getName.contains(query)) yield file def filesRegex(query: String) = for (file <- filesHere ; if file .getName.matches(query)) yield file 1 Dr.. Nguyen Hua Phung Control Abstraction 35/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_091.png",
"page_index": 561,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:29+07:00"
}
},
"CO3005-chapter-12-slide-562-0000": {
"id": "CO3005-chapter-12-slide-562-0000",
"text": "Example in Scala object FileMatcher { private def filesHere (new java.io.File (\".\")).listFiles def filesEnding(query: String) = for (file <- filesHere ; if f ile .getName.endsWith(query)) yield file} def filesContaining(query: String) = for (file <- filesHere; if file .getName.contains(query)) yield file def filesRegex(query: String) = for (file <- filesHere ; if file getName.matches(query)) yield file Dr.. Nguyen Hua Phung Control Abstraction 35/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_092.png",
"page_index": 562,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:32+07:00"
}
},
"CO3005-chapter-12-slide-563-0000": {
"id": "CO3005-chapter-12-slide-563-0000",
"text": "Example in Scala object FileMatcher { private def filesHere (new java.io.File (\".\")).listFiles def filesMatching(query: String , matcher: (String , String) => Boolean) = { for (file <- filesHere; if matcher( file .getName, query) yield file } def filesEnding(query: String) = filesMatching(query, -.endsWith(_)) def filesContaining(query: String) = filesMatching(query, -.contains(_)) def filesRegex(query: String) = filesMatching(query, -.matches(_)) 1 Dr.. Nguyen Hua Phung Control Abstraction 36/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_093.png",
"page_index": 563,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:34+07:00"
}
},
"CO3005-chapter-12-slide-564-0000": {
"id": "CO3005-chapter-12-slide-564-0000",
"text": "Functions as Returns What returns as functions Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_094.png",
"page_index": 564,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:36+07:00"
}
},
"CO3005-chapter-12-slide-565-0000": {
"id": "CO3005-chapter-12-slide-565-0000",
"text": "Functions as Returns What returns as functions o Code Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_095.png",
"page_index": 565,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:36+07:00"
}
},
"CO3005-chapter-12-slide-566-0000": {
"id": "CO3005-chapter-12-slide-566-0000",
"text": "Functions as Returns What returns as functions o Code Environment Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_096.png",
"page_index": 566,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:38+07:00"
}
},
"CO3005-chapter-12-slide-567-0000": {
"id": "CO3005-chapter-12-slide-567-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_097.png",
"page_index": 567,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:39+07:00"
}
},
"CO3005-chapter-12-slide-568-0000": {
"id": "CO3005-chapter-12-slide-568-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, void->int F O { int x = 1 : int g () { return x+1: 1 return g ; 1 void->int gg = FO; int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_098.png",
"page_index": 568,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:42+07:00"
}
},
"CO3005-chapter-12-slide-569-0000": {
"id": "CO3005-chapter-12-slide-569-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, void->int F O { int x = 1 : int g () { return x+1: 1 return g ; 1 void->int gg = FO; int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_099.png",
"page_index": 569,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:44+07:00"
}
},
"CO3005-chapter-12-slide-570-0000": {
"id": "CO3005-chapter-12-slide-570-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, void->int F O { int x = 1 : int g () { return x+1: 1 return g ; 1 void->int gg = FO; int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_100.png",
"page_index": 570,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:46+07:00"
}
},
"CO3005-chapter-12-slide-571-0000": {
"id": "CO3005-chapter-12-slide-571-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main void->int F O { gg int x = 1 : z int g () { return x+1: 1 return g ; 1 void->int gg = FO; int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_101.png",
"page_index": 571,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:48+07:00"
}
},
"CO3005-chapter-12-slide-572-0000": {
"id": "CO3005-chapter-12-slide-572-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main F void->int F O { gg x 1 int x = 1 : z int g () { return x+1: 1 return g ; 1 void->int gg = FO; int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_102.png",
"page_index": 572,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:51+07:00"
}
},
"CO3005-chapter-12-slide-573-0000": {
"id": "CO3005-chapter-12-slide-573-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main F void->int F O { gg x 1 int x = 1 : z int g () { return x+1: 1 return g ; g 1 void->int gg = FO; code int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_103.png",
"page_index": 573,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:54+07:00"
}
},
"CO3005-chapter-12-slide-574-0000": {
"id": "CO3005-chapter-12-slide-574-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main void->int F O { gg int x = 1 : z int g () { return x+1: 1 return g ; g 1 void->int gg = FO; code int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_104.png",
"page_index": 574,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:56+07:00"
}
},
"CO3005-chapter-12-slide-575-0000": {
"id": "CO3005-chapter-12-slide-575-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main void->int F O { gg int x = 1 : z int g () { return x+1: 1 return g ; g 1 void->int gg = FO; code int z = gg() ; Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_105.png",
"page_index": 575,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:36:58+07:00"
}
},
"CO3005-chapter-12-slide-576-0000": {
"id": "CO3005-chapter-12-slide-576-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main g void->int F O { gg int x = 1 : z int g () { return x+1: 1 return g ; g 1 void->int gg = FO; code int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_106.png",
"page_index": 576,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:37:01+07:00"
}
},
"CO3005-chapter-12-slide-577-0000": {
"id": "CO3005-chapter-12-slide-577-0000",
"text": "Functions as Returns What returns as functions o Code Environment Example, main g No x void->int F O { gg to eval int x = 1 : z int g () { x + 1 return x+1: 1 return g ; g 1 void->int gg = FO; code int z = gg(); Dr.. Nguyen Hua Phung Control Abstraction 37/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_107.png",
"page_index": 577,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:37:04+07:00"
}
},
"CO3005-chapter-12-slide-578-0000": {
"id": "CO3005-chapter-12-slide-578-0000",
"text": "Exercise How to keep the environment for function as results? Does the same problem happen for function as parameter? If your answer is Yes, please give an example. >Skip Scala Example Dr.. Nguyen Hua Phung Control Abstractior 38/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_108.png",
"page_index": 578,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:37:06+07:00"
}
},
"CO3005-chapter-12-slide-579-0000": {
"id": "CO3005-chapter-12-slide-579-0000",
"text": "Summary Subprogram mechanisms Simple Call-Return Recursive Call Exception Coroutine Scheduled Call Tasks Parameter Passing Higher-order Functions Dr.. Nguyen Hua Phung ControlAbstractior 39/39",
"metadata": {
"doc_type": "slide",
"course_id": "CO3005",
"source_file": "/workspace/data/converted/CO3005_Principles_of_Programming_Languages/Chapter_12/slide_109.png",
"page_index": 579,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T13:37:07+07:00"
}
}
} |