diff --git a/index.html b/index.html index 3bca2c82..6339b9dd 100644 --- a/index.html +++ b/index.html @@ -363,14 +363,14 @@
๐ซ ้ฎ็ฎฑ | ๐งโ๐ป ไธป้กต
diff --git a/search/search_index.json b/search/search_index.json index 1201d2bd..d04f37b7 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"\ud83c\udfdb\ufe0f Mini Babel Library","text":":material-circle-edit-outline: \u7ea6 231 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
La biblioteca de Babel
\u300c\u5b87\u5b99\uff08\u522b\u4eba\u7ba1\u5b83\u53eb\u56fe\u4e66\u9986\uff09\u7531\u8bb8\u591a\u516d\u89d2\u5f62\u7684\u56de\u5eca\u7ec4\u6210\uff0c\u6570\u76ee\u4e0d\u80fd\u786e\u5b9a\uff0c\u4e5f\u8bb8\u662f\u65e0\u9650\u7684\u300d \u2014\u2014 Jorge Luis Borges (1939)
\u8fd9\u662f\u6211\u4e3b\u8981\u7528\u4e2d\u6587\u5199\u7684 BLOG\uff0c\u5927\u90e8\u5206\u5185\u5bb9\u662f\u5b66\u4e60\u7b14\u8bb0\u3002\u6211\u7684\u7b14\u8bb0\u4e0d\u591a\uff01\u4ee5\u540e\u4e5f\u4e0d\u4f1a\u591a\u7684(\u4fdd\u8d28\u4e0d\u4fdd\u91cf) \u6b22\u8fce\u6765\u770b\u6211\u7684\u7b14\u8bb0\uff01
"},{"location":"#content-shortcut","title":"\ud83d\uded7 Content Shortcut\u23f0 \u66f4\u65b0\u8bb0\u5f55","text":"\ud83d\udcbb Computer Science
Selection
\ud83c\udf33 Linguistics
Selection
\ud83c\udf93 Deep Learning
Selection
\ud83d\udcad Opinions
Selection
\ud83c\udfb9 Life
Selection
2025-01-04\u00b6Music Theory \u4e50\u7406
French Tense \u6cd5\u8bed\u65f6\u6001
2025-01-01\u00b62024 Summary
2024-12-14\u00b6Main Page
\u8bb0\u5f55\u751f\u6210\u5de5\u5177\uff1aTonyCrane/mkdocs-changelog-plugin"},{"location":"#_1","title":"\u53cb\u94fe","text":"\u7ad9 \u5b9a\u4f4d\u662f \u672c\u7ad9\uff1a# \u63ba\u6742\u81ea\u5df1\u89c2\u70b9\u7684\u7b14\u8bb0 + \u5fc3\u5f97 \u4ed3\u5e93\uff1a\ud83d\udd17ZJUCourse \u5ba2\u89c2\u901a\u7528\u7684\u4e00\u4e2aZJU\u8bfe\u7a0b\u8d44\u6599\u5de5\u5177\u7bb1 \ud83d\udd17mem \u7684\u5c0f\u7ad9 \u5185\u5bb9\u4e3b\u8981\u662f\u7b97\u6cd5\u7b14\u8bb0 + ZJU \u8bfe\u7a0b\u7b14\u8bb0\u3002\u8c22\u8c22\u7b2c\u4e00\u4f4d\u627e\u6211\u6362\u53cb\u94fe\u7684\u5c0f\u670b\u53cb\uff01\u662f\u5f88\u5389\u5bb3\u7684 OIer \ud83d\udd17\u79d1\u5b66\u7a7a\u95f4 \u82cf\u5251\u6797\u82cf\u795e\u7684 blog\uff0c\u66f4\u65b0\u4e86\u5341\u51e0\u5e74\u4e86\uff0c\u4ef0\u6155"},{"location":"#_2","title":"\u8054\u7cfb\u4f5c\u8005","text":"\ud83d\udceb \u90ae\u7bb1 | \ud83e\uddd1\u200d\ud83d\udcbb \u4e3b\u9875
"},{"location":"docs/1-cs/","title":"Computer Science Notes","text":":material-circle-edit-outline: \u7ea6 460 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
This section mainly consists of my selected notes on the course/project/assignment of the computer science courses from Zhejiang University. \u672c\u7ae0\u8282\u5185\u5bb9\u4e3b\u8981\u4e3a\u6d59\u6c5f\u5927\u5b66\u8ba1\u7b97\u673a\u5b66\u9662\u8bfe\u7a0b\u7684\u8bfe\u7a0b/\u9879\u76ee/\u4f5c\u4e1a\u7b14\u8bb0\u3002
I respect the honest code of computer science school of Zhejiang University and do not publish any content against this code (e.g., solutions of the assignments or source codes of the projects). Please contact me if you find anything that has the risk to violate the code.
"},{"location":"docs/1-cs/#compass","title":"\ud83e\udded Compass","text":"\u5728\u7f51\u4e0a\u627e\u7b14\u8bb0/\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u6211\u7684\u6700\u5927\u611f\u53d7\u4e4b\u4e00\u662f\u867d\u7136\u8d44\u6e90\u5f88\u591a\u5f88\u591a\uff0c\u4f46\u662f\u5e38\u5e38\u4e0d\u77e5\u9053\u67d0\u4e2a\u8d44\u6e90\u6709\u591a\u91cd\u8981\uff0c\u65e0\u6cd5\u8bc4\u4f30\u91cc\u9762\u6db5\u76d6\u4e86\u591a\u5c11\u4e1c\u897f\u4ece\u800c\u4e0d\u77e5\u9053\u8981\u4e0d\u8981\u70b9\u5f00\uff0c\u6216\u8005\u65e0\u6cd5\u4f30\u8ba1\u5728\u671f\u672b\u6709\u9650\u7684\u65f6\u95f4\u91cc\u5e94\u8be5\u82b1\u591a\u5c11\u65f6\u95f4\u590d\u4e60\u67d0\u4e2a\u8d44\u6e90\u3002\u6211\u6b63\u5728\u52aa\u529b\u5728\u8fd9\u91cc\u5efa\u4e00\u4e2a\u5c1a\u80fd\u8bfb\u7684\u8d44\u6e90\u7684 pagetable\uff0c\u4ee5\u9632\u4e0d\u5e78\u7684\u6e38\u5ba2\u4ece\u4fa7\u8fb9\u680f\u6e38\u8d70\u8fdb\u672c\u56fe\u4e66\u9986\u7684\u5783\u573e\u5806\u6f29\u6da1\ud83c\udf00\u3002\u5982\u679c\u6211\u76ee\u524d\u7684\u7b14\u8bb0\u5728\u8fd9\u4e2a\u7ef4\u5ea6\u4e0a\u505a\u5f97\u4e0d\u597d\uff0c\u8bf7\u8054\u7cfb\u6211\u6216\u8005\u5411\u6211\u63d0 issue \u50ac\u6211\u6539 \u8c22\u8c22\uff01
\u56fe\u4f8b
\ufe0f\ud83d\udcd8 \ufe0f\ud83d\udcd6 \ud83e\uddea \ud83d\udd17 \u5b8c\u6210\u5ea6\u4e0d\u9ad8\uff0c\u5f03\u5751\u6216\u5728\u5199\uff0c\u4e0d\u63a8\u8350\u9605\u8bfb \uff08\u7279\u6307\u7406\u8bba\uff09\u5b8c\u6210\u5ea6\u8db3\u591f\u9ad8\uff0c\u53ef\u4ee5\u9605\u8bfb\uff01 \u4ec5\u5b9e\u9a8c\u8d44\u6e90\uff0c\u672a\u5199\u7406\u8bba\u90e8\u5206 \u540c\u7c7b\u4f18\u8d28\u6216\u66f4\u4f18\u8d44\u6e90\u63a8\u8350 \u7c7b\u522b \u8bfe.. \u7f16\u7a0b\u8bed\u8a00 \ud83d\udcd8C\u5c16 \ud83d\udcd8C++ \ud83d\udd17\u8bb2\u4e49@\u6684 \ud83d\udcd8Verilog \ud83d\udd17\u5b9e\u9a8c@\u74dc \ud83d\udd17playground@HDLB \ud83d\udcd8Python \ud83d\udcd6x86\u6c47\u7f16 \u8ba1\u7b97\u673a\u79d1\u5b66 \ud83d\udcd8\u79bb\u6563\u6570\u5b66 \ud83d\udd17\u8bb2\u4e49@Kaleo \ud83d\udcd8FDS \ud83d\udcd8ADS \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8\u8ba1\u7b97\u7406\u8bba \ud83d\udd17\u8bb2\u4e49@\u6684 \ufe0f\ud83d\udcd8\u7f16\u8bd1\u539f\u7406 \ud83d\udd17\u8bb2\u4e49@\u6684 \u8f6f\u4ef6 \ud83e\uddeaOS \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8DBMS \ud83d\udcd8\u8ba1\u7f51 \ud83d\udcd8\u8f6f\u5de5 \u786c\u4ef6 \ud83d\udcd8\u6570\u903b \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8\u8ba1\u6982 \ud83d\udcd8\u8ba1\u7ec4 \ud83d\udd17\u8bb2\u4e49@\u6684&\u4fee \ud83d\udcd6\u4f53\u7cfb"},{"location":"docs/1-cs/#contents","title":"\ud83d\udcdd Contents","text":":material-circle-edit-outline: \u7ea6 5487 \u4e2a\u5b57 :fontawesome-solid-code: 47 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 19 \u5206\u949f
"},{"location":"docs/1-cs/assembly-x86/#lab","title":"Lab\u8bb0\u5f55","text":"Failure
Lab\u5df2\u7ecf\u5168\u90e8\u6362\u6389\uff0c\u8fd9\u90e8\u5206\u4f5c\u4e1a\u4ecb\u7ecd\u65e0\u6cd5\u53c2\u8003\u4e86\u3002
\u4f5c\u4e1a1: \u5b57\u7b26\u4e32\u8f6c\u6362
\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5c0f\u5199\u5b57\u6bcd\u5168\u90e8\u8f6c\u6362\u4e3a\u5927\u5199\u5b57\u6bcd\uff0c\u5220\u9664\u7a7a\u683c\u540e\u8f93\u51fa\u3002
\u8bb0\u5f97\u4ed6\u6709\u5b57\u7b26\u4e32\u8bfb\u5199\u7684\u6e90\u4ee3\u7801\u3002
\u4f5c\u4e1a2: \u6253\u5370ASCII\u7801\u8868
\u8fdb\u5165\u56fe\u5f62\u6a21\u5f0f\uff0c\u8f93\u51fa\u7ea2\u7684ascii\u7801\u548c\u7eff\u7684\u76f8\u5e94\u5341\u516d\u8fdb\u5236\u7f16\u53f7\u3002
\u4e2a\u4eba\u611f\u89c9\u5148\u628a\u4f4d\u79fb\u5199\u51fa\u6765\u518d\u586b\u91cc\u9762\u7684\u8f93\u51fa\u6bd4\u8f83\u597d\u5f04\u3002
\u53ef\u4ee5\u53c2\u7167\u4ed6\u7684\u6570\u5b57\u7528\u5faa\u73af\u5de6\u79fb\u8f93\u51fa\u6210\u5341\u516d\u8fdb\u5236\u4ee3\u7801\u3002
\u4f5c\u4e1a3: \u7b80\u6613\u8ba1\u7b97\u5668
\u6574\u4f53\u601d\u8def\uff1a80386\u8bed\u6cd5\u5199\uff0c\u5185\u5bb9\u90fd\u5b58\u5728\u5185\u5b58\u53d8\u91cf\u91cc
\u52a0\u6cd5\u601d\u8def\uff1a\u9ad8\u4f4d\u52a0\u9ad8\u4f4d\uff0c\u4f4e\u4f4d\u52a0\u4f4e\u4f4d
\u4e58\u6cd5\u601d\u8def\uff1a\u5206\u522b\u4e58\u4f4e\u4f4d\u548c\u9ad8\u4f4d\uff0c\u9ad8\u4f4d\u7ed3\u679c\u52a0\u8fdb\u4f4d
\u9664\u6cd5\u601d\u8def\uff1a\u5206\u522b\u9664\u9ad8\u4f4d\u548c\u4f4e\u4f4d\uff0c\u3002\u3002\u540e\u9762\u5fd8\u4e86
\u8f93\u51fa\u5341\u8fdb\u5236\u601d\u8def\uff1a\u9ad8\u4f4d\u4f4e\u4f4d
\u4f5c\u4e1a4: C\u4ee3\u7801\u6587\u4ef6\u67e5\u770b\u5668\u7ffb\u8bd1\u6210\u6c47\u7f16
\u4ed6\u4f1a\u7ed9\u4e00\u4e2ac\u6e90\u4ee3\u7801\uff0c\u7528c\u548c\u6c47\u7f16\u5939\u5fc3\u8c03\u8bd5\u628ac\u7ffb\u8bd1\u6210\u6c47\u7f16\u3002
\u903b\u8f91\u7684\u601d\u8def\uff1a
\u5bc4\u5b58\u5668\u72b6\u6001\u4fdd\u5b58 + \u521d\u59cb\u72b6\u6001 + \u5224\u65ad\u7ec8\u6b62 + \u64cd\u4f5c + \u50a8\u5b58 + \u5faa\u73af\u6761\u4ef6 + \u8df3\u8f6c + \u5bc4\u5b58\u5668\u72b6\u6001\u6062\u590d
\u6e90\u4ee3\u7801\u6587\u4ef6\u540dmytest.c
gcc -c -g -o mytest mytest.c\nobjdump -s -d main.o > main.o.txt\n
\u76ee\u6807\u6587\u4ef6\u53cd\u6c47\u7f16\uff0c\u540c\u65f6\u663e\u793a\u6e90\u4ee3\u7801
gcc -g -c -o main.o main.c\nobjdump -S -d main.o > main.o.txt\n
\u663e\u793a\u6e90\u4ee3\u7801\u7684\u540c\u65f6\u663e\u793a\u884c\u53f7
objdump -j .text -ld -C -S main.o > main.o.txt\n
\u53ef\u6267\u884c\u6587\u4ef6\u53cd\u6c47\u7f16
gcc -o main main.c\nobjdump -s -d main > main.txt\n
\u540c\u65f6\u663e\u793a\u6e90\u4ee3\u7801
gcc -g -o main main.c\nobjdump -S -d main > main.txt\n
"},{"location":"docs/1-cs/assembly-x86/#_1","title":"\u671f\u672b\u8003\u8bd5","text":"\u7a0b\u5e8f\u586b\u7a7a\u9898(3\u9898\uff0c\u6bcf\u989810\u5206\uff0c\u517130\u5206)
\u4e00\u822c\u90fd\u4f1a\u7528stack\u538b\u5165\u53c2\u6570 \u4f1a\u7ed9\u51fac\u8bed\u8a00\u7684\u539f\u578b\uff08\uff1f\uff0c\u53c2\u6570\u7684\u538b\u5165\u987a\u5e8f\u4ece\u53f3\u5230\u5de6\uff0ccaller\u6e05\u7406 pascal\uff0c\u4ece\u5de6\u5230\u53f3\uff0ccallee\u6e05\u7406 stdcall\uff0c\u4ece\u53f3\u5230\u5de6\uff0ccaller\u6e05\u7406 \u90fd\u7528ax\u8fd4\u56de\u53c2\u6570 \u4e00\u822c\u4e24\u4e2a\u7a7a\u4e0d\u53ef\u4ee5\u4ea4\u6362\u3002\u3002\u3002 \u5148\u81ea\u5df1\u5199\u4e00\u904d\u518d\u586b \uff08\u4e00\u822c20\u51e0\u884c\u7684\u7a0b\u5e8f\uff09
\u7a0b\u5e8f\u9605\u8bfb(2\u9898\uff0c\u6bcf\u98985\u5206\uff0c\u517110\u5206) \u4f1a\u95ee\u8fd0\u884c\u7ed3\u679c\u548c\u4e2d\u95f4\u7ed3\u679c\uff08#\uff09\uff08\u5982\u679c\u6709\u5faa\u73af\uff0c\u6bcf\u6b21\u5faa\u73af\u5230\u90fd\u8981\u5199\uff0c\u4f46\u662f\u4e0d\u4f1a\u592a\u591a\uff09
\u4e0d\u4f1a\u6709\u76f4\u63a5\u624b\u5199\u4e00\u6574\u4e2a\u7a0b\u5e8f\u7684\u9898
\u91cd\u70b9\uff1a \u51fd\u6570\u53c2\u6570\u4f20\u9012\uff0c\u5982\u4f55\u6784\u9020\u4e00\u4e2a\u5806\u6808\u6846\u67b6\uff0cebp\u3002\u3002 \u9700\u8981\u770b\u61c2\u662f\u4e0d\u662f\u9012\u5f52\uff0c \u6709\u4e00\u4e2a\u7a0b\u5e8f\u586b\u7a7a\u4f1a\u51fa\u5355\u6b65\u8c03\u8bd5\uff0c\u8fb9\u89e3\u5bc6\u8fb9\u52a0\u5bc6\u90a3\u4e2a\u3002\u3002 \u4e0d\u4f1a\u8003\u4fdd\u62a4\u6a21\u5f0f\u3002
"},{"location":"docs/1-cs/assembly-x86/#_2","title":"\u590d\u4e60","text":""},{"location":"docs/1-cs/assembly-x86/#intel-808680386-cpu","title":"Intel 8086/80386 CPU \u529f\u80fd\u7ed3\u6784","text":""},{"location":"docs/1-cs/assembly-x86/#_3","title":"\u5de5\u4f5c\u65b9\u5f0f","text":"\u8fd0\u7b97\u5668\u8fdb\u884c\u4fe1\u606f\u5904\u7406\uff0c\u5bc4\u5b58\u5668\u8fdb\u884c\u4fe1\u606f\u5b58\u50a8\uff0c\u63a7\u5236\u5668\u63a7\u5236\u5404\u79cd\u5668\u4ef6\u5de5\u4f5c\uff0c\u603b\u7ebf\u8fde\u63a5\u5404\u79cd\u5668\u4ef6\u3002
"},{"location":"docs/1-cs/assembly-x86/#163280x86-view","title":"16\u4f4d\u548c32\u4f4d\u768480x86\u7684\u533a\u522b - \u64cd\u4f5c\u7cfb\u7edfview","text":"1234h:0058h \u8f6c\u5316\u6210\u7269\u7406\u5730\u5740=12340h+0058h=12398h \u8865\u7801
"},{"location":"docs/1-cs/assembly-x86/#_5","title":"\u6807\u5fd7\u4f4d","text":"\u72b6\u6001\u6807\u5fd7\uff1aCF ZF SF OF AF PF \u63a7\u5236\u6807\u5fd7\uff1aDF(direction flags) TF(trace/trap flag) IF(interrupt flag)
"},{"location":"docs/1-cs/assembly-x86/#_6","title":"\u6570\u636e\u5728\u5185\u5b58\u4e2d\u7684\u5b58\u653e\u89c4\u5f8b\uff1a","text":"\u5c0f\u7aef\u683c\u5f0f\u3002\u4f4e\u5b57\u8282\u5728\u524d\uff0c\u9ad8\u5b57\u8282\u5728\u540e\u3002 \u8bbeds=1000h, bx=2000h, ax=1234h Mov ds:[bx], ax \u6267\u884c\u540e1000:2001\u6307\u5411\u7684\u5b57\u8282=12h
"},{"location":"docs/1-cs/assembly-x86/#_7","title":"\u5bc4\u5b58\u5668","text":"\u603b\u7ed3
\u5bc4\u5b58\u5668 \u7c7b\u522b \u7528\u9014 AX \u6570\u636e\u5bc4\u5b58\u5668 \u7b97\u672f\u8fd0\u7b97\u4e2d\u7684\u4e3b\u8981\u5bc4\u5b58\u5668\uff0c\u5728\u4e58\u9664\u8fd0\u7b97\u4e2d\u7528\u6765\u5236\u5b9a\u88ab\u9664\u6570\uff0c\u4e5f\u662f\u4e58\u9664\u8fd0\u7b97\u540e\u7ed3\u679c\u7684\u9ed8\u8ba4\u5b58\u50a8\u5355\u5143\u3002\u53e6\u5916I/O\u6307\u4ee4\u5747\u4f7f\u7528\u8be5\u5bc4\u5b58\u5668\u4e0eI/O\u8bbe\u5907\u4f20\u9001\u4fe1\u606f\u3002 BX \u6570\u636e\u5bc4\u5b58\u5668 \u6307\u4ee4\u5bfb\u5740\u65f6\u5e38\u7528\u505a\u57fa\u5740\u5bc4\u5b58\u5668\uff0c\u5b58\u5165\u504f\u79fb\u91cf\u6216\u504f\u79fb\u91cf\u7684\u6784\u6210\u6210\u5206 CX \u6570\u636e\u5bc4\u5b58\u5668 \u5728\u5faa\u73af\u6307\u4ee4\u64cd\u4f5c\u6216\u4e32\u5904\u7406\u6307\u4ee4\u4e2d\u9690\u542b\u8ba1\u6570 DX \u6570\u636e\u5bc4\u5b58\u5668 \u5728\u53cc\u5b57\u8282\u957f\u8fd0\u7b97\u4e2d\u4e0eAX\u6784\u621032\u4f4d\u64cd\u4f5c\u6570\uff0cDX\u4e3a\u9ad816\u4f4d\u3002\u5728\u67d0\u4e9bI/O\u6307\u4ee4\u4e2d\uff0cDX\u88ab\u7528\u6765\u5b58\u653e\u7aef\u53e3\u5730\u5740 SP \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u59cb\u7ec8\u662f\u6808\u9876\u7684\u4f4d\u7f6e\uff0c\u4e0eSS\u5bc4\u5b58\u5668\u4e00\u8d77\u6784\u6210\u6808\u9876\u6570\u636e\u7684\u7269\u7406\u5730\u5740 BP \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u7cfb\u7edf\u9ed8\u8ba4\u5176\u6307\u5411\u5806\u6808\u4e2d\u67d0\u4e00\u5355\u5143\uff0c\u5373\u63d0\u4f9b\u6808\u4e2d\u8be5\u5355\u5143\u7684\u504f\u79fb\u91cf\u3002\u52a0\u6bb5\u524d\u7f00\u540e\uff0cBP\u53ef\u4f5c\u4e3a\u975e\u5806\u6808\u6bb5\u7684\u5730\u5740\u6307\u9488 SI \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u4e0eDS\u8054\u7528\uff0c\u6307\u793a\u6570\u636e\u6bb5\u4e2d\u67d0\u64cd\u4f5c\u7684\u504f\u79fb\u91cf\u3002\u5728\u505a\u4e32\u5904\u7406\u65f6\uff0cSI\u6307\u793a\u6e90\u64cd\u4f5c\u6570\u5730\u5740\uff0c\u5e76\u6709\u81ea\u52a8\u589e\u91cf\u548c\u81ea\u52a8\u51cf\u91cf\u7684\u529f\u80fd\u3002\u53d8\u5740\u5bfb\u5740\u65f6\uff0cSI\u4e0e\u67d0\u4e00\u4f4d\u79fb\u91cf\u5171\u540c\u6784\u6210\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf DI \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u4e0eDS\u8054\u7528\uff0c\u6307\u793a\u6570\u636e\u6bb5\u4e2d\u67d0\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf\uff0c\u6216\u4e0e\u67d0\u4e00\u4f4d\u79fb\u91cf\u5171\u540c\u6784\u6210\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf\uff0c\u4e32\u5904\u7406\u64cd\u4f5c\u65f6\uff0cDI\u6307\u793a\u9644\u52a0\u6bb5\u4e2d\u76ee\u7684\u5730\u5740\uff0c\u5e76\u6709\u81ea\u52a8\u589e\u91cf\u548c\u51cf\u91cf\u7684\u529f\u80fd\u3002 CS \u6bb5\u5bc4\u5b58\u5668 \u5b58\u653e\u5f53\u524d\u7a0b\u5e8f\u7684\u6307\u793a\u4ee3\u7801 DS \u6bb5\u5bc4\u5b58\u5668 \u5b58\u653e\u7a0b\u5e8f\u6240\u8bbe\u8ba1\u7684\u6e90\u6570\u636e\u6216\u7ed3\u679c SS \u6bb5\u5bc4\u5b58\u5668 \u4ee5\u201c\u5148\u5165\u540e\u51fa\u201d\u4e3a\u539f\u5219\u7684\u6570\u636e\u533a ES \u6bb5\u5bc4\u5b58\u5668 \u8f85\u52a9\u6570\u636e\u533a\uff0c\u5b58\u653e\u4e32\u6216\u5176\u5b83\u6570\u636e IP \u63a7\u5236\u5bc4\u5b58\u5668 \u5b83\u59cb\u7ec8\u6307\u5411\u5f53\u524d\u5c06\u8981\u6267\u884c\u6307\u4ee4\u5728\u4ee3\u7801\u6bb5\u4e2d\u7684\u504f\u79fb\u91cf FR \u63a7\u5236\u5bc4\u5b58\u5668 \u63a7\u5236\u6807\u5fd7\u4f4d "},{"location":"docs/1-cs/assembly-x86/#_8","title":"\u901a\u7528\u5bc4\u5b58\u5668","text":"IA-32\u67b6\u6784\u4e2d\u4e00\u5171\u67094\u4e2a32\u4f4d\u5bc4\u5b58\u5668\uff0c\u7528\u4e8e\u4fdd\u5b58\u4e34\u65f6\u6570\u636e\uff0c\u8fd94\u4e2a\u901a\u7528\u5bc4\u5b58\u5668\u53ef\u4ee5\u5f53\u4f5c16\u4f4d\u7528\uff0c\u4e5f\u53ef\u4ee5\u4f5c8\u4f4d\u7528\u3002
AX BX CX DX\uff1a\u6570\u636e\u5bc4\u5b58\u5668\uff0c\u6bcf\u4e2a\u6570\u636e\u5bc4\u5b58\u5668\u90fd\u53ef\u4ee5\u62c6\u6210\u4e24\u4e2a 8 \u4f4d\u5bc4\u5b58\u5668\u72ec\u7acb\u4f7f\u7528\uff0c\u5982 AX \u53ef\u62c6\u5206\u4e3a AH \u548c AL\uff0cBX \u62c6\u5206\u4e3a BH \u548c BL \u7b49\u3002H \u548c L \u5206\u522b\u8868\u793a\u9ad8 8 \u4f4d\u548c\u4f4e 8 \u4f4d\u3002
AX(accumulator)\uff1a\u7d2f\u52a0\u5668\u3002\u5728\u4e58\u9664\u6cd5\u8fd0\u7b97\u3001\u4e32\u8fd0\u7b97\u3001 I/O \u6307\u4ee4\u4e2d\u90fd\u4f5c\u4e3a\u4e13\u7528\u5bc4\u5b58\u5668\uff1b BX (base)\uff1a\u57fa\u5740\u5bc4\u5b58\u5668\uff0c\u5e38\u7528\u4e8e\u5b58\u6863\u5185\u5b58\u5730\u5740\u3002
CX (count)\uff1a\u8ba1\u6570\u5bc4\u5b58\u5668\u3002\u5e38\u7528\u4e8e\u5b58\u653e\u5faa\u73af\u8bed\u53e5\u7684\u5faa\u73af\u6b21\u6570\uff0c\u5b57\u7b26\u4e32\u64cd\u4f5c\u4e2d\u4e5f\u5e38\u7528\u3002
DX (data)\uff1a\u6570\u636e\u5bc4\u5b58\u5668\u3002\u5e38\u5e38\u548cEAX\u4e00\u8d77\u4f7f\u7528\u3002
"},{"location":"docs/1-cs/assembly-x86/#_9","title":"\u53d8\u5740\u5bc4\u5b58\u5668","text":"\u5b58\u653e\u5728\u53d8\u52a8\u7684\u5185\u5b58\u5730\u5740
ESI(source index): \u6e90\u53d8\u5740\u5bc4\u5b58\u5668\uff0c\u901a\u5e38\u5b58\u653e\u8981\u5904\u7406\u7684\u6570\u636e\u7684\u5185\u5b58\u5730\u5740\u3002
EDI(destination index)\uff1a\u76ee\u7684\u53d8\u5740\u5bc4\u5b58\u5668\uff0c\u901a\u5e38\u5b58\u653e\u5904\u7406\u540e\u7684\u6570\u636e\u7684\u5185\u5b58\u5730\u5740\u3002
ESI\u548cEDI\u5e38\u7528\u6765\u914d\u5408\u4f7f\u7528\u5b8c\u6210\u6570\u636e\u7684\u8d4b\u503c\u64cd\u4f5c
rep movs dword ptr[edi], dword ptr[esi];\n
\u8fd9\u53e5\u7684\u610f\u601d\u662f\u628aESI\u6307\u5411\u7684\u5185\u5b58\u5730\u5740\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230EDI\u6240\u6307\u5411\u7684\u5185\u5b58\u4e2d\uff0c\u6570\u636e\u957f\u5ea6\u5728ECX\u4e2d\u6307\u5b9a\u3002
"},{"location":"docs/1-cs/assembly-x86/#_10","title":"\u6307\u9488\u5bc4\u5b58\u5668","text":"ESP\uff08stack pointer\uff09\uff1a\u5806\u6808\u6307\u9488\u5bc4\u5b58\u5668\u3002SS\uff1aSP\u6307\u5411\u5806\u6808\u7684\u6808\u9876\uff0c\u56e0\u6b64\u867d\u7136\u662f\u901a\u7528\u5bc4\u5b58\u5668\uff0c\u4f46\u4e0d\u5e94\u968f\u4fbf\u6539\u53d8SP\u7684\u503c\u3002\u4e0d\u53ef\u4ee5\u4f5c\u4e3a\u901a\u7528\u5bc4\u5b58\u5668\u4f7f\u7528\uff0cESP\u5b58\u653e\u5f53\u524d\u5806\u6808\u6808\u9876\u7684\u5730\u5740\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cESP\u548cEBP\u8054\u5408\u4f7f\u7528\u6765\u8bbf\u95ee\u51fd\u6570\u4e2d\u7684\u53c2\u6570\u548c\u5c40\u90e8\u53d8\u91cf\u3002 EBP\uff08base pointer\uff09\uff1a\u57fa\u5740\u6307\u9488\u5bc4\u5b58\u5668\u3002\u53ef\u4ee5\u4f5c\u4e3a\u901a\u7528\u5bc4\u5b58\u5668\u7528\u4e8e\u5b58\u653e\u64cd\u4f5c\u6570\uff0c\u5e38\u7528\u6765\u4ee3\u66ff\u5806\u6808\u6307\u9488\u8bbf\u95ee\u5806\u6808\u7684\u6570\u636e\u3002 EIP\uff1a\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668\uff0c\u603b\u662f\u6307\u5411\u4e0b\u4e00\u6761\u8981\u6267\u884c\u7684\u6307\u4ee4\u7684\u5730\u5740\u3002 \u5e38\u89c1\u7684\u8bbf\u95ee\u5806\u6808\u6307\u4ee4\uff1a
push ebp\nmov ebp, esp\nsub esp, 78\npush esi\npush edi\ncmp dword ptr [ebp+8], 0\n
ss\u6808\u6bb5\u5bc4\u5b58\u5668 sp\u6808\u9876\u6307\u9488\u5bc4\u5b58\u5668 bp\u9ed8\u8ba4\u7684\u6808\u5bfb\u5740\u5bc4\u5b58\u5668
"},{"location":"docs/1-cs/assembly-x86/#_11","title":"\u6807\u5fd7\u5bc4\u5b58\u5668","text":"\u6807\u5fd7\u5bc4\u5b58\u5668EFLAGS\u4e00\u5171\u670932\u4f4d\uff0c\u5728\u8fd932\u4f4d\u4e2d\u5927\u90e8\u5206\u662f\u4fdd\u7559\u7ed9\u7f16\u5199\u64cd\u4f5c\u7cfb\u7edf\u7684\u4eba\u7528\u7684\u3002
IP (instruction pointer)\uff1a\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668\u3002\u4ee3\u7801\u6bb5\u5bc4\u5b58\u5668 CS \u548c\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668 IP \u662f 8086CPU \u4e2d\u6700\u5173\u952e\u7684\u4e24\u4e2a\u5bc4\u5b58\u5668\u3002\u5b83\u4eec\u5206\u522b\u7528\u6765\u63d0\u4f9b\u5f53\u524d\u6307\u4ee4\u7684\u6bb5\u5730\u5740\u548c\u504f\u79fb\u5730\u5740\u3002\u5373\u4efb\u610f\u65f6\u523b\uff0c8086CPU \u5c06 CS:IP \u6307\u5411\u7684\u5185\u5bb9\u5f53\u505a\u547d\u4ee4\u6267\u884c\u3002\u6bcf\u6761\u6307\u4ee4\u8fdb\u5165\u6307\u4ee4\u7f13\u51b2\u5668\u540e\u3001\u6267\u884c\u524d\uff0cIP += \u6240\u8bfb\u53d6\u6307\u4ee4\u7684\u957f\u5ea6\uff0c\u4ece\u800c\u6307\u5411\u4e0b\u4e00\u6761\u6307\u4ee4\u3002\u7528\u6237\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee IP \u5bc4\u5b58\u5668\u3002
FL (flags)\uff1a\u6807\u5fd7\u5bc4\u5b58\u5668\u3002\u4e0e\u5176\u4ed6\u5bc4\u5b58\u5668\u4e00\u6837\uff0c\u6807\u5fd7\u5bc4\u5b58\u5668\u4e5f\u6709 16 \u4f4d\uff0c\u4f46\u662f\u6807\u5fd7\u5bc4\u5b58\u5668\u53ea\u7528\u5230\u5176\u4e2d\u7684 9 \u4f4d\u3002\u8fd9 9 \u4f4d\u5305\u62ec 6 \u4e2a\u72b6\u6001\u6807\u5fd7\u548c 3 \u4e2a\u63a7\u5236\u6807\u5fd7\uff0c\u53c2\u89c1\u4e0b\u9762\u7684\u201c\u6807\u5fd7\u4f4d\u201d\u3002
OF\uff08Overflow Flag\uff09:\u6ea2\u51fa\u6807\u5fd7\uff0c\u6ea2\u51fa\u65f6\u4e3a1\uff0c\u5426\u5219\u7f6e0\u3002\u4e24\u4e2a\u6b63\u6570\u76f8\u52a0\u53d8\u8d1f\uff0c\u6216\u4e24\u4e2a\u8d1f\u6570\u76f8\u52a0\u53d8\u6b63\u4f1a\u6ea2\u51fa\u3002#
DF \uff08Direction Flag\uff09:\u65b9\u5411\u6807\u5fd7\uff0c\u5728\u4e32\u5904\u7406\u6307\u4ee4\u4e2d\u63a7\u5236\u4fe1\u606f\u7684\u65b9\u5411\u30020:\u6b63\u65b9\u5411\uff0c1\uff1a\u53cd\u65b9\u5411\u3002cld\uff0cstd\u3002#
IF (Interrupt Flag) :\u4e2d\u65ad\u6807\u5fd7\u3002\u7981\u6b62\u4e2d\u65ad0\uff0c\u5141\u8bb8\u4e2d\u65ad1\u3002cli\uff0csti\u3002#
AF (Auxiliary carry Flag) :\u8f85\u52a9\u8fdb\u4f4d\u6807\u5fd7\uff0c\u6709\u8fdb\u4f4d\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
ZF (Zero Flag) :\u96f6\u6807\u5fd7\uff0c\u8fd0\u7b97\u7ed3\u6784\u4e3a0\u65f6ZF\u4f4d\u4f4d\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
SF (Sign Flag):\u7b26\u53f7\u6807\u5fd7\uff0c\u7ed3\u679c\u4e3a\u8d1f\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002#
CF (Carry Flag): \u8fdb\u4f4d\u6807\u5fd7\uff0c\u8fdb\u4f4d\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002\u914d\u5957\u7684clc\uff0cstc\u4e24\u6761\u8bbe\u7f6e\u6307\u4ee4\uff1a\u6e05\u9664\u548c\u7f6e1\u3002#
PF (Parity Flag): \u5947\u5076\u6807\u5fd7\u3002\u7ed3\u679c\u64cd\u4f5c\u6570\u4e2d1\u7684\u4e2a\u6570\u4e3a\u5076\u6570\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
TF\uff1a\u5355\u6b65\u8c03\u8bd5\u8981\u7528\u3002#
EFLAGS\u662f\u5b9e\u73b0\u6761\u4ef6\u5224\u65ad\u548c\u903b\u8f91\u5224\u65ad\u7684\u4e00\u79cd\u673a\u5236\uff0c\u5728\u6c47\u7f16\u8bed\u8a00\u4e2d\u4e00\u822c\u4e0d\u76f4\u63a5\u8bbf\u95eeEFLAGS\u5bc4\u5b58\u5668\uff0c\u800c\u662f\u901a\u8fc7\u6307\u4ee4\u7684\u64cd\u4f5c\u9690\u542b\u8bbf\u95eeEFLAGS\u5bc4\u5b58\u5668\u3002
cmp dword ptr [ebp+8], 0. // \u5f71\u54cd\u6807\u5fd7\u4f4dCF\uff0cZF\uff0cSF\uff0cOF\uff0cAF\u548cPF\nJz 99495898 //\u5982\u679cZF\u7b49\u4e8e1\uff0c\u5219\u8df3\u8f6c\u523000405898
"},{"location":"docs/1-cs/assembly-x86/#_12","title":"\u6307\u4ee4","text":"\u603b\u7ed3
\u6307\u4ee4 \u4f5c\u7528 \u53c2\u6570 \u6539\u53d8\u6807\u5fd7\u4f4d mov \u8d4b\u503c \u88ab\u8d4b\u503c\u5bc4\u5b58\u5668\uff0c\u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\uff0c\u503c\u3011 no xchg \u6570\u636e\u4ea4\u6362 \u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\u3011\uff0c\u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\u3011 no push \u8fdb\u6808 \u6e90\u64cd\u4f5c\u6570\u3010\u5bc4\u5b58\u5668\u3011 pop \u51fa\u6808 \u76ee\u7684\u64cd\u4f5c\u6570\u3010\u5bc4\u5b58\u5668\u3011 pushf \u6807\u5fd7\u4f4d\u8fdb\u6808 \u65e0 popf \u6807\u5fd7\u4f4d\u51fa\u6808 \u65e0 lea Load effect address\uff0c\u5bfb\u5740\uff0c\u53d6\u504f\u79fb\u5730\u5740 lds \u5f53\u6307\u4ee4\u6307\u5b9a\u7684\u662f16\u4f4d\u5bc4\u5b58\u5668\u65f6\uff0c\u628a\u6e90\u64cd\u4f5c\u6570\u5b58\u50a8\u5355\u5143\u4e2d\u5b58\u653e\u7684\u5341\u516d\u4f4d\u504f\u79fb\u5730\u5740\u53d6\u51fa\u5b58\u653e\u5728\u5bc4\u5b58\u5668\u4e2d\uff0c\u7136\u540e\u628a\u6e90\u64cd\u4f5c\u6570+2\u7684\u5341\u516d\u4f4d\u6570\u88c5\u5165\u6307\u4ee4\u6307\u5b9a\u7684\u6bb5\u5bc4\u5b58\u5668\u3002\u5f53\u6307\u4ee4\u6307\u5b9a\u7684\u662f32\u4f4d\u5bc4\u5b58\u5668\u65f6 \u628a\u6e90\u64cd\u4f5c\u6570\u5b58\u50a8\u5355\u5143\u4e2d\u5b58\u653e\u768432\u4f4d\u504f\u79fb\u5730\u5740\u88c5\u5165\u5bc4\u5b58\u5668 \u7136\u540e\u628a \u6e90\u64cd\u4f5c\u6570+4 \u768416\u4f4d\u6570\u88c5\u5165\u6bb5\u5bc4\u5b58\u5668\u3002mem\u6307\u5411\u7684\u5730\u5740,\u9ad8\u4f4d\u5b58\u653e\u5728DS\u4e2d,\u4f4e\u4f4d\u5b58\u653e\u5728reg\u4e2d. LDS reg,mem les \u628a\u5185\u5b58\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7684\u53cc\u5b57\u64cd\u4f5c\u6570\u7684\u4f4e\u4f4d\u5b57\u88c5\u5165\u6307\u4ee4\u4e2d\u6307\u5b9a\u7684\u5bc4\u5b58\u5668\u3001\u9ad8\u4f4d\u5b57\u88c5\u5165ES\u5bc4\u5b58\u5668\u3002 cbw 8\u4f4d\u6570\u6269\u5c55\u4e3a16\u4f4d\u6570\uff0c\u6709\u7b26\u53f7\u6269\u5145 no cwd \u5b57(16\u4f4d)\u6269\u5c55\u4e3a\u53cc\u5b57(32\u4f4d)\uff0c\u6709\u7b26\u53f7\uff1f no add \u52a0 OPRDS\uff0cOPRDD adc \u5e26\u8fdb\u4f4d\u52a0\uff08\u7ed3\u679c\u542b\u6807\u5fd7\u4f4dCF\u7684\u503c\uff0c=OPRDS\uff0bOPRDD\uff0bCF\uff09 OPRDS\uff0cOPRDD sub \u51cf OPRDD\uff0cOPRDS sbb \u5e26\u8fdb\u4f4d\u51cf\uff08\u7ed3\u679c\u542b\u6807\u5fd7\u4f4dCF\u7684\u503c\uff0c=OPRDD\uff0dOPRDS\uff0dCF\uff09 OPRDD\uff0cOPRDS inc \u81ea\u589e1 \u5bc4\u5b58\u5668 dec \u81ea\u51cf1 \u5bc4\u5b58\u5668 mul 32\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aEAX\uff0c\u90a3\u4e48\u4e58\u79ef\u5c06\u5b58\u653e\u5728EDX\uff1aEAX\u4e2d 32\u4f4d\u4e58\u6570 16\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aAX\u90a3\u4e48\u4e58\u79ef\u5c06\u653e\u5728DX\uff1aAX\u4e2di 16\u4f4d\u4e58\u6570 8\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aAL\uff0c\u90a3\u4e48\u4e58\u79ef\u5c06\u653e\u5728AX 8\u4f4d\u4e58\u6570 div 32\u4f4d\uff1a\u88ab\u9664\u6570\u5c06\u662fEDX\uff1aEAX\uff0c \u6700\u7ec8\u7684\u5546\u5c06\u5b58\u653e\u5728EAX\uff0c \u4f59\u6570\u5c06\u5b58\u653e\u5728EDX\u4e2d 32\u4f4d\u4e58\u6570 16\u4f4d\uff1a\u88ab\u9664\u6570\u4e3aEAX\uff0c\u6700\u7ec8\u5f97\u5230\u7684\u5546\u653e\u5728AX\uff0c\u4f59\u6570\u653e\u5728EAX\u7684\u9ad816\u4f4d 16\u4f4d\u4e58\u6570 8\u4f4d\uff1a\u88ab\u9664\u6570\u662f16\u4f4d\uff0c\u6700\u7ec8\u5f97\u5230\u7684\u5546\u5c06\u653e\u5728AL\u4e2d\uff0c\u4f59\u6570\u653e\u5728AH\u4e2d 8\u4f4d\u4e58\u6570 imul \u65e0\u7b26\u53f7\u4e58 idiv \u65e0\u7b26\u53f7\u9664 xlat \u6362\u7801\u6307\u4ee4\uff0c\u4ee5bx\u4e3a\u9996\u5730\u5740\u7684\uff0c\u504f\u79fb\u5730\u5740\u4e3aal\u7684\u5185\u5bb9\u9001\u7ed9al\u3002 in \u7aef\u53e3\u8bfb\u5199\u6307\u4ee4 IN AL,21H\uff1b\u8868\u793a\u4ece21H\u7aef\u53e3\u8bfb\u53d6\u4e00\u5b57\u8282\u6570\u636e\u5230AL out \u7aef\u53e3\u8bfb\u5199\u6307\u4ee4 and \u6309\u4f4d\u4e0e or \u6309\u4f4d\u6216 xor \u6309\u4f4d\u5f02\u6216 not \u64cd\u4f5c\u6570\u6309\u4f4d\u53d6\u53cd neg \u64cd\u4f5c\u6570\u6309\u4f4d\u53d6\u53cd\u52a0\u4e00 test \u5bf9\u4e24\u4e2a\u64cd\u4f5c\u6570\u8fdb\u884c\u6309\u4f4d\u4e0e\u64cd\u4f5c\u3002\u4e0eand\u4e0d\u540c\uff0c\u4e0d\u5f71\u54cd\u76ee\u6807\u64cd\u4f5c\u6570\u7684\u503c\u3002 shl \u903b\u8f91\u5de6\u79fb\uff0c\u5c06\u4e00\u4e2a\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u6216\u5355\u5143\u4e2d\u7684\u6570\u636e\u5411\u5de6\u79fb\u4f4d\uff0c\u5c06\u6700\u540e\u79fb\u51fa\u7684\u4e00\u4f4d\u5199\u5165cf\u4e2d\u3002\u6700\u4f4e\u4f4d\u75280\u8865\u5145\u3002 shr \u903b\u8f91\u53f3\u79fb\uff0c\u5c06\u4e00\u4e2a\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u6216\u5355\u5143\u4e2d\u7684\u6570\u636e\u5411\u5de6\u79fb\u4f4d\uff0c\u5c06\u6700\u540e\u79fb\u51fa\u7684\u4e00\u4f4d\u5199\u5165cf\u4e2d\u3002\u6700\u9ad8\u4f4d\u75280\u8865\u5145\u3002 sal \u7b97\u672f\u5de6\u79fb\uff0c\u4e0eshl\u4e00\u6837\uff0c\u88650 sar \u7b97\u672f\u53f3\u79fb\uff0c\u4e0eshr\u4e0d\u4e00\u6837\uff0c\u7b97\u672f\u53f3\u79fb\u8865\u6700\u9ad8\u4f4d rol \u5faa\u73af\u5de6\u79fb ror \u5faa\u73af\u53f3\u79fb rcl \u5e26\u8fdb\u4f4d\u5faa\u73af\u5de6\u79fb\uff0c\u5de6\u79fb\u7684\u65f6\u5019\u79fb\u51fa\u53bb\u7684\u4f1a\u653e\u5728cf\uff1f rcr \u5e26\u8fdb\u4f4d\u5faa\u73af\u53f3\u79fb cmp \u6bd4\u8f83 ja jump if above jb Jump if below jae Jump if above or equal jbe Jump if below or equal jg jump if greater\uff0c\u6709\u7b26\u53f7\u5927\u4e8e\u8df3\u8f6c jl jump less\uff0c\u6709\u7b26\u53f7\u5c0f\u4e8e\u8df3\u8f6c jge jump if greater or equal jle Jump if less or equal jc jump if with carry, CF = 1 jnc jump if not with carry, CF = 0 je = jz jump if equal, ZF = 1 jne = jnz jump if not equal, ZF = 0 jz jump if zero, ZF = 1 jnz jump if not zero, ZF = 0 jcxz jump if cx equals zero js SF = 1 jns SF = 0 jo Jump if overflow, OF = 1 jno jump if not overflow, OF = 0 loop \u5faa\u73af \u4ee3\u7801\u6bb5\uff08\uff1f\uff09\u540d clc clear carry flag\uff0c\u5c06cf\u4f4d\u6e05\u96f6 stc set carry flag\uff0cCF\u7f6e1 cli clear interrupt endable flag\uff0cIF\u6e05\u96f6\uff0c\u5173\u95ed\u4e2d\u65ad sti set interrupt endable flag\uff0cIF\u7f6e\u4f4d1\uff0c\u6253\u5f00\u4e2d\u65ad CMC complement carry flag\uff0cCF\u53d6\u53cd CLD clear direction flag\uff0cDF\u6e05\u96f6 STD set interrupt endable flag\uff0cDF\u7f6e1 call \u8fd1\u8c03\u7528 ret \u8fd1\u8fd4\u56de call far ptr \u8fdc\u8c03\u7528\u3002\u4e09\u4e2apush\u4e00\u4e2ajmp\u3002push f\uff0cpush cs\uff0cpush ip\uff0cjump retf \u8fdc\u8fd4\u56de\u3002\u4e09\u4e2apop\u3002\u6307\u4ee4\u2f64\u6808\u4e2d\u7684\u6570\u636e\uff0c\u4fee\u6539CS\u548cIP\u7684\u5185\u5bb9\uff0c\u4ece\u2f7d\u5b9e\u73b0\u8fdc\u8f6c\u79fb int \u4e2d\u65ad\u6307\u4ee4 iret \u4e2d\u65ad\u8fd4\u56de jmp short \u6bb5\u5185\u77ed\u8f6c\u79fb\uff0c\u77ed\u662f\u6307\u8981\u8df3\u2f84\u7684\u2f6c\u6807\u5730\u5740\u4e0e\u5f53\u524d\u5730\u5740\u524d\u540e\u76f8\u5dee\u4e0d\u8d85\u8fc7128\u5b57\u8282 jmp near ptr \u6bb5\u5185\u8fd1\u8f6c\u79fb\u3002\u8fd1\u662f\u6307\u8df3\u8f6c\u7684\u2f6c\u6807\u5730\u5740\u4e0e\u5f53\u524d\u5730\u5740\u5728\u2f64\u2f00\u4e2a\u6bb5\u5185\uff0c\u5373CS\u7684\u503c\u4e0d\u53d8\uff0c\u53ea\u6539\u53d8EIP\u7684\u503c jmp far ptr \u6bb5\u95f4\u8f6c\u79fb\uff0c\u8fdc\u6307\u8df3\u5230\u53e6\u2f00\u4e2a\u4ee3\u7801\u6bb5\u53bb\u6267\u2f8f\uff0cCS/EIP\u90fd\u8981\u6539\u53d8 Jmp dword ptr \u6bb5\u95f4\u8f6c\u79fb\uff0c\u4ee5\u5185\u5b58\u5730\u5740\u5355\u5143\u5904\u7684\u53cc\u5b57\u6765\u4fee\u6539\u6307\u4ee4\uff0c\u2fbc\u5730\u5740\u5185\u5bb9\u4fee\u6539CS\uff0c\u4f4e\u5730\u5740\u5185\u5bb9 \u4fee\u6539IP\uff0c\u5185\u5b58\u5730\u5740\u53ef\u4ee5\u4ee5\u4efb\u4f55\u5408\u6cd5\u7684\u2f45\u5f0f\u7ed9\u51fa repe/renpe scasb \u5b57\u7b26\u4e32\u626b\u63cf\u6307\u4ee4\u3002cmp al, es:[di] di++; \u5f53DF=1\u65f6\uff0c\u4e3adi-- repne:\u5f53ECX!=0\u5e76\u4e14ZF==0\u65f6 \u91cd\u590d repe: cx != 0\u4e14zf != 0\u91cd\u590d repe/renpe cmpsb \u5b57\u7b26\u4e32\u6bd4\u8f83\u6307\u4ee4\u3002\u2f50\u8f83byte ptr ds:[si]\u4e0ebyte ptr es:[di] \u5f53DF=0\u65f6\uff0cSI++\uff0cDI++ \u5f53DF=1\u65f6\uff0cSI--\uff0cDI-- repne:\u5f53ECX!=0\u5e76\u4e14ZF==0\u65f6 \u91cd\u590d repe: cx != 0\u4e14zf != 0\u91cd\u590d rep movsb \u5b57\u7b26\u4e32\u79fb\u52a8\u6307\u4ee4\u3002\u5176\u4e2drep\u8868\u793arepeat\uff0cs\u8868\u793astring\uff0cb\u8868\u793abyte \u5728\u6267\u2f8f\u6b64\u6307\u4ee4\u524d\u8981\u505a\u4ee5\u4e0b\u51c6\u5907\u2f2f\u4f5c\uff1a \u2460ds:si lodsb \u5757\u88c5\u5165\u6307\u4ee4\uff0c\u628aSI\u6307\u5411\u7684\u5b58\u50a8\u5355\u5143\u8bfb\u5165\u7d2f\u52a0\u5668\uff0clodsb\u5c31\u8bfb\u5165ax\uff0clodsw\u5c31\u8bfb\u5165ax\uff0c\u7136\u540esi\u81ea\u52a8\u589e\u52a0\u6216\u51cf\u5c0f1\u62162 stosb/stosw/stosd SI\u6307\u5411\u7684\ud83d\udd17,\u5176\u4e2dLODSB\u662f\u8bfb\u5165AL, LODSW\u662f\u8bfb\u5165AX\u4e2d, \u7136\u540eSI\u81ea\u52a8\u589e\u52a0\u6216\u51cf\u5c0f1\u62162\u4f4d.\u5f53\u65b9\u5411\u6807\u5fd7\u4f4dDF=0\u65f6\uff0c\u5219SI\u81ea\u52a8\u589e\u52a0\uff1bDF=1\u65f6\uff0cSI\u81ea\u52a8\u51cf\u5c0f\u3002 rep stosb lodsb"},{"location":"docs/1-cs/assembly-x86/#_13","title":"\u6570\u636e\u4f20\u9001\u6307\u4ee4","text":"\u6570\u636e\u4f20\u9001\u6307\u4ee4\u662f\u4e3a\u4e86\u5b9e\u73b0CPU\u548c\u5185\u5b58\uff0c\u8f93\u5165\u548c\u8f93\u51fa\u7aef\u53e3\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u9001\u3002
mov
mov eax, 56 // \u5c0656H\u4f20\u9001\u5230eax\u5bc4\u5b58\u5668\nmov esi, dword ptr [eax * 2 + 1] // \u5c06\u5185\u5b58\u5730\u5740\u4e3aeax*2+1\u76844\u5b57\u8282\u6570\u636e\u4f20\u9001\u5230esi\u5bc4\u5b58\u5668\nmov ah, byte ptr [esi * 2 + eax] // \u5c06\u5185\u5b58\u5730\u5740\u4e3aesi*+eax\u5904\u76848\u4f4d\u6570\u636e\u4f20\u9001\u5230AH\u5bc4\u5b58\u5668\n
xchg
\u5bc4\u5b58\u5668\u548c\u5185\u5b58\u7684\u6570\u636e\u4ea4\u6362\uff0c\u4ea4\u6362\u7684\u6570\u636e\u53ef\u4ee5\u662f8\u5b57\u8282\u300116\u5b57\u8282\u621632\u5b57\u8282\uff0c\u5fc5\u987b\u683c\u5f0f\u76f8\u540c
xchg eax, edx; // \u5c06edx\u5bc4\u5b58\u5668\u7684\u503c\u548ceax\u5bc4\u5b58\u5668\u7684\u503c\u4ea4\u6362\nxchg [esp-55], edi; // \u5c06edi\u5bc4\u5b58\u5668\u7684\u503c\u548c\u5806\u6808\u5730\u5740\u4e3a[esp-55]\u5904\u7684\u503c\u4ea4\u6362\n
push pop
push\u548cpop\uff1a\u79f0\u4e3a\u538b\u5165\u5806\u6808\u6307\u4ee4\u548c\u5f39\u51fa\u5806\u6808\u6307\u4ee4\uff0c\u683c\u5f0f\u662fpush src(\u6e90\u64cd\u4f5c\u6570)\u548cpop dst(\u76ee\u7684\u64cd\u4f5c\u6570)\uff0cpush\u6307\u4ee4\u548cpop\u6307\u4ee4\u9700\u8981\u5339\u914d\u51fa\u73b0\uff0c\u5426\u5219\u5806\u6808\u4f1a\u4e0d\u5e73\u8861\u3002push\u6307\u4ee4\u5c06\u539f\u64cd\u4f5c\u6570src\u538b\u5165\u5806\u6808\uff0c\u540c\u65f6esp-4\uff08\u6808\u9876\u6307\u9488\u51cf\u4e00\u4e2a4\u4f4d\uff09\uff0c\u800cpop\u53cd\u4e4b\uff0c\u4ece\u5806\u6808\u7684\u9876\u90e8\u5f39\u51fa4\u5b57\u8282\u7684\u6570\u503c\u7136\u540e\u653e\u5165dst\u3002\u572832\u4f4d\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0cpush\u548cpop\u7684\u64cd\u4f5c\u662f\u4ee54\u5b57\u8282\u4e3a\u5355\u4f4d\u7684\uff0cpush\u548cpop\u6307\u4ee4\u5e38\u7528\u4e8e\u5411\u51fd\u6570\u4f20\u53c2\u3002
push eax // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u4ee54\u5b57\u8282\u538b\u5165\u5806\u6808\uff0c\u540c\u65f6esp-4\npush dword ptr [12FF8589] // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230\u5185\u5b58\u5730\u5740\u4e3a12FF8589\u6240\u6307\u5730\u65b9\uff0c\u540c\u65f6esp+4\n-----------------------------------------------------------------------------\npop dword ptr [12FF8589] // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230\u5185\u5b58\u5730\u5740\u4e3a12FF8589\u6240\u6307\u7684\u5730\u65b9\uff0c\u540c\u65f6esp+4\npop eax // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230eax\u5bc4\u5b58\u5668\uff0c\u540c\u65f6esp+4\n
"},{"location":"docs/1-cs/assembly-x86/#_14","title":"\u5730\u5740\u4f20\u9001\u6307\u4ee4","text":"x86\u67093\u6761\u5730\u5740\u4f20\u9001\u6307\u4ee4\uff0c\u5206\u522b\u662fLEA\uff0cLDS\u548cLES\u3002\u5176\u5b9eLDS\u548cLES\u6307\u4ee4\u548c\u6bb5\u5bc4\u5b58\u5668\u6709\u5173\uff0c\u572832\u4f4d\u7684windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u4e00\u822c\u7684\u7a0b\u5e8f\u5458\u90fd\u4e0d\u9700\u8981\u7ba1\u7406\u6bb5\u5bc4\u5b58\u5668\uff0c\u6240\u4ee5\u76f8\u5bf9\u800c\u8a00\uff0cLDS\u548cLES\u5bc4\u5b58\u5668\u4f7f\u7528\u5f97\u6bd4\u8f83\u5c11\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u5e38\u89c1\u7684\u53ea\u6709LEA\u6307\u4ee4\u3002
LEA
\u79f0\u4e3a\u5730\u5740\u4f20\u9001\u6307\u4ee4\uff0c\u683c\u5f0f\u662f\u201cLEA DST, ADDR\u201d\u3002LEA\u5c06ADDR\u5730\u5740\u52a0\u8f7d\u5230DST\uff0c\u5176\u4e2dADDR\u53ef\u4ee5\u662f\u5185\u5b58\uff0c\u4e5f\u53ef\u4ee5\u662f\u5bc4\u5b58\u5668\uff0c\u800cDST\u5fc5\u987b\u662f\u4e00\u4e2a\u901a\u7528\u5bc4\u5b58\u5668\u3002
lea eax, [12345678]; // \u6307\u4ee4\u6267\u884c\u540eeax\u5bc4\u5b58\u5668\u7684\u503c\u4e3a12345678H\nmov eax, [12345678]; // \u800cmov eax, [12345678] \u6307\u4ee4\u6267\u884c\u540eeax\u5bc4\u5b58\u5668\u7684\u503c\u4e3a\u5185\u5b58\u5730\u574012345678\u6307\u5411\u7684\u90a3\u4e2a\u6570\u503c\n// LEA\u6307\u4ee4\u53ef\u7528\u4e8e\u7b97\u6cd5\u8fd0\u7b97\nlea ecx, [ecx + eax*4]; // ecx = ecx + eax * 4\n// \u76f8\u5f53\u4e8e\u8ba1\u7b97\u51faecx+eax*4\u7684\u6570\u503c\uff0c\u5728[]\u91cc\u662f\u4e00\u4e2a\u5730\u5740\uff0clea\u53d6\u5730\u5740\u540e\u5c31\u53d6\u5230\u4e86\u8fd9\u4e2a\u6570\u503c\n
"},{"location":"docs/1-cs/assembly-x86/#_15","title":"\u7b97\u6570\u8fd0\u7b97\u6307\u4ee4","text":"80x86\u63d0\u4f9b\u4e868\u6761\u52a0\u51cf\u6cd5\u6307\u4ee4\uff0c4\u6761\u4e58\u9664\u6cd5\u6307\u4ee4\u3002
ADD\uff1a\u52a0\u6cd5\u6307\u4ee4
add eax, esi; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u52a0\u4e0aesi\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u7684\u5bc4\u5b58\u5668\u4e2d\nadd ebx, dword ptr[12345678] // \u5c06ebx\u5bc4\u5b58\u5668\u7684\u503c\u52a0\u4e0a\u5185\u5b58\u5730\u5740\u4e3a12345678\u6240\u5728\u76844\u5b57\u8282\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728ebx\u5bc4\u5b58\u5668\u4e2d\n// \u4e0d\u540c\u7684\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u4e2d\uff0cdword\u5360\u7528\u7684\u5b57\u8282\u6570\u4e0d\u540c\uff0c\u572832\u4f4d\u7684windows\u4e2d\u4e00\u4e2aword\u536016\u5b57\u8282\uff0cdword\u536032\u5b57\u8282\n// 64\u4f4d\u4e2d\u4e00\u4e2aword\u536032\u5b57\u8282\uff0cdword\u536064\u5b57\u8282\n
sub \u51cf\u6cd5\u6307\u4ee4
sub ecx, 4H; // \u5c06ecx\u5bc4\u5b58\u5668\u7684\u503c\u51cf\u53bb4H\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\nsub byte ptr[eax], ch; // \u5c06\u5185\u5b58\u5730\u5740\u4e3aeax\u6240\u6307\u5411\u7684\u6570\u636e\u7ed3\u6784\u6309\u5b57\u8282\u4e3a\u5355\u4f4d\u548cch\u5bc4\u5b58\u5668\u76f8\u51cf\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u6309\u5b57\u8282\u4e3a\u5355\u4f4d\u4fdd\u5b58\u5728eax\u6240\u6307\u5411\u7684\u4f4d\u7f6e\n
inc\u52a01\u6307\u4ee4
inc eax; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u52a01\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u653e\u5728\u539f\u6765\u7684\u5730\u65b9\n
dec\u51cf1\u6307\u4ee4
dec edx; // \u5c06dec\u5bc4\u5b58\u5668\u7684\u503c\u51cf1\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u653e\u5728\u539f\u6765\u7684\u5730\u65b9\n
cmp\u6bd4\u8f83\u6307\u4ee4
\u79f0\u6bd4\u8f83\u6307\u4ee4\u683c\u5f0f\u662f\u201dcmp oper1, oper2\u201d
cmp\u6307\u4ee4\u5c06oper1\u51cf\u53bboper2\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4e0d\u4fdd\u5b58\uff0c\u53ea\u662f\u76f8\u5e94\u5730\u8bbe\u7f6e\u5bc4\u5b58\u5668eflags\u7684cf\uff0cpf\uff0czf\uff0caf\uff0csf\u548cof\u3002\u4e5f\u5c31\u662f\u8bf4\u53ef\u4ee5\u901a\u8fc7\u6d4b\u8bd5\u5bc4\u5b58\u5668eflags\u76f8\u5173\u7684\u6807\u5fd7\u503c\u5f97\u77e5cmp\u6267\u884c\u540e\u7684\u7ed3\u679c
cmp eax, 56H; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u51cf\u53bb56H\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4e0d\u4fdd\u5b58\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5bc4\u5b58\u5668eflags\u76f8\u5173\u7684\u6807\u5fd7\u4f4d\n
neg
neg\uff1a\u53d6\u8865\u6307\u4ee4\uff0c\u683c\u5f0f\u662fneg oper
neg\u6307\u4ee4\u5c06oper\u64cd\u4f5c\u6570\u53d6\u53cd\uff0c\u7b80\u800c\u8a00\u4e4b\u5c31\u662f\u5c060\u51cf\u53bboper\u64cd\u4f5c\u6570\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u5728oper\u81ea\u8eab\u4e2d\u3002
neg eax; \n
mul imul
\u65e0\u7b26\u53f7\u4e58\u6cd5\u6307\u4ee4\u548c\u6709\u7b26\u53f7\u4e58\u6cd5\u6307\u4ee4\u3002mul\u6307\u4ee4\u9690\u542b\u4e86\u4e00\u4e2a\u53c2\u52a0\u8fd0\u7b97\u7684\u64cd\u4f5c\u6570eax\u5bc4\u5b58\u5668\uff0c\u5c06eax\u5bc4\u5b58\u5668\u91cc\u7684\u503c\u4e58oper\uff0c\u7ed3\u679c\u4fdd\u5b58\u5728eax\u4e2d\u3002\u5982\u679c\u7ed3\u679c\u8d85\u8fc732\u4f4d\u5219\u9ad832\u4f4d\u4f7f\u7528edx\u5bc4\u5b58\u5668\u4fdd\u5b58\uff0ceax\u5bc4\u5b58\u5668\u4fdd\u5b58\u4f4e32\u4f4d\u3002
mul edx; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u4e58\u4ee5edx\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\n
div idiv
\u9664\u6cd5\u6307\u4ee4\u548c\u6709\u7b26\u53f7\u9664\u6cd5\u6307\u4ee4\u3002
div ecx; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u63094\u5b57\u8282\u4e3a\u5355\u4f4d\u9664\u4ee5ecx\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5546\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\uff0c\u4f59\u6570\u4fdd\u5b58\u5728edx\u5bc4\u5b58\u5668\u4e2d\u3002\ndiv word ptr [esp+36]; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u6309word\u4e3a\u5355\u4f4d\u9664\u4ee5\u5806\u6808\u5730\u5740\u4e3aesp+36\u6240\u6307\u5411\u7684\u6570\u636e\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5546\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\uff0c\u4f59\u6570\u4fdd\u5b58\u5728edx\u5bc4\u5b58\u5668\u4e2d\u3002\n
"},{"location":"docs/1-cs/assembly-x86/#80386","title":"\u9ad8\u7ea7\u8bed\u8a00\u4e2d\u7684\u6570\u636e\u7ed3\u6784\u4e0e80386\u95f4\u63a5\u5bfb\u5740","text":"BX BP SI DI
BX\uff1a
BP\uff1a
SI\uff1a
DI\uff1a
\u95f4\u63a5\u5bfb\u5740\uff1abx\uff0cbp\uff0csi\uff0cdi\uff0c\u53ef\u4ee5\u653e\u5728\u65b9\u62ec\u53f7\u5185
\u7f3a\u7701\u6bb5\u5740\uff1ads\u548css\uff0c\u5982\u679c\u65b9\u62ec\u53f7\u5185\u6709bp\uff0c\u4e00\u5b9a\u662fss\uff0cbx\u4e00\u5b9a\u662fds
CS (code segment): \u4ee3\u7801\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u4ee3\u7801\u6bb5\u7684\u6bb5\u5730\u5740\u3002
DS (data segment)\uff1a\u6570\u636e\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u6570\u636e\u6bb5\u7684\u6bb5\u5730\u5740\u3002
SS (stack segment)\uff1a\u5806\u6808\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u5806\u6808\u6bb5\u7684\u6bb5\u5730\u5740\u3002
ES (extra segment)\uff1a\u9644\u52a0\u6570\u636e\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u653e\u9644\u52a0\u6bb5\u7684\u6bb5\u5730\u5740\u3002\u6709\u65f6\uff0c\u4e00\u4e2a\u6570\u636e\u6bb5\u4e0d\u591f\u7528\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u58f0\u660e\u4e00\u4e2a\u9644\u52a0\u6bb5\u6765\u5b58\u653e\u66f4\u591a\u7684\u6570\u636e\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u58f0\u660e 2 \u4e2a\u6570\u636e\u6bb5\uff0c\u5206\u522b\u7528 DS \u548c ES \u6307\u5411\u3002
\u7a0b\u5e8f\u5f00\u59cb\u8fd0\u884c\u65f6\uff0cDOS \u4f1a\u628a ds \u548c es \u8d4b\u503c\u4e3a psp(program segment prefix) \u6bb5\u5730\u5740\u3002psp \u6bb5\u4f4d\u4e8e\u7a0b\u5e8f\u9996\u4e2a\u6bb5\u7684\u524d\u9762\uff0c\u957f\u5ea6\u4e3a 100h \u5b57\u8282\uff0c\u5176\u7528\u9014\u662f\u4fdd\u5b58\u5f53\u524d exe \u76f8\u5173\u7684\u4e00\u4e9b\u4fe1\u606f\uff0c\u5982 psp:80h \u5f00\u59cb\u5b58\u653e\u4e86 exe \u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002
\u95f4\u63a5\u5bfb\u5740\uff1a \u53ef\u4ee5\u2f64\u4f5c\u95f4\u63a5\u5bfb\u5740\u7684\u5bc4\u5b58\u5668\u53ea\u6709\u56db\u4e2a\uff1abx, bp, si, di [bx], [bp], [si], [di]\u662f\u6700\u7b80\u5355\u7684\u95f4\u63a5\u5bfb\u5740 [bx + si], [bp + si], [bx + di], [bp + di]\u6ce8\u610f\u524d\u2faf\u5fc5\u987b\u662fbx/bp\uff0c\u540e\u2faf\u5fc5\u987b\u662fdi/si [bx+2] [bp-2] [si+1] [di-1] [bx+si+2] [bx+di-2]
[bp+si+1] [bp+di-1] tips\uff1a\u4e24\u4e2a\u5bc4\u5b58\u5668\u76f8\u52a0\u7684\u95f4\u63a5\u5bfb\u5740\u2f45\u5f0f\u4e2d, bx\u6216bp\u901a\u5e38\u2f64\u6765\u8868\u793a\u6570\u7ec4\u7684\u2fb8\u5730\u5740, \u2f7dsi\u6216di\u5219\u2f64\u6765\u8868\u793a\u4e0b \u6807\u3002
\u7f3a\u7701\u6bb5\u5740\uff1a\u4e0d\u542bbp\u7684\u6e90\u64cd\u4f5c\u6570\u2f00\u822c\u90fd\u7701\u7565\u7684\u6bb5\u5730\u5740ds\uff0c\u542b\u6709bp\u7684\u6e90\u64cd\u4f5c\u6570\u7701\u7565\u4e86ss\uff0c\u2f7d\u8fd9\u4e2a\u9ed8\u8ba4\u7684\u6bb5\u5730\u5740\u662f \u53ef\u4ee5\u88ab\u6539\u53d8\u7684
\u7528\u5806\u6808\u4f20\u9012\u53c2\u6570\u65f6\uff0c\u5982\u4f55\u7528[bp+]\u5b9e\u73b0\u5bf9\u53c2\u6570\u7684\u5f15\u7528\uff1f
bp + \u591a\u5c11\u5c31\u662f\u6808\u91cc\u7684\u591a\u5c11
\u738b\u723d\u300a\u6c47\u7f16\u8bed\u2f94\u300b\u7b2c\u56db\u7248 \u9644\u5f554:\u2f64\u6808\u4f20\u9012\u53c2\u6570
difcube:\n mov bp, sp\n mov ax, [bp+4] ;a\u7684\u503c\u9001\u5165ax\u4e2d\n sub ax, [bp+6] ;\u51cf\u6808\u4e2db\u7684\u503c\n mov bp, ax\n mul bp\n mul bp\n pop bp\n ret 4\n
"},{"location":"docs/1-cs/assembly-x86/#_16","title":"\u5176\u5b83\u7684\u7b14\u8bb0","text":""},{"location":"docs/1-cs/assembly-x86/#x86_1","title":"x86\uff1a","text":"Intel\u4ece16\u4f4d\u5fae\u5904\u7406\u56688086\u5f00\u59cb\u7684\u6574\u4e2aCPU\u82af\u7247\u7cfb\u5217\uff0c\u7cfb\u5217\u4e2d\u7684\u6bcf\u79cd\u578b\u53f7\u90fd\u4fdd\u6301\u4e0e\u4ee5\u524d\u7684\u5404\u79cd\u578b\u53f7\u517c\u5bb9\uff0c\u4e3b\u8981\u67098086\uff0c8088\uff0816\u4f4dCPU\uff09\uff0c80186\uff0c80286\uff08\u8fd9\u4e24\u4e2a\u662f\u8fc7\u6e21\u4ea7\u54c1\uff09\uff0c 80386\uff0c80486\u4ee5\u53ca\u4ee5\u540e\u5404\u79cd\u578b\u53f7\u7684Pentium\u82af\u7247\uff0832\u4f4dCPU\uff09\uff0c\u901a\u5e38\u6240\u8bf4\u7684x86\u90fd\u662f\u630732\u4f4dCPU
80386: 32\u4f4d\u6c47\u7f16\u3002
80836\u5bc4\u5b58\u5668
\u901a\u7528\u5bc4\u5b58\u5668(EAX EBX ECX EDX,ESP,EBP,ESI,EDI)
\u901a\u7528\u5bc4\u5b58\u5668\u4e0e8086\u7684\u5bc4\u5b58\u5668\u76f8\u6bd4,\u753116\u4f4d\u53d8\u4e3a\u4e8632\u4f4d
ESP:\u6808\u9876
EBP:\u6808\u5e95
EAX\uff0cEBX\uff0cECX\uff0cEDX\u901a\u7528\u5bc4\u5b58\u5668
EAX\uff1a\u7d2f\u52a0\u5668\uff08\u4e58\u6cd5\u7684\u65f6\u5019\u5b58\u4f4e\u4f4d\uff09
EBX\uff1a\u57fa\u5740\uff08\uff3bEBX\uff0b100\uff28\uff3d\uff09
ECX\uff1a\u8ba1\u6570\uff08\u5faa\u73af\u7684\u65f6\u5019\u8ba1\u6570\uff09
EDX\uff1a\u6570\u636e\uff08\u9ed8\u8ba4EDX\uff0a10H\uff0b\uff0e\uff0e\uff0e\uff1b\u4e58\u6cd5\u7684\u65f6\u5019\u5b58\u9ad8\u4f4d\uff09
ESI\uff0cEDI\uff1a\u53d8\u5740\u5bc4\u5b58\u5668
ESI\uff1a\u6e90\u53d8\u5740\u5bc4\u5b58\u5668
EDI\uff1a\u76ee\u7684\u53d8\u5740\u5bc4\u5b58\u5668\u3000\u4e0eEBX\u57fa\u5740\u642d\u914d\u4f7f\u7528
"},{"location":"docs/1-cs/assembly-x86/#_17","title":"\u53c2\u8003\u6587\u732e","text":"asm_sum.doc
xxjj\u7684\u300a\u6c47\u7f16\u8bed\u8a00\u8003\u8bd5\u603b\u7ed3\u300b https://www.yuque.com/xianyuxuan/coding/mkte6u
[80386]80x86\u6c47\u7f16\u6307\u4ee4_CarlosX\u7684\u535a\u5ba2-CSDN\u535a\u5ba2_80386\u6307\u4ee4\u96c6
80386 \u7b97\u672f\u8fd0\u7b97\u6307\u4ee4\uff0c\u903b\u8f91\u8fd0\u7b97\u6307\u4ee4\uff0c\u79fb\u4f4d\u6307\u4ee4 (\u4e09) _ttzyanswer\u7684\u535a\u5ba2-CSDN\u535a\u5ba2
"},{"location":"docs/1-cs/c-libgraphics/","title":"C\u5927\u7a0b libgraphics \u6587\u6863 \u4f7f\u7528\u8bb0\u5f55","text":":material-circle-edit-outline: \u7ea6 562 \u4e2a\u5b57 :fontawesome-solid-code: 162 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
\u26a0\ufe0f \u6ca1\u5199\u5b8c TODO
"},{"location":"docs/1-cs/c-libgraphics/#_1","title":"\u5df2\u77e5\u95ee\u9898","text":"\u2192\u4fee\u6539Makefile.win\uff0c\u5728\u672b\u5c3e\u52a0\u5165\uff08\u81ea\u5df1\u5b9e\u8df5\u7684\u65f6\u5019\u8fd9\u6b65\u4e0d\u52a0\u597d\u50cf\u4e5f\u884c\uff09
gratest1.o:gratest1.c\n$(CC) -c gratest1.c -o gratest1.o $(CFLAGS)\n
graphics.h \u4ec5\u63d0\u4f9b\u4ee5\u4e0b\u5c11\u91cf\u753b\u56fe\u51fd\u6570\u63a5\u53e3
InitGraphics();\nMovePen(x, y);\nDrawLine(dx, dy);\nDrawArc(r, start, sweep);\nGetWindowWidth();\nGetWindowHeight();\nGetCurrentX();\nGetCurrentY();\n
\u6211\u4eec\u5c06\u5728\u4e0b\u9762\u4ecb\u7ecd\u8fd9\u4e9b\u63a5\u53e3\u7684\u7528\u6cd5\u3002
"},{"location":"docs/1-cs/c-libgraphics/#_3","title":"\u521d\u59cb\u5316\u64cd\u4f5c","text":"\u5728main.c\u91cc\u9700\u8981\u8fdb\u884c\u5982\u4e0b\u521d\u59cb\u5316
#include \"graphics.h\"\n#include \"extragraph.h\"\n#include \"imgui.h\"\nvoid Main() // \u6ce8\u610f\u8fd9\u91cc\u9700\u8981\u4f7f\u7528\u5927\u5199Main\n{\nSet WindowTitle(\"Your Title\");\nInitGraphics(); // \u8c03\u7528\u4e86\u56fe\u5f62\u6a21\u5f0f\n}\n
InitGraphics(); \u8fd9\u4e2a\u51fd\u6570\u4f1a\u6253\u5f00\u4e00\u4e2a\u7a7a\u7684\u56fe\u5f62\u7a97\u53e3\u3002
"},{"location":"docs/1-cs/c-libgraphics/#_4","title":"\u7a97\u53e3","text":"\u4ee5\u4e0b\u56db\u4e2a\u51fd\u6570\u90fd\u4e0d\u9700\u8981\u4f20\u5165\u53c2\u6570\uff0c\u5206\u522b\u8fd4\u56de\u7a97\u53e3\u5bbd\u3001\u9ad8\uff0c\u5f53\u524dX\u3001Y\u5750\u6807\u3002
GetWindowWidth();\nGetWindowHeight();\nGetCurrentX();\nGetCurrentY();\n
"},{"location":"docs/1-cs/c-libgraphics/#_5","title":"\u597d\u7684\u7f16\u5199\u4e60\u60ef","text":"\u5e94\u8be5\u5148\u5b9a\u4e49\u4e00\u4e9b\u5e38\u91cf\uff0c\u7ed9\u8fd9\u4e9b\u5e38\u91cf\u53d6\u540d\u5b57
#define HouseHeight 2.0\n#define HouseWidth 3.0\n#define AtticHeight 0.7\n#define DoorWidth 0.4\n#define DoorKnobRadius 0.03\n#define DoorKnobInset 0.07\n#define PaneHeight 0.25\n#define PaneWidth 0.2\n#define FirstFloorWindows 0.3\n#define SecondFloorWindows 1.25\n
"},{"location":"docs/1-cs/c-libgraphics/#_6","title":"\u753b\u56fe\u5f62\u7684","text":""},{"location":"docs/1-cs/c-libgraphics/#movepen","title":"MovePen","text":"\u5c06\u7b14\u79fb\u52a8\u5230(x, y)\u8be5\u5750\u6807\u3002\u6ce8\u610f\u5f53\u753b\u56fe\u5f62\u65f6\uff0c\u540e\u9762\u51e0\u4e2a\u51fd\u6570\u7684\u76f8\u5bf9\u4f4d\u79fb\uff0c\u90fd\u662f\u76f8\u5bf9\u4e8e\u8fd9\u4e2a\u51fd\u6570\u8bbe\u7f6e\u7684\u7b14\u5750\u6807\u79fb\u52a8\u7684\u3002
MovePen(double x, double y);\n
"},{"location":"docs/1-cs/c-libgraphics/#drawline","title":"DrawLine","text":"\u5728\u753b\u7ebf\u4e4b\u524d\u4e00\u5b9a\u8981MovePen();
DrawLine(double dx, double dy);\n
\u753b\u7ebf\u7684\u65b9\u5411\uff1a
\u6a2a\u5750\u6807\u6700\u5de6\u8fb9\u662f0\uff0c\u5411\u53f3\u589e\u5927
\u7eb5\u5750\u6807\u6700\u4e0b\u9762\u662f0\uff0c\u5411\u4e0a\u589e\u5927
\u53ef\u4ee5\u7406\u89e3\u4e3a\u6211\u4eec\u5728\u7b2c\u4e00\u8c61\u9650
"},{"location":"docs/1-cs/c-libgraphics/#drawarc","title":"DrawArc","text":"\u5728\u753b\u5f27\u4e4b\u524d\u4e00\u5b9a\u8981MovePen();
DrawArc(double r, double start, double sweep);\n
"},{"location":"docs/1-cs/c-libgraphics/#_7","title":"\u6211\u4eec\u5e94\u5f53\u628a\u753b\u77e9\u5f62\u5c01\u88c5\u6210\u4e00\u4e2a\u65b0\u7684\u51fd\u6570","text":"void DrawBox (double x, double y, double width, double height)\n{\nMovePen(x, y);\nDrawLine(0, height);\nDrawLine(width, 0);\nDrawLine(0, height);\nDrawLine(-width, 0);\n}\n
void DrawCenteredBox(double x, double y, double width, double height)\n{\nDrawBox(w - width/2, y - height/2, width, height);\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_8","title":"\u753b\u5706\u7684\u51fd\u6570","text":"void DrawCenteredCircle(double x, double y, double r)\n{\nMovePen(x + r, y);\nDrawArc(r, 0, 360);\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_9","title":"\u6587\u5b57","text":"\u4ece\u5f53\u524d\u4f4d\u7f6e\u5f00\u59cb\u8f93\u51fa\u6587\u672c\u4e32
DrawTextString(string);\n
\u8fd9\u4e2a\u51fd\u6570\u7528\u4e8e\u83b7\u53d6\u67d0\u4e2a\u5b57\u7b26\u4e32\u957f\u5ea6
double stringLen = TextStringWidth(string);
"},{"location":"docs/1-cs/c-libgraphics/#_10","title":"\u67e5\u770b\u56de\u8c03\u51fd\u6570\u7c7b\u578b","text":"typedef void(* KeyboardEventCallback)(int key, int event);\n
"},{"location":"docs/1-cs/c-libgraphics/#_11","title":"\u5b9a\u65f6\u5668","text":""},{"location":"docs/1-cs/c-libgraphics/#_12","title":"\u65f6\u95f4\u56de\u8c03\u51fd\u6570","text":"registerTimerEvent(mytimer); //\u83b7\u53d6\u7535\u8111\u65f6\u949f\u4fe1\u606f\u8fd4\u56de\u7ed9mytimer\nstartTimer(0, (int)(1000/speed)); // \u8981\u8ba8\u8bba\u4f20\u8fdb\u6765\u7684timer\u662f\u4ec0\u4e48\n
"},{"location":"docs/1-cs/c-libgraphics/#_13","title":"\u5b9a\u65f6\u5668\u6d88\u606f\u56de\u8c03\u51fd\u6570","text":"void TimerEventProcess(int timerID);\n
\u793a\u4f8b
typedef enum\n{\nLabelTimer,\nBoxTimer,\n} MyTimer;\n
void mytimer(int timerID)\n{\nswitch (timerID)\n{\ncase LabelTimer:\nlabel_x += 0.5;\nif (label_x > 5.0) label_x = 1.0;\ndisplay();\nbreak;\ncase BoxTimer:\nbox_y += 0.5;\nif (box_y > 5.0) box_y = 1.0;\ndisplay();\nbreak;\nbreak;\n}\n}\n
registerTimerEvent(mytimer);\nstartTimer(LabelTimer, 100);\nstartTimer(BoxTimer, 200);\n
"},{"location":"docs/1-cs/c-libgraphics/#_14","title":"\u9f20\u6807","text":""},{"location":"docs/1-cs/c-libgraphics/#_15","title":"\u9f20\u6807\u6d88\u606f\u56de\u8c03\u51fd\u6570","text":"void MouseEventProcess(int x, int y, int button, int event);\n
x, y - \u4f4d\u7f6e\u5750\u6807
button - \u6309\u4e0b\u7684\u662f\u54ea\u4e2a\u952e
event - \u6309\u4e0b\uff0c\u677e\u5f00\uff0c\u79fb\u52a8\u7b49\u4e8b\u4ef6
void myMouseEvent (int x, int y, int button, int event)\n{\nmouse_x = ScaleXInches(x); // \u8fd9\u4e2a\u51fd\u6570\u5728extragraph\u5e93\u91cc\nmouse_y = ScaleYInches(y);\ndisplay();\n}\n
\u9700\u8981\u5728Main()\u91cc\u6dfb\u52a0\u8fd9\u4e00\u884c
registerMouseEvent(myMouseEvent);\n
\u5728display()\u91cc
void display()\n{\ndouble w = 1.0;\ndouble h = GetFontHeight() * 2;\n// \u6e05\u9664\u5c4f\u5e55\nDisplayClear();\n// draw a square\nSetPenColor(\"Red\");\ndrawLabel(label_x, label_y, \"Lable is Here\");\n//draw a rect/box to trace the mouse\n//drawRectangle(mouse_x, mouse_y, w, h, 0);\nSetPenColor(\"Blue\");\ndrawBox(mouse_x, mouse_y, w, h, 1, \"This box follows the mouse\", 'L', \"Red\");\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#linkedlist","title":"\u4f7f\u7528linkedlist\u5e93","text":"#include \"linkedlist.h\"\n
\u521b\u5efa\u4e00\u4e2a linkedlist \u540d\u53eb g_polylines
linkedlistADT g_polylines = NULL;\ng_polylines = NewLinkedList();\ndisplay();\n
void display()\n{\nlinkedlistADT poly = NextNode(g_polylines, g_polylines);\nSetPenColor(\"Blue\");\nif (poly) {\nPoint * p = (Point*) NodeObj(g_polylines, poly);\ndouble lx = p->x;\ndouble ly = p->y;\nMovePen(lx, ly);\nwhile (poly = NextNode(g_polylines, poly))\n{\np = (Point*) NodeObj(g_polylines, poly);\nDrawLine(p->x - lx, p->y - ly);\nlx = p->x;\nly = p->y;\n}\n}\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#button","title":"\u4f7f\u7528button\u548c\u952e\u76d8","text":"\u8fd9\u6b21\u9700\u8981\u7528\u5230\u7684\u5e93
#include <windows.h>\n#include <winuser.h>\n#include \"graphics.h\"\n#include \"extgraph.h\"\n#include \"imgui.h\"\n#include \"linkedlist.h\"\n
"},{"location":"docs/1-cs/c-libgraphics/#_16","title":"\u5b57\u7b26\u8f93\u5165\u56de\u8c03\u51fd\u6570","text":"void charEventProcess(char c);\n
c - \u8f93\u5165\u5b57\u7b26\u7684ASCII\u7801
"},{"location":"docs/1-cs/c-libgraphics/#_17","title":"\u952e\u76d8\u56de\u8c03\u51fd\u6570","text":"void KeyboardEventProcess(int key, int event);\n
key - \u54ea\u4e2a\u952e
event - \u6309\u4e0b\u8fd8\u662f\u677e\u5f00
\u793a\u4f8b
\u5728Main()\u4e2d
\n
void myKeyboardEvent(int key, int event)\n{\nuiGetKeyboard(key, event); // needed for using simpleGUI\ndisplay();\nswitch (event)\n{\ncase KEY_UP:\nif (key == VK_F1)\ng_add_point = !g_add_point;\nbreak;\ndefault:\nbreak;\n}\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_18","title":"\u989c\u8272\u5e93","text":"\u81ea\u5e26\u7684\u989c\u8272\u5217\u8868
char colorlist[100][100] = {\u201dBlack\u201d, \u201cDark Gray\u201d, \u201cGray\u201d, \u201cLight Gary\u201d, \u201cWhite\u201d, \u201cBrown\u201d, \u201cRed\u201d, \u201cOrange\u201d, \u201cYellow\u201d, \u201cGreen\u201d, \u201cBlue\u201d, \u201cViolet\u201d, \u201cMagenta\u201d, \u201cCyan\u201d};\nconst int colorNumber = 14;\n
\u81ea\u5b9a\u4e49\u989c\u8272
\u989c\u8272\u4f1a\u88ab\u52a0\u5165\u989c\u8272\u5e93\uff0cRGB\u7684\u53d6\u503c\u8303\u56f4\u90fd\u662f[0, 1]\u800c\u4e0d\u662f[0, 256)
DefineColor(\"Color Name\", R, G, B);\n
"},{"location":"docs/1-cs/c-libgraphics/#libgraphics","title":"libgraphics\u5176\u5b83\u5e38\u7528\u7684\u4e1c\u897f","text":""},{"location":"docs/1-cs/code-style/","title":"Pythons' Code Style Guide","text":":material-circle-edit-outline: \u7ea6 517 \u4e2a\u5b57 :fontawesome-solid-code: 71 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/1-cs/code-style/#pr","title":"PR","text":""},{"location":"docs/1-cs/code-style/#first-prototypes-and-implementations-then","title":"First prototypes, and implementations then","text":""},{"location":"docs/1-cs/code-style/#every-pr-should-be-meaningful-an-integral-element","title":"Every PR should be meaningful (an integral element)","text":""},{"location":"docs/1-cs/code-style/#split-to-the-smallest-elements","title":"Split to the smallest elements","text":"\u2705 each PR can be described within one sentence.
"},{"location":"docs/1-cs/code-style/#git-add-instead-of-git-add","title":"git add , instead of git add .","text":""},{"location":"docs/1-cs/code-style/#require-review-before-each-merging-by-setting-up-protecting-your-branch","title":"require review before each merging, by setting up \u2018protecting your branch\u2019","text":""},{"location":"docs/1-cs/code-style/#prs-title-same-as-git-commit-message","title":"PRs title - same as git commit messageformat [label] name + summary of change
admitted labels: Git Commit Style Guide
","text":""},{"location":"docs/1-cs/code-style/#pr-message-same-as-git-commit-message","title":"PR message - same as git commit message","text":""},{"location":"docs/1-cs/code-style/#file-management","title":"File management","text":""},{"location":"docs/1-cs/code-style/#oop","title":"oopEncompass each function (except main
) into a related class.
\u2705 Do models/models.py
\u274c Don't models_main.py
\u2705 Do path_checkpoint
.
\u274c Don't path_ckpt
.
_
to separate with the input parameters. e.g., the correct private number name should be
def __init__(self, foo):\n self._foo = foo # not recommended\n
instead of
def __init__(self, foo):\n self.foo = foo # recommended\n
And whenever an outer function requires a private member of a class, it is not recommended to directly use the private member from the class like
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\nfoo = Foo()\nfoo._bar # not recommnded\n
nor
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\n @property\n def get_bar(self):\n return self._bar\n\nfoo = Foo()\nfoo.get_bar()\n
instead, using a @property
decorator is recommonded.
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\n @property\n def bar(self):\n return self._bar\n\nfoo = Foo()\nfoo.bar\n
","text":""},{"location":"docs/1-cs/code-style/#spacing","title":"Spacing","text":"From top to down - In every comment: 1 space-line between each section, i.e., - Except the file top, no more than 2 space-line
"},{"location":"docs/1-cs/code-style/#type-hints","title":"Type Hints","text":""},{"location":"docs/1-cs/code-style/#write-type-hints-no-need-to-write-types-in-the-comment","title":"write type hints, no need to write types in the comment\u2705 Do
def foo(bar: int) -> str:\n \"\"\"\n Args:\n bar: \n Returns:\n str: \n \"\"\"\n pass\n
\u274c Don't
def foo(bar: int) -> str:\n \"\"\"\n Args:\n bar (int): \n Returns:\n str (str): \n \"\"\"\n pass\n
","text":""},{"location":"docs/1-cs/code-style/#try-to-use-the-typing-library","title":"try to use the typing
library. Usual usage: when you want to indicat the element type of a Dict / a List / etc.
from typing import Dict\n\ntyping.Dict[str, Union[int, float]]\n
Supported types: - Dict[x, y] - Union[x, y, ...] -
After Python 3.10, this feature is included as an internal feature, with all types written as lower cases.
dict[str, int | float]\n
But to preserve the extenability to lower versions, I believe the importing method would be better.
","text":""},{"location":"docs/1-cs/code-style/#comments","title":"Comments","text":""},{"location":"docs/1-cs/code-style/#where-should-comments-appear","title":"Where should comments appear?Required: file docstring (on the top of the file), class docstring (after the class's name), function docstring (after the function's name).
Either a sentence or several paragraphs.
\"\"\"A sentence describing the file content.\"\"\"\n
or
\"\"\"A sentence describing the file content.\n\nDeclarations.\n\"\"\"\n
Function docstring's format
\"\"\"A sentence describing the function's content.\n\nArgs:\n arg1 : explain\n\nReturns:\n return1 : explain\n\"\"\"\n
No space between the docstring and the imports.
","text":""},{"location":"docs/1-cs/code-style/#be-sure-to-make-every-doc-a-sentence","title":"Be sure to make every doc a sentence\u2705 Do # a comment
.
\u274c Don't # a comment.
.
\u2705 Do
# comment 1.\n# comment 2.\n# comment 3.\n
\u274c Don't
# comment 1.\n# the comment 2.\n# comment 3.\n
","text":""},{"location":"docs/1-cs/code-style/#imports","title":"Imports","text":""},{"location":"docs/1-cs/code-style/#order","title":"Order One way to automatically sort the imports in VSCode (Don't sing an alphabet song every time you add an import): 1. Open the setting.json
. 2. Add or change the following setting
```json\n\"editor.codeActionsOnSave\": {\n \"source.organizeImports\": true,\n},\n```\n
","text":""},{"location":"docs/1-cs/code-style/#importing-names","title":"Importing Names \u2705 Do use import x
, x.y
to avoid the conflict of namespace, e.g.,
import torch\nimport transformers\n\ntorch.nn.Module\ntransformers.Trainer\n
\u274c Don't use from x import y
.
The only examptions are those well-established ones, e.g., from typing import Dict, List, Optional, Sequence, Union
.
This code style guide is an examplanation of the Google's Python Style Guide.
"},{"location":"docs/1-cs/architecture/","title":"\u7d22\u5f15","text":":material-circle-edit-outline: \u7ea6 318 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u6253\u7b97\u7a0d\u5fae\u5199\u4e00\u70b9\u662f\u56e0\u4e3a\u81ea\u5df1\u5b66\u4f53\u7cfb\u7684\u65f6\u5019\u6ca1\u627e\u5230\u7279\u522b\u5b8c\u6574\u7b14\u8bb0\u8d44\u6599 + \u6ca1\u4e0a\u8ba1\u7ec4\uff0c\u81ea\u5df1\u5b8c\u5168\u6ca1\u7406\u89e3\uff0c\u5355\u7eaf\u786c\u80cc\u901f\u6210\u7684\uff0c\u8bb0\u4e00\u4e0b\u81ea\u5df1\u901f\u6210\u770b\u4e86\u54ea\u4e9b\u4e1c\u897f
\u5f53\u7136\u9996\u5148\u82b1\u4e86\u4e24\u4e2a\u4e0b\u5348\u8fc7\u4e86\u4e00\u904d\u9a6c\u5fb7\u8ba1\u7ec4\u7684\u667a\u4e91 + xyx\u8ba1\u7ec4\u7b14\u8bb0\uff0c\u8fb9\u5b66\u8fb9\u52a8\u7b14
\u8fd8\u6709\u6284 A4 \u7684\u89c4\u5212\u8bf7\u89c1\u6211 github \u90a3\u4e2a ZJU \u8d44\u6e90\u4ed3\u5e93
\u53c2\u8003\u8d44\u6599
:material-circle-edit-outline: \u7ea6 3017 \u4e2a\u5b57 :fontawesome-solid-code: 28 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap2/#_1","title":"\u76ee\u5f55","text":"\u8fd9\u5757\u5e38\u8003\u5927\u9898\uff0c\u6bd4\u5982\u8ba1\u7b97\u5730\u5740\u957f\u5ea6\uff0c\u8ba1\u7b97 AMAT\uff0c\u8ba1\u7b97 miss \u6b21\u6570\u7b49\u3002
"},{"location":"docs/1-cs/architecture/chap2/#cache_1","title":"cache \u7684\u5206\u7c7b\u548c\u5730\u5740\u7684\u8ba1\u7b97\u65b9\u6cd5","text":"Warning
\u8fd9\u4e2a\u8868\u8bb0\u4e0d\u6e05\u4e86\u6253\u7b97\u7b49\u4e0a\u8ba1\u7ec4\u518d\u8865\u3002
\u7c7b\u522b \u89e3\u91ca \u6807\u8bb0\u9879\u7ed3\u6784 \u5730\u5740\u8ba1\u7b97 \u4f18\u70b9 \u7f3a\u70b9 direct-mapping \u76f4\u63a5\u6620\u5c04 fully associative \u5168\u5173\u8054 2^n-set associative 2^n\u8def\u7ec4\u5173\u8054\u8fd9\u5757\u5e38\u8003\u9009\u62e9\u3002
\u603b\u7ed3\u6027\u7684\u56fe
\u63a5\u4e0b\u6765\u5177\u4f53\u8bb2\u89e3\u6bcf\u4e00\u79cd\u4f18\u5316\u65b9\u6cd5\u3002
\u9996\u5148\u56db\u5927\u7c7b\u4f18\u5316\u7684\u601d\u8def\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff1f\u6765\u81ea\u4e8e\u8861\u91cf\u5185\u5b58\u6027\u80fd\u7684\u516c\u5f0f\uff1a
\\[ Average\\space Memory\\_access\\space Time\\space (AMAT) = Hit\\_time + Miss\\_rate \\times Miss\\_penalty \\]\u9996\u5148\u8fd9\u4e2a\u516c\u5f0f\u7684\u610f\u601d\u662f\uff0c\u5f53 CPU \u9700\u8981\u5185\u5b58\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u8bbf\u95ee\u65f6\u95f4\u7684\u8ba1\u7b97\u65b9\u6cd5\u662f\uff1a - \u5982\u679c\u5728 cache \u91cc\u627e\u5230\u4e86\uff0c\u5373\u53d1\u751f cache hit\uff0c\u90a3\u4e48\u9700\u8981\u7684\u65f6\u95f4\u53ea\u6709 cache \u7684\u8bbf\u95ee\u7528\u65f6\u5373hit_time\u3002 - \u5982\u679c\u5728 cache \u91cc\u6ca1\u627e\u5230\uff08\u6b64\u65f6\u5df2\u7ecf\u7528\u4e86\u4e00\u4e2a hit_time\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48 hit_time \u662f 100% \u8981\u7528\u6389\u7684\uff09\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u53bb\u5185\u5b58\u91cc\u627e\uff0c\u53bb\u5185\u5b58\u91cc\u627e\u7684\u7528\u65f6\u662f\u8fd9\u79cd\u60c5\u51b5\u6240\u5360\u7684\u767e\u5206\u6bd4 miss_rate \u4e58\u4e0a\u53bb\u5185\u5b58\u91cc\u627e\u4e00\u6b21\u7684\u8017\u65f6 miss_penalty\u3002
Note
\u5f53\u7136\u9898\u76ee\u91cc\u8fd8\u53ef\u80fd\u4f1a\u8bf4 \"cache \u548c memory \u662f\u540c\u65f6\u8bbf\u95ee\u7684\"\uff0c\u610f\u601d\u5c31\u662f cache \u548c memory \u4e00\u8d77\u627e\uff0c\u5982\u679c cache \u91cc\u627e\u5230\u4e86\uff0c\u5c31\u628a memory \u8bbf\u95ee\u6390\u6389\uff0c\u8fd9\u6837\u5728 miss \u7684\u60c5\u51b5\u4e0b\u662f\u6bd4\u5148\u5728 cache \u91cc\u627e\u5b8c\u518d\u53bb memory \u627e\u66f4\u5feb\u7684\u3002\u8fd9\u6837\u7684\u6761\u4ef6\u4e0b\u8ba1\u7b97 AMAT \u5c31\u9700\u8981\u628a hit_time \u4e58\u4e0a\u4e00\u4e2a hit_rate\uff0c\u4e0d\u518d\u662f 100% \u7528\u6389\u4e86\u3002
\u603b\u4e4b\uff0cAMAT \u7684\u8868\u8fbe\u5f0f\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e09\u79cd\u4f18\u5316\u7684\u5927\u65b9\u5411\uff0c\u5373 (1)\u964d\u4f4e hit_time (2)\u51cf\u5c0f miss_rate (3)\u51cf\u5c0f miss_penalty\u3002\u6b64\u5916\u8fd8\u6709\u4e00\u4e2a\u5927\u65b9\u5411\u53eb (4)\u505a\u5e76\u884c\u7684 cache\uff0c\u5728\u6709\u7684\u8001\u5e08\u7684 PPT \u91cc\u7b2c(4)\u9879\u597d\u50cf\u4f1a\u62c6\u51fa\u4e24\u7c7b\u6765\u8bb2\uff0c\u4e0d\u8fc7\u6211\u4eec\u8fd9\u91cc\u5c31\u6309\u603b\u5171\u56db\u79cd\u5927\u65b9\u5411\u6765\u5199\uff0c\u8ddf\u56fe\u4e00\u81f4\uff0c\u6bd4\u8f83\u8212\u670d\u3002
"},{"location":"docs/1-cs/architecture/chap2/#miss-penalty","title":"Miss Penalty","text":"Multilevel Caches
\u7ecf\u5178\u7684\u5185\u5b58\u6a21\u578b\u662f
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
\u8fd9\u4e2a\u65b9\u6cd5\u662f\u628a\u5b83\u53d8\u6210
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [\u5c0fcache] - [\u5927cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
\u6bd4\u5982\u5c0f cache \u6ca1\u627e\u5230\u7684\u5148\u4ece\u5927 cache \u627e\uff0c\u5927 cache \u6ca1\u627e\u5230\u7684\u518d\u53bb\u5185\u5b58\u627e\u3002\u6b64\u7c7b\u53ef\u80fd\u51fa AMAT \u7684\u8ba1\u7b97\u9898\uff0c\u628a\u5404\u79cd rate \u62ce\u6e05\u4ee5\u540e\u5c31\u50cf\u4f55\u8001\u5e08\u8bf4\u7684\u201c\u5f53\u6210\u521d\u4e2d\u7269\u7406\u9898\u505a\u5c31\u884c\u201d\u3002 Early Resart & Critical Word 1st
\u4f17\u6240\u5468\u77e5\uff08\u81f3\u5c11\u4f60\u73b0\u5728\u77e5\u9053\u4e86\uff09cache \u7684\u4e00\u4e2a block \u7ecf\u5e38\u662f\u542b\u6709\u591a\u4e2a word \u7684\uff08\u4f60\u53ef\u80fd\u4f1a\u604d\u7136\u5927\u609f\u6709\u4e9b\u9898\u76ee\u91cc\u8bf4\u7684\u201ccache \u6309 word \u7f16\u5740\u201d\u662f\u4ec0\u4e48\u610f\u601d\uff09\uff0c\u800c block \u5f80\u5f80\u662f\u5927\u4e8e cache \u548c\u5185\u5b58\u4e4b\u95f4\u7684\u6570\u636e\u7ebf\u4f4d\u5bbd\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u60f3\u8981\u66ff\u6362\u4e00\u4e2a block\uff0c\u9700\u8981\u5728 cache \u548c\u5185\u5b58\u4e4b\u95f4\u4f20\u9001\u597d\u51e0\u8d9f\u624d\u80fd\u628a\u4e00\u4e2a block \u66ff\u6362\u5b8c\u3002
\u4f46\u662f miss \u53d1\u751f\u65f6 CPU \u9700\u8981\u7684\u53ef\u80fd\u53ea\u6709\u4e00\u4e2a word\uff0c\u90a3\u4e48\u53ef\u4ee5\u5148\u628a CPU \u9700\u8981\u7684\u8fd9\u4e2a word \u5199\u56de\u6765\uff0c\u8ba9 CPU \u5148\u7ee7\u7eed\u8dd1\u8d77\u6765\uff0c\u5728 CPU \u7ee7\u7eed\u8dd1\u7684\u540c\u65f6\u518d\u628a\u5269\u4e0b\u7684 word \u5199\u8fdb cache\u3002
Priority to Read Miss
\u5728\u4f7f\u7528 write buffer \u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c write \u7684\u6570\u636e\u5f88\u5feb\u5c31\u8981 read\uff0c\u53ef\u4ee5\u5148\u4e0d\u5c06 buffer \u7684\u6570\u636e\u5199\u8fdb\u5185\u5b58\uff0c\u800c\u662f\u7b49\u5230read\u7684\u65f6\u5019\u76f4\u63a5\u4ecebuffer\u91cc\u8bfb\uff0c\u8bfb\u591a\u6b21\u4e4b\u540e\u518d\u4e00\u6b21\u4ecebuffer\u91cc\u5199\u5185\u5b58\u3002
\u5176\u4e2d\uff0cwrite buffer \u662f\u4e00\u4e2a\u53ef\u4ee5\u8bbe\u5728 cache \u548c\u5185\u5b58\u4e4b\u95f4\u7684\u7ed3\u6784\uff0c\u610f\u601d\u662f\uff0c\u5047\u8bbe\u5185\u5b58\u53ea\u6709\u4e00\u4e2a\u8bfb\u5199\u7aef\u53e3\uff0c\u5199\u5165\u5185\u5b58\u975e\u5e38\u6162\uff0c\u90a3\u4e48 cache \u53ef\u4ee5\u5c06\u9700\u8981\u5199\u5230\u5185\u5b58\u7684\u4e1c\u897f\u5148\u642c\u5230 write buffer \u91cc\uff0c\u7136\u540e cache \u5148\u8dd1\u7740\uff0c\u5185\u5b58\u53bb\u6162\u6162\u5199\u5165\u3002
Merging Write Buffer
\u540c\u6837\u662f\u4f7f\u7528 write buffer \u7684\u60c5\u51b5\u3002merging write buffer \u5c31\u662f\u5c06\u5728\u591a\u884c\u53ef\u4ee5\u4e00\u6b21\u5199\u56de\u7684\u5185\u5bb9\u5408\u5e76\u5230\u4e00\u884c\uff0c\u4ee5\u53ef\u4ee5\u4e00\u6b21\u5199\u56de\u3002write buffer \u7684\u5185\u5bb9\u662f\u6309 byte \u7f16\u5740\u7684\uff0c\u4f46\u5185\u5b58\u6570\u636e\u7ebf\u4f4d\u5bbd\u4e00\u822c\u5927\u4e8e byte\uff0c\u6bd4\u5982\u4e00\u6b21\u53ef\u4ee5\u5199\u56de\u4e00\u6574\u4e2a word\uff0c\u90a3\u4e48\u5047\u5982 write buffer \u91cc\u73b0\u5728\u6709\u56db\u884c mem[200], mem[400], mem[208], mem[408]\uff0c\u5199\u56de\u5185\u5b58\u5c31\u9700\u8981\u56db\u6b21\u3002\u4f46\u662f\u5982\u679c\u6211\u4eec\u628a\u5728\u540c\u4e00\u4e2a word \u91cc\u7684 byte \u5408\u5e76\u4e00\u4e0b\uff0c\u53d8\u6210 mem[200] mem[208] \u548c mem[400] mem[408] \u4e24\u884c\uff0c\u4e24\u6b21\u5199\u56de\uff0c\u5c31\u4f1a\u53d8\u5feb\u3002
Victim Caches
\u662f\u4e00\u79cd\u51cf\u5c11 conflict miss \u7684\u65b9\u6cd5\uff0c\u5373\u66ff\u6362\u51fa\u53bb\u7684\u9875\u5148\u653e\u8fdb\u8fd9\u4e2a victim cache \u7ed3\u6784\u3002victim cache \u4e0e cache \u662f\u5168\u76f8\u5173\u7684\uff0c\u6709\u70b9\u50cf\u4e00\u4e2a\u4e8c\u7ea7 cache\uff0c\u662f\u4e00\u4e2a\u6bd4\u4e00\u7ea7 cache \u6162\u7684 cache\u3002\u8fd9\u6837\u5982\u679c\u53d1\u751f conflict miss\uff0c\u4ece\u8fd9\u4e2a victim cache \u91cc\u53d6\u6570\u636e\u6bd4\u4ece\u5185\u5b58\u91cc\u53d6\u66f4\u5feb\u3002
"},{"location":"docs/1-cs/architecture/chap2/#miss-rate","title":"Miss Rate","text":"\u8fd9\u4e00\u680f\u7684\u524d\u4e09\u4e2a\u65b9\u6cd5\u90fd\u4e0d\u662f\u5f88\u806a\u660e\uff0c\u672c\u8d28\u4e0a\u662f\u5728 cache \u7684\u4e09\u79cd\u8bbe\u8ba1\u65b9\u6cd5\u4e2d\u53bb\u6743\u8861\uff0c\u800c\u6211\u4eec\u77e5\u9053 cache \u7684\u4e09\u79cd miss \u8fd8\u662f\u6b64\u6d88\u5f7c\u957f\u7684\uff0c\u54ea\u4e00\u79cd\u8bbe\u8ba1\u65b9\u6cd5\u90fd\u4e0d\u80fd\u5b8c\u7f8e\u89e3\u51b3\u3002\u4e0d\u8fc7\u6574\u4f53\u800c\u8a00\uff0cfrom \u738b\u9053\u8ba1\u7ec4\uff0c\u4f7f\u7528\u5408\u9002\u7684 2^n \u8def\u7ec4\u5173\u8054\u65f6\uff0c\u6700\u597d\u7684\u60c5\u51b5\u80fd\u591f\u51e0\u4e4e\u517c\u5177\u76f4\u63a5\u6620\u5c04\u7684\u6548\u7387\u548c\u5168\u5173\u8054\u7684\u547d\u4e2d\u7387\u3002
Larger Block Size
\u628a cache \u7684\u6bcf\u4e2a\u5757\u8bbe\u8ba1\u5f97\u66f4\u5927\uff0c\u8fd9\u6837\u6bcf\u4e2a\u5757\u5b58\u5f97\u4e1c\u897f\u591a\u4e86\uff0c\u5f53\u7136 miss_rate \u5c31\u4e0b\u964d\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0cmiss_penalty \u4e0a\u5347\u4e86\uff0c\u56e0\u4e3a\u5199\u8d77\u6765\u53d8\u6162\u4e86\u3002
Larger Cache Size
\u628a cache \u7684\u5757\u6570\u589e\u591a\uff0c\u8fd9\u6837\u5b58\u5f97\u4e1c\u897f\u4e5f\u591a\u4e86\uff0cmiss_rate \u5c31\u4e5f\u4e0b\u964d\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0c\u51b7\u542f\u52a8 compulsory miss \u4e0a\u5347\u4e86\uff1b\u5982\u679c\u4e0d\u662f\u76f4\u63a5\u6620\u5c04\uff0c\u67e5\u627e\u65f6\u95f4\u4e5f\u4e0a\u5347\u4e86\u3002
Higher Associativity
\u63d0\u5347\u7ec4\u5173\u8054\u6570\uff0c\u8fd9\u6837\u51cf\u5c11 cache \u91cc\u9762\u7684\u4e1c\u897f\u88ab\u66ff\u6362\u51fa\u53bb\u7684\u6982\u7387\uff0c\u51cf\u5c11 conflict miss\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0c\u67e5\u627e\u65f6\u95f4\u589e\u52a0\u3002
Way-predicting Cache
\u5728\u7ec4\u5173\u8054\u8bbe\u8ba1\u4e2d\uff0c\u4f7f cache \u5177\u6709\u9884\u6d4b\u9700\u8981\u67e5\u627e\u7684 tag \u7684\u80fd\u529b\u3002\u56e0\u4e3a\u53bb\u67e5\u9700\u8981\u7684\u6570\u636e\u5728\u7ec4\u91cc\u54ea\u4e2a tag \u6bd4\u8f83\u6162\uff0c\u6240\u4ee5\u5148\u731c\u4e00\u4e2a tag \u5728 cache \u91cc\u627e\u7740\uff0c\u7b49 tag \u51c6\u5907\u597d\u540e\u5982\u679c\u731c\u5bf9\u4e86\uff0c\u90a3\u4e48\u8282\u7ea6\u4e86\u65f6\u95f4\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5 hit\u3002
Pseudo-associative Caches
\u65e2\u662f\u76f4\u63a5\u6620\u5c04\u53c8\u662f\u7ec4\u5173\u8054\u6620\u5c04\u7684 cache\u3002\u9996\u5148\u628a cache \u5f53\u4f5c\u4e00\u4e2a\u76f4\u63a5\u6620\u5c04 cache\uff0c\u7b2c\u4e00\u6b21\u67e5\u7684\u65f6\u5019\u5c31\u8fd9\u4e48\u67e5\uff0c\u6700\u5feb\u3002\u4f46\u662f\u8fd9\u79cd cache \u53c8\u540c\u65f6\u662f\u4e00\u4e2a\u7ec4\u5173\u8054\u6620\u5c04\uff0c\u5728 cache \u5757\u4e2d\u653e\u4e00\u4e2a\u989d\u5916\u7684\u6807\u5fd7\u8868\u793a\u4e0e\u4e4b\u5173\u8054\u7684\u5176\u5b83\u5757\uff0c\u5982\u679c miss \u4e86\u518d\u53bb\u67e5\u8fd9\u4e9b\u5757\u3002\u8fd9\u6837\u6709\u4e00\u4e2a\u5c0f\u7684 hit_time \u548c2^n - 1\u4e2a\u5927\u7684 pseudo_hit_time\uff0c\u4f46\u662f\u5e73\u5747\u6765\u8bf4 miss_rate \u6bd4\u76f4\u63a5\u6620\u5c04\u5c0f\uff0chit_time \u6bd4\u7ec4\u5173\u8054\u6620\u5c04\u5c0f\u3002
Compiler Techniques Reduce Cache Misses
\u7528\u8f6f\u4ef6\u65b9\u6cd5\uff0c\u4f18\u5316\u4ee3\u7801\u3002\u8fd9\u91cc\u6709\u56db\u4e2a\u4f8b\u7a0b\uff0c\u5206\u522b\u53eb Merging Arrays, Loop Interchange, Blocking, \u548c Loop Merging\u3002\u7b80\u5355\u7684\u76f4\u63a5\u7528\u6587\u5b57\u63cf\u8ff0\u4e86\u3002
Merging Arrays
\u6bd4\u5982\u6211\u4eec\u9700\u8981\u8bbf\u95ee\u7684\u662fa[100], b[100], \u5728\u540c\u4e00\u4e2a\u5faa\u73af\u91cc\u8fde\u7eed\u8bbf\u95eea[i] b[i]\u5373\u4e0b\u6807\u76f8\u540c\u7684\u9879\uff0ccache\u5982\u679c\u4e00\u6b21\u6027\u653e\u4e0d\u4e0b\u4e24\u4e2a\u6570\u7ec4\uff0c\u5c31\u4f1a\u4e24\u4e2a\u6570\u7ec4\u4ea4\u66ff\u4ece\u5185\u5b58\u91cc\u53d6\u51fa\u6765\u653e\u5230cache\u91cc\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u8bbe\u8ba1\u6210\u4e00\u4e2a\u7ed3\u6784\u4f53\u6570\u7ec4struct ab { a[100], b[100] }\uff0c\u8fd9\u6837 cache \u53ef\u4ee5\u628a a \u548c b \u76f8\u90bb\u5730\u62ff\u8fdb\u6765\u3002\u51cf\u5c11miss\u3002
Loop Interchange
e.g.
/* Before: \u5916\u884c\u5185\u5217\uff0c\u4e00\u884c\u53ef\u4ee5\u4e00\u6b21\u88ab\u653e\u8fdb\u5185\u5b58 */\nfor (k = 0; k < 100; k = k+1)\nfor (j = 0; j < 100; j = j+1)\nfor (i = 0; i < 5000; i = i+1)\nM[i][j] = 2 * M[i][j];\n/* After: \u5916\u5217\u5185\u884c */\nfor (k = 0; k < 100; k = k+1)\nfor (i = 0; i < 5000; i = i+1)\nfor (j = 0; j < 100; j = j+1)\nM[i][j] = 2 * M[i][j];\n
\u4fee\u6539\u540e\u7684cache\u547d\u4e2d\u7387\u53d8\u9ad8\u4e86\uff0c\u56e0\u4e3a\u4ea4\u6362\u540e\u5bf9\u5185\u5b58\u7684\u8bbf\u95ee\u662f\u8fde\u7eed\u7684\u3002\u4e00\u822c\u662f\u884c\u5bf9\u9f50\u7684\uff0c\u6700\u4f4e\u7ef4\u662f\u76f8\u90bb\u7684\u3002
Blocking
\u9002\u5f53\u62c6\u5206\u8fd0\u7b97\uff0c\u4ee5\u914d\u5408cache\u5927\u5c0f\u3002e.g. \u77e9\u9635\u76f8\u4e58\u4f8b\u5b50\u3002
/* Before */\nfor (i = 0; i < N: i += 1)\nfor (j = 0; j < N; j += 1) {\nr = 0; for (k = 0; k < N; k +=1 )\nr = r + y[i][k] * z[k][j]; }\n/* After */\nfor (jj = 0 ; jj < N; jj = jj+B)\nfor (kk = 0; kk < N; kk = kk +B) {\n// ...\u8bb0\u4e0d\u6e05\u4e86\nfor (ii = 0; ii < B; ii ++) {\n// \u603b\u4e4b\u8fd9\u4e2a\u5185\u5c42\u5faa\u73af\u53ea\u5904\u7406\u4e00\u4e2a B * B \u7684 block\uff0c\u5176\u4e2d block \u662f cache \u80fd\u653e\u4e0b\u7684\u5927\u5c0f\n}\n}\n
\u90a3\u4e48\u4f18\u5316\u524d cache \u9700\u8981\u66ff\u6362\u66f4\u591a\u6b21\uff0c\u56e0\u4e3a\u4e0d\u8bba\u662f\u884c\u5faa\u73af\u8fd8\u662f\u5217\u5faa\u73af\uff0c\u8d85\u8fc7 B \u4e4b\u540e cache \u90fd\u8981\u91cd\u65b0\u5199\u4e00\u904d\u3002\u7136\u540e\u4e0b\u6b21\u5199\u5230\u8fd9\u4e2a block \u65f6\u518d\u6362\u8fdb\u6765\u4e00\u6b21\u3002 \u4f18\u5316\u540e\u6bcf\u6b21\u5bf9\u6bcf\u4e00\u4e2a block \u4e00\u6b21\u6027\u5b8c\u6210\u64cd\u4f5c\u3002
Loop Merging
\u6bd4\u5982\u6709\u4e24\u4e2a\u5faa\u73af\u7684\u5faa\u73af\u8d77\u6b62\u6761\u4ef6\u4e00\u6837\uff0c\u90a3\u4e48\u5c31\u4e0d\u8981\u5f00\u4e24\u4e2a\u5faa\u73af\u4e86\uff0c\u5408\u5e76\u5230\u4e00\u4e2a\u5faa\u73af\u91cc\u5b8c\u6210\u3002
"},{"location":"docs/1-cs/architecture/chap2/#parallelism","title":"Parallelism","text":"Non-blocking Caches
cache miss\u65f6, \u7b49\u5f85\u5185\u5b58\u5199\u56de\u65f6\u7ee7\u7eed\u505a\u522b\u7684\u6ca1\u6709\u51b2\u7a81\u7684\u4e8b\u60c5\uff0c\u4e0d\u5fc5\u8981\u8ba9\u6240\u6709\u7684\u8d44\u6e90\u90fd\u7b49\u5f85\u5185\u5b58\u3002\u53ef\u4ee5\u8ba9\u522b\u7684\u5757\u5148\u5b8c\u6210\u522b\u7684\u6307\u4ee4\u7684\u9700\u6c42\u3002\u6bd4\u5982\u5728\u5904\u7406write miss\u7684\u65f6\u5019\uff0c\u5141\u8bb8\u5904\u7406read hit\u3002
\u4e3b\u8981\u7528\u4e8eout of order\uff08\u4e71\u5e8f\uff09\u7684\u5904\u7406\u5668\u4e0a\u3002
ppt \u7ed9\u7684\u5b9a\u4e49\u662f\uff1aallows cache to continues to supply hits while processing read misses (hit under miss, hit under multiple miss)
Hardware Prefetching of Instr/Data
\u53ef\u4ee5\u7531\u786c\u4ef6\u63a7\u5236\u6570\u636e\u9884\u53d6\uff0c\u4e00\u79cd\u7c7b\u4f3c branch-prediction \u7684\u505a\u6cd5\u3002\u9884\u6d4b\u5e76\u63d0\u524d\u53d6\u51fa\u53ef\u80fd\u9700\u8981\u7528\u5230\u7684\u6570\u636e\u653e\u5230cache\u91cc\u3002
\u4f7f\u7528prefetching\u7684\u524d\u63d0\u662f\u6307\u4ee4\u662f\u5e76\u884c\u7684\uff0ccache \u4e5f\u662f non-blocking \u7684\u3002
Compiler Controlled Prefetching
\u4e0a\u9762\u4e00\u6761\u9884\u53d6\u65b9\u6cd5\uff0c\u4e5f\u53ef\u4ee5\u7531\u7a0b\u5e8f\u5458\u548c\u7f16\u8bd1\u5668\u624b\u52a8\u6307\u5b9a\u54ea\u4e9b\u5185\u5bb9\u5e94\u8be5\u88ab\u653e\u5230cache\u3002
"},{"location":"docs/1-cs/architecture/chap2/#hit-time","title":"Hit Time","text":"Small & Simple Caches
\u6bd4\u5982\u5c31\u9488\u5bf9 cache \u672c\u8eab\uff0c\u51cf\u5c0f cache \u7684\u590d\u6742\u5ea6\u4ee5\u51cf\u5c0f\u7ec4\u5408\u903b\u8f91\u7684\u5ef6\u8fdf\u3002\u5f53\u7136\u7531\u4e8e\u6211\u4eec\u4e4b\u524d\u8ba8\u8bba\u8fc7\u7684 cache \u4e09\u4e2a\u6307\u6807\u7684\u76f8\u4e92\u5236\u7ea6\uff0c\u662f\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5176\u5b83\u4e24\u4e2a\u6307\u6807\u53d8\u4e0d\u597d\u7684\u3002
Avoiding Address Translation
\u8fd9\u91cc\u9700\u8981\u5206\u522b\u56de\u5fc6\u4e00\u4e0b cache \u6807\u8bb0\u4f4d\u7684\u7ed3\u6784\u548c OS \u91cc\u7684\u9875\u8868\u9879\u3002\u4e00\u822c\u672c\u8bfe\u7a0b\u4e2d\u4f7f\u7528\u7684 cache \u8bbe\u8ba1\u89c4\u5219\u90fd\u662f \"physically tagged, virtually indexed\"(PTVI)\uff0c\u610f\u601d\u662f\uff0c\u7528\u4e8e\u67e5\u627e cache block \u7684 tag \u6574\u4e2a\u5168\u90fd\u5728 page offset \u91cc\uff0c\u8fd9\u5757 offset \u5b57\u6bb5\u5bf9\u4e8e\u865a\u62df\u5730\u5740\u548c\u7269\u7406\u5730\u5740\u6765\u8bf4\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff0c\u53ea\u6709 page number \u9700\u8981\u9001\u8fdb tlb \u53bb\u5bfb\u627e\u7269\u7406\u5e27\u53f7\u3002\u5982\u56fe\u3002
\u5982\u679c\u4e4b\u524d\u7684\u505a\u6cd5\u662f cache \u7b49\u5230\u7269\u7406\u5e27\u53f7\u627e\u51fa\u6765\u3001\u5730\u5740\u7ffb\u8bd1\u5b8c\u518d\u53bb\u67e5\u627e\uff0c\u5c31\u592a\u6162\u4e86\u3002\u65e2\u7136 tag \u4e0d\u7528\u7b49\u5230\u5730\u5740\u7ffb\u8bd1\u5c31\u80fd\u62ff\u5230\uff0c\u53ef\u4ee5\u4f7f\u5730\u5740\u7ffb\u8bd1\u548c cache \u67e5\u627e\u540c\u65f6\u8fdb\u884c\u3002
Pipelined Cache Access
\u56e0\u4e3a cache management unit \u7684\u64cd\u4f5c\u5206\u4e3a\u597d\u591a\u6b65\uff0c\u53ef\u4ee5\u628a\u6bcf\u6b65\u53bb\u50cf\u6d41\u6c34\u7ebf\u4e00\u6837\u5e76\u884c\u3002\u7f3a\u70b9\u662f\u4f1a\u589e\u52a0\u7cfb\u7edf\u5f00\u9500\uff0c\u5bfc\u81f4 hit_time \u589e\u52a0\uff0c\u4f46\u662f\u597d\u5904\u662f\u524d\u9762\u7684\u6307\u4ee4 miss \u65f6\uff0c\u4e0b\u4e00\u6761\u6307\u4ee4\u53ef\u4ee5\u5e76\u884c\u3002
Multi-banked Cache
\u5c06\u591a\u8def\u7ec4\u5173\u8054\u7684\u6bcf\u4e00\u8def\u7684\u67e5\u627e\u5e76\u884c\u3002
ppt \u7ed9\u7684\u5b9a\u4e49\u662f\uff1acache is divided into independent banks that can support simultateous accesses like interleaved memory banks.
Trace Cache
\u6838\u5fc3\u903b\u8f91\u662f\u7f13\u5b58\u903b\u8f91\u4e0a\u7684\u6307\u4ee4\u6d41\uff0c\u800c\u4e0d\u662f\u7f13\u5b58\u7269\u7406\u5730\u5740\u7684\u6307\u4ee4\u6d41\uff0c\u4ece\u800c\u52a0\u5feb\u6307\u4ee4\u7684\u9884\u53d6\u3002\u6bd4\u5982\u5206\u652f\u6307\u4ee4\u4e2d\u4e0d\u53bb\u9884\u6d4b\u91cc cache \u4e0d\u4f1a\u547d\u4e2d\u7684\u5206\u652f\uff0c\u8fd9\u6837\u8282\u7701\u4e86 cache \u7a7a\u95f4\uff0c\u4e5f\u8ba9\u76f8\u90bb\u7684\u6307\u4ee4\u5728 cache \u4e2d\u4e5f\u76f8\u90bb\u3002\u6211\u7684\u7406\u89e3\u5b83\u7684\u610f\u601d\u662f\u628a prediction \u7684\u529f\u80fd\u9001\u7ed9\u4e86 cache\uff0c\u5982\u679c\u5206\u652f\u9884\u6d4b\u9884\u6d4b\u5230\u4e86\u67d0\u4e2a\u8df3\u8f6c\u6307\u4ee4\u4f1a\u53d1\u751f\uff0c\u90a3\u4e48 cache \u5c31\u53bb\u9884\u53d6\u53d1\u751f\u7684\u5206\u652f\u540e\u9762\u7684\u6570\u636e\u3002
"},{"location":"docs/1-cs/architecture/chap3/","title":"chap3: Instruction-level Parallelism (ILP)","text":":material-circle-edit-outline: \u7ea6 1058 \u4e2a\u5b57 :fontawesome-solid-code: 9 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap3/#_1","title":"\u76ee\u5f55","text":"Note
\u662f\u5199\u5f97\u7b80\u5355\u70b9\u4e86\u54c8\u3002\u5199\u4e0d\u52a8\u4e86\u3002\u8981\u4e0d\u5927\u5bb6\u770b\u8ba1\u7ec4\u738b\u9053\u597d\u4e86\u3002
\u4e09\u79cd\u7ade\u4e89
\u6570\u636e\u7ade\u4e89 Data Hazard \u5206\u4e3a\uff08\u6ce8\u610f\u4e0b\u9762\u547d\u540d\u65b9\u6cd5\u90fd\u662f\u6309\u201c\u672c\u5e94\u53d1\u751f\u7684\u987a\u5e8f\u201d\uff0c\u6bd4\u5982 RAW \u5c31\u662f\u6307\uff0c\u6b63\u5e38\u7684\u8fd0\u884c\u987a\u5e8f\u5c31\u662f\u5148\u5199\u540e\u8bfb\u3002\uff09
\u7ed3\u6784\u7ade\u4e89 Structural Hazard \u662f\u6307\u5982\u679c\u4e24\u4e2a\u6307\u4ee4\u9700\u8981\u540c\u65f6\u7528\u540c\u4e00\u4e2a Function Unit\uff0c\u6bd4\u5982\u540c\u65f6\u7528\u4e00\u4e2a\u9700\u8981\u4e24\u65f6\u949f\u5468\u671f\u624d\u80fd\u7b97\u5b8c\u7684 ALU\uff0c\u7ed3\u679c\u8be5 Function Unit \u53ea\u6709\u4e00\u4e2a\uff0c\u90a3\u4e48\u540e\u6765\u7684\u6307\u4ee4\u5c31\u5f97\u7b49\u5148\u6765\u7684\u6307\u4ee4\u7b97\u5b8c\u624d\u80fd\u53bb\u7b97\u3002
\u63a7\u5236\u7ade\u4e89 Control Hazard \u662f\u6307\u5982\u679c\u9047\u5230\u8df3\u8f6c\u6307\u4ee4\uff0c\u7ed3\u679c\u7528\u4e8e\u5224\u65ad\u8df3\u8f6c\u6761\u4ef6\u7684\u5bc4\u5b58\u5668\u503c\u8fd8\u6ca1\u597d\uff0c\u5c31\u9700\u8981\u7b49\u5bc4\u5b58\u5668\u51c6\u5907\u597d\u624d\u80fd\u77e5\u9053\u8df3\u4e0d\u8df3\uff0c\u90a3\u5c31\u9700\u8981\u505c\u4e0b\u7b49\u3002
\u6d41\u6c34\u7ebf\u7c7b\u578b
\u5355\u5468\u671f\u6d41\u6c34\u7ebf \u4ee5\u8017\u65f6\u6700\u957f\u7684\u4e00\u4e2a\u9636\u6bb5\u7684\u7528\u65f6\u4e3a\u673a\u5668\u5468\u671f\u3002 \u6240\u6709\u6307\u4ee4\u8dd1\u5b8c\u7528\u65f6\u7684\u8ba1\u7b97\uff1a(\u6307\u4ee4\u6570 + \u9636\u6bb5\u6570 - 1) * \u673a\u5668\u5468\u671f\u3002\u7406\u89e3\u8d77\u6765\u5c31\u662f\u53ea\u6709\u7b2c\u4e00\u6761\u6307\u4ee4\u7684\u524d n-1 \u4e2a\u5468\u671f\u6ca1\u6709\u6307\u4ee4\u5b8c\u6210\uff0c\u4e4b\u540e\u6bcf\u4e2a\u5468\u671f\u90fd\u5b8c\u6210\u4e00\u6761\u6307\u4ee4\u3002
\u591a\u5468\u671f\u6d41\u6c34\u7ebf \u4f1a\u8003\u586b\u8868\u9898\u3002\u5c31\u662f\u90a3\u79cd\u4e58\u6cd5\u7b49 6 \u4e2a\u5468\u671f\u9664\u6cd5\u7b49 24 \u4e2a\u7684\u3002lab \u91cc\u4f1a\u590d\u4e60\u5230\u3002
\u8fd8\u6709\u4e0b\u56fe\u8fd9\u51e0\u79cd
\u770b\u7684\u65f6\u5019\u6ce8\u610f\u603b\u7ed3\u4e00\u4e0b\u6bcf\u4e00\u79cd\u7684 CPI \u662f\u5927\u4e8e\u7b49\u4e8e\u8fd8\u662f\u5c0f\u4e8e 1\u3002\u6211\u603b\u7ed3\u4e0d\u51fa\u6765\u4e86\u3002
"},{"location":"docs/1-cs/architecture/chap3/#ilp_1","title":"ILP \u5728\u4f53\u7cfb\u91cc\u5b66\u7684\u4e09\u79cd\u7b97\u6cd5","text":"Note
\u672c\u6765\u8fd9\u5757\u8be5\u5199\u7684\u4f46\u662f\u6211\u5199\u4e0d\u52a8\u4e86
\u76f4\u63a5\u53bb bing \u641c\u7d22 (1)Scoreboard, (2)Tomasulo, (3)Tomasulo w speculation, \u53bb\u627e\u4e00\u4e2a\u5357\u5927\u540c\u5b66\u5199\u7684\u77e5\u4e4e\u5e16\u5b50\uff0c\u6211\u662f\u770b\u8fd9\u5957\u5e16\u5b50\u770b\u61c2\u7684\u3002\u8fd8\u6709 lab \u91cc\u8fd9\u5757\u7684\u5b9e\u9a8c\u4e5f\u80fd\u5e2e\u52a9\u7406\u89e3\u3002
\u8bf7\u518d\u7ed3\u5408\u8fd9\u5f20\u56fe\u8bb0\u5fc6\u4e00\u4e0b\uff1a
\u8fd8\u6709\u4e00\u4e2a\u4e0a\u8ff0\u8d44\u6599\u4f3c\u4e4e\u6ca1\u8bb2\u5230\u7684\u70b9\uff0c\u5173\u4e8e ISSUE \u65f6\u673a\uff0c\u6211\u8bb0\u5f97\u662f - Scoreboard: \u9700\u8981\u7684 Function Unit \u4e3a\u7a7a\uff0c\u4e14\u9700\u8981\u5199\u7684 Reg State \u6ca1\u6709\u522b\u7684\u6307\u4ee4\u8fd8\u51c6\u5907\u5199\uff08\u907f\u514d WAW\uff09\u65f6\u3002 - Tomasulo: Reservation Station \u6709\u7a7a\u65f6\u3002 - Tomasulo w ROB (\u5373 w speculation): Reservation Station \u548c ROB \u90fd\u7a7a\u65f6\u3002
Warning
\u4f46\u662f\u4e0a\u8ff0 Tomasulo w ROB \u4f3c\u4e4e\u8ddf\u6211\u8003\u7684\u4e00\u4e2a\u671f\u672b\u9898\u4e0d\u517c\u5bb9\uff0c\u4e0d\u77e5\u9053\uff0c\u7b49\u540e\u4eba\u6765\u4e3a\u6211\u6307\u51fa
"},{"location":"docs/1-cs/architecture/chap3/#branch-prediction","title":"Branch prediction","text":"\u56de\u5fc6 control hazard\uff0c\u6d41\u6c34\u7ebf CPU \u9047\u5230\u8df3\u8f6c\u8bed\u53e5\u5982\u679c\u5224\u65ad\u6761\u4ef6\u8fd8\u6ca1\u5c31\u7eea\uff0c\u5c31\u9700\u8981\u7b49\u64cd\u4f5c\u6570\u624d\u80fd\u7ee7\u7eed\u5f80\u4e0b\u8d70\u3002\u6211\u4eec\u60f3\u8ba9 CPU \u968f\u4fbf\u5148\u731c\u4e00\u4e2a\u5f80\u4e0b\u8d70\u7740\uff0c\u5982\u679c\u7b49\u64cd\u4f5c\u6570\u51c6\u5907\u597d\u53d1\u73b0\u731c\u9519\u4e86\uff0c\u5927\u4e0d\u4e86\u518d\u6390\u6389\uff0c\u731c\u5bf9\u4e86\u90a3\u5c31\u8282\u7ea6\u65f6\u95f4\u4e86\u3002
\u731c\u7684\u6839\u636e\u6709\u4ec0\u4e48\u5462\uff0c\u786e\u5b9e\u6709\u6839\u636e\uff0c\u7edf\u8ba1\u8868\u660e\u5927\u90e8\u5206\u7a0b\u5e8f\u91cc\u53d1\u751f\u8df3\u8f6c\uff08branch taken\uff09\u548c\u4e0d\u53d1\u751f\u8df3\u8f6c\uff08branch not taken\uff09\u7684\u6570\u76ee\u662f\u4e25\u91cd\u4e0d\u6210\u6bd4\u4f8b\u7684\uff0c\u7ecf\u5e38\u5176\u4e2d\u4e00\u4e2a\u53ef\u80fd\u80fd\u5360\u5230 90% \u591a\u7684\u60c5\u51b5\u3002\u90a3\u4e48\uff0c\u5047\u8bbe\u5982\u679c\u77e5\u9053\u4e4b\u524d\u5f88\u591a\u8df3\u8f6c\u8bed\u53e5\u90fd\u8df3\u4e86\uff0c\u63a5\u4e0b\u6765\u53d1\u751f\u7684\u8df3\u8f6c\u8bed\u53e5\u4e5f\u5927\u6982\u7387\u4f1a\u8df3\u3002
\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u8bbe\u8ba1\u4e00\u4e2a\u72b6\u6001\u673a\uff0c\u6709\u56db\u79cd\u7f16\u7801 00(\u5f88\u53ef\u80fd\u8df3) 01(\u5e94\u8be5\u8df3\u5427) 10(\u5e94\u8be5\u4e0d\u8df3\u5427) 11(\u5f88\u53ef\u80fd\u4e0d\u8df3)\uff0c\u5982\u679c\u72b6\u6001\u673a\u5728 00 \u548c 01 \u72b6\u6001\u5c31\u9884\u6d4b\u4e0b\u4e00\u6b21\u4e5f\u8df3\u8f6c\uff0c\u5982\u679c\u72b6\u6001\u673a\u5728 10 \u548c 11 \u5c31\u9884\u6d4b\u4e0b\u4e00\u6b21\u4e0d\u8df3\u8f6c\u3002
\u800c\u72b6\u6001\u8f6c\u79fb\u662f\u8fd9\u6837\u53d1\u751f\u7684\uff1a
Note
\u6211\u77e5\u9053 mkdocs \u5e94\u8be5\u6e32\u4e0d\u4e86 mermaid\uff0c\u4f46\u662f\u6211\u61d2\uff0c\u8bf7\u5927\u5bb6\u8111\u6e32\u4e00\u4e0b\u3002\u3002\u6216\u8005\u770b\u81ea\u5df1\u8001\u5e08 ppt\u3002\u3002\u662f\u4e00\u4e2a\u6709\u56db\u4e2a\u72b6\u6001\u7684\u7ea2\u7ea2\u84dd\u84dd\u7684\u72b6\u6001\u673a
graph LR\n00 --(\u672c\u6b21\u8df3\u4e86)--> 00\n00 --(\u672c\u6b21\u6ca1\u8df3)--> 01\n01 --(\u672c\u6b21\u8df3\u4e86)--> 00\n01 --(\u672c\u6b21\u6ca1\u8df3)--> 10\n10 --(\u672c\u6b21\u8df3\u4e86)--> 01\n10 --(\u672c\u6b21\u6ca1\u8df3)--> 11\n11 --(\u672c\u6b21\u8df3\u4e86)--> 10\n11 --(\u672c\u6b21\u6ca1\u8df3)--> 11\n
\u8ba1\u7b97\u9898\u4f1a\u8003\u4f7f\u7528\u8fd9\u6837\u7684 branch prediction\uff0c\u9884\u6d4b\u5931\u8bef\u7684\u6982\u7387\u662f\u591a\u5c11\u3002
"},{"location":"docs/1-cs/architecture/chap5/","title":"chap5: Thread-level Parallelism","text":":material-circle-edit-outline: \u7ea6 381 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap5/#_1","title":"\u76ee\u5f55","text":"\u4e0d\u77e5\u9053\u600e\u4e48\u63cf\u8ff0\u7684\u4e24\u4e2a\u672f\u8bed
Note
\u8ba1\u7ec4\u738b\u9053\u6709\u4e00\u7ae0\u4e13\u95e8\u8bb2\u3002\u5176\u5b83\u8bf7\u901a\u8fc7\u738b\u9053\u5b66\u4e60\uff0c\u8fd8\u6709\u59dc\u8001\u5e08 ppt \u4e5f\u6709\u4e00\u4e2a\u5c0f\u603b\u7ed3\u7684\u8868\u683c\u3002
\u6982\u5ff5 \u5168\u540d \u7279\u70b9 \u4f18\u70b9 UMA uniform memory access \u6bcf\u4e2a\u8282\u70b9\u5230 memory \u7684\u8bbf\u95ee\u65f6\u95f4\u4e00\u81f4 NUMA non-uniform memory access \u6bcf\u4e2a\u8282\u70b9\u5230 memory \u7684\u8bbf\u95ee\u65f6\u95f4\u4e0d\u4e00\u81f4\uff0c\u5230\u81ea\u5df1\u7684\u5feb\uff0c\u5230\u522b\u4eba\u7684\u6162 \u6269\u5c55\u5230\u66f4\u5927\u89c4\u6a21\u4e0a\u7684\u53ef\u6269\u5c55\u6027\u5f3acache \u4e00\u81f4\u6027\u7684\u672f\u8bed
\u5982\u679c CPU \u6709\u591a\u4e2a\u6838\uff0c\u6216\u8005\u5982\u679c CPU \u662f\u5206\u5e03\u5f0f\u7684\uff0c\u5b83\u4eec\u5171\u7528\u4e00\u4e2a cache\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u4f7f cache \u5bf9\u6240\u6709\u6838/\u8282\u70b9\u7684\u8bfb\u5199\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u6bd4\u5982\u4e00\u4e2a\u6838/\u8282\u70b9\u5199\u7684\u4e1c\u897f\u5bf9\u5176\u5b83\u6838/\u8282\u70b9\u53ef\u89c1\uff0c\u5176\u5b83\u6838/\u8282\u70b9\u770b\u89c1\u7684\u90fd\u662f\u6700\u65b0\u7684\u3002
\u672f\u8bed \u4e00\u53e5\u8bdd\u5b9a\u4e49\uff08\u5728 ppt \u4e0a\u53d1\u73b0\u7684\uff0c\u4f46\u662f\u4e2a\u4eba\u611f\u89c9\u4e0d\u592a\u51c6\u786e\uff09 \u5173\u6ce8\u7684\u65b9\u9762\u662f\uff08\u8fd9\u680f from \u8bfe\u672c\u66f4\u51c6\u786e\uff0c\u4f46\u4e0d\u662f\u4e00\u53e5\u8bdd\u5b9a\u4e49\uff09 coherence Memory accesses executed by each processor were kept in order. reads and writes to the same location consistency Memory accesses among different processors were interleaved. reads and writes wrt other memory locations"},{"location":"docs/1-cs/architecture/chap5/#cache_1","title":"\u8fbe\u6210 cache \u4e00\u81f4\u6027\u4e24\u4e2a\u534f\u8bae","text":"Note
\u806a\u660e\u7684\u8bfb\u8005\u5df2\u7ecf\u53d1\u73b0\u6211\u5df2\u7ecf\u4e0d\u60f3\u5199\u4e86
Snooping\u534f\u8bae
Note
\u8bf7\u901a\u8fc7\u81ea\u5df1\u73ed\u8001\u5e08 ppt \u5b66\u4e60\uff1aMOESI \u72b6\u6001\u673a + \u4f8b\u9898\u8868\u683c \u4e24\u4e2a\u56fe
Directory\u534f\u8bae
Note
\u8bf7\u901a\u8fc7\u81ea\u5df1\u73ed\u8001\u5e08 ppt \u5b66\u4e60: \u4f8b\u9898\u8868\u683c \u4e00\u4e2a\u56fe
"},{"location":"docs/1-cs/compiler/","title":"Compiler","text":":material-circle-edit-outline: \u7ea6 56 \u4e2a\u5b57
\u662f ZJU \u7f16\u8bd1\u539f\u7406\u7b14\u8bb0\u3002\u4f5c\u4e3a xyx \u4e8b\u65e0\u5de8\u7ec6\u7248\u672c\u7684\u7b14\u8bb0\uff08\u53ef\u5728\u672c\u7ad9\u9996\u9875\u627e\u5230\uff09\u7684\u8865\u5145\uff0c\u6211\u505a\u4e86\u4e00\u4e9b\u6211\u505a\u9898\u65f6\u9700\u901f\u67e5\u7684\u8d44\u6599\u7684\u6574\u7406\u3002
\u8fdb\u5ea6\uff1a
:material-circle-edit-outline: \u7ea6 788 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
\u672c\u9875\u5b8c\u6210\u4e86\u5173\u4e8e LL(1), LR(0), SLR (aka. SLR(1)), LR(1), LALR(1) \u6587\u6cd5\u7684\u4e00\u4e9b\u5e38\u7528\u533a\u522b\u7684\u6574\u7406\u3002\u7531\u4e8e\u4f5c\u8005\u4e5f\u5b66\u5f97\u4e0d\u597d\uff0c\u5982\u679c\u6709\u9519\uff0c\u8bf7\u5411\u6211\u6307\u51fa\uff08\u53ef\u60dc\u8bc4\u8bba\u533a\u6211\u8fd8\u6ca1\u7814\u7a76\u597d\u600e\u6837\u914d\uff0c\u4e00\u5b9a\u5c3d\u5feb\u914d\u4e0a\uff0c\u53ef\u4ee5\u5148\u5176\u5b83\u9014\u5f84\u8054\u7cfb\u6211\uff09\u3002
\u672c\u9875\u9762\u5199\u4f5c\u65f6\u7684\u7279\u70b9\u662f\u5c3d\u91cf\u7528\u81ea\u7136\u8bed\u8a00\u6765\u63cf\u8ff0\u7279\u70b9\uff0c\u800c\u4e0d\u662f latex \u6570\u5b66\u516c\u5f0f\u548c\u56fe\u50cf\u3002\u539f\u56e0\u662f\u6211\u5728\u5176\u5b83\u8d44\u6599\u641c\u5230\u7684\u8bb2\u89e3\u90fd\u4e8b\u65e0\u5de8\u7ec6\u7528\u5927\u91cf\u516c\u5f0f\u548c\u56fe\u50cf\uff0c\u4f7f\u7406\u89e3\u53d8\u5f97\u5bb9\u6613\uff0c\u4f46\u4e0d\u9002\u5408\u901f\u67e5\u548c\u8bb0\u5fc6\u3002\u76f4\u767d\u4e00\u70b9\u8bf4\u5c31\u662f\u7b14\u8005\u4e0d\u60f3\u770b\u5230\u5b83\u4eec\uff0c\u4e00\u770b\u5c31\u5934\u75bc\u3002\u56e0\u6b64\u4e5f\u9020\u6210\u4e86\u672c\u6587\u6863\u7684\u4e00\u4e2a\u7f3a\u70b9\uff1a\u4e0d\u662f\u4e3a\u521d\u5b66\u8005\u8bbe\u8ba1\u7684\u3002\u521d\u5b66\u8005\u63a8\u8350\u9605\u8bfb xyx \u7684\u7b14\u8bb0\u3002\u505a\u9898\u65f6\u901f\u67e5\u8bb0\u5fc6\u53ef\u4ee5\u770b\u672c\u6587\u6863\u3002
\u600e\u6837\u5224\u65ad\u6587\u6cd5\u662f...\u4e0d\u662f...
\u6587\u6cd5 \u5224\u65ad\u662f \u5224\u65ad\u4e0d\u662f LL(1) (\u4e0d\u542b\u5de6\u9012\u5f52 && \u5bf9\u4e8e\u6587\u6cd5\u4e2d\u6bcf\u4e00\u4e2a non-terminal\uff0c\u5b83\u7684\u4ea7\u751f\u5f0f\u7684 SELECT set\uff08\u5373\u5f00\u5934\u7684 terminal \u4e0e\u5f00\u5934\u7684 non-terminal \u7684 FIRST\uff09\u4e24\u4e24\u4e0d\u4ea4\uff0c\u4e14\u4e0d\u80fd\u540c\u65f6\u63a8\u51fa\u7a7a\u4e32) || \u4ea7\u751f\u5f0f lhs \u4e24\u4e24\u4e0d\u76f8\u540c \u542b\u5de6\u9012\u5f52 || \u9047\u5230\u4e0b\u4e00\u4e2a\u8981\u626b\u63cf\u7684 terminal \u8f93\u5165\u65f6\uff0c\u6709\u8d85\u8fc7\u4e00\u79cd derive \u65b9\u6cd5 LR(0) \u6784\u9020\u51fa LR(0) items DFA\uff0c\u5982\u679c\u4e0d\u5b58\u5728 shift-reduce & reduce-reduce conflicts LR(0) items DFA \u5b58\u5728 shift-reduce | reduce-reduce conflicts SLR (aka. SLR(1)) \u6784\u9020\u51fa LR(0) items DFA\uff0c\u9996\u5148\u5176\u4e0d\u5b58\u5728 reduce-reduce \u51b2\u7a81\uff0c\u4e14\u5b58\u5728 shift-reduce \u51b2\u7a81\uff08\u5426\u5219\u5c31\u4e3a LR(0) \u8bed\u6cd5\u4e86\uff09\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u6709 shift-reduce \u51b2\u7a81\u7684\u5730\u65b9\uff0c\u72b6\u6001\u91cc\u9762\u6709\u53ef shift \u89c4\u5219\u4e5f\u6709\u53ef reduce \u89c4\u5219\uff0c\u5982\u679c reduce \u540e\u5f97\u5230\u7684 non-terminal \u7684 FOLLOW set \u4e0e\u53ef shift \u89c4\u5219\u65b0\u7eb3\u5165\u7684 terminal \u90fd\u6ca1\u6709\u4ea4 shift-reduce conflict \u4e2d\u5982\u679c reduce \u540e\u5f97\u5230\u7684 non-terminal \u7684 FOLLOW set \u4e0e\u53ef shift \u89c4\u5219\u65b0\u7eb3\u5165\u7684 terminal \u6709\u4ea4 LR(1) \u6784\u9020\u51fa LR(1) items DFA\uff0c\u5982\u679c\u4e0d\u5b58\u5728 shift-reduce & reduce-reduce conflicts LR(1) items DFA\uff0c\u5982\u679c\u5b58\u5728 shift-reduce | reduce-reduce conflicts LALR(1) \u6784\u9020\u51fa LR(1) items DFA\uff0c\u5982\u679c\u5408\u5e76\u540c\u5fc3\u96c6\u540e\u6ca1\u6709\u4ea7\u751f reduce-reduce conflicts\uff08\u4e00\u5b9a\u4e0d\u4f1a\u4ea7\u751f shift-reduce conflicts\uff0c\u540c\u5fc3\u96c6\u4e0d\u957f\u90a3\u6837\uff09 LR(1) items DFA \u5982\u679c\u5408\u5e76\u540c\u5fc3\u96c6\u540e\u4ea7\u751f\u4e86 reduce-reduce conflicts\u5927\u5bb6\u7684 items DFA \u600e\u4e48\u753b...
\u6587\u6cd5 items DFA LL(1) \u5b83\u6ca1\u6709\u2026 LR(0) \u5148\u753b NFA\uff1a\u6240\u6709 shift \u7684\u60c5\u51b5\u9760\u8bfb\u53d6 non-terminal/terminal \u8f6c\u6362\uff0c\u6240\u6709 reduce \u7684\u60c5\u51b5\u7a7a\u8f6c\u79fb\u3002\u7136\u540e\u753b DFA\uff1a\u628a\u7a7a\u8f6c\u79fb\u5408\u5e76\u3002 SLR (aka. SLR(1)) \u540c\u753b LR(0)\u3002\u53ea\u662f\u591a\u5224\u65ad\u4e00\u4e0b shift-reduce conflict \u7684 FOLLOW \u548c terminal \u91cd\u5408\u60c5\u51b5\uff0c\u4f46\u8fd9\u4e2a\u53ea\u4f53\u73b0\u5728 parse table\uff0c\u4e0d\u5c5e\u4e8e DFA \u5173\u5fc3\u7684\u4e8b\u3002 LR(1) \u5176\u5b83\u6b65\u9aa4\u540c\u753b LR(0)\uff0c\u53ea\u662f\u591a\u4e86\u5728\u6240\u6709 items \u540e\u9762\u7528\u9017\u53f7\u9694\u5f00\u4e00\u4e2a lookahead symbol\u3002lookahead \u7684\u9009\u62e9\u5f88\u50cf\u9009\u62e9\u4e86\u5bf9\u5e94\u4ea7\u751f\u5f0f\uff08\u4e0d\u8bba\u662f lhs/rhs\uff09\u7684 FOLLOW set\uff0c\u5373\u5bf9\u5e94\u4ea7\u751f\u5f0f\u4e4b\u540e\u63a5\u7684 terminal \u662f\u4ec0\u4e48\u3002 LALR(1) \u540c\u753b LR(1)\u3002\u53ea\u662f\u9700\u8981\u5408\u5e76\u6240\u6709\u540c\u5fc3\u96c6\uff0c\u540c\u5fc3\u96c6\u662f\u6307\u4ea7\u751f\u5f0f\u76f8\u540c\u4f46\u662f\u53ea\u6709 lookahead symbol \u4e0d\u540c\u7684\u90a3\u4e9b\u72b6\u6001\u3002\u5927\u5bb6\u7684 parse table \u600e\u4e48\u753b...
\u6587\u6cd5 parse table LL(1) non-terminals, nullable, FIRST, FOLLOW LR(0) states, shift&reduce, goto SLR (aka. SLR(1)) states, shift&reduce, goto LR(1) states, shift&reduce, goto LALR(1) states, shift&reduce, goto"},{"location":"docs/1-cs/database/","title":"DBMS","text":":material-circle-edit-outline: \u7ea6 360 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/database/#whats-this","title":"what's this","text":"\u8fd9\u91cc\u662f\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u7406\u8bba\u8bfe\u3002
content table:
\u4e00\u4e9b\u4e0e\u8003\u8bd5\u6709\u5173\u7684\u504f\u95e8\u4e1c\u897f\u3002
\u4e00\u4e2a\u671f\u672b\u8003\u70b9\uff1a\u6570\u636e\u5e93\u5b66\u79d1\u7684\u56db\u4e2a\u56fe\u7075\u5956
\u4eba\u7269 \u5e74\u4efd \u8d21\u732e Charles William Bachman 1973 \u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf DBMS \u7684\u5f00\u53d1\u3002\u4f7f\u7528\u5de5\u7a0b\u65b9\u6cd5\u6765\u8bbe\u8ba1\u548c\u5b9e\u73b0\u6570\u636e\u5e93\u7ba1\u7406\u3002 Edgar Frank \"Ted\" Codd 1981 \u5173\u7cfb\u6570\u636e\u5e93\u7406\u8bba\uff0c\u63d0\u51fa\u4e86\u5173\u7cfb\u6a21\u578b\u7684\u6982\u5ff5\uff0c\u8bbe\u8ba1\u4e86\u5173\u7cfb\u6570\u636e\u5e93\u7684\u6570\u5b66\u57fa\u7840\uff0c\u5e76\u53d1\u660e\u4e86SQL\u3002 Raj Reddy 1994 \u5206\u5e03\u5f0f\u6570\u636e\u5e93\u7cfb\u7edf\u3002\u63d0\u51fa\u4e86\u4e00\u79cd\u540d\u4e3aDAI\uff08distributed artificial intelligence\uff09\u7684\u5206\u5e03\u5f0f\u8ba1\u7b97\u6a21\u578b\u3002\u4f7f\u6570\u636e\u53ef\u4ee5\u5728\u591a\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u5171\u4eab\u548c\u5206\u5e03 Mike Ralph Stonebraker 2014 \u9762\u5411\u5bf9\u8c61\u6570\u636e\u5e93\u7cfb\u7edf\u3002\u63d0\u51fa\u4e86\u4e00\u79cd\u540d\u4e3a O-ODBS (object-oriented database system) \u7684\u65b0\u578b\u6570\u636e\u5e93\u7cfb\u7edf\u67b6\u6784\uff0c\u5c06\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u548c\u6570\u636e\u5e93\u7cfb\u7edf\u76f8\u7ed3\u5408\u3002\u4f7f\u6570\u636e\u5e93\u7cfb\u7edf\u53ef\u4ee5\u66f4\u597d\u652f\u6301\u590d\u6742\u5e94\u7528\u548c\u66f4\u5927\u89c4\u6a21\u6570\u636e\u3002"},{"location":"docs/1-cs/database/#_1","title":"\u53c2\u8003\u8d44\u6599","text":"\u5b8c\u6574\u8d44\u6599
\u4e13\u9898\u5e16\u5b50
:material-circle-edit-outline: \u7ea6 2 \u4e2a\u5b57
"},{"location":"docs/1-cs/database/SQL/","title":"SQL Grammar","text":":material-circle-edit-outline: \u7ea6 172 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/database/SQL/#_1","title":"\u5173\u7cfb\u4ee3\u6570","text":"5 \u79cd\u57fa\u672c\u64cd\u4f5c
\u6269\u5c55\u64cd\u4f5c
select
select distinct
where
and / or
order by
insert to
update delete
JOIN \u8bed\u53e5
\u8fde\u63a5\uff1a\u7528\u4e8e\u628a\u591a\u4e2a\u8868\u7684\u884c\u7ed3\u5408\u8d77\u6765\u3002
SQL \u4e2d\u51e0\u79cd join \u7684\u7c7b\u578b
:material-circle-edit-outline: \u7ea6 3119 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
\u8fd9\u7ae0\u5173\u6ce8\u5982\u4f55\u5728\u78c1\u76d8 disk \u4e0a\u5b9e\u73b0\u4e00\u4e2a database\u3002
"},{"location":"docs/1-cs/database/design/#storage-structure","title":"Storage Structure \u5b58\u50a8\u7ed3\u6784","text":"\u9996\u5148\u9700\u8981\u4ecb\u7ecd storage hierarchy\u3002\u4e00\u4e2a\u4ece\u9876\uff08\u5bb9\u91cf\u6700\u5c0f\u6700\u5feb\u7684\uff09\u5411\u4e0b\uff08\u5bb9\u91cf\u6700\u5927\u6700\u6162\u7684\uff09\u7684\u56fe\u793a\u5982\u4e0b\uff0c
/\\ Primary storage \u4e3b\u5b58\u50a8\u5668: CPU register \u5bc4\u5b58\u5668, cache \u7f13\u5b58, main memory \u4e3b\u5b58\n /--\\ Secondary storage \u4e8c\u7ea7\u5b58\u50a8\u5668: flash memory \u95ea\u5b58, magnetic disk \u78c1\u76d8\n /----\\ Teriary storage \u4e09\u7ea7\u5b58\u50a8\u5668: optical disk \u5149\u76d8, magnetic tape \u78c1\u5e26\n --------\n
\u5176\u4e2d\u6700\u9876\u5c42 primary storage \u662f volatile\uff08\u6613\u5931\u7684\uff09\uff0c\u610f\u601d\u662f\u5982\u679c\u8ba1\u7b97\u673a\u65ad\u7535\u91cd\u542f\uff0c\u5c31\u4f1a\u4e22\u5931\uff1b\u4e0b\u9762\u4e24\u5c42\u90fd\u662f non-volatile\uff08\u4e0d\u6613\u5931\u7684\uff09\uff0c\u610f\u601d\u662f\u5373\u4f7f\u8ba1\u7b97\u673a\u65ad\u7535\uff0c\u4e5f\u4e0d\u4f1a\u4e22\u5931\u3002 \u4e0b\u9762\u4f9d\u6b21\u7b80\u5355\u4ecb\u7ecd\u6bcf\u4e2a\u5b58\u50a8\u5668\uff1a
Cache \u7f13\u5b58
\u7f13\u5b58\u662f\u901f\u5ea6\u6700\u5feb\u7684\u5b58\u50a8\u5668\uff0c\u4f46\u9020\u4ef7\u548c\u7ef4\u62a4\u6210\u672c\u6700\u9ad8\uff0c\u6240\u4ee5\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u3002\u867d\u7136\u6570\u636e\u5e93\u65e0\u9700\u7ef4\u62a4 cache\uff0c\u4f46\u6709\u7684\u6570\u636e\u5e93\u5728\u8bbe\u8ba1\u67e5\u8be2\u7684\u65f6\u5019\u4f1a\u5173\u6ce8 cache \u6548\u7387\u3002
Main memory \u4e3b\u5b58
\u4e3b\u5b58\u91cc\u7684\u6570\u636e\u53ef\u4ee5\u76f4\u63a5\u88ab CPU \u6267\u884c\u8ba1\u7b97\u64cd\u4f5c\uff0c\u8fd9\u91cc\u7684\u8ba1\u7b97\u64cd\u4f5c\u5c31\u662f\u6307 machine instruction \u673a\u5668\u6307\u4ee4\u3002\u4e3b\u5b58\u4e5f\u76f8\u5bf9\u5c0f\uff0c\u867d\u7136\u73b0\u5728\u6709\u7684\u5546\u4e1a\u6570\u636e\u5e93\u53ef\u4ee5\u88ab\u6574\u4e2a\u585e\u8fdb\u4e3b\u5b58\u3002\u4e3b\u5b58\u662f volatile \u4e5f\u5c31\u662f\u65ad\u7535\u4e22\u5931\u7684\uff0c\u7cfb\u7edf\u574f\u6389\u4e5f\u4f1a\u4e22\u5931\u3002
Flash memory \u95ea\u5b58 \u95ea\u5b58\u53ca\u4ee5\u4e0b\u7684\u5b58\u50a8\u5668\u5c31\u90fd\u662f\u65ad\u7535\u4e0d\u4e22\u5931\u7684\u4e86\u3002\u95ea\u5b58\u7684\u7ef4\u62a4\u6210\u672c\u6bd4\u4e3b\u5b58\u4f4e\uff0c\u6bd4\u78c1\u76d8\u9ad8\u3002
\u95ea\u5b58\u53ef\u4ee5\u7528\u4e8e\u5728\u201cUSB flash drive\u201d\uff08U \u76d8\uff09\u4e2d\u4fdd\u5b58\u6570\u636e\uff1b\u8fd8\u6709 Solid-state drive \u56fa\u6001\u786c\u76d8\uff08SSD\uff09\u4e5f\u4f7f\u7528\u4e86\u95ea\u5b58\uff0c\u4f46\u662f\u63d0\u4f9b\u4e86\u78c1\u76d8\u4e00\u6837\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u4ee3\u66ff\u78c1\u76d8\u7684\u529f\u80fd\u3002
Magnetic disk \u78c1\u76d8
\u4e5f\u53eb hard disk drive \u786c\u76d8\u3002\u78c1\u76d8\u662f\u4e3b\u8981\u7684\u957f\u671f online \u5b58\u50a8\u7684\u4ecb\u8d28\uff0c\u4f46\u662f CPU \u5982\u679c\u60f3\u8981\u64cd\u4f5c\u78c1\u76d8\u4e0a\u7684\u6570\u636e\uff0c\u5c31\u5148\u8981\u628a\u6570\u636e\u79fb\u5230\u4e3b\u5b58\u91cc\uff0c\u5904\u7406\u5b8c\u518d\u79fb\u51fa\u6765\u3002\u78c1\u76d8\u7684\u5b58\u50a8\u80fd\u529b\u5728\u9010\u5e74\u4e0a\u5347\u3002
Optical disk \u5149\u76d8
\u5e38\u89c1\u7684 disk video disk\uff08DVD\uff09\u5c31\u662f\u4e00\u79cd\u5149\u76d8\u3002\u5149\u76d8\u4e0a\u7684\u6570\u636e\u88ab\u7528\u6fc0\u5149\u8bfb\u5199\u3002\u5b83\u662f\u4e00\u79cd write-once, read-many (WORM) \u4ecb\u8d28\uff0c\u5373\u53ea\u80fd\u5199\u4e00\u6b21\uff0c\u4f46\u662f\u80fd\u8bfb\u5f88\u591a\u6b21\u3002
Magnetic tape \u78c1\u76d8
\u78c1\u76d8\u4e00\u822c\u662f\u7528\u6765\u5907\u4efd\u548c\u5b58\u6863\u4e0d\u5e38\u7528\u7684\u6570\u636e\u7684\uff0c\u8fd9\u7c7b\u6570\u636e\u5c31\u4e0d\u5e38\u4f7f\u7528\uff0c\u4e00\u822c\u9700\u8981\u88ab\u5b89\u5168\u5730\u957f\u671f\u4fdd\u5b58\u3002\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5fc5\u987b\u88ab\u987a\u5e8f\u8bfb\u53d6\uff0c\u5373\u8bfb\u5199\u5934\u5728\u78c1\u76d8\u4e0a\u79fb\u52a8\uff0c\u8bfb\u54ea\u91cc\u79fb\u5230\u54ea\u91cc\uff0c\u6240\u4ee5\u5b83\u53eb sequential-access storage\uff0c\u8fd9\u6837\u8bfb\u53d6\u662f\u975e\u5e38\u6162\u7684\u3002\u76f4\u63a5\u8bfb\u53d6\u7684 direct-access storage\uff0c\u6bd4\u5982\u78c1\u76d8\u548c SSD storage\uff0c\u8bfb\u53d6\u5c31\u76f8\u5bf9\u5feb\u4e00\u4e9b\uff0c\u56e0\u4e3a\u53ef\u4ee5\u76f4\u63a5\u8bfb\u53d6\u76d8\u4e0a\u7684\u4efb\u4f55\u5730\u65b9\u3002
\u4e00\u4e2a\u78c1\u76d8\u6709\u4e0a\u5341\u4e07\u4e2a track\uff08\u78c1\u9053\uff09\uff0c\u4e00\u4e2a\u78c1\u9053\u53c8\u6709\u4e0a\u5343\u4e2a sector\uff08\u6247\u533a\uff0c\u662f\u8ba1\u7b97\u673a\u548c\u78c1\u76d8\u4ea4\u6362\u6570\u636e\u7684\u6700\u5c0f\u5355\u4f4d\uff09\u3002\u78c1\u76d8\u4e0a\u5bfb\u9053\u7684\u5de5\u5177\u662f arm assemly \u8bfb\u5199\u5934\uff0c\u8bfb\u5199\u5934\u8fdb\u8fdb\u9000\u9000\u6765\u5bfb\u627e\u6570\u636e\u5728\u54ea\u4e2a\u78c1\u9053\u4e0a\uff0c\u7b49\u5bf9\u5e94\u6247\u533a\u65cb\u8f6c\u5230\u8bfb\u5199\u5934\uff0c\u624d\u5f00\u59cb\u4f20\u8f93\u6570\u636e\u3002
\u540c\u6837\u7684\u78c1\u9053\u7ec4\u6210\u4e00\u4e2a\u67f1\u9762\uff0c\u5bf9\u4e8e\u5927\u6587\u4ef6\uff0c\u6700\u597d\u50a8\u5b58\u5728\u540c\u4e00\u4e2a\u67f1\u9762\u4e0a\uff0c\u8fd9\u6837\u53ef\u4ee5\u5e76\u884c\u8bfb\u5199\u3002
\u6d4b\u91cf\u78c1\u76d8\u7684\u6027\u80fd\u9700\u8981\u4e00\u4e9b\u91cf\u5316\u6307\u6807\uff0c\u901a\u5e38\u6211\u4eec\u8003\u8651\u6570\u636e\u6570\u636e\u8bbf\u95ee\u7684\u7528\u65f6\u548c\u3002
Access time\uff08\u8bbf\u95ee\u65f6\u95f4\uff09
Data-transfer Rate\uff08\u6570\u636e\u4f20\u8f93\u7387\uff09
!!! (\u8fd9\u5757\u5728 db \u548c os \u91cc\u90fd\u4e0d\u8003\uff0c\u4f46\u662f\u90fd\u4f1a\u7ecf\u5e38\u63d0\u5230\uff0c\u5f88\u795e\u79d8\uff0c\u6240\u4ee5\u987a\u4fbf\u505a\u4e00\u4e0b\u7b14\u8bb0)
RAID \u5168\u79f0\u662f redundant arrays of independent disk \u72ec\u7acb\u78c1\u76d8\u5197\u4f59\u9635\u5217\u3002\u5b83\u7684\u6765\u5386\u662f\u56e0\u4e3a\uff0c\u8fc7\u53bb\u7684\u7cfb\u7edf\u8bbe\u8ba1\u8005\u4eec\u8ba4\u4e3a\u4f7f\u7528\u591a\u4e2a\u5c0f\u578b\u3001\u5ec9\u4ef7\u78c1\u76d8\u7ec4\u6210\u7684\u5b58\u50a8\u7cfb\u7edf\u662f\u4e00\u4e2a\u66f4\u7ecf\u6d4e\u9ad8\u6548\u7684\u9009\u9879\uff0c\u6240\u4ee5\u539f\u6765 RAID \u4e2d\u7684 I \u662f inexpensive \u7684\u610f\u601d\u3002\u4f46\u73b0\u5728\u6240\u6709\u78c1\u76d8\u5728\u7269\u7406\u5c3a\u5bf8\u4e0a\u90fd\u5f88\u5c0f\uff0c\u5bb9\u91cf\u66f4\u5927\u7684\u78c1\u76d8\u5b9e\u9645\u4e0a\u5177\u6709\u66f4\u4f4e\u7684\u6bcf\u5146\u5b57\u8282\u6210\u672c\u3002\u5f00\u53d1\u8005\u4f7f\u7528 RAID \u7cfb\u7edf\u73b0\u5728\u4e3b\u8981\u56e0\u5176\u66f4\u9ad8\u7684\u53ef\u9760\u6027\u548c\u6027\u80fd\uff0c\u548c\u7ba1\u7406\u64cd\u4f5c\u7b80\u4fbf\u3002
!!! TODO
\u901a\u8fc7\u5e76\u884c\u6765\u52a0\u901f
\u6570\u636e\u5e93\u662f\u5b58\u50a8\u5728\u4e00\u7cfb\u5217\u7684\u6587\u4ef6\u4e2d\u7684\uff0c\u6587\u4ef6\u5185\u90e8\uff0c\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u6709\u4e00\u7cfb\u5217\u7684 records \u8bb0\u5f55\uff0c\u6bcf\u4e2a record \u542b\u6709\u4e00\u7cfb\u5217\u7684 fields \u57df\u3002
\u5728\u8bbe\u8ba1\u65f6\uff0c\u4e00\u822c\u6709\u4e00\u4e9b\u5047\u8bbe\uff1a\uff081\uff09\u5047\u8bbe\u8bb0\u5f55\u7684\u957f\u5ea6\u662f\u56fa\u5b9a\u7684\uff0c\uff082\uff09\u5047\u8bbe\u6bcf\u4e2a\u6587\u4ef6\u91cc\u53ea\u6709\u4e00\u79cd\u8bb0\u5f55\uff0c\uff083\uff09\u5047\u8bbe\u4e0d\u540c\u7684\u6587\u4ef6\u88ab\u7528\u4e8e\u4e0d\u540c\u7684\u5173\u7cfb\u3002
"},{"location":"docs/1-cs/database/design/#_2","title":"\u8bb0\u5f55\u7684\u7c7b\u578b","text":"\u8bb0\u5f55\u5206\u4e3a
Fixed-length records \u5b9a\u957f\u8bb0\u5f55
\u8bb0\u5f55 i \u4ece\u5b57\u8282 n * (i-1) \u5904\u5f00\u59cb\uff0c
Variable-length records \u53d8\u957f\u8bb0\u5f55
\u4e00\u4e2a\u65b0\u7684\u8bb0\u5f55\u8981\u63d2\u5165\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u6709\u51e0\u79cd\u7b97\u6cd5\u6765\u51b3\u5b9a\u63d2\u5165\u5230\u6587\u4ef6\u7684\u54ea\u4e2a\u4f4d\u7f6e\uff1a
\u6bcf\u4e2a\u6587\u4ef6\u88ab\u5212\u5206\u4e3a\u56fa\u5b9a\u957f\u5ea6\u7684 blocks\u3002block \u662f\u6570\u636e\u5b58\u53d6\u548c\u7a7a\u95f4\u5206\u914d\u7684\u57fa\u672c\u5355\u4f4d\u3002
\u4e00\u4e2a block \u5305\u542b\u591a\u6761\u8bb0\u5f55\u3002\u5728\u4f20\u7edf\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u8bb0\u5f55\u7684\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7 block\uff0c\u6bcf\u6761\u8bb0\u5f55\u4e00\u5b9a\u90fd\u662f\u5b8c\u6574\u7684\u3002\u8bb0\u5f55\u4e4b\u95f4\u7528\u94fe\u8868\u6765\u8fde\u63a5\u3002
\u8bb0\u5f55\u5206\u4e3a\u5b9a\u957f\u8bb0\u5f55\u548c\u53d8\u957f\u8bb0\u5f55\u4e24\u79cd\u3002
Fixed-length records \u5b9a\u957f\u8bb0\u5f55
Storage record i starting from byte n*(i-1) where n is the size of each record. Record access is simple but records may cross blocks.
Modification of fixed-length records: do not allow records to cross block boundaries.
Deletion of record i: alternatives
\u53ef\u4ee5\u4e0d move records\uff0cbut link all free records on a free list. \u8981\u5220\u9664\u7684\u6761\u76ee\u6253\u4e0a\u6807\u8bb0\uff0c\u5f62\u6210\u4e00\u4e2a\u7a7a\u8bb0\u5f55\u7684\u94fe\u8868\u3002\u672a\u6765\u8981\u63d2\u5165\u65f6\u4e5f\u5e94\u9009\u62e9\u7a7a\u8bb0\u5f55\uff0c\u53ea\u8981\u901a\u8fc7\u6307\u9488\u5c31\u53ef\u4ee5\u627e\u5230\uff0c\u7136\u540e\u66f4\u65b0\u8bb0\u5f55\u5373\u53ef\u3002
Varaible-length records \u53d8\u957f\u8bb0\u5f55 variable-length records arise in database systems in several ways:
variable length attributes represented by fixed size (offset, length), with actual data storad after all fixed length atrributes.
null values represented by null-value bitmap ()
\u4e0d\u5b9a\u957f\u7684\u4fdd\u5b58\u5728\u540e\u9762\uff0c\u5b9a\u957f\u7684\uff08offset length\uff09\u4fdd\u5b58\u5728\u524d\u9762\u3002
slotted page structure \u5206\u69fd\u9875
\u5178\u578b\u7684\u53d8\u957f\u8bb0\u5f55\u6709\u5982\u4e0b\u7279\u70b9\uff1a
\u5b58\u50a8\u7f13\u51b2\u533a\u7684\u7ba1\u7406
"},{"location":"docs/1-cs/database/design/#index","title":"Index \u7d22\u5f15","text":"\u6570\u636e\u5e93\u4e2d\u5f15\u5165\u7d22\u5f15\u6982\u5ff5\uff0c\u662f\u4e3a\u4e86\u52a0\u5feb\u67e5\u627e\u901f\u5ea6\u3002
\u5728\u5f15\u5165\u7d22\u5f15\u7684\u65f6\u5019\uff0c\u9700\u8981\u5173\u6ce8\u7684\u56e0\u7d20\u90fd\u6709\u5982\u4e0b\u51e0\u79cd
Access type \u8bbf\u95ee\u7c7b\u578b
Access time \u8bbf\u95ee\u65f6\u95f4
Insertion time \u63d2\u5165\u65f6\u95f4
Deletion time \u5220\u9664\u65f6\u95f4
Space overhead \u7a7a\u95f4\u5f00\u9500
\u4e00\u822c\u6765\u8bf4\uff0c\u952e\u7684\u6392\u5217\u65b9\u5f0f\u5206\u4e3a ordered index \u987a\u5e8f\u7d22\u5f15\u548c hased index \u4e24\u79cd\u3002
\u800c\u7d22\u5f15\u6307\u5411\u6570\u636e\u7684\u65b9\u5f0f\u53c8\u5206\u4e3a\uff1a
Dense index \u5bc6\u96c6\u7d22\u5f15 \u5bc6\u96c6\u7d22\u5f15\u4e0b\uff0c\u6bcf\u4e00\u6761\u6570\u636e\u8bb0\u5f55\u90fd\u6709\u5bf9\u5e94\u7684\u7d22\u5f15\u3002
Sparse inedx \u7a00\u758f\u7d22\u5f15 \u6b64\u65f6\u4e0d\u662f\u6bcf\u4e00\u6761\u8bb0\u5f55\u90fd\u6709\u5bf9\u5e94\u7684\u7d22\u5f15\u3002\u7d22\u5f15\u53ea\u6307\u5411\u5bf9\u5e94\u7684\u4e00\u90e8\u5206\u8bb0\u5f55\uff0c\u5176\u4f59\u8bb0\u5f55\u901a\u8fc7\u94fe\u8868\u4e00\u6837\u7684\u6307\u9488\u8fde\u63a5\u8d77\u6765\u3002\u6b64\u65f6\u9700\u8981\u7684\u7a7a\u95f4\u548c\u63d2\u5165\u5220\u9664\u65b0\u7d22\u5f15\u7684\u5f00\u9500\u8f83\u5c0f\uff0c\u4f46\u662f\u6bd4\u5bc6\u96c6\u7684\u7d22\u5f15\u6162\u3002
Secondary index \u4e8c\u7ea7\u7d22\u5f15 \u7d22\u5f15\u901a\u8fc7\u4e00\u4e2a\u5927\u7684 bucket \u6765\u5bfb\u627e\u6240\u6307\u5411\u7684\u5730\u65b9\u3002
Multilevel index \u591a\u7ea7\u7d22\u5f15 \u5206\u4e3a outer index \u548c inner index\u3002
Clustering Index A clustering index is an index whose search key also defines the sequentially ordered, a clustering index is an index whose search key also defines the sequenrial order of the file. Clustering indices are also called primary indices.
\u4ecb\u7ecd\u5e38\u7528\u7684 B+ \u6811\u6570\u636e\u7ed3\u6784\u3002\u4e0e fds \u4e2d\u5b9a\u4e49\u76f8\u540c\uff0c\u4f46\u662f\u518d\u4ecb\u7ecd\u4e00\u6b21\u3002
B+ \u6811\u662f\u4e00\u79cd\u5e73\u8861\u7684\uff08\u6bcf\u5c42\u90fd\u662f\u6ee1\u7684\uff09\u591a\u5206\u6811\uff08\u4e0d\u6b62\u4e24\u4e2a\u8282\u70b9\uff09\u3002\u4e00\u4e2a m \u9636\u7684 B+ \u6811\u6ee1\u8db3\u5982\u4e0b\u6761\u4ef6\uff1a
\u5728\u5b9e\u73b0\u4e2d\uff0cB+ \u6811\u7684\u4e00\u4e2a\u8282\u70b9\u7684\u5927\u5c0f\u548c\u4e00\u4e2a\u78c1\u76d8\u533a\u5757\u4e00\u6837\u5927\uff08\u901a\u5e38\u662f 4 KB\uff09\uff0c\u800c\u7d22\u5f15\u7684\u89c4\u6a21\u4e00\u822c\u5728 100 \u5de6\u53f3\u3002
B+ Tree Visualization \u662f\u4e00\u4e2a B+ \u6811\u53ef\u89c6\u5316\u7684\u5de5\u5177\u3002
\u4ecb\u7ecd\u67e5\u8be2\u3001\u63d2\u5165\u548c\u5220\u9664\u64cd\u4f5c\u3002
\u5f53 B+ \u6811\u4e2d\u7684\u8282\u70b9 TODO \u5177\u4f53\u7684\u6761\u4ef6\u662f\u4ec0\u4e48\uff0c\u6211\u4eec\u8fd9\u91cc\u8bb0\u4f5c\u7834\u574f\u4e86 B+ \u6811\u3001\u5143\u7d20\u8fc7\u591a\u6216\u5143\u7d20\u8fc7\u5c11\uff0c\u5c31\u9700\u8981\u8003\u8651\u66f4\u65b0\u7d22\u5f15\u3002
\u63d2\u5165\uff1a
\u5220\u9664\uff1a
\u5206\u522b\u5206\u6790\u51e0\u79cd\u6570\u636e\u64cd\u4f5c\u4e0b\uff0cB+ \u6811\u7684\u6027\u80fd\uff1a
\u67e5\u627e search
\u67e5\u627e\u7b97\u6cd5\u5c31\u662f\u4ece\u6839\u8282\u70b9\u5f00\u59cb\u5411\u4e0b\u6bd4\u8f83\uff0c\u6839\u636e\u4e0e\u6bcf\u4e2a\u7236\u8282\u70b9\u7684\u5927\u5c0f\u5173\u7cfb\u4e00\u8def\u6bd4\u8f83\u627e\u5230\u8981\u627e\u7684\u53f6\u5b50\u7ed3\u70b9\u3002\u5982\u679c N \u4e3a\u53f6\u5b50\u7684\u603b\u6570\uff0c\u90a3\u4e48\u67e5\u8be2\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0d\u4f1a\u8d85\u8fc7 \\(log_n/2(K)+1\\)\u3002
\u63d2\u5165 insert
\u63d2\u5165\u7b97\u6cd5\u6d89\u53ca\uff1a\u5148\u627e\u5230\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\u76f4\u63a5\u63d2\u5165\uff0c\u5982\u679c\u5f53\u524d\u7684\u8282\u70b9\u6570\u91cf\u8d85\u8fc7\u4e86\u9636\u6570 M \u5219\u62c6\u6210\u4e24\u4e2a\u90e8\u5206\uff0c\u5e76\u5411\u4e0a\u66f4\u65b0\u7d22\u5f15\u3002\u6240\u4ee5\u65f6\u95f4\u590d\u6742\u5ea6\u662f...
\u5220\u9664 delete
\u5220\u9664\u7b97\u6cd5\u8bbe\u8ba1\uff1a\u76f4\u63a5\u628a\u8981\u5220\u9664\u7684\u8282\u70b9\u5220\u9664\uff0c\u7136\u540e\u628a\u6ca1\u6709\u7d22\u5f15 key \u4e86\u7684\u975e\u53f6\u8282\u70b9\u5220\u9664\uff0c\u4ece\u65c1\u8fb9\u627e\u4e00\u4e2a\u53f6\u8282\u70b9\u5408\u5e76\u51fa\u65b0\u7684\u975e\u53f6\u8282\u70b9\u3002\u6240\u4ee5\u65f6\u95f4\u590d\u6742\u5ea6\u662f...
B+ \u6811\u7684\u76f8\u5173\u8ba1\u7b97
\u9ad8\u5ea6\u7684\u4f30\u8ba1\uff1a\u53ef\u4ee5\u5206\u6790\u9ad8\u5ea6\u7684\u4e0a\u4e0b\u754c
size \u5927\u5c0f\u7684\u4f30\u8ba1\uff1a\u4e5f\u662f\u5206\u6790\u9ad8\u5ea6\u7684\u4e0a\u4e0b\u754c
:material-circle-edit-outline: \u7ea6 1976 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f
\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981\u5173\u7cfb\u6a21\u5f0f\uff1f
\u5728\u8bbe\u8ba1\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u6211\u4eec\u753b\u5b8c E-R \u56fe\uff0c\u8981\u628a\u56fe\u8f6c\u5316\u6210\u8868\u7684\u5f62\u5f0f\u5316\u5b9a\u4e49\uff08\u6bd4\u5982 Student(sid, course, department)
\u8fd9\u79cd\u683c\u5f0f\uff09\u3002\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u5bf9\u4e00\u4e9b\u5c5e\u6027\u8fdb\u884c\u8fdb\u4e00\u6b65\u7ea6\u675f\uff0c\u6bd4\u5982\u8981\u5173\u6ce8\u8fd9\u4e9b\u95ee\u9898\uff1a\uff081\uff09\u5728\u4e24\u4e2a\u8868\u91cc\u7684\u952e\u8c01\u51b3\u5b9a\u8c01\uff1f\u8981\u4fdd\u8bc1\u53ea\u6709 candidate key \u7684\u5c5e\u6027\u624d\u80fd\u51b3\u5b9a\u5176\u5b83\u5c5e\u6027\u3002\uff082\uff09\u6709\u4e9b\u8868\u8be5\u5408\u5728\u4e00\u8d77\uff0c\u8fd8\u662f\u62c6\u6210\u591a\u4e2a\u8868\uff1f\u5982\u679c\u8868\u5408\u5f97\u592a\u591a\uff0c\u6709\u4e9b\u4fe1\u606f\u53ef\u80fd\u51fa\u73b0\u592a\u591a\u6b21\uff0c\u4ea7\u751f\u4fe1\u606f\u5197\u4f59\u3001\u63d2\u5165\u5f02\u5e38\u3001\u66f4\u65b0\u56f0\u96be\u3002\uff083\uff09\u6709\u4e9b\u5c5e\u6027\u867d\u7136\u4e0d\u662f\u4e3b\u952e\uff0c\u4f46\u53c8\u51b3\u5b9a\u5176\u5b83\u5173\u7cfb\u7684\u503c\uff0c\u8fd9\u79cd\u60c5\u51b5\u53eb\u505a\u6709\u51fd\u6570\u4f9d\u8d56\u3002
\u6240\u4ee5\u6211\u4eec\u5f15\u5165\u5173\u7cfb\u4ee3\u6570\uff0c\u6765\u6307\u5bfc\u6211\u4eec\u4ece E-R \u56fe\u5230\u5efa\u7acb\u5f62\u5f0f\u5316\u5b9a\u4e49\u7684\u8fd9\u4e00\u6b65\u9aa4\u3002\u5176\u5b9e\u4e3b\u8981\u7275\u626f\u5230\u7684\u6b65\u9aa4\u5c31\u662f\u5173\u7cfb\u5206\u89e3\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5148\u4ecb\u7ecd\u5206\u89e3\uff0c\u7136\u540e\u4ecb\u7ecd\u5176\u4f9d\u8d56\u7684\u7406\u8bba\u51fd\u6570\u4f9d\u8d56\u7684\u5b9a\u4e49\uff1b\u7136\u540e\u4ecb\u7ecd 6 \u79cd\u6307\u5bfc\u5173\u7cfb\u6a21\u5f0f\u7684\u8303\u5f0f\uff0c\u8fd9\u4e9b\u6bcf\u79cd\u8303\u5f0f\u5c42\u5c42\u9012\u8fdb\uff0c\u662f\u4e00\u4e9b\u5bf9\u6570\u636e\u5e93\u5173\u7cfb\u8d8a\u6765\u8d8a\u4e25\u683c\u7684\u7ea6\u675f\u3002
"},{"location":"docs/1-cs/database/normalforms/#_2","title":"\u5206\u89e3","text":"\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u662f\u4e0d\u597d\u7684\uff0c\u6211\u4eec\u5e0c\u671b\u628a\u5b83\u5206\u89e3\u6210\u597d\u7684\u5173\u7cfb\u3002
\u4ecb\u7ecd\u4e00\u4e0b decomposition \u5206\u89e3\u5206\u4e3a\u4e24\u7c7b
lossy decomposition \u6709\u635f\u5206\u89e3 \u5982\u679c\u4e0d\u80fd\u7528\u5206\u89e3\u540e\u7684\u51e0\u4e2a\u5173\u7cfb\u91cd\u5efa\u539f\u672c\u7684\u5173\u7cfb\uff0c\u5c31\u79f0\u5206\u89e3\u4e3a\u6709\u635f\u5206\u89e3\u3002
lossless decomposition \u65e0\u635f\u5206\u89e3 \u4e00\u4e2a\u5173\u7cfb\u662f\u65e0\u635f\u5206\u89e3\uff0c\u5b9a\u4e49\u662f
(1) \\(\\Pi_{R_1}(r) \\Join \\Pi_{R_2}(r) = r\\)\uff0c\u5f53 R1 \u548c R2 \u662f\u5173\u7cfb R \u7684\u5206\u89e3\uff0cr(R) \u6307 R \u4e0a\u5728\u5206\u89e3\u65f6\u53ef\u80fd\u635f\u5931\u7684\u4e00\u4e2a\u5173\u7cfb\u65f6\u3002
\u6216\u8005
(2) \u5173\u7cfb R \u5206\u89e3\u540e\u4ea7\u751f\u5173\u7cfb\u96c6 (R1, R2) \u4e14 R = R1 \\(\\cup\\) R2\u3002
\u4e00\u4e2a\u66f4\u76f4\u89c2\u7684\u5224\u65ad\u65b9\u6cd5\u662f\uff0c\u5982\u679c\u6ee1\u8db3 (1) R1 \\(\\cap\\) R2 -> R1 \u4e14 (2) R1 \\(\\cap\\) R2 -> R2\uff0c\u5219\u79f0\u4e3a\u4e00\u4e2a\u65e0\u635f\u8fde\u63a5\u3002\u5176\u4e2d\u7bad\u5934\u7684\u610f\u601d\u662f\u51b3\u5b9a\u3002\u5982\u679c\u8fde\u63a5\u540e\u8fd8\u80fd\u51b3\u5b9a\u539f\u6765\u7684\u4e24\u4e2a\u5173\u7cfb\uff0c\u90a3\u4e48\u5f53\u7136\u662f\u65e0\u635f\u94fe\u63a5\u3002
\u8fd9\u4e2a\u5206\u89e3\u7684\u7406\u8bba\uff0c\u662f\u57fa\u4e8e (1) functional dependencies \u51fd\u6570\u4f9d\u8d56 (2) multivalued dependencies \u591a\u503c\u4f9d\u8d56 \u4e24\u4e2a\u7406\u8bba\u7684\u3002
\u6839\u636e\u5206\u89e3\u7406\u8bba\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f97\u5230\u518d\u4e0b\u4e00\u6b65\u8981\u4ecb\u7ecd\u7684\u516d\u4e2a\u8303\u5f0f\u3002
"},{"location":"docs/1-cs/database/normalforms/#_3","title":"\u51fd\u6570\u4f9d\u8d56","text":"\u6982\u5ff5\u533a\u522b
\u51fd\u6570\u4f9d\u8d56\uff1a
\u90e8\u5206\u51fd\u6570\u4f9d\u8d56\uff1a\u8bbe X, Y \u662f\u5173\u7cfb R \u7684\u4e24\u4e2a\u5c5e\u6027\u96c6\u5408\uff0c\u5b58\u5728 X->Y, \u82e5 X' \u662f X \u7684\u771f\u5b50\u96c6\uff0c\u5b58\u5728 X\u2018->Y\uff0c\u5219\u79f0 Y \u90e8\u5206\u4f9d\u8d56\u4e8e\u51fd\u6570 X\u3002
\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\uff1a\u8bbe X, Y, Z \u662f\u5173\u7cfb R \u4e2d\u4e92\u4e0d\u76f8\u540c\u7684\u5c5e\u6027\u96c6\u5408\uff0c
\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\uff1a
\u6211\u770b\u4e0d\u61c2\u3002\u3002\u3002\u3002\u3002\u3002
\u51fd\u6570\u4f9d\u8d56\u662f\u6765\u81ea\u4e8e\u5e94\u7528\u5c42\u9762\u7684\u89c4\u5b9a\uff08Functional dependencies are constraints on the set of legal relations\uff09\uff0c\u5148\u6709\u51fd\u6570\u4f9d\u8d56\uff0c\u518d\u6709\u6570\u636e\u5e93\u4e2d\u7684\u503c\u3002\u51fd\u6570\u4f9d\u8d56\u8981\u6c42\u4e24\u4e2a\u503c
\u901a\u8fc7
\u51fd\u6570\u4f9d\u8d56\u53ef\u4ee5\u88ab\u8bc1\u4f2a\uff08\u5bf9\u4e8e\u5355\u4e2a\uff09\uff0c\u4e0d\u80fd\u88ab\u8bc1\u5b9e\uff08\u5bf9\u4e8e\u6240\u6709\uff09\u3002
!!! \u672c\u8282\u4ee5\u4e0b latex \u9e1f\u8bed\u5168\u90fd\u4e0d\u8003
\u5f62\u5f0f\u5316\u7684\u5b9a\u4e49\u91cc\u51fd\u6570\u4f9d\u8d56\u662f\u6307\uff0c\u5728\u4e00\u4e2a\u5173\u7cfb R \u4e2d\uff0c\u5982\u679c\u5c5e\u6027\uff08\u7ec4\uff09Y \u7684\u503c\u662f\u7531\u5c5e\u6027\uff08\u7ec4\uff09X \u7684\u503c\u51b3\u5b9a\u7684\uff0c\u5c31\u79f0 Y \u5bf9 X \u6709\u51fd\u6570\u4f9d\u8d56\u3002\u8003\u8651\u5230\u672c\u8eab\u51fd\u6570\u7684\u5b9a\u4e49\u662f X \u4e2d\u7684\u5143\u7d20\u5728 Y \u4e2d\u6709\u552f\u4e00\u786e\u5b9a\u7684\u503c\uff0c\u90a3\u4e48\u8fd9\u91cc\u7684\u4f9d\u8d56\u5c31\u662f\u6307\uff0c\u4e24\u4e2a\u5143\u7d20\u5982\u679c\u5728 X \u4e2d\u7684\u503c\u4e00\u6837\uff0c\u90a3\u4e48\u5728 Y \u4e2d\u7684\u503c\u4e5f\u4e00\u6837\u3002
\u5f62\u5f0f\u5316\u5b9a\u4e49\uff1a\u8bbe \\(R(U)\\) \u662f\u5c5e\u6027\u96c6\u5408 \\(U={A_1, A_2, ..., A_n}\\) \u4e0a\u7684\u4e00\u4e2a\u5173\u7cfb\u6a21\u5f0f\uff0cX, Y \u662f U \u4e0a\u7684\u4e24\u4e2a\u5b50\u96c6\uff0c\u82e5\u5bf9 \\(R(U)\\) \u7684\u4efb\u4e00\u4e2a\u53ef\u80fd\u7684\u5173\u7cfb \\(r\\)\uff0c\\(r\\) \u4e2d\u4e0d\u5b58\u5728\u4e24\u4e2a\u5728 X \u4e2d\u5c5e\u6027\u503c\u76f8\u7b49\uff0c\u5728 Y \u4e2d\u5c5e\u6027\u503c\u4e0d\u7b49\u7684\u5143\u7ec4\u3002\u5373\u79f0\u4e3a\u201cX \u51fd\u6570\u51b3\u5b9a Y\u201d\u6216\u201cY \u51fd\u6570\u4f9d\u8d56 X\u201d\uff0c\u8ba1\u4f5c X -> Y\u3002
Armstrong \u516c\u7406\u7cfb\u7edf\u662f\u63cf\u8ff0\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u51fd\u6570\u4f9d\u8d56\u5173\u7cfb\u7684\u4e00\u7cfb\u5217 references\uff08\u63a8\u7406\u89c4\u5219\uff09\uff0c\u5728 1974 \u5e74\u7531 William W. Armstrong \u8bbe\u8ba1\u3002
Armstrong \u516c\u7406\u7cfb\u7edf\u6709\u4e09\u5927\u516c\u7406\uff08\u81ea\u53cd\u5f8b\uff0c\u589e\u5e7f\u5f8b\uff0c\u4f20\u9012\u5f8b\uff09\uff0c\u548c\u4e00\u4e9b\u5f15\u7406\u3002
\u516c\u7406
!!! \u5bf9\u4e0d\u8d77\uff0c\u6211\u662f\u61d2\u72d7\uff0c\u6211\u4e0d\u60f3\u6572 latex \u5199\u5f62\u5f0f\u5316\u5b9a\u4e49\u4e86\uff0c\u7528\u4eba\u8bdd\u7ed9\u5927\u5bb6\u8bb2\u5427\u3002
\u8bbe F \u4e3a R(U) \u7684\u4e00\u7ec4\u51fd\u6570\u4f9d\u8d56\uff0c\u8bb0\u4e3a R(U, F)\u3002
\u81ea\u53cd\u5f8b
\u5982\u679c\u4e00\u4e2a\u5c5e\u6027\u96c6\u662f\u53e6\u4e00\u4e2a\u5c5e\u6027\u96c6\u7684\u5b50\u96c6\uff0c\u90a3\u4e48\u8bf4\u540e\u8005\u51b3\u5b9a\u524d\u8005\u3002\u53ef\u4ee5\u53eb\u505a\uff0c\u5c5e\u6027\u96c6 X \u51b3\u5b9a\u5b83\u7684\u5c5e\u6027\u5b50\u96c6\u3002
\u589e\u5e7f\u5f8b
\u5982\u679c X -> Y \u5728 F \u8fd9\u4e2a\u51fd\u6570\u4f9d\u8d56\u96c6\u5408\u4e2d\uff0c\u53e6\u4e00\u5c5e\u6027\uff08\u7ec4\uff09Z \u662f\u5c5e\u6027\u96c6 U \u4e2d\u7684\u5143\u7d20\uff0c\u90a3\u4e48\u4ece F \u4e2d\u53ef\u4ee5\u63a8\u5bfc\u5f97\u51fa XZ \u51fd\u6570\u51b3\u5b9a YZ\u3002\u6709\u70b9\u50cf\u5728\u8bf4\u672c\u6765 X \u51b3\u5b9a Y\uff0c\u540e\u968f\u4fbf\u53d6\u4e00\u4e2a\u5c5e\u6027\u96c6 Z\uff0c\u5728\u4e24\u4fa7\u5206\u522b\u8fde\u63a5 X \u548c Y\uff0c\u7ed3\u679c XZ \u8fd8\u662f\u51b3\u5b9a YZ\u3002
\u4f20\u9012\u5f8b
\u82e5 X -> Y\uff0cY -> X\uff0c\u5219 X -> Z\u3002
\u5f15\u7406
!!! \u5b66\u4e0d\u52a8\u4e86\u5149\u62a5\u4e2a\u83dc\u540d\u5427
\u6b63\u5219\u8986\u76d6
"},{"location":"docs/1-cs/database/normalforms/#normal-form-6","title":"Normal Form \u8303\u5f0f\uff1a6 \u4e2a\u8303\u5f0f","text":"\u63a5\u4e0b\u6765\u6211\u4eec\u4ecb\u7ecd\u6570\u636e\u5e93\u8bbe\u8ba1\u7684\u516d\u5927\u8303\u5f0f\u3002\u5982\u524d\u6587\u6240\u8ff0\uff0c\u516d\u4e2a\u8303\u5f0f\u662f\u5bf9\u6570\u636e\u5e93\u5173\u7cfb\u5c5e\u6027\u5c42\u5c42\u9012\u8fdb\u3001\u8d8a\u6765\u8d8a\u4e25\u683c\u7684\u7ea6\u675f\u3002
\u7cbe\u7b80\u7248\u5982\u4e0b\uff08\u7528\u4e8e\u8003\u524d\u7a81\u51fb\uff09\uff1a
\u540d\u79f0 \u4ecb\u7ecd \u8303\u4f8b \u8303\u56f4 \u7b2c\u4e00\u8303\u5f0f 1NF \u5927\uff0c\u9010\u4e2a\u5305\u542b\u4e0b\u65b9\u7684 \u7b2c\u4e8c\u8303\u5f0f 2NF \u7b2c\u4e00\u8303\u5f0f 3NF Buckus-Codd NF \u7b2c\u4e94\u8303\u5f0f 5NF \u7b2c\u516d\u8303\u5f0f 6NF \u5c0f\uff0c\u9010\u4e2a\u88ab\u4e0a\u65b9\u7684\u5305\u542b\u63a5\u4e0b\u6765\u662f\u8be6\u7ec6\u4ecb\u7ecd\u3002
First Normal Form \u7b2c\u4e00\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u6ca1\u6709\u91cd\u590d\u7684\u5217\u3002
\u7b2c\u4e00\u8303\u5f0f\u7684\u542b\u4e49\uff1aatomicity \u539f\u5b50\u6027\u3002\u5373\u4e0d\u80fd\u518d\u7ee7\u7eed\u62c6\u5206\uff0c\u5c5e\u6027\u4e0d\u80fd\u518d\u5411\u4e0b\u62c6\u5206\u3002\u5f53\u4e00\u4e2a\u5173\u7cfb\u6a21\u5f0f R \u7684\u6240\u6709\u5c5e\u6027\u90fd\u662f atomic \u7684\uff0c\u8fd9\u4e2a\u5173\u7cfb\u6a21\u578b\u5c31\u662f\u7b2c\u4e00\u8303\u5f0f\u3002
\u6bd4\u5982\uff0cstring \u5e94\u5f53\u88ab\u5f53\u4f5c\u4e0d\u53ef\u5206\u5272\u7684\u3002\u6bd4\u5982 ZJU \u7684\u5b66\u53f7\u7b2c\u4e00\u4f4d\u770b\u672c\u79d1\u751f\u7814\u7a76\u751f\uff0c\u540e\u9762\u4e24\u4f4d\u770b\u5e74\u7ea7\uff0c\u4f46\u8fd9\u4e24\u4e2a\u4fe1\u606f\u5982\u679c\u9700\u8981\u662f\u5e94\u5f53\u88ab\u663e\u793a\u5730\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u800c\u4e0d\u662f\u9700\u8981\u7684\u65f6\u5019\u53bb\u5b66\u53f7\u4e2d\u5206\u6790\u67e5\u627e\u7684\u3002\u5982\u679c\u8fd9\u6837\u505a\uff0c\u76f8\u5f53\u4e8e\u628a\u89e3\u6790\u5b57\u7b26\u4e32\u7684\u5de5\u4f5c\u7ed9\u4e86\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u5b57\u7b26\u4e32\u67e5\u627e\u662f\u4e00\u4e2a\u6bd4\u6570\u636e\u5e93\u67e5\u8be2\u6162\u7684\u6b65\u9aa4\uff0c\u8fd9\u6837\u7ed3\u679c\u5f88\u4e0d\u597d\u3002
\u7b2c\u4e00\u8303\u5f0f\u6ca1\u6709\u6d88\u9664\u5197\u4f59\uff0c\u5b83\u6d88\u9664\u7684\u662f\u5217\u91cc\u91cd\u590d\u7684\u4fe1\u606f\u3002\u5b83\u628a\u8868\u683c\u91cc\u5197\u4f59\u7684\u5217\u62c6\u5206\u6210\u4e86\u591a\u4e2a\u884c\u3002
Second Normal Form \u7b2c\u4e8c\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u5b9e\u4f53\u7684\u5c5e\u6027\u5b8c\u5168\u4f9d\u8d56\u4e8e\u4e3b\u5173\u952e\u5b57\u3002
\u7b2c\u4e8c\u8303\u5f0f\u662f\u57fa\u4e8e fully functional dependency \u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u7684\u3002\u610f\u601d\u662f\uff0c\u7b2c\u4e8c\u8303\u5f0f\u7528\u4e8e\u90a3\u4e9b\u6709\u590d\u5408\u952e\u503c\u7684\u5173\u7cfb\uff0c\u6bd4\u5982\u5f53\u4e00\u4e2a\u5173\u7cfb\u7684\u4e3b\u952e\u662f\u591a\u4e2a\u5217\u7684\u590d\u5408\u65f6\u3002
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u672c\u6765\u5c31\u6ca1\u6709\u590d\u5408\u7684\u5c5e\u6027\uff0c\u90a3\u672c\u6765\u5c31\u662f 2NF \u7684\u3002
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u6709\u590d\u5408\u7684\u5c5e\u6027\uff0c\u6bd4\u5982 AB -> C\uff0c\u90a3\u4e48 2NF \u4f1a\u628a AB \u62c6\u5f00\u3002
TODO\uff1a\u600e\u4e48\u62c6\u5462
Third Normal Form \u7b2c\u4e09\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u4e0d\u4f9d\u8d56\u4e8e\u5176\u5b83\u975e\u5c5e\u6027\u3002
A relation is in the third normal form, if there is no transitive dependency for non-prime attributes as well as it is in the second normal form.
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u5728\u7b2c\u4e09\u8303\u5f0f\u91cc\uff0c\u5b83\u5e94\u5f53\u5bf9\u4e8e\u975e\u4e3b\u952e\u5c5e\u6027\u6ca1\u6709\u4f20\u9012\u4f9d\u8d56\uff0c\u5e76\u4e14\u5728\u7b2c\u4e8c\u8303\u5f0f\u91cc\u3002
Boyce-Cudd Normal Form BCNF\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u6bcf\u4e2a\u4f9d\u8d56\u5173\u7cfb\u4e2d\uff0c\u88ab\u4f9d\u8d56\u7684\u90fd\u662f\u4e3b\u952e
A relation is in BCNF if it is already 3NF, and if for any functional dependency say P->Q, P should be a super key.
\u6bd4\u8f83 3NF \u548c BCNF \u7684\u533a\u522b\uff1a
3NF BCNF \u4e0d\u5e94\u6709 \u5f31 \u5f3a \u51cf\u5c11\u4e86\u5197\u4f59 \u4fdd\u7559\u4e86\u6240\u6709\u51fd\u6570\u4f9d\u8d56 \u53ef\u80fd\u6709\u7684\u51fd\u6570\u4f9d\u8d56\u6ca1\u6709\u88ab\u4fdd\u5b58Fifth Normal Form \u7b2c\u4e94\u8303\u5f0f
Sixth Normal Form \u7b2c\u516d\u8303\u5f0f
\u505a\u9898\u7684\u65f6\u5019\u4f3c\u4e4e\u53ea\u4f1a\u8ba9\u5199\uff1a\u7b26\u5408 1NF \u7684\uff0c3NF \u7684\uff0cBCNF \u7684\u4e09\u79cd\u5206\u89e3\u3002
"},{"location":"docs/1-cs/database/normalforms/#_4","title":"\u51fd\u6570\u4f9d\u8d56","text":""},{"location":"docs/1-cs/database/normalforms/#_5","title":"\u95ed\u5305","text":""},{"location":"docs/1-cs/database/normalforms/#_6","title":"\u6700\u5c0f\u8986\u76d6","text":""},{"location":"docs/1-cs/database/normalforms/#references","title":"References","text":":material-circle-edit-outline: \u7ea6 1202 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
\u67e5\u8be2\u5904\u7406\u7684\u57fa\u672c\u6b65\u9aa4\u662f\uff1a\uff081\uff09Parsing and translation \u89e3\u6790\u548c\u7ffb\u8bd1 \uff082\uff09Optimization \u4f18\u5316 \uff083\uff09Evaluation \u8bc4\u4f30\u3002
\u6211\u4eec\u6700\u5173\u6ce8\u7684\u5176\u5b9e\u662f\u4f18\u5316\u6b65\u9aa4\u3002\u4f18\u5316\u4e00\u6b65\u662f\u57fa\u4e8e\u4ee5\u4e0b\u5047\u8bbe\uff1a\u4e00\u79cd SQL \u67e5\u8be2\u53ef\u80fd\u5bf9\u5e94\u4e86\u591a\u79cd\u7b49\u4ef7\u7684\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u4f30\u8ba1\u6bcf\u79cd\u4f18\u5316\u65b9\u6cd5\u7684 cost \u6765\u8bc4\u4f30\u65b9\u6cd5\u7684\u597d\u574f\u3002\u67e5\u8be2\u4f18\u5316\u4f1a\u9009\u62e9\u6700\u8282\u7ea6\u7684\u65b9\u5f0f\u8fdb\u884c\u67e5\u8be2\u3002
\u90a3\u4e48\u95ee\u9898\u5c31\u89c4\u7ea6\u6210\u4e86\u4ece\u6240\u6709\u7b49\u4ef7\u7684\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u4e2d\uff0c\u9009\u62e9 cost \u6700\u5c0f\u7684\u4e00\u4e2a\u3002\u90a3\u4e48\u95ee\u9898\u5c31\u53d8\u6210\u4e86\u5982\u4f55\u8ba1\u7b97 cost\uff01
Cost is generally measured as total elapsed time for answering query. Many factors contribute to the time cost: disk access + CPU + network communication
. \u4f46\u662f\u524d\u9762\u8ba8\u8bba\u8fc7\uff0c\u4e00\u4e2a\u67e5\u8be2\u88ab\u6267\u884c\u7684\u65f6\u5019\u9700\u8981\u88ab\u52a0\u8f7d\u5230\u78c1\u76d8\u4e0a\uff0c\u800c\u78c1\u76d8\u8bfb\u5199\u975e\u5e38\u6162\uff1bCPU \u65f6\u95f4\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\uff1b\u53ea\u8981\u4e0d\u662f\u7f51\u7edc\u5e94\u7528\u5c31\u4e0d\u7528\u7ba1\u7f51\u7edc\u4f20\u8f93\u5f00\u9500\u3002\u6240\u4ee5\u76ee\u524d\u6211\u4eec\u5173\u6ce8\u7684 cost \u6700\u5927\u7684\u6765\u6e90\u5c31\u662f\u78c1\u76d8\u8bbf\u95ee\u65f6\u95f4\uff0c\u5176\u4e2d\u5305\u542b seek, block read, block write \u7684\u7528\u65f6\u3002\u56e0\u6b64\u5b9a\u4e49\u4ee5\u4e0b cost \u8ba1\u7b97\u65b9\u6cd5\uff1a
\u5728 B \u4e2a block \u4e2d\u67e5\u8be2 S \u6b21\u7684\u65f6\u95f4 = B * \u8f6c\u79fb\u5230\u4e00\u4e2a block \u7684\u65f6\u95f4 + S * \u4e00\u6b21\u67e5\u8be2\u7684\u65f6\u95f4\u3002
\u800c\u67e5\u8be2\u4e2d\uff0c\u8bfb\u5199\u8017\u65f6\u66f4\u591a\uff0c\u5176\u4e2d\u5199\u6bd4\u8bfb\u66f4\u8017\u65f6\u3002\u6240\u4ee5\u6211\u4eec\u5e0c\u671b\u67e5\u627e\u548c\u67e5\u8be2\u7684\u65f6\u95f4\u90fd\u66f4\u5c11\u3002
\uff08TODO\uff1a\u8fd9\u91cc\u8ba1\u7b97\u7684\u65f6\u5019\u8981\u57fa\u4e8e\u4e24\u4e2a\u5047\u8bbe\uff0ccost \u4f9d\u8d56\u4e8e\u4e3b\u5b58\u4e2d\u7f13\u51b2\u533a\u7684\u5927\u5c0f\uff0c\u66f4\u591a\u7684\u5185\u5b58\u53ef\u4ee5\u51cf\u5c11 disk access\uff1b\u53e6\u5916\u901a\u5e38\u8003\u8651\u6700\u574f\u7684\u60c5\u51b5\uff0c\u5373\u4e3b\u5b58\u53ea\u63d0\u4f9b\u6700\u5c11\u7684\u5185\u5b58\u6765\u5b8c\u6210\u67e5\u8be2\u5de5\u4f5c\uff09
\u63a5\u4e0b\u6765\u6765\u4f30\u8ba1\u5173\u7cfb\u4ee3\u6570\u5404\u4e2a\u64cd\u4f5c\u7684 cost
Select \u9009\u62e9\u7684 cost \u8ba1\u7b97
\u6709\u4e09\u79cd select \u7684\u7b97\u6cd5
\u7ebf\u6027\u641c\u7d22
\u53bb\u4f9d\u6b21\u67e5\u8be2\u6bcf\u4e2a block \u5224\u65ad\u662f\u5426\u6ee1\u8db3\u67e5\u8be2\u6761\u4ef6\u3002
\u7d22\u5f15\u641c\u7d22
Primary index, equality on key \u641c\u7d22\u4e00\u6761\u8bb0\u5f55
Primary index, equality on non-key \u9700\u8981\u641c\u7d22\u591a\u6761\u8bb0\u5f55
Secondary index \u4e8c\u7ea7\u7d22\u5f15
Sort \u6392\u5e8f\u7684 cost \u4f30\u8ba1
sort \u64cd\u4f5c\u4e00\u822c\u4f7f\u7528\u5916\u90e8\u5f52\u5e76\u6392\u5e8f\u3002\u5bf9\u4e8e\u4e00\u4e2a\u5927\u5c0f\u4e3a M \u7684\u5185\u5b58\uff0cb_r \u8868\u793a block \u7684\u6570\u91cf\u3002sort \u5206\u4e3a\u4ee5\u4e0b\u4e24\u4e2a\u6b65\u9aa4\uff1a(1) create sorted runs\uff0c\u6570\u636e\u4ece\u78c1\u76d8\u8bfb\u5165\u5185\u5b58\u4e2d\uff0c\u56e0\u4e3a\u5185\u5b58\u5927\u5c0f\u662f M\uff0c\u6bcf\u6b21\u80fd\u5904\u7406 M \u4e2a\u6570\u636e\u9879 (2) merge the runs\u3002
\u9700\u8981\u7684 merge pass \u7684\u603b\u6570 \\(\\lceil log_{M-1}(b_r/M) \\rceil\\)\u3002
\u521b\u5efa\u548c\u6bcf\u6b21 run \u7684\u8fc7\u7a0b\u4e2d disk access \u7684\u6570\u91cf 2br\u3002
\u5916\u90e8\u6392\u5e8f\u4e2d\u603b\u7684 disk access \u6b21\u6570 \\((2\\lceil log_{M-1}(b_r/M) \\rceil+1)b_r\\)
Join \u8fde\u63a5\u7684 cost \u4f30\u8ba1
\u4ee5\u4e0b\u6709\u51e0\u79cd\u5b9e\u73b0 join \u7684\u7b97\u6cd5 (1) nested-loop join (2) block nested-loop join (3) indexed nested-loop join (4) merge-join (5) hash-join\u3002
nested-loop join For each tuple in the outer relation, scan the entire inner relation to find all matching tuples.
\u8ba1\u7b97 theta-join \u8868\u8fbe\u5f0f\uff1a
for each tuple tr in sr do begin\n for each tuple ts in s do begin\n test pair (tr, ts) to see if they satisfy the join condition\n
r is called the outer relation and s the inner relation of the join.
block nested-loop join
Similar to the nested-loop join, but processes the relations in block rather than tuple by tuple to reduce the number of I/O operations.
for each block br of r do begin\n for each block bs of s do begin\n for each tuple tr in br do begin\n for each tuple ts in bs do begin\n check if (tr, ts) satisfy the join condition\n if they do, add tr\u00b7ts to the result\n end\n end\n end\nend\n
\u6700\u574f\u7684\u60c5\u51b5\uff1a block transfer b_r * b_s + b_r
\u57fa\u7840\u60c5\u51b5\uff1a
index nested-loop join
merge-join Requires both relations to be sorted on the join key. Merges the sorted relations by iterating through them in parallel.
hash join
Uses a hash table to partition the tuples of one relation based on the join key, then probes the hash table with the tuples of the other relation.
\u5bf9\u6bd4\uff1a
Nested-loop Join: Simple but inefficient for large datasets due to \ud835\udc42 ( \u2223 \ud835\udc45 \u2223 \u00d7 \u2223 \ud835\udc46 \u2223 ) O(\u2223R\u2223\u00d7\u2223S\u2223) complexity. Block Nested-loop Join: Optimized version of nested-loop join that processes blocks to reduce I/O operations. Merge Join: Efficient for sorted relations, with complexity dominated by the sort operations. Hash Join: Very efficient for large datasets, especially when one relation can fit into memory, with \ud835\udc42 ( \u2223 \ud835\udc45 \u2223 + \u2223 \ud835\udc46 \u2223 ) O(\u2223R\u2223+\u2223S\u2223) complexity assuming good hashing.
Duplicated Deletion \u91cd\u590d\u6d88\u9664
\u6392\u5e8f\u548c\u6295\u5f71\u53ef\u4ee5\u6d88\u9664\u91cd\u590d
\u8003\u5f97\u4e0d\u591a\u3002
Aggregation \u805a\u5408
\u4e5f\u53ef\u4ee5\u7528\u6392\u5e8f\u6216\u6295\u5f71\u6765\u505a\u3002
"},{"location":"docs/1-cs/database/query/#query-optimization","title":"Query Optimization \u67e5\u8be2\u4f18\u5316","text":"\u5bf9\u7ed9\u5b9a\u67e5\u8be2\uff0c\u4f18\u5316\u7684\u65b9\u6cd5\u6709\uff1a
Equivalent expressions \u7b49\u4ef7\u8868\u8fbe\u5f0f
\u8fd9\u79cd\u5c5e\u4e8e\u903b\u8f91\u4f18\u5316\uff0c\u8bbe\u8ba1\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u505a\u6570\u5b66\u9898\u65f6\u8ba1\u7b97 a*b + c*b\uff0c\u4f18\u5316\u6210 (a+c) * b\uff0c\u5c31\u50cf\u4e00\u79cd\u903b\u8f91\u4f18\u5316\u3002
\u5b83\u4e5f\u53eb Cost based optimization.
\u5728\u6570\u636e\u5e93\u4e2d\u539f\u5219\u4e00\u822c\u662f\u5f80\u5f80\u5148\u53bb\u505a\u9009\u62e9\u548c\u6295\u5f71\uff08\u5df2\u7ecf\u5bf9\u521d\u59cb\u8868\u505a\u8fc7\u4e00\u6b21\u9009\u62e9\uff0c\u51cf\u5c11\u4e86\u5f88\u591a\u8bb0\u5f55\uff09\uff0c\u518d\u8fde\u63a5\u3002
Different algorithms for each operation \u76f8\u540c\u7b97\u5b50\u7684\u4e0d\u540c\u8868\u8fbe\u5f0f
\u8fd9\u79cd\u5c5e\u4e8e\u7269\u7406\u5c42\u9762\u7684\u4f18\u5316\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u505a\u6570\u5b66\u9898\u65f6\u4e0d\u518d\u7528\u7b14\u7b97\uff0c\u800c\u662f\u7528\u8ba1\u7b97\u5668\u7b97\uff0c\u5c31\u50cf\u662f\u4e00\u79cd\u7269\u7406\u5c42\u9762\u7684\u4f18\u5316\u3002
\u5b83\u4e5f\u53eb Transformation based optimization.
!!! TODO \u4e0b\u9762\u7684\u51e0\u4e2a\u4e13\u9898\u7a76\u7adf\u662f\u4ec0\u4e48\u903b\u8f91\u6392\u7684
"},{"location":"docs/1-cs/database/query/#equivalent-expressions","title":"Equivalent expressions","text":""},{"location":"docs/1-cs/database/query/#statistics-for-cost-estimation","title":"Statistics for Cost Estimation","text":""},{"location":"docs/1-cs/database/transaction/","title":"Transaction \u4e8b\u52a1","text":":material-circle-edit-outline: \u7ea6 1318 \u4e2a\u5b57 :fontawesome-solid-code: 7 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/1-cs/database/transaction/#_1","title":"\u7b80\u4ecb","text":"\u4e8b\u52a1\u662f\u7a0b\u5e8f\u6267\u884c\u7684\u57fa\u672c\u5355\u4f4d\uff0c\u4f1a\u5f15\u8d77\u4e00\u4e9b\u6570\u636e\u9879\u7684\u66f4\u65b0\u3002\u6211\u4eec\u5b9a\u4e49\u4e8b\u52a1\u6709\u4ee5\u4e0b\u56db\u4e2a\u57fa\u672c\u5c5e\u6027\uff1a
Atomicity \u539f\u5b50\u6027 \u4e8b\u52a1\u662f non-or-all \u7684\uff0c\u5373\u6240\u6709\u6b65\u9aa4\u8981\u4e48\u5168\u90e8\u6267\u884c\u540e commit\uff0c\u8981\u4e48\u5c31 rollback \u56de\u6eda\u5230\u6ca1\u505a\u7684\u72b6\u6001\u3002
Durability \u6301\u4e45\u6027 \u4e8b\u52a1\u5b8c\u6210\u540e\u66f4\u65b0\u6570\u636e\uff0c\u5373\u4f7f\u8f6f\u786c\u4ef6\u51fa\u4e86\u95ee\u9898\uff0c\u66f4\u65b0\u7684\u6570\u636e\u4e5f\u5fc5\u987b\u5b58\u5728\u3002
Consistency \u4e00\u81f4\u6027 \u5b9a\u4e49\u8bf4\uff1a\u4e8b\u52a1\u5fc5\u987b\u4f7f\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u3002\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff0c\u5982\u679c\u6709\u4e00\u4e2a\u4fdd\u5b58\u5b58\u6b3e\u7684\u6570\u636e\u5e93\uff0c\u4e00\u5f00\u59cb\u5b58\u53d6\u8bb0\u5f55\u52a0\u8d77\u6765\u7ed3\u679c\u662f\u7b49\u4e8e\u603b\u6570\u7684\uff0c\u90a3\u4e48\u4e8b\u52a1\u6267\u884c\u5b8c\uff0c\u8fd8\u8981\u4fdd\u6301\u6240\u6709\u8bb0\u5f55\u5728\u8fd9\u4e2a\u52a0\u8d77\u6765\u7b49\u4e8e\u603b\u6570\u7684\u72b6\u6001\u3002
Isolation \u72ec\u7acb\u6027 \u5f53\u591a\u4e2a\u7528\u6237\u5e76\u53d1\u8bbf\u95ee\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u6570\u636e\u5e93\u4e3a\u6bcf\u4e2a\u7528\u6237\u5f00\u542f\u7684\u4e8b\u52a1\uff0c\u4e0d\u80fd\u88ab\u5176\u5b83\u4e8b\u52a1\u7684\u64cd\u4f5c\u6240\u5e72\u6270\u3002
\u4e3a\u4e86\u4fdd\u8bc1\u4e8b\u52a1\u7684\u8fd9\u4e9b\u5c5e\u6027\uff0c\u4e00\u822c\u4e3b\u8981\u9700\u8981\u8003\u8651\u4e24\u4e2a\u95ee\u9898\uff1a
\u4e8e\u662f\uff0c\u6211\u4eec\u8003\u8651\u628a\u4e00\u4e2a\u4e8b\u52a1\u5206\u4e3a\u591a\u4e2a\u72b6\u6001\u6765\u5b8c\u6210\u3002\u4e00\u4e2a\u4e8b\u52a1\u6709\u4e94\u79cd\u72b6\u6001\uff1a
\u4e00\u4e2a\u8f6c\u5316\u7684\u72b6\u6001\u56fe\u5982\u4e0b
graph LR\n\nA[[active]] --> P[[Partially commited]]\nP --(single step)--> C[[commited]]\nA --> F[[failed]]\nP --> F\nF --(single step)--> B[[aborted]]\n
\u6211\u4eec\u4e3b\u8981\u9700\u8981\u4fdd\u8bc1 partially commited \u5230 commited\uff0c\u548c failed \u5230 abort\uff0c\u8fd9\u4e24\u6b65\u90fd\u662f\u539f\u5b50\u6027\u7684\u3002
"},{"location":"docs/1-cs/database/transaction/#_2","title":"\u8c03\u5ea6","text":"\u8fd9\u6837\u5c31\u6d89\u53ca\u5230\u8c03\u5ea6\u6982\u5ff5\u3002Schedules \u8c03\u5ea6\u662f\u4e00\u7cfb\u5217\u7528\u4e8e\u6307\u5b9a\u5e76\u53d1\u4e8b\u52a1\u6267\u884c\u987a\u5e8f\u7684\u6307\u4ee4\u3002\u5b83\u9700\u8981\uff081\uff09\u5305\u542b\u4e8b\u52a1\u4e2d\u7684\u6240\u6709\u6307\u4ee4\uff0c\uff082\uff09\u4fdd\u8bc1\u5355\u4e2a\u4e8b\u52a1\u4e2d\u7684\u6307\u4ee4\u7684\u76f8\u5bf9\u987a\u5e8f\u3002
\u5982\u679c\u4e8b\u52a1\u662f\u826f\u6784\u7684\u4e14\u662f\u4e24\u9636\u6bb5\u7684\uff0c\u90a3\u4e48\u4efb\u4f55\u4e00\u4e2a\u5408\u6cd5\u7684\u8c03\u5ea6\u90fd\u662f\u9694\u79bb\u7684 \u5177\u4f53\u7684\u6570\u5b66\u63a8\u5230\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u7167<<\u4e8b\u52a1\u5904\u7406:\u6982\u5ff5\u4e0e\u6280\u672f>>\u8fd9\u672c\u4e66\u76847.5.8.2\u8282\u6b64\u4e66\u4e43\u662f\u5173\u4e8e\u6570\u636e\u5e93\u4e8b\u52a1\u7684\u5723\u7ecf\uff0c\u65e0\u9700\u89e3\u91ca(\u4e2d\u6587\u7ffb\u8bd1\u867d\u7136\u6666\u6da9\uff0c\u4e5f\u80fd\u575a\u6301\u8bfb\u4e0b\u53bb,\u5f3a\u70c8\u63a8\u8350
"},{"location":"docs/1-cs/database/transaction/#_3","title":"\u4e32\u884c","text":"\u5982\u679c\u4e00\u4e2a\u8c03\u5ea6\u4e0e\u4e00\u4e2a\u4e32\u884c\u8c03\u5ea6\uff08serial\uff09\u7b49\u4ef7\uff0c\u90a3\u4e48\u79f0\u8fd9\u4e2a\u8c03\u5ea6\u662f serializable \u53ef\u4e32\u884c\u5316\u7684\u3002
\u53ef\u4e32\u884c\u5316\u5efa\u7acb\u5728\u4e00\u4e2a\u5047\u8bbe\u4e0a\uff1a\u4e8b\u52a1\u4e0d\u4f1a\u7834\u574f\u6570\u636e\u5e93\u7684\u4e00\u81f4\u6027\uff0c\u53ea\u8003\u8651\u6709\u8bfb\u5199\u4e24\u79cd\u64cd\u4f5c\u3002
\u6211\u4eec\u8bf4\u4e00\u4e2a\u8c03\u5ea6\u662f conflict serializable \u51b2\u7a81\u53ef\u4e32\u884c\u5316\u7684\uff0c\u5f53\uff1a
"},{"location":"docs/1-cs/database/transaction/#-","title":"-","text":""},{"location":"docs/1-cs/database/transaction/#_4","title":"\u5e76\u53d1\u5904\u7406","text":"\u540c\u65f6\u6267\u884c\u591a\u4e2a\u4e8b\u52a1\uff0c\u53ef\u4ee5\u63d0\u9ad8\u8fd0\u884c\u7684\u6548\u7387\uff0c\u51cf\u5c11\u5e73\u5747\u6267\u884c\u65f6\u95f4\u3002
\u5e76\u53d1\u63a7\u5236\u7684\u5904\u7406\u673a\u5236\u662f\uff0c\u8ba9\u5e76\u53d1\u7684\u4e8b\u52a1\u72ec\u7acb\u8fdb\u884c\uff0c\u63a7\u5236\u5e76\u53d1\u7684\u4e8b\u52a1\u4e4b\u95f4\u7684\u4ea4\u6d41\u3002
"},{"location":"docs/1-cs/database/transaction/#_5","title":"\u6545\u969c\u6062\u590d","text":"\u6545\u969c\u7684\u79cd\u7c7b\u6709\uff1a
database application \u903b\u8f91\u9519\u8bef\uff1a\u6bd4\u5982\u4e0d\u6ee1\u8db3\u6570\u636e\u5e93\u7ea6\u675f\u6761\u4ef6\uff08\u4e3b\u952e\uff09\uff0c\u7cfb\u7edf\u9519\u8bef\u6b7b\u9501\u3002
DBMS
Database
checkpoint
Recovery algorithms are techniques to ensure database consistency and transaction atomicity and durability despite failures. \u6545\u969c\u6062\u590d\u7b97\u6cd5\u5c31\u662f\u4fdd\u969c\u6570\u636e\u5e93 ACD\uff08\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6ca1\u6709 I\uff09\u7279\u6027\u7684\u65b9\u6cd5\u3002
\u6545\u969c\u6062\u590d\u7b97\u6cd5\u6709\u4e24\u4e2a\u90e8\u5206\uff1a
\u6545\u969c\u6062\u590d\u7b97\u6cd5\u5177\u6709 Idempotent(\u5e42\u7b49\u6027): An recovery algorithm is said to be idempotent if executing it several times gives the same result as executing it once. \u610f\u601d\u662f\u7b97\u6cd5\u6062\u590d\u591a\u6b21\u7684\u6548\u679c\u662f\u4e00\u6837\u7684\uff0c\u56e0\u4e3a\u6062\u590d\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4e5f\u53d1\u751f crash\u3002
Log-based Recovery \u57fa\u4e8e\u65e5\u5fd7\u7684\u6062\u590d\u6cd5
log records \u65e5\u5fd7\u8bb0\u5f55\uff1a
\u65e5\u5fd7\u8bb0\u5f55\u662f\u8bb0\u5f55\u5728 stable storage\uff08\u7a33\u5b9a\u5b58\u50a8\u5668\uff09\u4e0a\u7684\uff0c\u4e00\u7cfb\u5217\u8bb0\u5f55\u6570\u636e\u5e93\u600e\u6837\u88ab\u6210\u529f\u4fee\u6539\u7684\u4fe1\u606f\u3002log \u7531\u4e00\u4e32 log records \u7ec4\u6210\u3002\u5b83\u6709\u4ee5\u4e0b\u51e0\u79cd\u683c\u5f0f
checkpoint \u4e4b\u95f4\u7684\u95f4\u9694\u5e94\u5f53\u901a\u8fc7\u65e5\u5fd7\u91cf\u6765\u786e\u5b9a\u3002
\u4e24\u79cd\u7b56\u7565 - Redo:
In the redo phase, the system replays updates of all transactions by scaning the log forward from the last checkpoint. The log records that are replayed include log records for transactions that were rolled back befored system crash, and those that had not committed when the system crash occurred. \n\u5728 redo \u9636\u6bb5\u91cc\uff0c\u7cfb\u7edf\u6839\u636e\u91cd\u65b0\u626b\u63cf\u4e0a\u4e00\u6b21 checkpoint \u4e4b\u540e\u7684\u6240\u6709\u8bb0\u5f55\uff0c\u91cd\u65b0\u6267\u884c\u4e0a\u4e00\u6b21 checkpoint \u4e4b\u540e\u7684\u6240\u6709 transaction\u3002\u8fd9\u91cc\u7684 log \u8bb0\u5f55\u5305\u62ec\u5728 crash \u4e4b\u524d\u6b63\u5728\u56de\u6eda\u7684\u90a3\u4e9b\u8bb0\u5f55\uff0c\u4e5f\u5305\u62ec crash \u65f6\u8fd8\u6ca1\u6709\u63d0\u4ea4\u7684\u90a3\u4e9b\u8bb0\u5f55\u3002Redo \u9636\u6bb5\u4e5f\u4f1a\u5224\u65ad\u6240\u6709 transaction \u662f\u5426\u5b8c\u6210\u4e86\uff0c\u662f\u5426\u9700\u8981 roll back\u3002\u6ca1\u5b8c\u6210\u7684 transaction \u4f1a\u88ab\u6807\u8bb0\u4e3a\u6216\u8005 \\<Ti abort\\> \u6216\u8005 \\<Ti commit\\> \u7684\u6807\u8bb0\u3002\u5177\u4f53\u6765\u8bf4\u6267\u884c\u7684\u6b65\u9aa4\u6709\u4e0b\u9762\u51e0\u6761\uff1a\n\n-\n
:material-circle-edit-outline: \u7ea6 14 \u4e2a\u5b57
"},{"location":"docs/1-cs/database/xml/#_1","title":"\u5b9a\u4e49\u548c\u57fa\u672c\u7ed3\u6784","text":""},{"location":"docs/1-cs/database/xml/#document-schema","title":"Document Schema","text":""},{"location":"docs/1-cs/database/xml/#_2","title":"\u67e5\u8be2","text":""},{"location":"docs/1-cs/oop/course/","title":"Courses \u542c\u8bfe","text":":material-circle-edit-outline: \u7ea6 1567 \u4e2a\u5b57 :fontawesome-solid-code: 91 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f
"},{"location":"docs/1-cs/oop/course/#cs106bcs106l","title":"\u5173\u4e8eCS106B\u548cCS106L","text":"CS106B\u504f\u7b80\u5355\uff0c\u76f8\u5f53\u4e8eZJU\u7684\u6570\u636e\u7ed3\u6784+C++\u7684STL\u7528\u6cd5\u4e00\u5757\u8bb2\uff0c\u53e6\u5916\u518d\u8bb2\u4e00\u4e9bFDS\u7684\u7b97\u6cd5\u3002 CS106L\u662f\u4e13\u95e8\u8bb2C++\u8fdb\u9636\u7279\u6027\u7684\u3002
\u56e0\u4e3a\u5728\u542cCS106B\u4e4b\u524d\u5b66\u8fc7FDS\uff0cCS106B\u82b1\u4e00\u5929\u901f\u901a\u4e86\u4e00\u4e0b\uff0c\u91cd\u590d\u5185\u5bb9\u6709\u70b9\u591a\uff0c\u622a\u4e0b\u4e86\u4e00\u5e45\u56fe\u3002
CS106L\u63d0\u4f9b\u7684C++\u5b66\u4e60\u8def\u7ebf\u56fe
"},{"location":"docs/1-cs/oop/course/#zju","title":"ZJU\u8bfe\u7a0b","text":""},{"location":"docs/1-cs/oop/course/#_1","title":"\u8bfe\u7a0b\u53c2\u8003\u8d44\u6599","text":"CPP Reference Standard C++ CppCon
"},{"location":"docs/1-cs/oop/course/#_2","title":"\u4e0a\u8bfe\u5fc3\u5f97","text":"\u6211\u8ddf\u7684\u662fcx\u8001\u5e08\u7684\u73ed\uff0c\u5e94\u8be5\u662f\u6559\u5f97\u6700\u597d\u7684\u4e00\u6863orz \u4f46\u662f\u4e0a\u8bfe\u5185\u5bb9\u4ecd\u4e0d\u80fd\u8986\u76d6\u4f5c\u4e1a\u548c\u671f\u672b\u7684\u5185\u5bb9\uff0c\u89c9\u5f97\u542c\u8bfe\u5185\u5bb9\u53ea\u80fd\u8d77\u5230\u4e00\u4e2a\u9aa8\u67b6\u4f5c\u7528\uff0c\u8bfe\u540e\u9700\u8981\u82b1\u4e0a\u8bfe2\u81f33\u500d\u7684\u65f6\u95f4\u81ea\u5b66\u81ea\u5df1\u6574\u7406\u7b14\u8bb0\uff0c\u591a\u8bfb\u591a\u5199\u4ee3\u7801\uff0c\u4e0d\u7136\u671f\u672b\u4f1a\u9047\u5230\u6ca1\u89c1\u8fc7\u7684\u7279\u6027\uff0c\u4f1a\u6709\u70b9\u60e8orz\uff08\u50cf\u6211\u4e00\u6837\uff09
"},{"location":"docs/1-cs/oop/course/#_3","title":"\u9762\u5411\u5bf9\u8c61\u56db\u5927\u7279\u6027","text":"class Name\n{\n public:\n public_data;\n public_functions;\n protected:\n protected_data;\n protected_functions;\n private:\n private_data;\n private_functions;\n}\n
\u8fd4\u56de\u7c7b\u578b \u7c7b\u540d::\u6210\u5458\u51fd\u6570\u540d\uff08\u53c2\u6570\u8868\uff09 { // \u51fd\u6570\u4f53 }
"},{"location":"docs/1-cs/oop/course/#_9","title":"\u5185\u8054\u51fd\u6570\u548c\u5916\u8054\u51fd\u6570","text":"\u53ef\u4ee5\u628a\u76f8\u540c\u6570\u636e\u7ed3\u6784\u548c\u76f8\u540c\u64cd\u4f5c\u96c6\u7684\u5bf9\u8c61\u770b\u4f5c\u5c5e\u4e8e\u540c\u4e00\u7c7b\u3002\u5bf9\u8c61\u662f\u7c7b\u7684\u5b9e\u4f8b\u3002
"},{"location":"docs/1-cs/oop/course/#_11","title":"\u5bf9\u8c61\u7684\u5b9a\u4e49","text":"\u5bf9\u8c61\u540d.\u6570\u636e\u6210\u5458\u540d\uff08\u662f \u5bf9\u8c61\u540d.\u7c7b\u540d::\u6210\u5458\u540d \u7684\u7f29\u5199\uff09 \u5bf9\u8c61\u540d.\u6210\u5458\u51fd\u6570\u540d\uff08\u53c2\u6570\u8868\uff09
class Sample\n{\npublic:\nint k;\nint geti(){return i;}\nint getj(){return j;}\nint getk(){return k;}\nprivate:\nint i;\nprotected:\nint j;\n};\nint main()\n{\nSample a;\na.i; // \u975e\u6cd5\na.j: // \u975e\u6cd5\na.k; // \u5408\u6cd5\n}\n
"},{"location":"docs/1-cs/oop/course/#_13","title":"\u7c7b\u7684\u4f5c\u7528\u57df","text":"\u7c7b\u7684\u6784\u9020\u51fd\u6570\u662f\u7c7b\u7684\u4e00\u4e2a\u7279\u6b8a\u6210\u5458\u51fd\u6570\uff0c\u6ca1\u6709\u8fd4\u56de\u7c7b\u578b\uff08\u4e0d\u662fvoid\uff09\uff0c\u53ef\u4ee5\u6709\u53c2\u6570\uff0c\u51fd\u6570\u540d\u548c\u7c7b\u540d\u4e00\u6837\u3002\u5f53\u521b\u5efa\u7c7b\u7684\u4e00\u4e2a\u65b0\u5bf9\u8c61\u65f6\uff0c\u81ea\u52a8\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5b8c\u6210\u521d\u59cb\u5316\u5de5\u4f5c\u3002
"},{"location":"docs/1-cs/oop/course/#namespace","title":"Namespace","text":""},{"location":"docs/1-cs/oop/course/#namespace_1","title":"\u4ec0\u4e48\u662fnamespace\uff1f","text":"\u662f\u5355\u4e00\u7684\u5168\u5c40\u540d\u5b57\u7a7a\u95f4\u3002\u9632\u6b62\u5728\u4e00\u4e2a\u7a7a\u95f4\u4e2d\u76f8\u540c\u7684\u540d\u5b57\u5f15\u8d77\u51b2\u7a81\u3002 \u4f8b\u5b50\uff1a
namespace myown1\n{\nstring user_name = \"myown1\";\n}\nnamespace myown2\n{\nstring user_name = \"myown2\";\n}\nint main()\n{\n// using namespace myown1; \ncout << \"\\\\n\" << \"Hello, \"\n<< myown1::user_name\n<< \"...and goodbye!\\\\n\"\ncout << \"\\\\n\" << \"Hello, \"\n<< myown2::user_name\n<< \"...and goodbye!\\\\n\"\nreturn 0;\n}\n
\u5173\u952e\u8bcdusing\u5c06\u4e00\u4e2a\u540d\u5b57\u7a7a\u95f4\u53d8\u4e3a\u53ef\u89c1\uff0c\u4e0d\u4f1a\u8986\u76d6\u5f53\u524d\u7684namespace\u3002
"},{"location":"docs/1-cs/oop/course/#_15","title":"\u7ee7\u627f\u4e0e\u6d3e\u751f\u7c7b","text":"\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u4e2d\u9664\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e4b\u5916\u7684\u6240\u6709\u6210\u5458\u3002\u6d3e\u751f\u7c7b\u7684\u6210\u5458\u5305\u62ec\uff1a - \u7ee7\u627f\u57fa\u7c7b\u7684\u6210\u5458 - \u6d3e\u751f\u7c7b\u5b9a\u4e49\u65f6\u58f0\u660e\u7684\u6210\u5458
\u4ece\u5df2\u6709\u7c7b\u6d3e\u751f\u51fa\u65b0\u7c7b\u65f6\uff0c\u53ef\u4ee5\u5728\u6d3e\u751f\u7c7b\u5185\u5b8c\u6210\u4ee5\u4e0b\u51e0\u79cd\u529f\u80fd\uff1a - \u589e\u52a0\u65b0\u7684\u6570\u636e\u6210\u5458 - \u589e\u52a0\u65b0\u7684\u6210\u5458\u51fd\u6570 - \u91cd\u65b0\u5b9a\u4e49\u57fa\u7c7b\u4e2d\u5df2\u6709\u7684\u6210\u5458\u51fd\u6570 - \u53ef\u4ee5\u6539\u53d8\u73b0\u6709\u6210\u5458\u7684\u5c5e\u6027
\u58f0\u660e\u4e00\u4e2a\u6d3e\u751f\u7c7b\u7684\u4e00\u822c\u683c\u5f0f
class \u6d3e\u751f\u7c7b\u540d:\u7ee7\u627f\u65b9\u5f0f \u57fa\u7c7b\u540d\n{\n// \u6d3e\u751f\u7c7b\u65b0\u589e\u7684\u6570\u636e\u6210\u5458\u548c\u6210\u5458\u51fd\u6570\n};\n
\u4e09\u79cd\u7ee7\u627f\u65b9\u5f0f
class employee: public person\n{};\n// default\nclass employee: private person\n{};\nclass employee: protected person\n{};\n
\u57fa\u7c7b\u6210\u5458\u5728\u6d3e\u751f\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027
\u5728\u57fa\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027 \u7ee7\u627f\u65b9\u5f0f \u5728\u6d3e\u751f\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027 \u89e3\u91ca private public inaccessible \u57fa\u7c7b\u4e2dprivate\u7684\u5bf9\u8c61\u5728\u7c7b\u5916\u5f53\u7136\u4e0d\u53ef\u8bbf\u95ee private private inaccessible private protected inaccessible public public public \u57fa\u7c7b\u4e0d\u7ba1 public private private public protected protected protected public protected \u6743\u9650\u4f1a\u88ab\u7ee7\u627f\u65b9\u5f0f\u7f29\u5c0f\u800c\u4e0d\u4f1a\u653e\u5927 protected private private protected protected protected\u6d3e\u751f\u7c7b\u5bf9\u57fa\u7c7b\u7684\u8bbf\u95ee\u89c4\u5219 - \u5185\u90e8\u8bbf\u95ee\uff1a\u7531\u6d3e\u751f\u7c7b\u4e2d\u65b0\u589e\u6210\u5458\u5bf9\u57fa\u7c7b\u7ee7\u627f\u6765\u7684\u6210\u5458\u7684\u8bbf\u95ee\u3002 - \u5bf9\u8c61\u8bbf\u95ee\uff1a\u5728\u6d3e\u751f\u7c7b\u5916\u90e8\uff0c\u901a\u8fc7\u6d3e\u751f\u7c7b\u7684\u5bf9\u8c61\u5bf9\u4ece\u57fa\u7c7b\u7ee7\u627f\u6765\u7684\u6210\u5458\u7684\u8bbf\u95ee\u3002
\u57fa\u7c7b\u6210\u5458 private\u6210\u5458 public\u6210\u5458 protected\u6210\u5458 \u5185\u90e8\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u53ef\u8bbf\u95ee \u53ef\u8bbf\u95ee \u5bf9\u8c61\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee\u79c1\u6709\u7ee7\u627f\u4e3e\u4f8b
class Point\n{\npublic:\nvoid InitP(float x = 0, float y = 0)\n{\nthis->X = x;\nthis->Y = y;\n}\nvoid Move(float offX, float offY)\n{\nX += offX;\nY += offY;\n}\nfloat GetX() const{return X;}\nfloat GetY() const{return Y;}\nprivate:\nfloat X, Y;\n};\nclass Rectangle: private Point // \u6d3e\u751f\u7c7b\u58f0\u660e\n{\npublic: //\u65b0\u589e\u5916\u90e8\u63a5\u53e3\nvoid InitR(float x, float y, float w, float h)\n{\nInitR(x, y);\nW = w;\nH = h;\n} // \nvoid Move(float xOff, float yOff)\n{\nPoint::\n}\n}\n
"},{"location":"docs/1-cs/oop/final_review/","title":"ZJU \u671f\u672b\u590d\u4e60","text":":material-circle-edit-outline: \u7ea6 1500 \u4e2a\u5b57 :fontawesome-solid-code: 36 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f
\u9762\u5411\u671f\u672b\u9898\u7684\u76f8\u4f3c\u77e5\u8bc6\u70b9\u805a\u7c7b
"},{"location":"docs/1-cs/oop/final_review/#_1","title":"\u6784\u9020\u987a\u5e8f","text":"\uff081\uff09main\u51fd\u6570\u4ee5\u5916\u7684\u5bf9\u8c61\uff0c\u5168\u5c40\u7c7b\u5b9a\u4e49\u540e\u76f4\u63a5\u5b9a\u4e49\u7684\u7c7b\u5bf9\u8c61 \uff082\uff09main\u51fd\u6570\u5185\u7684\u5bf9\u8c61 \uff083\uff09\u7236\u7c7b\u6784\u9020 \uff084\uff09\u5b50\u7c7b\u7c7b\u6210\u5458 \uff085\uff09\u5b50\u7c7b\u6784\u9020 \u6790\u6784\u987a\u5e8f\u76f8\u53cd
"},{"location":"docs/1-cs/oop/final_review/#_2","title":"\u4ec0\u4e48\u65f6\u5019\u751f\u6210\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\uff1f","text":"\u5982\u679c\u5df2\u7ecf\u6709\u6784\u9020\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u4e0d\u4f1a\u751f\u6210\u9ed8\u8ba4\u6784\u9020\u51fd\u6570 \u6ca1\u6709\u7684\u65f6\u5019\u4e5f\u4e0d\u4e00\u5b9a\u4f1a\u751f\u6210 \u9700\u8981\u7528\u624d\u751f\u6210
"},{"location":"docs/1-cs/oop/final_review/#_3","title":"\u91cd\u8f7d\u89c4\u5219","text":"\u4e0d\u80fd\u91cd\u8f7d\u7684\u6709\uff1a - \u4f5c\u7528\u57df\u64cd\u4f5c\u7b26:: - \u6761\u4ef6\u64cd\u4f5c\u7b26?:\uff08\u5e94\u8be5\u662f\u95ee\u53f7\u8868\u8fbe\u5f0f\uff1f\uff09 - \u70b9\u64cd\u4f5c\u7b26\u3001\u7c7b\u6210\u5458\u6307\u9488 - \u9884\u5904\u7406\u7b26\u53f7#
\u53ea\u80fd\u91cd\u8f7d\u4e3a\u53cb\u5143\u4e0d\u80fd\u6210\u5458\u51fd\u6570\uff1a - <<\u548c>> \u539f\u56e0\u662f\u6210\u5458\u51fd\u6570\u91cd\u8f7d\uff0c\u53ea\u80fd\u5e26\u4e00\u4e2a\u53c2\u6570\uff0clhs\u5fc5\u987b\u662f\u6210\u5458\u81ea\u8eab
\u4f46\u662f\u6d41\u64cd\u4f5c\u7b26\u5de6\u8fb9\u662fcin\u6216cout\uff0c\u91cd\u8f7d\u4e3a\u53cb\u5143\u51fd\u6570\u65f6\uff0c\u53ef\u4ee5\u6bd4\u6210\u5458\u51fd\u6570\u591a\u8bf4\u660e\u4e00\u4e2a\u5f62\u53c2\u505alhs
\u91cd\u8f7d\u548c\u91cd\u5199\u90fd\u662f\u591a\u6001\uff1a \u91cd\u8f7d\uff1a\u8fd0\u884c\u65f6\u591a\u6001 \u91cd\u5199\uff1a\u7f16\u8bd1\u65f6\u591a\u6001
static\u548cvirtual\u53ea\u80fd\u6709\u4e00\u4e2a
\u6790\u6784\u51fd\u6570\u4e0d\u80fd\u5e26\u53c2\u6570
"},{"location":"docs/1-cs/oop/final_review/#_4","title":"\u5b50\u7c7b\u548c\u7236\u7c7b\u6307\u9488","text":"\u4ec0\u4e48\u65f6\u5019\u5fc5\u987b\u7528\u5e38\u5f15\u7528\uff08const &\uff09\uff1a\u5f15\u7528\u578b\u53c2\u6570\u5e94\u5f53\u5728\u80fd\u5b9a\u4e49\u4e3aconst\u7684\u60c5\u51b5\u4e0b\u5c3d\u91cf\u5b9a\u4e49\u4e3aconst\u3002
\u4f7f\u7528\u5f15\u7528\u7684\u4e3b\u8981\u539f\u56e0\uff1a \u7a0b\u5e8f\u80fd\u591f\u4fee\u6539\u8c03\u7528\u51fd\u6570\u4e2d\u7684\u6570\u636e\u5bf9\u8c61 \u901a\u8fc7\u4f20\u9012\u5f15\u7528\u800c\u4e0d\u662f\u6574\u4e2a\u6570\u636e\u5bf9\u8c61\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u901f\u5ea6
\u53ea\u4f7f\u7528\u4f20\u9012\u8fc7\u6765\u7684\u503c\u800c\u4e0d\u4fee\u6539 \u9700\u8981\u4fee\u6539\u4f20\u9012\u8fc7\u6765\u7684\u503c \u5185\u7f6e\u6570\u636e\u7c7b\u578b\uff08\u5c0f\u578b\u7ed3\u6784\uff09 \u6309\u503c\u4f20\u9012 \u6307\u9488\u4f20\u9012 \u6570\u7ec4 \u6307\u9488\u4f20\u9012 \u6307\u9488\u4f20\u9012 \u8f83\u5927\u7684\u7ed3\u6784\uff09 \u6307\u9488\u6216\u5f15\u7528 \u6307\u9488\u6216\u5f15\u7528 \u7c7b/\u5bf9\u8c61 \u5f15\u7528\u4f20\u9012 \u5f15\u7528\u4f20\u9012\u5f15\u7528\u548c\u6307\u9488\u7684\u533a\u522b\uff1a \u53ef\u4ee5\u628a\u5f15\u7528\u7406\u89e3\u6210\u4e00\u4e2a\u5e38\u91cf\u6307\u9488\uff0c\u56e0\u6b64\u5f15\u7528\u58f0\u660e\u65f6\u5c31\u5fc5\u987b\u521d\u59cb\u5316\uff0c\u4e00\u7ecf\u58f0\u660e\u4e0d\u80fd\u518d\u548c\u5176\u5b83\u5bf9\u8c61\u7ed1\u5b9a\u3002
Copy constructor must pass its first argument by reference
"},{"location":"docs/1-cs/oop/final_review/#_6","title":"\u7c7b\u5185\u9759\u6001\u6210\u5458\u7684\u521d\u59cb\u5316","text":"const static\u53ef\u4ee5\u5728\u7c7b\u5185\u76f4\u63a5\u521d\u59cb\u5316\uff0c\u975econst static\u6210\u5458\u9700\u8981\u5728\u7c7b\u5916\u521d\u59cb\u5316\u3002
\u53ef\u4ee5\u8c03\u7528\u9ed8\u8ba4\u521d\u59cb\u5316A::n\uff0c\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\u3002\u6b64\u65f6\u8c03\u7528\u9ed8\u8ba4\u6784\u9020\u4e0d\u80fd\u7528n()\uff0c\u5426\u5219\u8ba4\u4e3a\u662f\u4e2a\u51fd\u6570\u3002\u6216\u8005\u5e26\u521d\u59cb\u503c\u521d\u59cb\u5316A::n(9)
static\u548cconst - \u6ca1\u6709static\u5c31\u662fconst\u7684\u8bf4\u6cd5
const\u7684\u51e0\u79cd\u5f62\u5f0f
const int& fun(int& a); // \u4fee\u9970\u8fd4\u56de\u503c \nint& fun(const int& a); // \u4fee\u9970\u5f62\u53c2 \nint& fun(int& a) const {} // const\u6210\u5458\u51fd\u6570\n
const\u8fd4\u56de\u503c\uff1a\u662f\u4fee\u9970\u8fd4\u56de\u503c\u5f15\u7528\u7c7b\u578b\u7684\u65f6\u5019\uff0c\u4e3a\u4e86\u907f\u514d\u8fd4\u56de\u503c\u88ab\u4fee\u6539\u7684\u60c5\u51b5
\u8fd4\u56de\u503c\u662f\u5f15\u7528\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u5f15\u7528\u5fc5\u7136\u4e0d\u662f\u4e34\u65f6\u5bf9\u8c61\u7684\u5f15\u7528\uff0c\u4e00\u5b9a\u662f\u6210\u5458\u53d8\u91cf\u6216\u8005\u51fd\u6570\u53c2\u6570\u3002\uff08\u53ea\u8981\u53c2\u6570\u4e0d\u9700\u8981\u4fee\u6539\u4e00\u5b9a\u52a0\u4e0aconst\uff09
const\u53c2\u6570\u5fc5\u987b\u4f20\u7b7e\u540d\u540e\u5e26const\u7684\u51fd\u6570\uff1a\u8981\u628athis\u6307\u9488\u53d8\u6210const
\u600e\u6837\u6784\u6210\u91cd\u8f7d - \u4e0d\u91cd\u8f7d\u7684
const int& fun(int& a); // \u53c2\u6570\u5217\u8868\u6ca1\u6709\u53d8 \nint& fun(const int a); // \u56e0\u4e3a\u662f\u503c\u4f20\u9012\uff0c\u4e0d\u662fconst\u7684\u4e5f\u80fdtype conversion\n
int& fun(const int& a); // \u56e0\u4e3a\u662f\u53d8\u91cf\u4f20\u9012\uff0c\u8981\u6c42\u68c0\u67e5\u53c2\u6570\u7684const\uff0c\u662f\u53c2\u6570\u5217\u8868\u53d8\u4e86 \nint& fun(int& a) const {} // \u56e0\u4e3a\u9690\u542b\u53c2\u6570this\u7684const\u4e0e\u5426\u4e0d\u4e00\u6837\uff0c\u4e5f\u662f\u53c2\u6570\u5217\u8868\u53d8\u4e86\n
\u200b\u4ee3\u66ff\u5b8f\u7684\u4e00\u79cd\u64cd\u4f5c\uff0c\u5728\u7f16\u8bd1\u9636\u6bb5\u628a\u6240\u6709\u51fd\u6570\u540d\u66ff\u6362\u6210inline function\u7684\u5b9e\u73b0 \u6bd4\u51fd\u6570\u7684\u4f18\u70b9\uff1a\u4e0d\u7528\u9891\u7e41\u8fdb\u6808\u51fa\u6808 \u6bd4\u5b8f\u7684\u4f18\u70b9\uff1a\u6709\u7c7b\u578b\u68c0\u67e5\uff0c\u80fd\u5199\u591a\u884c\uff0c\u80fd\u64cd\u4f5c\u7c7b\u7684\u79c1\u6709\u6210\u5458 inline\u5173\u952e\u5b57\u53ea\u6709\u51fa\u73b0\u5728\u51fd\u6570\u7684\u5b9a\u4e49\u800c\u4e0d\u662f\u58f0\u660e\u524d\u65f6\u624d\u6709\u7528\u3002 \u9759\u6001\u7ed1\u5b9a\u00a0Static\u00a0Binding \u3002\u80fd\u591f\u660e\u786e\u8fd0\u884c\u7684\u662f\u54ea\u4e2a\u7c7b\u7684\u65b9\u6cd5\u65f6\u4f1a\u53d1\u751f\u9759\u6001\u7ed1\u5b9a \u3002\u53d1\u751f\u5728\u7f16\u8bd1\u65f6\u523b\uff0c\u6240\u4ee5\u53c8\u53eb\u65e9\u7ed1\u5b9a \u52a8\u6001\u7ed1\u5b9aDynamic\u00a0Binding \u3002\u51fa\u73b0\u591a\u6001\uff0c\u7f16\u8bd1\u5668\u4e0d\u80fd\u660e\u786e\u5230\u5e95\u4f7f\u7528\u54ea\u4e2a\u7c7b\u7684\u65b9\u6cd5\u65f6\u53d1\u751f\u52a8\u6001\u7ed1\u5b9a \u3002\u53d1\u751f\u5728\u8fd0\u884c\u65f6\u523b\uff0c\u6240\u4ee5\u53c8\u53eb\u665a\u7ed1\u5b9a \u3002\u53ea\u6709\u5b58\u5728\u00a0virtual\u00a0\u65e6\u901a\u8fc7\u6307\u9488\u8bbf\u95ee\u65f6\uff0c\u624d\u4f1a\u53d1\u751f\u52a8\u6001\u7ed1\u5b9a
static binding \u7f16\u8bd1\u65f6
class Animal { public: void eat() { cout << \"Animal eats\" << endl; } }; class Dog : public Animal { public: void eat() { cout << \"Dog eats\" << endl; } };\n
dynamic binding \u8fd0\u884c\u65f6
class Animal { public: virtual void eat() { cout << \"Animal eats\" << endl; } }; class Dog : public Animal { public: void eat() { cout << \"Dog eats\" << endl; } };\n
\u200b \u5728\u4e0b\u9762\u7684\u60c5\u51b5\u4e0b\uff0c\u6784\u9020\u51fd\u6570\u4f1a\u88ab\u8c03\u7528\uff1a - \u5bf9\u4e8e\u5168\u5c40\u5bf9\u8c61\uff0c\u5728main()\u4e24\u6570\u8fd0\u884c\u4e4b\u524d\uff0c\u6216\u8005\u5728\u540c\u4e00\u4e2a\u7f16\u8bd1\u5355\u5143\u5185\u5b9a\u4e49\u7684\u4efb\u4e00\u51fd\u6570\u6216\u5bf9\u8c61 \u88ab\u4f7f\u7528\u4e4b\u524d\u3002\u5728\u540c\u4e00\u4e2a\u7f16\u8bd1\u5355\u5143\u5185\uff0c\u5b83\u4eec\u7684\u6784\u9020\u4e24\u6570\u6309\u7167\u58f0\u660e\u7684\u987a\u5e8f\u521d\u59cb\u5316\u3002 - \u5bf9\u4e8e static\u00a0local\u00a0variables\uff0c\u00a0\u5728\u7b2c\u4e00\u6b21\u8fd0\u884c\u5230\u5b83\u7684\u58f0\u660e\u7684\u65f6\u5019. - \u5bf9\u4e8e automatic\u00a0storage\u00a0duration\u00a0\u7684\u5bf9\u8c61\uff0c\u5728\u5176\u58f0\u660e\u88ab\u8fd0\u884c\u65f6\u3002 - \u5bf9\u4e8e dynamic\u00a0storage\u00a0duration\u00a0\u7684\u5bf9\u8c61\uff0c\u5728\u5176\u7528\u00a0new\u00a0\u8868\u8fbe\u5f0f\u521b\u5efa\u65f6\u3002
"},{"location":"docs/1-cs/oop/final_review/#_7","title":"\u667a\u80fd\u6307\u9488","text":"std::unique_ptr<T> //\u72ec\u5360\u8d44\u6e90\u6240\u6709\u6743\u7684\u6307\u9488\u3002 \nstd::shared_ptr<T> //\u5171\u4eab\u8d44\u6e90\u6240\u6709\u6743\u7684\u6307\u9488\u3002 \nstd::weak_ptr<T> //\u5171\u4eab\u8d44\u6e90\u7684\u89c2\u5bdf\u8005\uff0c\u9700\u8981\u548cstd::shared_ptr \u4e00\u8d77\u4f7f\u7528\uff0c\u4e0d\u5f71\u54cd\u8d44\u6e90\u7684\u751f\u547d\u5468\u671f\u3002\n
\u4f7f\u7528\u88f8\u6307\u9488 \u6240\u4ee5\u9ed8\u8ba4\u53c2\u6570\u662f\u548c\u865a\u8868\u65e0\u5173\u4e0e\u5f53\u524d\u7c7b\u578b\u6709\u5173\u5417 \u662f\u7684 \u9ed8\u8ba4\u53c2\u6570\u4e0d\u8fdb\u865a\u8868 \u2192 upcasting\u7684\u65f6\u5019
"},{"location":"docs/1-cs/oop/final_review/#upcasting","title":"upcasting","text":":material-circle-edit-outline: \u7ea6 1186 \u4e2a\u5b57 :fontawesome-solid-code: 361 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f
\u9700\u6c42\uff1a\u8ba9\u6211\u4eec\u7684\u4ee3\u7801\u72ec\u7acb\u4e8e\u5177\u4f53\u7684\u7c7b\u578b\u5de5\u4f5c\u3002
\u6211\u4eec\u5199\u51fa\u4e00\u4e2a\u9002\u7528\u4e8e\u6240\u6709\u7c7b\u578b\u7684\u6570\u636e\u7ed3\u6784\u7684\u7c7b\u6216\u7b97\u6cd5\uff08\u51fd\u6570\uff09\uff0c\u5728\u771f\u6b63\u9700\u8981\u4f7f\u7528\u65f6\u751f\u6210\u4e00\u4e2a\u9002\u7528\u4e8e\u6240\u9700\u7c7b\u578b\u7684\u5b9e\u4f8b\u3002\u8fd9\u79cd\u7f16\u7a0b\u8303\u5f0f\u79f0\u4e3a\u8303\u578b\u7f16\u7a0b\u3002
\u6a21\u677f\u7c7b\u7684\u5199\u6cd5
template<typename T>\nclass Container{\nT *data;\nunsigned size, capa;\npiblic:\nContainer(unsigned capa = 512): data(new T[capa]){}\n~Container() {delete[] data;}\nT& operator[](unsigned index) {return data[index];}\n}\n
\u8fd9\u91cctemplate T\u8868\u660e\u5b83\u63a5\u53d7\u4e00\u4e2a\u7c7b\u578b\u4f5c\u4e3a\u53c2\u6570\uff0c\u540d\u5b57\u662fT\u3002\u5728\u6a21\u677f\u7684\u5b9a\u4e49\u5185\u90e8\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5230\u8fd9\u4e2a\u7c7b\u578b\u53d8\u91cfT\u3002
\u7279\u5316\uff1a\u6839\u636e\u6a21\u677f\u751f\u6210\u5b9e\u9645\u7684\u7c7b\u7684\u8fc7\u7a0b
Container<int> ci;\nContainer<double> cd;\n
\u6a21\u677f\u51fd\u6570\u8981\u600e\u4e48\u5199
template<typename T>\nT abs(T x) {return x>0?x:-x;}\n
\u6a21\u677f\u8fd0\u7b97\u7b26\u91cd\u8f7d\u600e\u4e48\u5199
template<typename T>\nclass Container {\nT* data;\nunsigned size = 0, capa;\npublic: Container(unsigned capa = 512) : data(new T[capa]), capa(capa){}\n~Container(){delete[] data;}\nT& operator[](unsigned index) {return data[index];}\nconst T& operator[](unsigned idnex) const {return data[index];}\nunsigned getSize() const {return size;}\nunsigned getCapa() const {return capa;}\nContainer &add(T val){\ndata[size++] = val;\nreturn *this;\n}\n};\ntemplate<typename T>\nostream & operator<<(ostream& os, const Container<T>&c){\nfor (unsigned i = 0; i < c.getSize(); i++){\nos << c[i] << ' ';\nreturn os;\n}\n}\n
"},{"location":"docs/1-cs/oop/templates/#reference","title":"Reference","text":"7 \u6a21\u677f (I) - \u57fa\u672c\u77e5\u8bc6\u4e0e STL \u4f7f\u7528 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4
"},{"location":"docs/1-cs/oop/templates/#template","title":"\u53ef\u53d8\u53c2\u6570\u6a21\u677f templateC++11\u7684\u65b0\u7279\u6027 \u5bf9\u53c2\u6570\u9ad8\u5ea6\u6cdb\u5316\uff0c\u53ef\u4ee5\u8868\u793a0\u5230\u4efb\u610f\u4e2a\u4efb\u610f\u7c7b\u578b\u7684\u53c2\u6570\u3002
\u8bed\u6cd5
template <class ...T> // \u58f0\u660e\u4e00\u4e2a\u53c2\u6570\u5305\uff0c\u8fd9\u4e2a\u53c2\u6570\u5305\u4e2d\u5305\u542b0\u5230\u4efb\u610f\u4e00\u4e2a\u53c2\u6570\u6a21\u677f\nvoid f(T... args); // \u5728\u6a21\u677f\u5b9a\u4e49\u7684\u53f3\u8fb9\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570\u5305\u5c55\u5f00\u6210\u4e00\u4e2a\u4e00\u4e2a\u72ec\u7acb\u53c2\u6570\n
\u6700\u5927\u7684\u96be\u70b9\uff1a\u5982\u4f55\u5c55\u5f00\u53ef\u53d8\u6a21\u677f\u53c2\u6570
\u6253\u5370\u53c2\u6570\u4e2a\u6570\uff1a
template<class ...T>\nvoid f(T... args)\n{\n cout << sizeof...(args) << endl;\n}\n\nf();\nf(1, 2);\nf(1, 2.5, \"\");\n
\u9012\u5f52\u65b9\u5f0f\u5c55\u5f00\u53c2\u6570\u5305
#include <iostream>\nusing namespace std;\n\n// \u9012\u5f52\u7ec8\u6b62\u51fd\u6570\nvoid print(){\n cout << \"empty\" << endl;\n}\n\n// \u5c55\u5f00\u51fd\u6570\ntemplate<class T, class ...Args>\nvoid print(T head, Args... rest){\n cout << \"parameter\" << head << endl;\n print(rest...);\n}\n\nint main(){\n print(1, 2, 3, 4);\n return 0;\n}\n
\u4e0a\u8ff0\u4f8b\u5b50\u4f1a\u8f93\u51fa\u6bcf\u4e00\u4e2a\u53c2\u6570\uff0c\u76f4\u5230\u7a7a\u65f6\u8f93\u51faempty\u3002\u5c55\u5f00\u53c2\u6570\u5305\u7684\u51fd\u6570\u6709\u4e24\u4e2a\uff0c\u4e00\u4e2a\u662f\u9012\u5f52\u51fd\u6570\uff0c\u53e6\u4e00\u4e2a\u662f\u9012\u5f52\u7ec8\u6b62\u51fd\u6570\uff0c\u53c2\u6570\u5305Args\u2026\u5728\u5c55\u5f00\u7684\u8fc7\u7a0b\u4e2d\u9012\u5f52\u8c03\u7528\u81ea\u5df1\uff0c\u6bcf\u8c03\u7528\u4e00\u6b21\uff0c\u53c2\u6570\u5305\u4e2d\u7684\u53c2\u6570\u5c31\u5c11\u4e00\u4e2a\uff0c\u76f4\u5230\u6240\u6709\u53c2\u6570\u90fd\u5c55\u5f00\u4e3a\u6b62\u3002\u5f53\u6ca1\u6709\u53c2\u6570\u65f6\uff0c\u5219\u8c03\u7528\u975e\u6a21\u677f\u51fd\u6570print()\u7ec8\u6b62\u9012\u5f52\u8fc7\u7a0b\u3002
\u7ec8\u6b62\u51fd\u6570\u4e5f\u53ef\u4ee5\u5199\u6210
template<class T>\nvoid print(T t){\n cout << t << endl;\n}\n
\u53ef\u53d8\u6a21\u677f\u53c2\u6570\u6c42\u548c
template<typename T>\nT sum(T t){\n return t;\n}\ntemplate<typename T, typename ... Types>\nT sum(T first, Types ...rest){\n return first + sum<T> (rest...);\n}\n\nsum(1, 2, 3, 4);\n
\u9012\u5f52\u51fd\u6570\u5c55\u5f00\u53c2\u6570\u5305\u662f\u4e00\u79cd\u6807\u51c6\u505a\u6cd5\uff0c\u4e5f\u6bd4\u8f83\u597d\u7406\u89e3\uff0c\u4f46\u662f\u7f3a\u70b9\u65f6\u5fc5\u987b\u8981\u4e00\u4e2a\u91cd\u8f7d\u7684\uff08\u540c\u540d\uff09\u9012\u5f52\u7ec8\u6b62\u51fd\u6570\u6765\u7ec8\u6b62\u9012\u5f52\u3002
\u6216\u8005\u4e0d\u9012\u5f52\u65b9\u5f0f\uff0c\u8fd9\u79cd\u65b9\u5f0f\u9700\u8981\u501f\u52a9\u9017\u53f7\u8868\u8fbe\u5f0f\u548c\u521d\u59cb\u5316\u5217\u8868\u3002\u524d\u9762\u7684print\u53ef\u4ee5\u8fd9\u4e48\u5199
template<class T>\nvoid printarg(T t){\n cout << t << endl;\n}\n\ntemplate <class ...Args>\nvoid expand(Args... args){\n int arr[] = {(printarg(args), 0)...};\n}\n\nexpand(1, 2, 3, 4);\n
arr\u8fd9\u4e2a\u6570\u7ec4\u7684\u76ee\u7684\u5355\u7eaf\u662f\u5c55\u5f00\u53c2\u6570\u5305
\u5982\u679c\u5c06\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\uff0c\u5c31\u53ef\u4ee5\u652f\u6301lambda\u8868\u8fbe\u5f0f
template<class F, class... Args> void expand(const F& f, Args&&...args){\ninitializer_list<int>{(f(std::forward< Args>(args)), 0)};\n}\nexpand([](int i){cout << i << endl;}, 1,2,3);\n
\u53ef\u4ee5\u5e26\u4efb\u610f\u4e2a\u6570\u4e0d\u540c\u7684\u53c2\u6570\uff0c\u6bd4\u5982std::tuple
template<class... Types>\nclass tuple;\n
\u6a21\u677f\u504f\u7279\u5316\u548c\u9012\u5f52\u65b9\u5f0f\u5c55\u5f00\u53c2\u6570\u5305
\u53ef\u53d8\u53c2\u6570\u6a21\u677f\u7c7b\u7684\u5c55\u5f00\u4e00\u822c\u9700\u8981\u5b9a\u4e49\u4e24\u5230\u4e09\u4e2a\u7c7b\uff0c\u5305\u62ec\u7c7b\u58f0\u660e\u548c\u504f\u7279\u5316\u7684\u6a21\u677f\u7c7b
// \u524d\u5411\u58f0\u660e\ntemplate<typename... Args>\nstruct Sum;\n\n// \u57fa\u672c\u5b9a\u4e49\ntemplate<typename First, typename... Rest>\nstruct Sum<First, Rest...>{\n enum { value = Sum<First>::value + Sum<Rest...>::value };\n}\n\n// \u9012\u5f52\u7ec8\u6b62\ntemplate<typename Last>\nstruct Sum<Last>{\n enum { value = sizeof(Last) };\n}\n
","text":""},{"location":"docs/1-cs/oop/templates/#stl","title":"\u6807\u51c6\u6a21\u677f\u5e93 STL STL\u516d\u5927\u90e8\u4ef6\uff1a\u5bb9\u5668\uff08containers\uff09\uff0c\u5206\u914d\u5668\uff08allocators\uff09\uff0c\u7b97\u6cd5\uff08algorithm\uff09\uff0c\u8fed\u4ee3\u5668\uff08iterator\uff09\uff0c\u9002\u914d\u5668\uff08adapters\uff09\uff0c\u4eff\u51fd\u6570\uff08functors\uff09
","text":""},{"location":"docs/1-cs/oop/templates/#_1","title":"\u5e38\u7528\u7684\u5bb9\u5668","text":"vector, deque, list, set/multiset, map/multimap \u7b49
"},{"location":"docs/1-cs/oop/templates/#1-vector","title":"1. Vector","text":"Vector\u662f\u4e00\u79cd\u53d8\u957f\u6570\u7ec4\u3002
#include<vector>\nusing namespace std;\nvector<int> name;\nvector<double> name;\nvector<char> name;\nvector<struct node> name;\n// \u8fd9\u4e24\u4e2a\u4e3b\u8981\u6709\u901f\u5ea6\u4e0a\u7684\u533a\u522b\uff0carray\u975e\u5e38\u6162\uff0cvector\u5feb\u4e00\u4e9b\nvector< vector<int> > name; // > >\u4e4b\u95f4\u8981\u52a0\u7a7a\u683c\uff0c\u65b0\u6807\u51c6\u4e0d\u7528\u52a0\u4e86\nvector<int> array[SIZE]; // \u8fd9\u4e2a\u4e0d\u662f\u5f88\u5e38\u7528\uff0c\u56e0\u4e3a\u5bb9\u6613\u51fa\u9519\uff0c\u4e14\u6570\u7ec4\u4e0d\u77e5\u9053\u81ea\u5df1\u7684\u957f\u5ea6\uff0c\u8fd8\u6709std::array\n
\u8bbf\u95ee\u65b9\u5f0f
// 1. \u901a\u8fc7\u4e0b\u6807\n#include<iostream>\n#include<vector>\nusing namespace std;\nint main()\n{\nvector<int> vi;\nvi.push_back(1);\ncout<<vi[0]<<endl;\nreturn 0;\n}\n// 2. \u901a\u8fc7\u8fed\u4ee3\u5668\nvector<int>::iterator\nvector<double>::iterator\n// \u4f8b\n#include<iostream>\n#include<vector>\nint main()\n{\nvector<int> v;\nfor(int i = 0; i < 5; i++)\n{\nv.push_back(i); }\nvector<int>::iterator it=v.begin();\nfor(int i = 0; i < v.size(); i++)\n{\ncout << it[i] << \" \";\n// \u4e5f\u53ef\u4ee5\u5199\u6210 cout << * (it + i) << \" \";\n}\nreturn 0;\n}\n// \u6216\u8005\u4f18\u96c5\u7684\u5199\u6cd5\n// \u56e0\u4e3a\u8fed\u4ee3\u5668\u4e0d\u652f\u6301 it < v.end()\u7684\u5199\u6cd5\uff0c\u53ea\u80fd\u5199!=\nfor (vector<int>::iterator it=v.begin(); it!=v.end();it++)\n{\ncout << *it << \" \";\n}\n
\u5e38\u7528\u51fd\u6570 push_back(item) // \u5728vector\u540e\u9762\u6dfb\u52a0\u4e00\u4e2a\u5143\u7d20\npop_back(item) // \u5728vector\u540e\u9762\u5220\u9664\u4e00\u4e2a\u5143\u7d20\nsize(vector) // \u8fd4\u56de\u5143\u7d20\u4e2a\u6570\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(1)\nclear(vector) // \u6e05\u9664\u6240\u6709\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(N)\ninsert(position, x) // \u5728position\u7684\u5730\u65b9\u63d2\u5165\u4e00\u4e2ax\n// \u4f8b\nv.insert(v.begin()+2, -1); // \u76f8\u5f53\u4e8e\u5728v[2]\u5904\u63d2\u5165\u4e00\u4e2a-1\nerase(position);\nerase(positionBegin, positionEnd); // \u5de6\u95ed\u53f3\u5f00\n
"},{"location":"docs/1-cs/oop/templates/#2-set","title":"2. set","text":"\u96c6\u5408\u662f\u4e0d\u5141\u8bb8\u5143\u7d20\u91cd\u590d\u7684\u65e0\u5e8f\u5bb9\u5668
#include<set>\nusing namespace std;\nset<int> name;\nset<double> name;\nset<char> name;\nset<struct node> name;\nset<set<int> > name;\n
\u56e0\u4e3a\u65e0\u5e8f\uff0cset\u53ea\u80fd\u901a\u8fc7iterator\u8bbf\u95ee\uff0c\u9664\u4e86vector\u548cstring\u4e4b\u5916\u7684\u5bb9\u5668\u90fd\u4e0d\u80fd\u901a\u8fc7\u4e0b\u6807\u8bbf\u95ee set<int>::iterator it;\nset<char>::iterator it;\n
\u5e38\u7528\u51fd\u6570 st.insert(X);\nst.find(X); // \u8fd4\u56deset\u4e2dvalue\u6240\u5bf9\u5e94\u7684\u8fed\u4ee3\u5668\uff0c\u4e5f\u5c31\u662fvalue\u7684\u6307\u9488\n// \u4f8b\nset<int>::iterator it = st.find(2);\ncout << *it << endl;\n// \u53ef\u4ee5\u76f4\u63a5\u5199\u6210\ncout << *(st.find(2)) << endl;\nst.erase(it); // \u5220\u9664\u67d0\u4e2a\u5730\u5740\u7684\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(1)\nst.erase(X); // \u5220\u9664\u67d0\u4e2a\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(N)\nst.erase(itBegin, itEnd);\nst.size();\n
"},{"location":"docs/1-cs/oop/templates/#3-deque","title":"3. deque","text":"deque\u662f\u7531\u4e00\u6bb5\u5b9a\u91cf\u8fde\u7eed\u7a7a\u95f4\u6784\u6210\uff0c\u4e00\u65e6\u8981\u5728deque\u7684\u524d\u7aef\u548c\u5c3e\u7aef\u589e\u52a0\u7a7a\u95f4\uff0c\u4fbf\u914d\u7f6e\u4e00\u6bb5\u8fde\u7eed\u7a7a\u95f4\uff0c\u4e32\u5728\u6574\u4e2adeque\u7684\u5934\u90e8\u548c\u5c3e\u90e8.
"},{"location":"docs/1-cs/oop/templates/#4-list","title":"4. list","text":""},{"location":"docs/1-cs/oop/templates/#5-mapunordered_map","title":"5. map/unordered_map","text":""},{"location":"docs/1-cs/oop/templates/#6-string","title":"6. string","text":"// init\n#include<string>\nstring str;\nstring str = \"Hello\";\ncin >> str;\ncout << str;\n// assignment\nchar cstr1[20];\nchar cstr2[20] = \"jaguar\";\nstring str1;\nstring str2 = \"panther\";\ncstr1 = cstr2; // illegal\nstr1 = str2; // legal\n// concatenation\nstring str3;\nstr3 = str1 + str2;\nstr1 += str2;\nstr1 += \"a string literal\";\n// constructors (Ctors)\nstring (const char *cp, int len);\nstring (const string& s2, int pos);\nstring (const string& s2, int pos, int len);\n// sub-string\nsubstr (int pos, int len);\n// modification\nassign (...);\ninsert (...);\ninsert (int pos, const string& s);\nerase (...);\nappend (...);\nreplace (...);\nreplace (int pos, int len, const string& s);\n...\n// search\nfind (const string& s);\n// File I/O\n#include <ifstream> // read from file\n#include <ofstream> // write to file\n// write into file\nofstream File1(\"...\");\nFile1 << \"Hello world\" << std::enl;\n// read from file\nifstream File2(\"...\");\nstd::string str;\nFile2 >> str;\n
"},{"location":"docs/1-cs/oop/templates/#_2","title":"\u7b97\u6cd5","text":"\u7b97\u6cd5\u90e8\u5206\u4e3b\u8981\u7531<algorithm> <numeric> <functional>
\u7ec4\u6210 <algorithm>
\u662f\u6700\u5927\u7684\u4e00\u4e2a <numeric>
\u4f53\u79ef\u5f88\u5c0f\uff0c\u53ea\u5305\u62ec\u51e0\u4e2a\u5728\u5e8f\u5217\u4e0a\u8fdb\u884c\u7b80\u5355\u6570\u5b66\u8fd0\u7b97\u7684\u6a21\u677f\u51fd\u6570 <functional>
\u5b9a\u4e49\u4e86\u4e00\u4e9b\u6a21\u677f\u7c7b\uff0c\u7528\u4ee5\u58f0\u660e\u51fd\u6570\u5bf9\u8c61
\u7528\u8fed\u4ee3\u5668\u53ef\u4ee5\u8bfb\u53d6\u5b83\u6307\u5411\u7684\u5143\u7d20\u3002\u8fed\u4ee3\u5668\u540d\u5c31\u8868\u793a\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5143\u7d20\uff0c\u901a\u8fc7\u975e\u5e38\u91cf\u8fed\u4ee3\u5668\u8fd8\u80fd\u4fee\u6539\u5176\u6307\u5411\u7684\u5143\u7d20\u3002
#include<iostream> #include<vector> using namespace std; int main() { vector<int> v; for (int n = 0; n < 5; ++n) v.push_back(n); vector<int>::iterator i; for (i = v.begin(); i != v.end(); i++) { cout << *i << \" \"; // *i \u662f i \u6307\u5411\u7684\u5143\u7d20 *i *= 2; \n} }\n
"},{"location":"docs/1-cs/oop/templates/#stl_1","title":"\u7c7b\u5e93\u548cSTL STL\u662f\u8303\u578b\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4e00\u4e2a\u8303\u4f8b\uff0c\u542b\uff1a\u5bb9\u5668\uff08container\uff09\u3001\u8fed\u4ee3\u5668\uff08iterator\uff09\u3001\u7b97\u6cd5\uff08algorithm\uff09\u3001\u51fd\u6570\u5bf9\u8c61\uff08function object\uff09\u3002\u7c7b\u5e93\u662f\u7c7b\u7684\u96c6\u5408\uff0c\u662f\u4e00\u79cd\u9884\u5b9a\u4e49\u7684\u9762\u5411\u5bf9\u8c61\u7684\u7a0b\u5e8f\u5e93\u3002
","text":""},{"location":"docs/1-cs/oop/templates/#c","title":"C++\u7684\u6807\u51c6\u5e93","text":"using namespace std;
\u5bb9\u5668\uff08container\uff09\u7c7b\u662f\u7528\u6765\u5bb9\u7eb3\u3001\u5305\u542b\u4e00\u7ec4\u5143\u7d20\u6216\u5143\u7d20\u96c6\u5408\u7684\u5bf9\u8c61\u7684\u3002STL\u4e2d\u5b9a\u4e49\u4e86\u591a\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u5bb9\u5668\uff0c\u4f8b\u5982
\u5b9a\u4e49
vector<int> iv;\nvector<int> cv(5);\nvector<int> cv(5, 'x');\nvector<int> iv2(iv);\n
\u4f7f\u7528
#include<iostream>\n#include<vector>\nusing namespace std;\nint main()\n{\nvector<char> v; // create zero-len vector\nint i;\n// put values into a vector\nfor (i = 0; i < 10; i++)\nv.push_back('A' + i);\n// can access vector contents using subsripting\nfor (i = 0; i < 10; i++)\ncout << v[i] << \" \";\ncout << endl;\n// access via iterator\nvector<char>::iterator p = v.begin();\nwhile(p != v.end())\n{\ncout << *p << \" \";\np++;\n}\nreturn 0;\n}\n
"},{"location":"docs/1-cs/oop/templates/#list","title":"\u7ebf\u6027\u8868 list","text":"\u5b9a\u4e49\u4e86\u53cc\u5411\u7684\u7ebf\u6027\u8868\uff0c\u53c8\u53ef\u79f0\u4e3a\u53cc\u5411\u94fe\u8868\u3002list\u7c7b\u53ea\u652f\u6301\u987a\u5e8f\u8bbf\u95ee\u3002
// sort a list\n#include<iostream>\n#include<list>\n#include<cstdlib>\nusing namespace std;\nint main()\n{\nint i;\nlist<char> lst;\n// create a list of random characters\nfor (i = 0; i < 10; i++)\nlist.push_back('A' + (rand()%26));\n}\n
"},{"location":"docs/1-cs/oop/templates/#set","title":"\u96c6\u5408 set","text":"#include<set>\n#include<iostream>\n#include<string>\nint main()\n{\nstd::set<std::string> source;\nstd::string input;\nfor(int i=0;i<6;i++)\n{\nstd::cin>>input;\nsource.insert(input);\n}\nstd::set<std::string>::iterator at = source.begin();\nwhile(at != source.end())\nstd::cour << * at++ << std::endl;\n}\n
"},{"location":"docs/1-cs/oop/templates/#multiset","title":"multiset","text":""},{"location":"docs/1-cs/oop/templates/#map","title":"\u6620\u5c04 map","text":""},{"location":"docs/1-cs/oop/templates/#queue","title":"\u961f\u5217 queue","text":""},{"location":"docs/1-cs/oop/templates/#stdstack","title":"std::stack","text":""},{"location":"docs/1-cs/oop/templates/#stdpair","title":"std::pair","text":""},{"location":"docs/1-cs/oop/templates/#string","title":"\u5b57\u7b26\u4e32string","text":""},{"location":"docs/1-cs/oop/templates/#_3","title":"\u7b97\u6cd5\u5e93 ` #include<algorithm>\n#include<iostream>\n#include<string>\n#include<vector>\nusing namespace std;\nvoid load(vector<string>&);\nvoid print(vector<string>);\nconst int SIZE = 8;\nint main()\n{\nvector<string> v(SIZE);\nload(v);\nsort(v.begin(), v.end()); // \u6307\u5b9a\u6392\u5e8f\u7684\u8d77\u6b62\u4f4d\u7f6e\nprint(v);\nreturn 0;\n}\n// \u4f1a\u6309\u7167\u5b57\u6bcd\u5e8f\u6392\u5e8f\n
"},{"location":"docs/1-cs/oop/templates/#_4","title":"\u8fed\u4ee3\u5668 \u662f\u4e00\u79cd\u7c7b\u4f3c\u6307\u9488\u7684\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fed\u4ee3\u5668\u6765\u8bbf\u95ee\u5bb9\u5668\u4e2d\u7684\u5143\u7d20\u3002
#include<list>\n#include<iostream>\nint main()\n{\nusing namespace std;\nlist<int> c1;\nlist<int>::iterator c1_Iter;\nlist<int>::reverse_iterator c1_rIter;\nc1_rIter = c1.rbegin(); // the last element\n}\n
"},{"location":"docs/1-cs/oop/templates/#_5","title":"\u53c2\u8003\u8d44\u6599 https://zhuanlan.zhihu.com/p/344558356 LJJ PPT
","text":""},{"location":"docs/1-cs/os/","title":"\u7d22\u5f15","text":":material-circle-edit-outline: \u7ea6 384 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u6211\u89c9\u5f97 x+i for i in [x, y, g] \u4e09\u4f4d\u7684\u7b14\u8bb0\u5bf9\u4e8e\u8fd9\u95e8\u8bfe\u7406\u8bba\u90e8\u5206\u7684\u4ecb\u7ecd\u5df2\u7ecf\u975e\u5e38\u5145\u5206\u4e86\u3002\u5927\u5bb6\u53ef\u4ee5\u5728\u6211 root \u7d22\u5f15\u9875\u6307\u5411\u7684 xy \u7b14\u8bb0\u627e\u5230\u6211\u8fd9\u91cc\u63d0\u5230\u7684\u4e09\u4efd\u7b14\u8bb0\u3002
\u6211\u4ecd\u8981\u5199\u8fd9\u95e8\u8bfe\u7684\u5b9e\u9a8c\u90e8\u5206\u7684\u539f\u56e0\u662f\uff0c\u81ea\u5df1\u89c9\u5f97\u5b9e\u9a8c\u624b\u518c\u5199\u5f97\u4ecd\u6709\u4e00\u4e9b\u5bfc\u81f4\u4e0d\u592a\u597d\u7406\u89e3\u7684\u7f3a\u9677\uff0c\u6bd4\u5982\u7406\u8bba\u548c\u64cd\u4f5c\u5206\u6210\u4e0a\u4e0b\u4e24\u5927\u5757\u6765\u5199\uff0c\u5bfc\u81f4\u67e5\u8d77\u6765\u7684\u65f6\u5019\u50cf\u5728\u5403\u4e00\u76d8\u94a2\u4e1d\u7403\u7092\u610f\u5927\u5229\u9762\uff0c\u6bd4\u5982\u6709\u65f6\u5728\u8bf4\u64cd\u4f5c\u65f6\u4e0d\u5206\u5df2\u7ecf\u5b9e\u73b0\u597d\u7684/\u6211\u8981\u505a\u7684/linux\u4f1a\u505a\u4f46\u662f\u6211\u4eec\u4e0d\u5173\u5fc3\u7684\u3002
\u6211\u7684\u9884\u671f\u662f\u628a\u8fd9\u4efd\u7b14\u8bb0\u5199\u6210\u4e00\u5757\u4e00\u5757\u7684\u4e1c\u897f\uff0c\u6bcf\u4e00\u5757\u662f\u4e00\u4e2a\u7406\u8bba+\u64cd\u4f5c+\u4e00\u4e2a\u80fd\u8dd1\u8d77\u6765\u7684\u6700\u5c0f\u5355\u5143\u3002\u73b0\u5b9e\u662f\u6211\u7684\u65f6\u95f4\u771f\u7684\u592a\u4e0d\u8db3\u4e86\uff0c\u611f\u89c9\u53ea\u6765\u5f97\u53ca\u53bb\u8865\u5145\u4e00\u4e9b\u5b9e\u9a8c\u624b\u518c\u91cc\u6ca1\u6709\u5199\u7684\u80cc\u666f\u6216\u8005\u662f\u6211\u81ea\u5df1\u64cd\u4f5c\u65f6\u7684\u4e00\u4e9b\u5fc3\u5f97\u6216\u603b\u7ed3\uff0c\u53ea\u80fd\u5f53\u5b9e\u9a8c\u624b\u518c\u7684\u8865\u5145\u6765\u770b\u3002\u7136\u540e\u672c\u6765\u8fd9\u91cc\u5e94\u5f53\u6709\u4e00\u53e5\u5e0c\u671b\u4ee5\u540e\u6709\u65f6\u95f4\u80fd\u5199\u5b8c\uff0c\u4f46\u662f\u6211\u4e5f\u4e0d\u60f3\u8fd9\u6837\u627f\u8bfa\u4e86\uff0c\u6211\u66f4\u613f\u610f\u8bf4\u4e00\u4e9b\u73b0\u5b9e\u7684\u6bd4\u5982\u6211\u4e0d\u4f1a\u518d\u66f4\u65b0\u8fd9\u4efd\u7b14\u8bb0\u4e86\uff0c\u4f46\u662f\u5e0c\u671b\u8bfb\u8005\u505a\u5b9e\u9a8c\u7684\u65f6\u5019\u53ef\u4ee5\u5e26\u7740\u4e0a\u8ff0\u63d0\u5230\u7684\u601d\u8def\u53bb\u6574\u7406\u81ea\u5df1\u7684\u601d\u7ef4\u548c\u5b9e\u9a8c\u62a5\u544a\u3002
\u63a5\u4e0b\u6765\u8bf7\u70b9\u8fdb\u53e6\u4e00\u4e2a lab \u9875\u9762\u7ee7\u7eed\u9605\u8bfb\u3002
"},{"location":"docs/1-cs/os/lab/","title":"OS lab","text":":material-circle-edit-outline: \u7ea6 8965 \u4e2a\u5b57 :fontawesome-solid-code: 91 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 31 \u5206\u949f
\u76ee\u5f55\uff1a\u8fd9\u91cc\u4f1a\u5148\u8bb2\u4e00\u4e0b\u7528\u5230\u7684\u80cc\u666f\u77e5\u8bc6\u548c mac \u4e0b\u7684\u73af\u5883\u914d\u7f6e\u6280\u5de7\uff08\u56e0\u4e3a\u624b\u518c\u8bb2 mac \u4e0d\u591a\uff09\uff0c\u7136\u540e\u6328\u4e2a\u5b9e\u9a8c\u6211\u60f3\u8fdb\u884c\u4e00\u4e9b\u7efc\u8ff0\uff0c\u4e0d\u77e5\u9053\u7cbe\u529b\u80fd\u652f\u6491\u5199\u591a\u5c11\uff0c\u6700\u540e\u8865\u5145\u4e24\u4e2a\u6211\u5b9e\u9a8c\u4e2d\u603b\u9047\u5230\u7684\u4f46\u624b\u518c\u6ca1\u6d89\u53ca\u7684\u95ee\u9898\u3002\u81ea\u77e5\u5b66\u5f97\u4e0d\u597d\uff0c\u4e0d\u786e\u5b9a\u7684\u5730\u65b9\u6211\u4f1a\u6807\u51fa\u6765\u3002
"},{"location":"docs/1-cs/os/lab/#overview","title":"overview","text":"Warning
\u7ed3\u6784\u56fe TODO
\u4e00\u4e2a\u6700\u540e\u505a\u51fa\u6765\u7684 lab \u7ed3\u6784\u56fe:
"},{"location":"docs/1-cs/os/lab/#_1","title":"\u80cc\u666f\u77e5\u8bc6","text":"\u5148\u4ecb\u7ecd\u4e00\u4e0b\u6574\u4e2a\u5b9e\u9a8c\u548c\u5b9e\u9a8c\u73af\u5883\u7684\u5927\u80cc\u666f\u3002
"},{"location":"docs/1-cs/os/lab/#os","title":"\u8ba1\u7b97\u673a\u4e0a\u7535\u5230OS\u8fd0\u884c\u7684\u8fc7\u7a0b","text":"\u5d4c\u5165\u5f0f\u7cfb\u7edf\uff08\u76f8\u6bd4\u8ba1\u7b97\u673a\u7cfb\u7edf\u6bd4\u8f83\u7b80\u5355\uff0c\u53ea\u80fd\u5728\u7279\u5b9a\u786c\u4ef6\u4e0a\u8fd0\u884c\uff09\u7684\u542f\u52a8\u8fc7\u7a0b\u6bd4\u8f83\u7b80\u5355\uff0c\u7528\u5b83\u6765\u505a\u4f8b\u5b50\u8bb2\u89e3\uff0c\u8fc7\u7a0b\u662f\uff1a
Hardware RISC-V M Mode RISC-V S Mode \n+------------+ +--------------+ +----------+\n| Power On | ----> | Bootloader | ----> | Kernel |\n+------------+ +--------------+ +----------+\n
"},{"location":"docs/1-cs/os/lab/#sbiopensbi","title":"sbi\u548copensbi","text":"\u4ecb\u7ecd\u5b9e\u9a8c\u73af\u5883\u7528\u7684\u7b2c\u4e00\u4e2a\u5de5\u5177\uff1asbi (supervisor binary interface)\u662f s-mode \u7684 kernel \u548c m-mode \u6267\u884c\u73af\u5883\u4e4b\u95f4\u7684\u63a5\u53e3\u89c4\u8303
opensbi\u662f\u4e00\u4e2ariscv sbi\u89c4\u8303\u7684\u5f00\u6e90\u5b9e\u73b0\uff0c\u603b\u4e4b\u610f\u601d\u662fopensbi\u662f\u4e00\u4e9b\u5bf9m-mode\u4e0b\u786c\u4ef6\u7684\u7edf\u4e00\u5b9a\u4e49\uff0c\u5728s-mode\u4e0b\u7684\u5185\u6838\u53ef\u4ee5\u6309\u7167\u8fd9\u4e9b\u89c4\u8303\u5bf9\u4e0d\u540c\u786c\u4ef6\u64cd\u4f5c\u3002
\u6211\u4eecopensbi\u53ef\u4ee5\u4f5c\u4e3abootloader\u5b8c\u6210\u673a\u5668\u542f\u52a8\u65f6m-mode\u4e0b\u7684\u786c\u4ef6\u521d\u59cb\u5316\u548c\u5bc4\u5b58\u5668\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u5229\u7528opensbi\u5b8c\u6210\u5b57\u7b26\u6253\u5370\u4e4b\u7c7b\u7684\u64cd\u4f5c\u3002
qemu\u4f1a\u628aopensbi\u8d77\u59cb\u5730\u5740\u52a0\u8f7d\u52300x80000000\u5904.
opensbi\u521d\u59cb\u5316\u540e\u4f1a\u8df3\u8f6c\u52300x80200000\u5904\uff0c\u5373kernel\u7684\u8d77\u59cb\u5730\u5740\u3002\u6240\u4ee5\u8981\u7f16\u8bd1\u7684\u4ee3\u7801\u57280x80200000\u5904\u3002
"},{"location":"docs/1-cs/os/lab/#_2","title":"\u7279\u6743\u6a21\u5f0f","text":"riscv\u6709\u4e09\u79cd\u7279\u6743\u6a21\u5f0f\uff1aUser, Supervisor, & Machine\u3002\u6574\u4e2a\u5b9e\u9a8c\u4e2d\u6211\u4eec\u4e00\u5f00\u59cb\u90fd\u8981\u5728 s-mode \u64cd\u4f5c\uff0c\u4e4b\u540e\u6162\u6162\u5b9e\u73b0 u-mode\u3002
Level Encoding Name Abbreviation \u4ecb\u7ecd 0 00 User/Application U \u5bf9\u786c\u4ef6\u6a21\u5f0f\u7684\u62bd\u8c61\uff0c\u6709\u6700\u9ad8\u7ea7\u522b\u7684\u6743\u9650 1 01 Supervisor S \u5bf9\u5e94\u4e0e\u5185\u6838\u6001Kernel\u3002\u5f53\u7528\u6237\u9700\u8981\u5185\u6838\u8d44\u6e90\u65f6\uff0c\u5411\u5185\u6838\u7533\u8bf7\uff0c\u5e76\u5207\u6362\u5230\u5185\u6838\u6001\u8fdb\u884c\u5904\u7406 2 10 Reserved 3 11 Machine M \u7528\u6237\u6001\uff0c\u6700\u4f4e\u7ea7\u522b\u6743\u9650\u4e00\u822c\u6bcf\u79cd\u6a21\u5f0f\u53ef\u4ee5\u8fd0\u884c\u7684\u7a0b\u5e8f\u6709
supported modes intended usage M simple embedded systems M, U secure embedded systems M, S, U systems running unix-like operating systems"},{"location":"docs/1-cs/os/lab/#_3","title":"\u73af\u5883\u914d\u7f6e","text":""},{"location":"docs/1-cs/os/lab/#docker","title":"Docker","text":"\u5728\u5b98\u7f51\u5b89\u88c5Docker\u3002\u4e4b\u540e\u9700\u8981\u6253\u5f00Docker app\uff0c\u767b\u9646\u540e\u624d\u80fd\u5728terminal\u4e2d\u4f7f\u7528docker\u547d\u4ee4\u3002
$ sudo hdiutil attach Docker.dmg\n$ sudo /Volumes/Docker/Docker.app/Contents/MacOS/install\n$ sudo hdiutil detach /Volumes/Docker\n
\u521b\u5efa\u5bb9\u5668
docker pull ubuntu:22.04\ndocker run -it --name my_linux ubuntu:22.04 bash\n
\u51fa\u73b0root@xxxxxxx:?# \u5373\u521b\u5efa\u6210\u529f\uff0c\u5176\u4e2dxxxxxxx\u4e00\u4e32\u662f\u5f53\u524d\u5bb9\u5668\u7684id\uff0c\u9700\u8981\u8bb0\u5f55\u4e0b\u6765\uff0c\u4e0b\u6b21\u53ef\u4ee5\u901a\u8fc7\u8be5id\u8fdb\u5165\u76f8\u540c\u5bb9\u5668\u3002
\u5b89\u88c5\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u5305\uff0cqemu\uff0cgdb\uff0c\u8fd9\u51e0\u6b65\u9700\u8981\u5f00\u7740\u547d\u4ee4\u884c\u4ee3\u7406\uff0c\u622a\u56fe\u7565\u3002
"},{"location":"docs/1-cs/os/lab/#docker_1","title":"\u806a\u660e\u5730\u4f7f\u7528docker","text":"\u8fd8\u662f\u6700\u597d\u914d\u7f6e\u4e00\u4e0b vscode \u91cc\u7684\u56fe\u5f62\u754c\u9762\u3002\u6b65\u9aa4\uff1a
ps a
\u548c kill qemu
\u7b49\u547d\u4ee4\u3002\u3002\u5f53\u7136\u53ef\u80fd\u4e5f\u53ea\u6709\u7b28\u86cb\u6211\u6309\u7167\u540e\u4e24\u79cd\u7528\u4e86\u597d\u4e45\u3002Warning
TODO \u8fd9\u5757\u5e94\u8be5\u518d\u6269\u5199\u4e00\u4e0b\u7684
bash [shell file].sh
\u6765\u8fd0\u884c\u3002riscv-gnu-toolchain
\u3002\u9700\u8981\u8c03\u8bd5\u65f6\uff0c\u56e0\u4e3a\u9876\u5c42 makefile \u5e2e\u6211\u4eec\u5199\u597d\u4e86\u8c03\u8bd5\u547d\u4ee4\uff0c\u6211\u4eec\u7b2c\u4e00\u4e2a terminal \u53ea\u9700\u8981\u8f93\u5165 make debug
\u3002 \u7136\u540e\u65b0\u5f00\u4e00\u4e2a terminal \u8f93\u5165 gdb-multiarch path/to/vmlinux
\u5176\u4e2d vmlinux \u662f\u7f16\u8bd1\u597d\u7684\u6587\u4ef6\u3002
gdb \u4f7f\u7528\u7684\u65b9\u6cd5/\u7a8d\u95e8
\u8c03\u8bd5\u7684\u65f6\u5019\u9700\u8981\u770b\u4ec0\u4e48\u5462\uff1f
\u8fd9\u662f\u6211\u521a\u4e0a\u624b\u8c03\u8bd5\u7684\u65f6\u5019\u611f\u5230\u56f0\u6270\u7684\u4e00\u4e2a\u95ee\u9898\u3002
\u540e\u6765\u6211\u9010\u6e10\u60f3\u6e05\u695a\u7684\u662f\uff0c\u9996\u5148\u6211\u8ba4\u4e3a\u5982\u679c\u4e0d\u77e5\u9053\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u8fd0\u884c\u7684\u6d41\u7a0b\uff08\u6bd4\u5982\u5148\u54ea\u4e2a\u51fd\u6570\u518d\u54ea\u4e2a\u51fd\u6570\uff09\uff0c\u662f\u4e0d\u9002\u5408\u5f00\u59cb\u8c03\u8bd5\u7684\uff0c\u5e94\u5f53\u56de\u53bb\u518d\u601d\u8003\u4e00\u904d lab \u7684\u7406\u8bba\uff0c\u8d77\u7801\u77e5\u9053\u81ea\u5df1\u7a0b\u5e8f\u7684\u5404\u79cd\u9884\u671f\u7ed3\u679c\u3002\u66b4\u8bba\u4e00\u70b9\u8bf4\u5176\u5b9e\u6211\u89c9\u5f97\u8c03\u8bd5\u65f6\u957f\u5927\u4e8e\u5f00\u53d1\u65f6\u957f\u90fd\u662f\u4e0d\u592a\u597d\u7684\uff0c\u66b4\u9732\u51fa\u80af\u5b9a\u54ea\u91cc\u7406\u8bba\u6ca1\u5543\u900f\u5c31\u5f00\u59cb\u52a8\u7b14\u4e86\u3002
\u7136\u540e\u53ef\u4ee5\u7531\u5927\u5230\u5c0f\uff0c\u6bd4\u5982\u5148\u628a\u51e0\u4e2a\u65ad\u70b9\u6253\u5728\u731c\u6d4b\u53ef\u80fd\u51fa\u9519\u4e86\u7684\u51e0\u4e2a\u51fd\u6570\u4e0a\uff0c\u786e\u5b9a\u5177\u4f53\u5728\u54ea\u4e2a\u51fd\u6570\u51fa\u9519\u540e\u518d\u9010 c \u8bed\u8a00\u884c\u8fd0\u884c\uff0c\u786e\u5b9a\u662f\u54ea\u4e2a c \u8bed\u8a00\u884c\u51fa\u9519\u540e\u518d\u9010\u6c47\u7f16\u884c\u8fd0\u884c\uff0c\u5faa\u5e8f\u6e10\u8fdb\u627e\u5230\u5177\u4f53\u51fa\u9519\u7684\u6307\u4ee4\u3002\u5728\u9644\u8fd1\u6253\u5370\u6253\u5370\u51e0\u4e2a\u5bc4\u5b58\u5668\u7684\u503c\uff08\u53ef\u4ee5\u770b\u7684\u5bc4\u5b58\u5668\u6211\u4f1a\u5728\u4e0b\u4e00\u8282\u4ecb\u7ecd\uff09\uff0c\u7136\u540e\u5728\u6b64\u57fa\u7840\u4e0a\u601d\u8003\u9519\u8bef\u539f\u56e0\u3002
"},{"location":"docs/1-cs/os/lab/#gdb","title":"\u806a\u660e\u5730\u4f7f\u7528 gdb","text":"gdb \u81ea\u5e26\u7684\u547d\u4ee4\u884c ui \u7f3a\u70b9\u4e3b\u8981\u5728\u4e8e\u4e0d\u80fd\u968f\u65f6\u663e\u793a\u5bc4\u5b58\u5668\u548c\u53d8\u91cf\u7684\u503c\uff0c\u8c03\u8bd5\u4f1a\u4e0d\u8212\u670d\u3002\u6709\u4e00\u4e9b\u66f4\u597d\u7684 ui \u5de5\u5177\u3002
\u6211\u6ca1\u6709\u914d\u6240\u4ee5\u4e0d\u80fd\u63d0\u4f9b\u5f88\u597d\u7684\u6211\u7684\u63a8\u8350\uff0c\u8d34\u4e00\u4e9b\u522b\u4eba\u7684\u5e16\u5b50\u3002\u9664\u4e86\u4e0b\u9762\u5e16\u5b50\u91cc\u63d0\u5230\u7684\u51e0\u4e2a\uff0c\u8431\u8431\u8fd8\u63d0\u5230\u4e00\u4e2a gdbpeda
\u3002
\u63a8\u8350\u51e0\u4e2a\u597d\u7528\u7684GDB\u56fe\u5f62\u5316\u529f\u80fd\u589e\u5f3a\u63d2\u4ef6
"},{"location":"docs/1-cs/os/lab/#lab0","title":"lab0","text":"\u6ca1\u96be\u5ea6\u4e0d\u7528\u8bb2
"},{"location":"docs/1-cs/os/lab/#lab1","title":"lab1","text":""},{"location":"docs/1-cs/os/lab/#c-risc-v","title":"C & RISC-V \u5185\u8054\u6c47\u7f16","text":"Note
\u8fd9\u5757\u6765\u81ea\u4e8e\u5bf9 lab1 \u6587\u6863\u7684\u6574\u7406\u3002\u5e0c\u671b\u6709\u6574\u7406\u5f97\u6bd4\u539f\u6587\u6863\u53ef\u8bfb\u4e00\u4e9b\u3002
__asm__ volatile (\n\"instruction1\\n\"\n\"instruction2\\n\"\n......\n......\n\"instruction3\\n\"\n: [out1] \"=r\" (v1),[out2] \"=r\" (v2)\n: [in1] \"r\" (v1), [in2] \"r\" (v2)\n: \"memory\"\n);\n
\u5176\u4e2d\uff0c\u4e09\u4e2a\u00a0:
\u00a0\u5c06\u6c47\u7f16\u90e8\u5206\u5206\u6210\u4e86\u56db\u90e8\u5206\u3002\u8fd9\u56db\u90e8\u5206\u4e2d\u540e\u4e09\u90e8\u5206\u4e0d\u662f\u5fc5\u987b\u7684\uff1a
\u8fd9\u6bb5\u6682\u65f6\u7528\u4e0d\u7740\u6211\u4e0d\u5199\u4e86\uff0c\u8d34\u4e00\u6bb5lab1\u4e2d\u7684\u539f\u6587\u7ed9\u7684\u793a\u4f8b\u3002e.g. 1
unsigned long long s_example(unsigned long long type,unsigned long long arg0) {\nunsigned long long ret_val;\n__asm__ volatile (\n\"mv x10, %[type]\\n\"\n\"mv x11, %[arg0]\\n\"\n\"mv %[ret_val], x12\"\n: [ret_val] \"=r\" (ret_val)\n: [type] \"r\" (type), [arg0] \"r\" (arg0)\n: \"memory\"\n);\nreturn ret_val;\n}\n
e.g. 1. \u4e2d\u6307\u4ee4\u90e8\u5206\uff0c%[type]\u3001%[arg0]\u4ee5\u53ca%[ret_val]\u4ee3\u8868\u7740\u7279\u5b9a\u7684\u5bc4\u5b58\u5668\u6216\u662f\u5185\u5b58\u3002\u8f93\u5165\u8f93\u51fa\u90e8\u5206\u4e2d\uff0c[type] \"r\" (type)
\u4ee3\u8868\u7740\u5c06\u00a0()
\u00a0\u4e2d\u7684\u53d8\u91cf\u00a0type
\u00a0\u653e\u5165\u5bc4\u5b58\u5668\u4e2d\uff08\"r\"
\u00a0\u6307\u653e\u5165\u5bc4\u5b58\u5668\uff0c\u5982\u679c\u662f\u00a0\"m\"
\u00a0\u5219\u4e3a\u653e\u5165\u5185\u5b58\uff09\uff0c\u5e76\u4e14\u7ed1\u5b9a\u5230\u00a0[]
\u00a0\u4e2d\u547d\u540d\u7684\u7b26\u53f7\u4e2d\u53bb\u3002[ret_val] \"=r\" (ret_val)
\u00a0\u4ee3\u8868\u7740\u5c06\u6c47\u7f16\u6307\u4ee4\u4e2d\u00a0%[ret_val]
\u00a0\u7684\u503c\u66f4\u65b0\u5230\u53d8\u91cf\u00a0ret_val
\u4e2d\u3002
e.g. 2
#define write_csr(reg, val) ({\n__asm__ volatile (\"csrw \" #reg \", %0\" :: \"r\"(val)); })\n
e.g. 2. \u5b9a\u4e49\u4e86\u4e00\u4e2a\u5b8f\uff0c\u5176\u4e2d\u00a0%0
\u00a0\u4ee3\u8868\u7740\u8f93\u51fa\u8f93\u5165\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u7b26\u53f7\uff0c\u5373\u00a0val
\u3002 #reg
\u00a0\u662fc\u8bed\u8a00\u7684\u4e00\u4e2a\u7279\u6b8a\u5b8f\u5b9a\u4e49\u8bed\u6cd5\uff0c\u76f8\u5f53\u4e8e\u5c06reg\u8fdb\u884c\u5b8f\u66ff\u6362\u5e76\u7528\u53cc\u5f15\u53f7\u5305\u88f9\u8d77\u6765\u3002\u4f8b\u5982\u00a0write_csr(sstatus,val)
\u00a0\u7ecf\u5b8f\u5c55\u5f00\u4f1a\u5f97\u5230\uff1a
({\n__asm__ volatile (\"csrw \" \"sstatus\" \", %0\" :: \"r\"(val)); })\n
\u6b64\u5916\uff0c\u8fd9\u4e2a\u793a\u4f8b\u4e2d\u7684\u00a0({...})
\u00a0\u8fd8\u6d89\u53ca\u4e86\u4e00\u4e2a GNU \u5bf9 C \u7684\u6269\u5c55\uff0c\u53ef\u4ee5\u53c2\u8003\u00a0Statements and Declarations in Expressions\u3002\u590d\u5408\u8bed\u53e5\u4e2d\u7684\u6700\u540e\u4e00\u9879\u5e94\u8be5\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u540e\u8ddf\u4e00\u4e2a\u5206\u53f7\u00a0;
\u3002\u8be5\u5b50\u8868\u8fbe\u5f0f\u7684\u503c\u7528\u4f5c\u6574\u4e2a\u8bed\u53e5\u7684\u503c\uff0c\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u7c7b\u4f3c\u201c\u8fd4\u56de\u503c\u201d\u7684\u6548\u679c\u3002
Note
\u8fd9\u5757\u6765\u81ea\u4e8e\u5bf9 lab1 \u6587\u6863\u7684\u6574\u7406\u3002\u5e0c\u671b\u6709\u6574\u7406\u5f97\u6bd4\u539f\u6587\u6863\u53ef\u8bfb\u4e00\u4e9b\u3002
`vmlinux.lds`` \u662f GNU ld\uff0c\u4e00\u79cd\u94fe\u63a5\u5668\uff0c\u5c06 .o \u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u8fde\u63a5\u8d77\u6765\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002ld\u4f7f\u7528\u94fe\u63a5\u811a\u672clinker script\u63a7\u5236\u3002\u8fd9\u4e2a\u6587\u4ef6\u91cc\u6709\u5199\uff1a
OUTPUT_ARCH( \"riscv\" )
ENTRY( _start )
\u5e76\u4e14head.S\u91cc\u9700\u8981\u7f16\u5199\u5bf9\u5e94\u7684_start\u51fd\u6570BASE_ADDR = 0x80200000;
\u6211\u4eec\u9605\u8bfb\u4e00\u4e0b\u8fd9\u4e2a\u94fe\u63a5\u5668\u6587\u4ef6\uff0c\u5bf9\u4e4b\u540e\u7684\u5b9e\u9a8c\u5e2e\u52a9\u633a\u5927\u3002
\u9996\u5148\u53ef\u4ee5\u7c97\u7565\u89c2\u5bdf\u5230\uff0ckernel \u7a7a\u95f4\u91cc\u662f\u5206\u6bb5(secition)\u7684\uff0c\u4e3b\u8981\u7684section\u6709\uff1a
\u6bb5\u540d \u4e3b\u8981\u4f5c\u7528 .text \u901a\u5e38\u5b58\u653e\u7a0b\u5e8f\u6267\u884c\u4ee3\u7801 .rodata \u901a\u5e38\u5b58\u653e\u5e38\u91cf\u7b49\u53ea\u8bfb\u6570\u636e .data \u901a\u5e38\u5b58\u653e\u5df2\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf \u9759\u6001\u53d8\u91cf .bss \u901a\u5e38\u5b58\u653e\u672a\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf \u9759\u6001\u53d8\u91cf\u518d\u7ec6\u81f4\u4e00\u70b9\u53bb\u89c2\u5bdf\u91cc\u9762\u7684\u7b26\u53f7\u3002
.
\u5728\u94fe\u63a5\u811a\u672c\u4ee3\u8868\u5f53\u524d\u5730\u5740\uff0c\u5b83\u6709\u8d4b\u503c\u3001\u88ab\u8d4b\u503c\u3001\u81ea\u589e\u7b49\u64cd\u4f5c\u3002*
\u6709\u4e24\u79cd\u7528\u6cd5\uff0c\u5176\u4e00\u662f *()
\u5728\u5927\u62ec\u53f7\u4e2d\u8868\u793a\u5c06\u6240\u6709\u6587\u4ef6\u4e2d\u7b26\u5408\u62ec\u53f7\u5185\u8981\u6c42\u7684\u6bb5\u653e\u7f6e\u5728\u5f53\u524d\u4f4d\u7f6e *(.data .data.*)
\uff0c\u5176\u4e8c\u662f\u4f5c\u4e3a\u901a\u914d\u7b26\u3002_s
\u00a0\u4e0e\u00a0_e
\u5f00\u5934\u7684\u7b26\u53f7\u90fd\u662f\u672c\u5b9e\u9a8c\u52a9\u6559\u8001\u5e08\u81ea\u5df1\u5b9a\u4e49\u7684\u3002\u7f16\u8bd1\u51fa\u7684\u6587\u4ef6\u91cc\uff1a
nm vmlinux
\u00a0\u547d\u4ee4\u5373\u53ef\u6253\u5370 vmlinux \u7684\u7b26\u53f7\u8868\u3002\u64cd\u4f5c\u7cfb\u7edf\u5728\u542f\u52a8\u540e\u7531\u4e8b\u4ef6(event)\u9a71\u52a8\uff0c\u6211\u4eec\u5c06\u5f15\u5165\u4e00\u79cd\u4e8b\u4ef6trap\uff0ctrap\u7ed9\u4e86os\u4e0e\u8f6f\u786c\u4ef6\u4ea4\u4e92\u7684\u80fd\u529b\u3002\u5728boot\u9636\u6bb5opensbi\u5b9e\u73b0\u4e86M\u6001\u7684trap\u5904\u7406\u3002\u6211\u4eec\u5b9e\u73b0\u7684\u662fs\u6001\u7684trap\u5904\u7406\u3002
\u5e76\u4e14\u6211\u4eec\u660e\u786e\u4e00\u4e0b Interrupt, Exception \u548c Trap \u7684\u533a\u522b (from riscv unprivileged spec)\uff1a
\u5b9e\u9a8c\u624b\u518c\u5219\u7ed9\u4e86\u4e0b\u8868\uff0c\u867d\u7136\u91cc\u9762\u6ca1\u6709\u8bb2\u5230 trap\uff0c\u4f46\u662f\u8fd9\u4e2a\u5bf9\u4e8e interrupt \u548c exception \u7684\u89e3\u91ca\u66f4\u6e05\u695a\u3002
Interrupt Exception hardware generated software generated Asynchronous external requests (generated by e.g. keyboard or printer) synchronous internal requests for services based upon abnormal events (generated by e.g. illegal instructions, illegal address, overflow, etc.) normal events abnormal events\u7406\u89e3\u4e86\u4e0a\u8ff0\u4e24\u4e2a\u6982\u5ff5\u540e\u53ef\u4ee5\u628a trap \u5f53\u4f5c\u4e00\u79cd\u7edf\u79f0\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3a trap = interrupt + exception\u3002\u6211\u4eec\u540e\u7eed\u5b9e\u73b0\u7684 trap_handler()
\u65e2\u8981\u5904\u7406\u4e2d\u65ad\u4e5f\u8981\u5904\u7406\u5f02\u5e38\u3002
\u8981\u5b9e\u73b0\u7684\u4e2d\u65ad\u7684\u6d41\u7a0b\u5982\u4e0b\uff0c\u53ef\u4ee5\u53c2\u7167\u8fd9\u4e2a\u5b8c\u6210 do_timer()
switch_to()
schedule()
\u7b49\u51fd\u6570\uff1a
\u56de\u5fc6\u5185\u5b58\u7ed3\u6784\uff08\u5982\u679c\u4f60\u660e\u786e\u77e5\u9053\u5bc4\u5b58\u5668\u662f\u4ec0\u4e48\u5c31\u4e0d\u7528\u56de\u5fc6\u4e86\uff09\uff0c\u53ef\u89c1\u5bc4\u5b58\u5668\u5e76\u4e0d\u5728\u8fd0\u884c\u5185\u5b58\u91cc\uff1a
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
riscv\u670932\u4e2a\u901a\u7528\u5bc4\u5b58\u5668 + \u5f88\u591a\u63a7\u5236\u72b6\u6001\u5bc4\u5b58\u5668 (control and status registers (CSRs))\u3002riscv \u7ed9\u6bcf\u4e2a\u5bc4\u5b58\u5668\u6709\u4e2a\u5143\u4fe1\u606f\uff0c\u8fd9\u4e2a\u5143\u4fe1\u606f\u5171\u7528 12-bit \u6765\u5b58\u50a8\u5373 csr[11:0]\uff0c\u6240\u4ee5\u4e00\u5171\u652f\u6301 4096 \u4e2a\u5bc4\u5b58\u5668\u3002\u5177\u4f53\u800c\u8a00\uff0ccsr[11:0] \u8fd9\u4e2a\u6570\u636e\u7ed3\u6784\u6bcf\u4e2a\u4f4d\u7684\u610f\u4e49\u5206\u914d\u5982\u4e0b\uff1a
\u4f4d\u6570 11:10 9:8 7:4 \u957f\u5ea6 2 2 4 \u4f5c\u7528 11=read-only\uff0cother=read/write\uff1f \u80fd\u8bbf\u95ee\u8be5csr\u7684\u6700\u4f4e\u7684\u6743\u9650\u6a21\u5f0f \u6211\u731c\u662f\u4fdd\u7559\u7ed9\u6bcf\u4e2acsr\u7279\u5b9a\u7684\u9996\u5148\uff0c\u901a\u7528\u5bc4\u5b58\u5668\u6709\u5982\u4e0b\u8fd9\u4e9b\uff1a
\u5728\u7f16\u5199\u6c47\u7f16\u4ee3\u7801\u7684\u65f6\u5019\u4e00\u822c\u4f7f\u7528\u5bc4\u5b58\u5668\u7684abi\u7684\u540d\u5b57\u800c\u4e0d\u662f\u5bc4\u5b58\u5668\u7684\u7f16\u53f7
\u800c\u4e0b\u9762\u8981\u5355\u72ec\u8bb2\u4e00\u4e0b csr\u3002
sstatus (supervisor status register)
The sstatus register is an SXLEN(\u4ee3\u886832\u621664)-bit read/write register formatted as follows. \u6211\u4eec\u7528\u7684\u662f64\u4f4d\u3002
\u4e5f\u5c31\u662f\u8bf4\u8fd9\u4e2a\u5bc4\u5b58\u5668\u628a\u5f88\u591a\u4e8b\u4ef6\u7684\u72b6\u6001\u90fd\u75280\u62161\u8868\u793a\uff0c\u62fc\u5230\u4e86\u540c\u4e00\u4e2a\u5bc4\u5b58\u5668\u91cc\u3002
\u4f4d\u6570 \u540d\u79f0 \u7f6e1\u8868\u793a \u7f6e0\u8868\u793a 1 SIE \u54cd\u5e94\u6240\u6709\u7684S\u6001trap \u7981\u7528\u6240\u6709S\u6001trap 5 SPIE \u5728trap\u53d1\u751f\u524d\u7684SIE=1 \u5728trap\u53d1\u751f\u524d\u7684SIE=0 8 SPP \u5f53\u4e2d\u65ad\u53d1\u751f\u5b8c\u7684\u65f6\u5019\uff0c\u8fd4\u56de\u5230S-mode \u5f53\u4e2d\u65ad\u53d1\u751f\u5b8c\u7684\u65f6\u5019\uff0c\u8fd4\u56de\u5230U-mode\u624b\u518c\u91cc\u8fd8\u4ecb\u7ecd\u7684\u4f4d\u6709
sie (supervisor interrupt enable register)
\u5982\u679c\u5f00\u542f\u4e86sstatus[SIE]\uff0c\u5c31\u4f1a\u6839\u636esie\u4e2d\u7684\u6bd4\u7279\u4f4d\uff0c\u51b3\u5b9a\u662f\u5426\u5904\u7406interrupt
Bits sip.SEIP and sie.SEIE are the interrupt-pending and interrupt-enable bits for supervisor- level external interrupts. If implemented, SEIP is read-only in sip, and is set and cleared by the execution environment, typically through a platform-specific interrupt controller. Bits sip.STIP and sie.STIE are the interrupt-pending and interrupt-enable bits for supervisor- level timer interrupts. If implemented, STIP is read-only in sip, and is set and cleared by the execution environment. Bits sip.SSIP and sie.SSIE are the interrupt-pending and interrupt-enable bits for supervisor- level software interrupts. If implemented, SSIP is writable in sip and may also be set to 1 by a platform-specific interrupt controller.
stvec (supervisor trap vector base address register)
\u4e2d\u65ad\u5411\u91cf\u8868\u57fa\u5740.
WARL\u662f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u7684\u5730\u5740
MODE\u662f
Value mode \u63cf\u8ff0 0 Direct \u6a21\u5f0f \u9002\u7528\u4e8e\u7cfb\u7edf\u4e2d\u53ea\u6709\u4e00\u4e2a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f, \u5176\u6307\u5411\u4e2d\u65ad\u5904\u7406\u5165\u53e3\u51fd\u6570 \uff08 \u672c\u5b9e\u9a8c\u4e2d\u6211\u4eec\u6240\u7528\u7684\u6a21\u5f0f \uff09 1 Vectored\u6a21\u5f0f \u6307\u5411\u4e2d\u65ad\u5411\u91cf\u8868\uff0c \u9002\u7528\u4e8e\u7cfb\u7edf\u4e2d\u6709\u591a\u4e2a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f \u22652 \u4fdd\u7559sscratch (supervisor scratch register)
Typically, sscratch is used to hold a pointer to the hart-local supervisor context while the hart is executing user mode. At the beginning of a trap handler, sscratch is swapped with a user register to provide an initial working register.
\u5728\u672c\u6b21\u5b9e\u9a8c\u4e2d\uff0c\u6211\u4eec\u62ffsscratch\u8bb0\u5f55s-mode\u7684stack pointer\uff0c\u5728trap\u53d1\u751f\u7684\u65f6\u5019\u4e0eu-mode stack pointer\u4ea4\u6362\uff08\u597d\u50cf\u662f\u6765\u7740\u5fd8\u4e86TODO\u4e00\u4f1a\u6838\u5b9e\uff09
sepc (supervisor exception program counter)
\u4f1a\u8bb0\u5f55 trap \u5904\u7406\u8fc7\u540e\u7684\u8fd4\u56de\u5730\u5740\u3002
scause (supervisor cause register)
\u4f1a\u8bb0\u5f55 trap \u53d1\u751f\u7684\u539f\u56e0\uff0c\u8fd8\u4f1a\u8bb0\u5f55\u8be5 trap \u662f\u00a0Interrupt
\u00a0\u8fd8\u662f\u00a0Exception
\u3002\u539f\u56e0\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a
stval (supervisor trap value register)
The stval register can optionally also be used to return the faulting instruction bits on an illegal instruction exception (sepc points to the faulting instruction in memory). If stval is written with a nonzero value when an illegal-instruction exception occurs, then stval will contain the shortest of:
\u0088 the actual faulting instruction \u0088 the first ILEN bits of the faulting instruction \u0088 the first SXLEN bits of the faulting instruction
The value loaded into stval on an illegal-instruction exception is right-justified and all unused upper bits are cleared to zero.
satp (supervisor address translation and protection register)
\u8bb0\u5f55\u6700\u9ad8\u7ea7\u9875\u8868\u7684\u7269\u7406\u5730\u5740\u3002MODE\u4f4d=8\u65f6\uff0c\u4f7f\u7528Sv39\u6a21\u5f0f\u865a\u62df\u5730\u5740\uff08\u672c\u5b9e\u9a8c\uff09
\u4ee5\u4e0b\u662f\u65f6\u949f\u4e2d\u65ad\u76f8\u5173\u7684\u5bc4\u5b58\u5668\uff1a
mtime
\u8ba1\u65f6\u5668\uff0c\u4ee5\u6052\u5b9a\u9891\u7387\u81ea\u589e\uff08\u6211\u8bb0\u5f97\u5728\u672c\u5b9e\u9a8c\u91cc\u662f\u591a\u5c11\u5206\u4e4b\u4e00\u79d2\uff09
mtimecmp\uff08machine timer register\uff09
\u4e0b\u4e00\u6b21\u65f6\u949f\u4e2d\u65ad\u7684\u4e2d\u65ad\u70b9
mcounteren\uff08counter enable register\uff09
\uff08\u672c\u5b9e\u9a8c\u4e2d\u4e0d\u7528\u7ba1\uff0c\u4f46\u662f\u8bf4\u660e\u4e00\u4e0b\uff1a\uff09mtime\u672c\u6765\u662fm\u6001\u7684\u5bc4\u5b58\u5668\uff0c\u5728s\u6001\u4e0d\u80fd\u8bfb\u5199\uff0c\u4f46\u662fopensbi\u5df2\u7ecf\u8bbe\u7f6e\u8fc7\u53ef\u4ee5\u8bfb\u5199m\u6001
"},{"location":"docs/1-cs/os/lab/#_6","title":"\u5bc4\u5b58\u5668\u64cd\u4f5c","text":"\u64cd\u4f5ccsr\u5bc4\u5b58\u5668\u7684riscv\u6307\u4ee4\u96c6 TODO\u5f85\u6574\u7406
func scr rs1 rd\u5316\u7528\u4e00\u4e2a\u6682\u65f6\u4e0d\u60f3\u53bb\u627e\u6765\u6e90\u7684 CSDN \u5e16\u5b50\u7684\u603b\u7ed3\uff1a
\u672c\u5b9e\u9a8c\u5efa\u7acb\u7684\u7ebf\u7a0b\u90fd\u662f\u5185\u6838\u6001\u7ebf\u7a0b\u3002\u4e00\u4e2a\u4f9d\u636e\u5c31\u662f\u67d0\u4e2a\u7ebf\u7a0b trap \u540e\u4e0d\u4f1a\u963b\u585e\u5176\u5b83\u7ebf\u7a0b\u3002
\u7ebf\u7a0b\u7684 task_struct \u53ef\u4ee5\u7406\u89e3\u4e3a\u7406\u8bba\u8bfe\u4e0a\u8bb2\u7684 PCB (\u662f\u4e0d\u662f\u8be5\u53eb TCB\uff1f)\u3002\u91cc\u9762\u7684\u4e1c\u897f\u4f1a\u968f\u7740\u9010\u4e2a lab \u6dfb\u52a0\u8fdb\u53bb\uff0c\u6700\u7ec8\u4f1a\u6709\u4ee5\u4e0b\u4e1c\u897f\uff1a
Warning
TODO \u4ee5\u4e0b\u5185\u5bb9\u9700\u8981\u518d\u68c0\u67e5\uff0c\u5ffd\u7136\u5206\u4e0d\u6e05\u6bcf\u4e2a\u7ebf\u7a0b\u603b\u5171\u662f\u5f00\u4e86\u4e00\u4e2a\u8fd8\u662f\u4e24\u4e2a\u5185\u5b58\u7a7a\u95f4
\u7ebf\u7a0b\u5185\u5b58\u7a7a\u95f4\u7ed3\u6784\u5982\u4e0b\u3002
\u5185\u6838\u865a\u62df\u5b58\u50a8\u5668 \u7528\u6237\u4e0d\u53ef\u89c1\u7684\u5b58\u50a8\u5668 0xc000 0000 \u7528\u6237\u6808 \u2190 sp 0x4000 0000 \u5171\u4eab\u5e93\u7684\u5b58\u50a8\u5668\u6620\u5c04\u533a\u57df \u8fd0\u884c\u65f6\u5806\uff08\u7531malloc\u521b\u5efa\uff09 \u2190 brk \u8bfb\u5199\u6bb5 .data .bss \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d \u53ea\u8bfb\u6bb5 .init .text .rodata \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d 0x0804 8000 \u672a\u7528\u7684 \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d"},{"location":"docs/1-cs/os/lab/#lab3","title":"lab3","text":"\u5230\u672c\u5b9e\u9a8c\u7ed3\u675f\u65f6\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u5c06\u8981\u5b9e\u73b0\u8fd9\u6837\u4e00\u4e2a\u4ece\u542f\u52a8\u5230\u5f00\u542f\u6620\u5c04\u7684\u8fc7\u7a0b\uff08\u4e5f\u5bf9\u5e94 head.S
\u5f00\u5934\u7684\u4e00\u5806\u51fd\u6570\u8c03\u7528\u6d41\u7a0b\uff09\uff1a
lab2\u4e2d\u6211\u4eec\u505a\u7684\u90fd\u662f\u5185\u6838\u7ebf\u7a0b\uff0c\u53ef\u4ee5\u5171\u4eab\u8fd0\u884c\u7a7a\u95f4\uff0c\u5373\u8fd0\u884c\u4e0d\u540c\u7ebf\u7a0b\u5bf9\u5185\u8bad\u7684\u4fee\u6539\u662f\u76f8\u4e92\u53ef\u89c1\u7684\u3002\u5982\u679c\u9700\u8981\u7ebf\u7a0b\u76f8\u4e92\u9694\u79bb\u5c31\u9700\u8981\u5f15\u5165\u865a\u62df\u5185\u5b58\uff0c\u65b9\u4fbf\u591a\u7ebf\u7a0b\u9ad8\u6548\u5171\u4eab\u5185\u5b58\u3002\u5982\u679c\u5f88\u865a\u5730\u53bb\u8bb2\u865a\u62df\u5185\u5b58\u7684\u4f5c\u7528\uff1a
\u6211\u4eec\u8981\u5b9e\u73b0\u7684\u865a\u62df\u5185\u5b58\u5e03\u5c40\uff0c\u9996\u5148\u7528\u4e00\u4e2a\u622a\u56fe\u6765\u7406\u89e3\uff1a
\u4f4e\u5730\u5740<- ->\u9ad8\u5730\u5740\n\nstart_address end_address\n 0x0 0x3fffffffff\n \u2502 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2518 \u250c\u2500\u2500\u2500\u2500\u2500\u2518\n\u2193 256G \u2193 \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 User Space \u2502 ... \u2502 Kernel Space \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2191 256G \u2191\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \n \u2502 \u2502\n 0xffffffc000000000 0xffffffffffffffff\n start_address end_address\n
\u7136\u540e\u5fc5\u987b\u8981\u641e\u660e\u767d\uff1a\u865a\u62df\u5185\u5b58\u4ece\u6765\u6ca1\u6709\u88ab\u771f\u6b63\u5f00\u8f9f\u8fc7\uff0c\u88ab\u771f\u6b63\u5f00\u8f9f\u7684\u53ea\u6709\u7269\u7406\u5185\u5b58\u3002\u6211\u4eec\u5728\u7a0b\u5e8f\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5f00\u7684\u53d8\u91cf\u548c alloc \u7684 page\uff0c\u90fd\u662f\u5f00\u5728 kernel \u7684\u6808\u6216\u8005\u5806\u4e0a\uff08.data\u548c.bss\u6bb5\uff09\uff0c\u56e0\u4e3a\u67e5\u5730\u5740\u65f6\u53ef\u4ee5\u67e5\u5230\u5b83\u4eec\u7684\u7269\u7406\u5730\u5740\u3002\u800c\u5404\u79cd csr \u5728 cpu \u91cc\uff0c\u4e0d\u4f1a\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002\u800c\u672c\u6b21\u5b9e\u9a8c\u6240\u8bb2\u7684\u201c\u5f00\u542f\u865a\u62df\u5185\u5b58\u201d\uff0c\u672c\u8d28\u4e0a\u53ea\u662f\u8bbe\u8ba1\u4e00\u4e2a\u865a\u62df\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u8f6c\u6362\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u653e\u5728\u9875\u8868\u91cc\u3002
"},{"location":"docs/1-cs/os/lab/#sv39","title":"Sv39 \u7684\u9875\u8868\u9879","text":"\u7406\u89e3\u4e00\u4e0b\u9875\u8868\u9879\uff08pte\uff09\u3002\u5b83\u7684\u4f4e\u4f4d\uff1a
create_mapping()
\u51fd\u6570\u904d\u5386\u6574\u4e2a\u6620\u5c04\u5927\u5c0f\uff0c\u4f9d\u6b21\u6309\u4e8c\u7ea7\u9875\u8868\uff08\u5373\u6839\u9875\u8868\u7684\u4e0b\u4e00\u7ea7\uff09\u2192\u4e09\u7ea7\u9875\u8868\u2192\u7269\u7406\u9875\uff0c\u68c0\u67e5\u9875\u8868\u9879\u7684V bit\u770b\u9875\u8868\u9879\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u5219\u7528kalloc() \u5206\u914d\u4e00\u9875\u4f5c\u4e3a\u9875\u8868\u76ee\u5f55\uff1b\u5b58\u5728\u5219\u5728\u9875\u8868\u9879\u4e2d\u8bb0\u5f55\u9875\u8868\u7684\u7269\u7406\u5730\u5740\u3002
pte : [ PPN2: 53-28 ][ PPN1: 27-19 ][ PPN0: 18-10 ][ perm: 9-0 ]
vm_addr: [ VPN2: 38-30 ][ VPN1: 29-21 ][ VPN0:20-12 ][ offset: 11-0 ]
\u56e0\u4e3a\u67e5\u8be2\u4e09\u7ea7\u9875\u8868\u7684\u6d41\u7a0b\u4e3a\uff1a
\u6240\u4ee5\u53cd\u63a8\u8bbe\u7f6e\u7684\u6d41\u7a0b\u4e3a\uff1a
\u9876\u5c42\u9875\u8868
now_tbl = pgtbl;
now_vpn = VPN2(va);
now_pte = *(now_tbl + now_vpn);
\u6b21\u7ea7\u9875\u8868\u76f8\u540c
\u5728 2023 \u5e74\u7248\u7684\u5b9e\u9a8c\u4e2d\uff0cvmlinux.lds
\u4e2d\u8bbe\u7f6e\u4e86\u5c06\u7f16\u8bd1\u51fa\u7684\u7b26\u53f7\u8868\u90fd\u7528\u865a\u62df\u5730\u5740\u6765\u8868\u793a\uff0c\u65b9\u4fbf\u8c03\u8bd5\u3002\u4e5f\u5373\u7a0b\u5e8f\u8fd0\u884c\u5230\u6b64\u5904\u8bfb\u5230\u7684\u9875\u8868\u9879\u5730\u5740\u662f\u865a\u62df\u5730\u5740\u3002\u663e\u7136\uff0c\u5728 setup_vm()
\u4e4b\u524d\uff0c\u865a\u62df\u5185\u5b58\u8fd8\u6ca1\u6709\u88ab\u5f00\u542f\uff0c\u6240\u4ee5\u8981\u51cf\u6389\u4e00\u4e2a\u504f\u79fb\u91cf\u4f7f\u5176\u80fd\u8bfb\u5230\u9875\u8868\u9879\u7684\u7269\u7406\u5730\u5740\u3002\u5728 relocate:
\u5904\u7406\u504f\u79fb\u4e4b\u540e\u5c31\u4e0d\u7528\u7ba1\u4e86\u3002
\u6211\u4eec\u56de\u5fc6 lab3 \u91cc\u865a\u62df\u5730\u5740\u53ea\u7528\u4e86\u9ad8\u4f4d\uff0c\u4f4e\u4f4d\u6ca1\u6709\u7528\uff0c\u5728\u672c\u5b9e\u9a8c\u6211\u4eec\u8981\u5c06\u4f4e\u4f4d 0x0-0x4000000
\u5206\u7ed9\u7528\u6237\u8fdb\u7a0b\u3002\u800c\u7528\u6237\u8fdb\u7a0b\u7684\u4ee3\u7801\u5b9e\u9645\u5728\u7269\u7406\u5730\u5740\u4e0a\u5206\u914d\u51fa\u6765\u7684\u67d0\u4e2a\u5730\u65b9\u3002\u603b\u4e4b\uff0c\u8981\u5b9e\u73b0\u4ee5\u4e0b\u7684\u5185\u5b58\u5e03\u5c40\uff1a
PHY_START new allocated memory allocated space end PHY_END\n \u2502 \u2502 \u2502 \u2502\n \u25bc \u25bc \u25bc \u25bc\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n PA \u2502 \u2502 \u2502 uapp (copied from _sramdisk) \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25b2 \u25b2\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u2502 (map) \u2502\n \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502\n \u2502 \u2502\n \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n VA \u2502 UAPP \u2502 \u2502u mode stack\u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25b2 \u25b2\n \u2502 \u2502\n\n USER_START USER_END\n
"},{"location":"docs/1-cs/os/lab/#riscv_1","title":"riscv\u5904\u7406\u5668\u652f\u6301\u7684\u6a21\u5f0f","text":"lab3\u521b\u5efa\u7684\u90fd\u662f\u5185\u6838\u7ebf\u7a0b \u516c\u7528\u4e86\u5730\u5740\u7a7a\u95f4\uff08\u9875\u8868swapper_pg_dir\uff09\u3002\u8981\u5f15\u5165\u7528\u6237\u6001\u8fdb\u7a0b\u9700\u8981\u505a\uff1a
\u5177\u4f53\u5728\u6211\u4eec\u7684\u5b9e\u9a8c\u64cd\u4f5c\u4e2d\uff0c\u5b9e\u73b0\u7528\u6237\u6001\u548c\u5185\u6838\u6001\u5207\u6362\u7684\u65b9\u6cd5\u662f\uff1asstatus[SUM] \u548c PTE[U]
\u5bc4\u5b58\u5668 sstatus[SUM]
\u9875\u8868\u9879 PTE[U]
Warning
\u60f3\u5199\u4e00\u4e0b\u5728\u6c47\u7f16\u4ee3\u7801\u91cc\u7684\u64cd\u4f5c\uff0c\u5fd8\u5e72\u51c0\u4e86\uff0c\u6574\u4f53\u601d\u8def\u662f\u8fd9\u6837\u7684\uff0c\u4f46\u4e00\u4e9b\u7ec6\u8282\u5f85\u6838\u5b9e
\u5e76\u4e14\u5728\u6c47\u7f16\u4ee3\u7801\u91cc\u9700\u8981\u5b9e\u73b0\u4e00\u7cfb\u5217 csr \u8bfb\u5199\u64cd\u4f5c\uff1a
__switch_to
: \u9700\u8981\u52a0\u5165\u4fdd\u5b58/\u6062\u590d\u00a0sepc
sstatus
sscratch
\u00a0\u4ee5\u53ca\u5207\u6362\u9875\u8868\u7684\u903b\u8f91\u3002\u5728\u5207\u6362\u4e86\u9875\u8868\u4e4b\u540e\uff0c\u9700\u8981\u901a\u8fc7\u00a0fence.i
\u00a0\u548c\u00a0vma.fence
\u00a0\u6765\u5237\u65b0 TLB \u548c ICache\u3002_traps
\u548c trap_handler()
: \u56e0\u4e3a\u6211\u4eec\u7684\u7ebf\u7a0b\u662f\u5728trap\u91cc\u5207\u6362\u7684\uff0c\u8fd8\u8981\u6539trap\u7684\u903b\u8f91\u3002\u7ebf\u7a0b\u5728u-mode\u91cc\u8fd0\u884c\uff0c\u5230trap\u8981\u5207\u6210s-mode\uff0c\u4e2d\u65ad\u5b8c\u518d\u5207\u56de\u6765\u3002\u4e14\u5982\u679c\u662f\u5185\u6838\u7ebf\u7a0b\uff08\u6ca1\u6709u-mode stack\uff09\u89e6\u53d1\u4e86\u5f02\u5e38\u5c31\u4e0d\u9700\u8981\u8fdb\u884c\u5207\u6362\uff0c\u6240\u4ee5\u5185\u6838\u7ebf\u7a0b\u7684sp\u6c38\u8fdc\u6307\u5411s-mode stack\uff0csscratch\uff08sp\uff1f\uff09\u4e3a0\u3002TODO\uff1a\u6709\u4e00\u4e2a\u975e\u5e38\u4f18\u96c5\u7684\u76f4\u63a5\u5b9e\u73b0\u4e24\u4e2a csr \u4ea4\u6362\u7684\u547d\u4ee4\u3002\u627e\u4e0d\u5230\u4e86\u3002\u4f1a\u8865\u7684\u3002__dummy
: \u6211\u4eec\u56de\u5fc6\u4e4b\u524d lab2 \u5b9e\u73b0\u7684\u662f\uff0c\u76f4\u63a5\u5c06 __dummy
\u51fd\u6570\u7684\u5199\u5728\u7ebf\u7a0b\u7684 sepc\uff08\u4e2d\u65ad\u8fd4\u56de\u5730\u5740\uff09\u91cc\uff0c\u53c8\u5728 __dummy
\u91cc\u5199\u8fd4\u56de\u5730\u5740\u662f dummy()
\u51fd\u6570\u3002\u6240\u4ee5\u5982\u679c\u6211\u4eec\u8fd9\u91cc\u60f3\u8ba9\u8fdb\u7a0b\u5207\u6362\u5230\u7528\u6237\u8fdb\u7a0b\u540e\u8fdb\u5165\u7528\u6237\u7a0b\u5e8f\uff0c\u4fee\u6539 __dummy
\u8fd0\u884c\u5b8c\u6240\u8fd4\u56de\u7684\u5730\u5740\u4e3a user app \u7684\u7b2c\u4e00\u6761\u6307\u4ee4\u5730\u5740\u5c31\u53ef\u4ee5\u4e86\u3002\u4e00\u79cd\u7269\u7406\u5185\u5b58\u7ba1\u7406\u7b97\u6cd5\uff0c\u7a7a\u95f2\u7a7a\u95f4\u9996\u5148\u88ab\u770b\u6210 2^N \u4e2a\u7269\u7406\u9875\u7684\u5927\u7a7a\u95f4\uff0c\u5f53\u4e00\u4e2a\u5927\u5c0f\u4e3a m \u7684\u9875\u8bf7\u6c42\u5185\u5b58\u5206\u914d\u65f6\uff0c\u4e0d\u505c\u628a\u7a7a\u95f4 /2 \u5212\u5206\uff0c\u6700\u540e\u627e\u5230\u6700\u63a5\u8fd1m\u76842\u7684\u6b21\u65b9\u7684\u4e00\u4e2a\u7a7a\u95f4\u5927\u5c0f\u5206\u7ed9 m\u3002\u5f53\u5757\u91ca\u653e\u65f6\uff0c\u5206\u914d\u5668\u5c31\u4f1a\u627e\u5230\u5176\u5b83\u7a7a\u95f2\u7684\u4f19\u4f34\u5757\u53bb\u5408\u5e76\u3002\u5b83\u7684\u5b9e\u73b0\u5728\u8fd9\u4e2a\u6587\u7ae0\u91cc\u8bb2\u5f97\u66f4\u597d Lab 6\uff1aRISC-V \u52a8\u6001\u5185\u5b58\u5206\u914d\u4e0e\u7f3a\u9875\u5f02\u5e38\u5904\u7406 - \u77e5\u4e4e (zhihu.com)\u3002
"},{"location":"docs/1-cs/os/lab/#elf","title":"elf \u6587\u4ef6","text":"\u4e00\u4e2a elf \u6587\u4ef6\u50cf\u4e00\u4e2a\u5c01\u88c5\u590d\u6742\u7248\u7684\u4e8c\u8fdb\u5236\u7528\u6237\u7a0b\u5e8f\u3002\u7528\u62bd\u8c61\u7684\u753b\u56fe\u7ed9\u5b83\u7684\u7ed3\u6784\u505a\u4e00\u4e2a\u6bd4\u55bb\uff08\u5bf9\u4e0d\u8d77\u592a\u62bd\u8c61\u4e86\uff09\uff1a
Elf_Ehdr ehdr->e_phoff\n\u2b07\ufe0f \u2b07\ufe0f\n[ [type: ???][type: LOAD][type: ???] ]\n
\u5c31\u662f elf \u6587\u4ef6\u91cc\u6563\u843d\u7740\u51e0\u4e2a\u5c0f\u6bb5\uff0c\u5176\u4e2d\u4e00\u4e2a\u7c7b\u578b\u4e3a LOAD \u7684\u6bb5\u662f\u9700\u8981\u590d\u5236\u5230\u7ebf\u7a0b\u4ee3\u7801\u6bb5\u7684\uff0c\u4f46\u4e0d\u4e00\u5b9a\u590d\u5236\u5230\u7ebf\u7a0b\u5934\u7684\u8d77\u59cb\u5730\u5740 0x0
\uff0cp_vaddr
\u4f1a\u544a\u8bc9\u4f60\u8fd9\u6bb5\u4ee3\u7801\u5e0c\u671b\u88ab\u590d\u5236\u5230\u54ea\u91cc\u53bb\u3002e_entry \u4e5f\u8d34\u5fc3\u544a\u8bc9\u4f60\u7b2c\u4e00\u6761\u4ee3\u7801\u6307\u4ee4\u7684\u8d77\u59cb\u5730\u5740\u5728\u54ea\u3002\u603b\u4e4b\uff0c\u4f60\u9700\u8981\u5148\u901a\u8fc7\u4e00\u4e9b\u504f\u79fb\u91cf\u5728 Elf64_Ehdr \u8fd9\u4e2a\u6307\u9488\u91cc\u627e\u5230\u7b2c\u4e00\u4e2a segment\uff0c\u7136\u540e\u4ee5\u4e00\u4e2a Elf63_phdr \u7684\u5927\u5c0f\u4e3a\u5355\u4f4d\uff0c\u6328\u4e2a\u53bb\u5bfb\u627e\u4e00\u4e2a\u7c7b\u578b\u4e3a LOAD \u7684 segment\u3002\u7b49\u627e\u5230\u4e86\u5c31\u53ef\u4ee5\u62f7\u8d1d\u4e86\u3002
\u5982\u679c\u4f60\u6309\u7167\u4e00\u5806\u6307\u9488\u7684\u5199\u6cd5\u88ab\u641e\u5f97\u6655\u5934\u8f6c\u5411\uff0c\u751a\u81f3\u53ea\u662f\u5148\u7528 readelf -h
\u67e5\u770b\u4e00\u4e0b elf \u6587\u4ef6\u91cc\u5404\u4e2a\u4e1c\u897f\u7684\u5730\u5740\uff08\u67e5\u770b\u540e\u53ef\u4ee5\u53d1\u73b0\u4e0e\u5b9e\u9a8c\u6307\u5bfc\u4e2d\u7ed9\u7684\u4f8b\u5b50\u5c31\u662f\u540c\u4e00\u4e2a\u6587\u4ef6\uff09\uff0c\u7136\u540e\u76f4\u63a5\u628a\u6574\u4e2a uapp \u7a0b\u5e8f\u5168\u90e8\u62f7\u5230\u8fdb\u7a0b\u91cc\u6765\uff0c\u76f4\u63a5\u628a __dummy
\u8fd4\u56de\u5730\u5740\u6307\u5230\u4f60\u5728\u6587\u4ef6\u91cc\u8bfb\u51fa\u6765\u7684\u90a3\u4e2a\u4ee3\u7801\u8d77\u59cb\u5730\u5740\uff0c\u751a\u81f3\u90fd\u80fd\u8dd1\u3002\u5728\u8dd1\u8d77\u6765\u4e4b\u540e\uff0c\u6839\u636e\u4f60\u7684\u7406\u89e3\u4e00\u70b9\u4e00\u70b9\u628a\u8bbe\u7f6e\u6307\u9488\u7684\u4ee3\u7801\u6309\u7167\u542b\u4e49\u66ff\u6362\u4e0a\uff0c\u6211\u611f\u89c9\u8fd9\u6837\u53cd\u7740\u505a\u4e5f\u884c\u3002
Warning
\u4e0b\u9762\u51e0\u4e2a\u5b9e\u9a8c\u6211\u5199\u5f97\u6709\u70b9\u7b80\u7565\uff0c\u5c0f\u90e8\u5206\u56e0\u4e3a\u6211\u4e0d\u8bb0\u5f97\u4e86\uff0c\u5927\u90e8\u5206\u56e0\u4e3a\u6211\u81ea\u6211\u611f\u89c9\u6ca1\u6709\u5403\u900f\u8fd9\u4e2a\u5b9e\u9a8c\uff0c\u4e0d\u73ed\u95e8\u5f04\u65a7\u4e86\u3002\u4f46\u662f\u8fd9\u4e2a\u5730\u65b9\u53d1\u81ea\u5185\u5fc3\u5730\u60f3\u7559\u4e2a TODO \u5e0c\u671b\u80fd\u6709\u673a\u4f1a\u8865\u5b8c\u3002
\u672c\u5b9e\u9a8c\u4e0e lab4 \u5185\u5b58\u5206\u914d\u7684\u533a\u522b\u662f\uff0c\u4e3a\u4e86\u9632\u6b62\u7269\u7406\u5185\u5b58\u4e0d\u8db3\uff0c\u5728 task \u521d\u59cb\u5316\u8bf7\u6c42\u7a7a\u95f4\u65f6\uff0c\u5148\u4e0d\u5206\u914d\u7269\u7406\u5185\u5b58\uff0c\u800c\u662f\u7528 do_mmap()
\u5148\u628a task \u7684\u8bf7\u6c42\u7684\u6240\u6709\u53c2\u6570\u8bb0\u5f55\u4e0b\u6765\uff0c\u7b49 task \u771f\u6b63\u53bb\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u5fc5\u7136\u4f1a\u89e6\u53d1 page fault\uff0c\u7136\u540e\u5728 page fault handler \u91cc\u6839\u636e\u8bb0\u5f55\u7684\u53c2\u6570\uff0c\u518d\u5206\u914d\u7269\u7406\u5185\u5b58\u3002
\u5b9e\u9a8c\u4e3b\u8981\u76ee\u6807\u662f\u5b9e\u73b0\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u903b\u8f91\uff0c\u5373\u5728\u7528\u6237\u7a0b\u5e8f\u8c03\u7528fork()\u51fd\u6570\uff0c\u4ea7\u751f220\u53f7\u7cfb\u7edf\u8c03\u7528\u7684\u65f6\u5019\uff0c\u5728sys_clone()\u8fd9\u4e2a\u51fd\u6570\u91cc\u521b\u5efa\u5b50\u8fdb\u7a0b\uff0c\u5e76\u4f7f\u5176\u52a0\u5165\u88ab\u8c03\u7528\u7684task\u961f\u5217\u3002
"},{"location":"docs/1-cs/os/lab/#lab7","title":"lab7","text":"Warning
lab7 \u6211\u53ea\u5b8c\u6210\u4e86\u5360 60% \u7684\u7b2c\u4e00\u90e8\u5206\uff0c\u4f46\u5176\u5b9e\u5de5\u4f5c\u91cf\u6bd4\u8f83\u5927\u7684\u8fd8\u5728\u7b2c\u4e8c\u90e8\u5206\u3002\u6211\u8fd9\u91cc\u53ea\u80fd\u603b\u7ed3\u7b2c\u4e00\u90e8\u5206\u4e86\u3002
\u672c\u5b9e\u9a8c\u6bcf\u4e2atask\u90fd\u6709\u4e00\u4e2a\u7ed3\u6784\u4f53\u53bb\u7ef4\u62a4\u5df2\u7ecf\u6253\u5f00\u7684\u6587\u4ef6\u8868\u3002\u672c\u5b9e\u9a8c\u9996\u5148\u4fee\u6539task struct\uff0c\u5728\u6bcf\u4e2atask struct\u4e2d\u6dfb\u52a0\u4e86\u4e00\u4e2a\u9875(struct file* \u578b)\u53bb\u7ef4\u62a4\u8fd9\u4e2a\u6587\u4ef6\u8868\u3002
\u6bcf\u4e2a\u6587\u4ef6\u8868\u6709\u4e00\u4e9b\u51fd\u6570\u6307\u9488\uff0c\u5206\u522b\u6307\u5411\u5bf9\u6587\u4ef6\u7684\u8bfb\u5199\u64cd\u4f5c\u51fd\u6570\u3002\u9996\u5148\u9700\u8981\u5b9e\u73b0\u8fd9\u4e9b\u51fd\u6570\uff0c\u5982 stdout_write()
\u548c stdin_read()
\u7b49\u3002
\u5f53\u7528\u6237\u7a0b\u5e8f\u4ea7\u751f\u6587\u4ef6\u8bfb\u5199\u7684 system call \u65f6\uff0ctrap_handler()
\u4e2d\u9700\u8981\u5b9e\u73b0\u5bf9\u8fd9\u4e9b system call \u7684\u5904\u7406\u51fd\u6570\u3002\u5177\u4f53\u64cd\u4f5c\u5c31\u662f\u6355\u83b7\uff0c\u7136\u540e\u4ec0\u4e48\u4e5f\u4e0d\u505a\uff0c\u76f4\u63a5\u628a\u53c2\u6570\u4ea4\u7ed9\u4e0a\u8ff0\u5b9e\u73b0\u7684\u6587\u4ef6\u8bfb\u5199\u51fd\u6570\u6765\u64cd\u4f5c\u3002
Q1: \u8fd0\u884c\u53d1\u73b0\u7a0b\u5e8f\u5728\u51e0\u4e2a\u521d\u59cb\u5316\u51fd\u6570\u4e4b\u95f4\u6765\u56de\u8df3\u8dc3\uff0c\u6bd4\u5982\u5df2\u7ecf\u5230\u4e86 set_up_vm_final()
\uff0c\u53c8\u8df3\u56de set_up_vm()
\uff0c\u518d\u5f80\u4e0b\u8fd0\u884c\u5c31\u5728\u8fd9\u51e0\u4e2a\u51fd\u6570\u4e4b\u95f4\u5faa\u73af\u3002\u8fdb\u5165 gdb \u8c03\u8bd5\uff0c\u5219\u53d1\u73b0\u53d1\u751f\u8df3\u8f6c\u7684\u5730\u65b9\u5e76\u6ca1\u6709\u4efb\u4f55 branch \u6216\u8005 call \u8bed\u53e5\u6307\u5411\u8df3\u5f80\u7684\u5730\u5740\uff0c\u4f46\u662f\u80fd\u89c2\u5bdf\u5230\u51fa\u73b0\u8df3\u8f6c\u7684\u5730\u65b9\uff0c\u5f80\u5f80\u662f\u8fdb\u4e86 memset() \u6216\u8005 memcopy() \u51fd\u6570\u3002
A1: \u6574\u4e2a\u5b9e\u9a8c\u8fc7\u7a0b\u4e2d\u6211\u9047\u5230\u4e86\u4e09\u56db\u6b21\uff0c\u4e00\u5f00\u59cb\u89c9\u5f97\u662f\u4ee5\u5947\u602a\u7684\u65b9\u5f0f\u89e3\u51b3\u4e86\uff08\u6bd4\u5982\uff0c\u7a81\u7136\u53d1\u73b0\u81ea\u5df1\u5728\u521d\u59cb\u5316\u8fdb\u7a0b\uff0c\u5f15\u5165\u5916\u90e8\u9875\u8868\u65f6\u7528\u5230\u7684\u4ee3\u7801\u662f extern unsigned long *swapper_pg_dir;
\uff0c\u800c\u4e0d\u662f extern unsigned long swapper_pg_dir[512] __attribute__((__aligned__(0x1000)));
\uff0c\u5373\uff0c\u7f3a\u5c11\u4e86\u4e00\u4e2a\u5730\u5740\u5bf9\u9f50\u3002\u540c\u5b66\u6307\u51fa\u5982\u679c\u6ca1\u6709\u5bf9\u9f50\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u9875\u8868\u8fb9\u7f18\u7684\u4e00\u4e9b\u6570\u636e\u7684\u4e22\u5931\u635f\u574f\u3002\uff09\uff0c\u540e\u6765\u6162\u6162\u53d1\u73b0\u89c4\u5f8b\u662f\uff1a\u53d1\u751f\u8fd9\u6837\u8df3\u8f6c\u7684\u6307\u4ee4\uff0c\u90fd\u5728\u5c1d\u8bd5\u5f80 0x80000000
\u8fd9\u4e2a\u7269\u7406\u5730\u5740\u4ee5\u4e0b\u7684\u7269\u7406\u5730\u5740\u5199\u4e1c\u897f\u3002\u6211\u4eec\u6ce8\u610f\u5230 qemu \u63d0\u4f9b\u7ed9\u6211\u4eec\u7684\u7269\u7406\u5730\u5740\u90fd\u662f 0x80000000
\u4ee5\u4e0a\u7684\u5730\u5740\uff0c\u867d\u7136\u6ca1\u6709\u8003\u8bc1\uff0c\u4f46\u662f\u5408\u7406\u731c\u6d4b\u5176\u4e0b\u7684\u5730\u5740\u662f qemu \u81ea\u5df1\u7684\u4ee3\u7801\u533a\uff0c\u652f\u6301 qemu \u81ea\u5df1\u7684\u8fd0\u884c\u903b\u8f91\u3002\u5982\u679c\u4e0d\u5c0f\u5fc3\u5199\u5230\u4e86\u8fd9\u4e2a\u5730\u65b9\uff0c\u5f53\u7136\u53ef\u80fd\u53d1\u751f\u4e0d\u80fd\u89e3\u91ca\u7684 qemu \u884c\u4e3a\u3002
\u6240\u4ee5\u5982\u679c\u9047\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u884c\u7684\u4e00\u6b65\u4e00\u6b65\u68c0\u67e5\u65b9\u6cd5\u662f\uff1a
create_mapping()
\u505a\u9875\u8868\u6709\u6ca1\u6709\u505a\u5bf9\u3002\u4e00\u4e2a\u6f02\u4eae\u7684\u68c0\u67e5\u65b9\u6cd5\u662f printk(\"[function name]: map from %#llx-%#llx to %#llx-%#llx\", pa, pa+size, va, va+size);
\uff0c\u5e2e\u52a9\u68c0\u67e5\u4ece\u54ea\u4e2a\u5730\u5740 copy \u5230\u54ea\u4e2a\u5730\u5740\u4e86\u3002memset()
memcpy()
\u7b49\u51fd\u6570\u6709\u6ca1\u6709\u7528\u5bf9\u3002\u4e00\u6837\u662f\u7528\u4e0a\u9762\u7c7b\u4f3c\u7684 prink \u53bb\u6253\u5370\u8d77\u59cb\u5730\u5740\u3002\u603b\u4e4b\uff0c\u6839\u672c\u76ee\u6807\u662f\u53bb\u770b\u4e00\u4e0b\u6709\u6ca1\u6709\u5f80\u7269\u7406\u5730\u5740 0x80000000
\u4ee5\u4e0b\u7684\u5730\u65b9\u5199\u4e1c\u897f\u3002
Q2: \u8fd0\u884c\u7a0b\u5e8f\u5230\u4e00\u534a\u5361\u4f4f\uff0c\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa\u4e86\uff0c\u8c03\u8bd5\u53d1\u73b0\u6700\u540e\u662f\u5728 __dummy
\u7684 sret
\u540e\u5361\u4f4f\u4e86\u3002
A2: \u53ef\u4ee5\u5148\u5b9e\u73b0\u4e00\u4e2a\u6f02\u4eae\u70b9\u7684 trap_handler()
\u5e2e\u52a9\u8c03\u8bd5\u3002\u8fd9\u70b9\u5728 lab7 \u7684\u6307\u5bfc\u91cc\u624d\u6709\u63d0\u793a\u5230\uff0c\u4e0d\u8fc7\u6211\u89c9\u5f97\u5e94\u8be5\u65e9\u70b9\u5b9e\u73b0\u8d77\u6765\u3002\u6bd4\u5982\uff1a
void trap_handler(uint64 scause, uint64 sepc, struct pt_regs* regs) { // a0, a1, a2\nuint64 stval = csr_read(stval);\n// printk(\"[S] Trap @sepc = %#llx, @scause = %#llx, @stval = %#llx\\n\", sepc, scause, stval);\nint done = 0;\n/* Interrupt */\nif ((scause >> 63) && (scause & 0x7FFFFFFFFFFFFFFF) == 5) {\nclock_set_next_event();\nprintk(\"[S] Supervisor Timer Intterupt\\n\");\ndo_timer();\n} /* Exception */\nelse {\n/* instrution addr misaligned */\nif (scause == 0) {}\n/* Instruction access fault */\nelse if (scause == 1) {}\n/* Illegal instruction */\nelse if (scause == 2) {}\n/* breakpoint */\nelse if (scause == 3) {}\n/* load addr misaligned */\nelse if (scause == 4) {}\n/* load access fault */\nelse if (scause == 5) {}\n/* store/amo addr misaligned */\nelse if (scause == 6) {}\n/* store/amo access fault */\nelse if (scause == 7) {}\n/* ecall U-mode */\nelse if (scause == 8) {\nif (sys_call_num == SYS_WRITE) {\n// ...\n} else if (sys_call_num == SYS_GETPID) {\n// ...\n} else if (sys_call_num == SYS_CLONE) {\n// ...\n}\nregs->sepc += 4; // pc + 4\n} /* ecall S-mode */\nelse if (scause == 9) {}\n/* Instruction page fault */\n/* Load page fault */\n/* Store/amo page fault */\nelse if (scause == 12 || scause == 13 || scause == 15) {\ndone = do_page_fault(scause, regs);\n} else {\nprintk(\"[S] Unhandled exception with scause = %d, sepc = %lx\\n\", scause, sepc);\nwhile (1);\n}\n}\n// if (!done) while(1);\n}\n
\u603b\u4e4b\uff0c\u5efa\u8bae\u5bf9 trap_handler()
\u505a\u7684\u6539\u8fdb\u6709\u4e24\u4ef6 while(1)
\u8bed\u53e5\uff0c\u8fd9\u662f\u56e0\u4e3a\u5982\u679c\u4f60\u7684\u7a0b\u5e8f\u5361\u4f4f\u7684\u539f\u56e0\u662f\u5faa\u73af\u53d1\u751f trap\uff0c\u4e00\u4e2a trap \u8fd8\u6ca1\u7ed3\u675f\u5c31\u8fdb\u5165\u4e86\u53e6\u4e00\u4e2a\uff0c\u90a3\u53ef\u80fd\u4f1a\u5faa\u73af\u8f93\u51fa\u4f60\u6253\u5370\u7684\u4fe1\u606f\u770b\u4e0d\u6e05\u3002\u8fd9\u4e2a\u8bed\u53e5\u53ef\u4ee5\u5e2e\u4f60\u505c\u4f4f\u8ba9\u4f60\u770b\u6e05\u6253\u5370\u7684\u4fe1\u606f\u3002\uff08\u600e\u4e48\u6211\u8bb2\u5f97\u542c\u8d77\u6765\u597d\u5f31\u667a\uff09\u5982\u679c\u786e\u5b9e\u662f\u5faa\u73af trap \u5bfc\u81f4\u7684\u7a0b\u5e8f\u5361\u4f4f\uff0c\u90a3\u4e48\u6309\u6253\u5370\u7684\u4fe1\u606f\u53bb\u601d\u8003\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\u679c\u8fd8\u662f\u4ec0\u4e48\u8f93\u51fa\u90fd\u6ca1\u6709\uff08\u6211\u8bb0\u5f97\u4e5f\u6709\u8fd9\u79cd\u60c5\u51b5\uff09\uff0c\u6211\u4e0d\u8bb0\u5f97\u662f\u4ec0\u4e48\u539f\u56e0\u4e86\uff0c\u4f46\u662f\u8d77\u7801\u5e2e\u4f60\u6392\u9664\u4e86\u53d1\u751f\u4e86 trap \u7684\u53ef\u80fd\u6027\uff0c\u4f60\u53ef\u4ee5\u5728\u6b64\u57fa\u7840\u4e0a\u7ee7\u7eed\u601d\u8003\u662f\u4e3a\u4ec0\u4e48\u3002
"},{"location":"docs/2-ling/","title":"Linguistic Notes","text":":material-circle-edit-outline: \u7ea6 62 \u4e2a\u5b57
This section mainly consists of the notes of the linguistics courses from Zhejiang University.
"},{"location":"docs/2-ling/#contents","title":"Contents","text":"It is commonly considered that the subject linguistics consists of 6 main branches.
Besides, we also talk about other topics,
French
Cross-lingual comparison
:material-circle-edit-outline: \u7ea6 40 \u4e2a\u5b57
\u4e3b\u8981\u53ef\u80fd\u5199\u4e00\u4e9b\u8bed\u6cd5\uff0c\u8bcd\u6cd5\u548c\u53e5\u6cd5\u7b49\u3002
\u5355\u8bcd\u8bb0\u5fc6\u548c\u4e60\u60ef\u7528\u8bed\u4e0d\u5728\u672c\u5e16\u7684\u8bb0\u5f55\u8303\u56f4\u4e4b\u5185\u3002
"},{"location":"docs/2-ling/acqusition/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1161 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/2-ling/acqusition/french-tense/#overview","title":"Overview\uff1a\u8bed\u6001\u548c\u65f6\u6001","text":"\u52a8\u8bcd\u7684\u53d8\u4f4d\u6709\u4e24\u79cd\u5c5e\u6027\uff1a\u8bed\u6001\u548c\u65f6\u6001\u3002\u8bed\u6001\u5bf9\u5e94\u4e00\u4e2a\u52a8\u4f5c\u7684\u7edd\u5bf9\u8fdb\u884c\u7a0b\u5ea6\u5c5e\u6027\uff0c\u800c\u65f6\u6001\u5bf9\u5e94\u52a8\u4f5c\u7684\u76f8\u5bf9\u53d1\u751f\u65f6\u95f4\u3002
\u6211\u627e\u5230\u4e86\u4e00\u4e2a\u5173\u4e8e\u8bed\u6001\u6bd4\u8f83\u597d\u7684\u793a\u610f\u56fe\uff0c\u6a2a\u5411\u8868\u793a\u52a8\u8bcd\u7684\u5b8c\u6210\u7a0b\u5ea6\uff0c\u7eb5\u5411\u8868\u793a\u52a8\u8bcd\u672c\u8eab\u7684\u6301\u7eed\u65f6\u957f\uff0c\u4e8e\u662f\u4e0a\u3001\u4e0b\u3001\u5de6\u3001\u53f3\u53ef\u4ee5\u5927\u81f4\u5bf9\u5e94\u77ac\u6001\u52a8\u8bcd\u3001\u6301\u7eed\u52a8\u8bcd\u3001\u5c06\u8981\u53bb\u505a\u3001\u5df2\u7ecf\u5b8c\u6210\u3002
\u77ac\u6001\n /\\\n / \\\n /\u975e\u5e38\u6001\\\n -------\n\u4e0d\u5b9a\u6001 / \\ \u5b8c\u6210\u6001\n ------------\n \u5e38\u6001\n
\u800c\u65f6\u6001\u8868\u793a\u52a8\u4f5c\u53d1\u751f\u7684\u65f6\u95f4\u987a\u5e8f\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u4e09\u89d2\u5957\u5165\u8fc7\u53bb\u3001\u73b0\u5728\u3001\u5c06\u6765\u8fd9\u4e09\u4e2a\u76f8\u5bf9\u65f6\u95f4\uff0c\u7ec4\u5408\u5f97\u5230\u5bf9\u5e94\u65f6\u6001\u4e0b\u7684\u591a\u4e2a\u8bed\u6001\u3002 \u6cd5\u8bed\u7684 3 \u79cd\u65f6\u6001\u6709\uff1a
\u540c\u65f6\u8fd8\u6709 6 \u79cd\u8bed\u6001\uff1a
\u4e8e\u662f\u53ef\u4ee5\u7ec4\u5408\u4ea7\u751f\u591a\u4e2a\u65f6\u6001\u4e0b\u7684\u591a\u4e2a\u8bed\u6001\uff0c\u5b83\u4eec\u4e00\u822c\u5408\u79f0\u53eb\u65f6\u6001\uff0c\u6709\u70b9\u6b67\u4e49\uff0c\u4e0d\u8fc7\u5c31\u8fd9\u6837\u53eb\u597d\u4e86\u3002\u4e0b\u9762\u4e00\u4e00\u4ecb\u7ecd\u3002
"},{"location":"docs/2-ling/acqusition/french-tense/#_1","title":"\u5177\u4f53\u65f6\u6001\u4ecb\u7ecd","text":"\u9996\u5148\u63d0\u4f9b\u4e00\u4e2a overview\u3002
Fig 1. \u4ec5\u4e0e\u5ba2\u89c2\u73b0\u5b9e\u6709\u5173\u7684\u51e0\u4e2a\u65f6\u6001\u7684\u65f6\u95f4\u8f74
\u76f4\u9648\u5f0f (l'indicatif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u76f4\u9648\u5f0f\u73b0\u5728\u65f6l'indicatif pr\u00e9sent \u53d1\u751f\u5728\u73b0\u5728\u7684\u52a8\u4f5c\u6216\u5b58\u5728\u7684\u72b6\u6001\u3002 \u52a8\u8bcd\u8bcd\u6839 - \u8bcd\u5c3e + \u4e0d\u540c\u4eba\u79f0\u4e3b\u8bed\u5bf9\u5e94\u7684\u8bcd\u5c3e j'aime,tu aimes,il/elle/on aime,nous aimons,vous aimez,ils/elle aiment je choisis,tu choisis,il/elle/on choisit,nous choisissons,vous choisissez,ils/elles choisissent je dors,tu dors,il/elle/on dort,nous dormons,vous dormez,ils/elles dorment \u76f4\u9648\u5f0f\u590d\u5408\u8fc7\u53bb\u65f6le pass\u00e9 compos\u00e9 \u8868\u793a\u4ece\u73b0\u5728\u89d2\u5ea6\u770b\u5df2\u7ecf\u53d1\u751f\u7684\u52a8\u4f5c\u3002\u8868\u8fbe\u7684\u662f\u201c\u67d0\u4e8b\u5df2\u7ecf\u5b8c\u6210\u201d\u7684\u6982\u5ff5\u3002 \u00eatre \u7684\u76f4\u9648\u5f0f\u73b0\u5728\u65f6 + \u52a8\u8bcd\u8fc7\u53bb\u5206\u8bcd\uff08\u5c11\u90e8\u5206\u8868\u793a\u8d8b\u5411\u6027\u3001\u4f4d\u7f6e\u6216\u72b6\u6001\u53d8\u5316\u7684\u4e0d\u53ca\u7269\u52a8\u8bcd\u3001\u6240\u6709\u4ee3\u8bcd\u5f0f\u52a8\u8bcd\uff0csee Fig 2\uff09 \u6216avoir \u7684\u76f4\u9648\u5f0f\u73b0\u5728\u65f6 + \u52a8\u8bcd\u8fc7\u53bb\u5206\u8bcd\uff08\u5176\u5b83\uff09 .. .. .. \u76f4\u9648\u5f0f\u672a\u5b8c\u6210\u8fc7\u53bb\u65f6l'imparfait \u8868\u793a\u8fc7\u53bb\u53d1\u751f\u7684\u52a8\u4f5c\uff0c\u53ea\u662f\u4e8b\u60c5\u7684\u5b8c\u6210\u72b6\u6001\u662f\u4e0d\u660e\u786e\u7684\uff0c \u76f4\u9648\u5f0f\u6108\u8fc7\u53bb\u65f6le plus-que parfait \u76f4\u9648\u5f0f\u7b80\u5355\u8fc7\u53bb\u65f6le pass\u00e9 simple \u76f4\u9648\u5f0f\u5148\u8fc7\u53bb\u65f6le pass\u00e9 ant\u00e9rieur \u76f4\u9648\u5f0f\u6700\u8fd1\u8fc7\u53bb\u65f6le pass\u00e9 proche \u76f4\u9648\u5f0f\u7b80\u5355\u5c06\u6765\u65f6le furture simple \u76f4\u9648\u5f0f\u5148\u5c06\u6765\u65f6le future ant\u00e9rieur \u76f4\u9648\u5f0f\u6700\u8fd1\u5c06\u6765\u65f6le future proche \u76f4\u9648\u5f0f\u8fc7\u53bb\u5c06\u6765\u65f6le futur dans le pass\u00e9Fig 2. le pass\u00e9 compos\u00e9 \u4e2d\u4f7f\u7528 \u00eatre \u52a9\u52a8\u8bcd\u7684\u52a8\u8bcd
\u547d\u4ee4\u5f0f (l'imp\u00e9ratif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u6761\u4ef6\u5f0f (le conditionnel)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u865a\u62df\u5f0f (le subjonctif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u5206\u8bcd\u5f0f (le participe)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent"},{"location":"docs/2-ling/acqusition/french-tense/#references","title":"References","text":":material-circle-edit-outline: \u7ea6 2 \u4e2a\u5b57
"},{"location":"docs/2-ling/morphology/#outline","title":"outline","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/","title":"TODO","text":":material-circle-edit-outline: \u7ea6 327 \u4e2a\u5b57 :fontawesome-solid-code: 2 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
Aug. 25th. 2023
This talk aims both to provide an introduction to the subject Philosophy of Language (a similar subject with semantics and pragmatics, according to its definition; PoL hereafter), and give a summary on the recent ongoing discussion on the linguistics concepts in NLP (e.g. \"meaning\", \"understanding\", \"reasoning\", \"grounding\").
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#a-preview-of-this-talk","title":"A Preview of This Talk","text":"1st 40min: History of philosophy of language 2nd 40min: Recent papers and discussions on PoL topics in NLP 3rd 10min: Discussion on take-away
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#the-location-of-pol-on-the-academic-coordinate","title":"The Location of PoL on the Academic Coordinate","text":"Before we start this talk, we will first provide a brief definition of the term Philosophy of Language in our talk here. The PoL concerns mainly the two following questions, (i) The relationship between the natural language and the world, (ii) The relationship between the human languages and their meaning. Chen (2003) believes that the PoL and the linguistics are two different subjects. He suggests that the linguistics is the study of language rules and patterns and the application of them, while the PoL pays more attention on the more abstract and essential features of the human language (e.g. its relation to the cognition). The author of this talk believes, according to the definition of PoL, it is a subject that closely involves the semantics and pragmatics branches in linguistics. However the PoL and linguistics overlap or not, it is commonly believed that the subject PoL was born in the 1920s, when the linguistic turn was put on stage in the European philosophy.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#history-of-pol","title":"History of PoL","text":"Now we will dive into the history of PoL. This section is parted \"person by person\". It is noticed that \"person-by-person\" is a common structure of most of the philosophy history, as most of the philosophy progresses are propelled by giants instead of the common people.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#gottfried-wilhelm-leibniz","title":"Gottfried Wilhelm Leibniz","text":"The main contribution of Leibniz is
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#ferdinand-de-saussure","title":"Ferdinand de Saussure","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#friedrich-ludwig-gottlob-frege","title":"Friedrich Ludwig Gottlob Frege","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#bertrand-russell","title":"Bertrand Russell","text":"Bertrand Russell is a pure logician.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#ludwig-wittgenstein","title":"Ludwig Wittgenstein","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#noam-chomsky","title":"Noam Chomsky","text":""},{"location":"docs/2-ling/philosophy/pol_zh/","title":"Philosophy of Language \u8bed\u8a00\u54f2\u5b66","text":":material-circle-edit-outline: \u7ea6 3102 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
Nov. 9th. 2022
"},{"location":"docs/2-ling/philosophy/pol_zh/#talk","title":"\u8fd9\u6b21talk\u4f1a\u8bb2\u4ec0\u4e48","text":"\u2705\u00a0\u4ecb\u7ecd\u8bed\u8a00\u54f2\u5b66\u7684\u601d\u6f6e\u6d41\u53d8\u5386\u7a0b\uff0c\u4ecb\u7ecd\u8bed\u8a00\u4e0a\u7684\u5b9e\u9a8c\u601d\u60f3\u5b9e\u9a8c\uff0c\u8ba8\u8bba\u4e00\u4e9b\u8bed\u8a00\u5b66\u3001\u8ba4\u77e5\u3001\u903b\u8f91\u548c\u54f2\u5b66\u7684\u5173\u8054
"},{"location":"docs/2-ling/philosophy/pol_zh/#pol","title":"PoL","text":"\u8bed\u8a00\u54f2\u5b66\u7684\u57fa\u672c\u95ee\u9898\uff1a 1. \u8bed\u8a00\u548c\u4e16\u754c\u7684\u5173\u7cfb 2. \u8bed\u8a00\u6216\u8bed\u8bcd\u7684\u610f\u4e49\u95ee\u9898
\u8bed\u8a00\u54f2\u5b66\u548c\u8bed\u8a00\u5b66 \u8bed\u8a00\u5b66\u548c\u8bed\u8a00\u54f2\u5b66\u7684\u8054\u7cfb\u7d27\u5bc6\uff0c\u4f46\u662f\u662f\u4e24\u95e8\u5b66\u79d1\u3002
20\u4e16\u7eaa\u54f2\u5b66\u4e0a\u53d1\u751f\u4e86\u8bed\u8a00\u8f6c\u5411\uff0c\u8fd9\u4e5f\u662f\u73b0\u4ee3\u8bed\u8a00\u5b66\u5f62\u6210\u7684\u65f6\u5019\u3002
\u8bed\u8a00\u5b66\u662f\u5bf9\u8bed\u8a00\u89c4\u5f8b\u548c\u8fd9\u4e9b\u89c4\u5f8b\u7684\u5e94\u7528\u7684\u7814\u7a76\uff0c\u8bed\u8a00\u54f2\u5b66\u66f4\u5173\u5fc3\u8bed\u8a00\u66f4\u672c\u8d28\u66f4\u62bd\u8c61\u7684\u610f\u4e49\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#history-of-pol","title":"History of PoL","text":"\u83b1\u5e03\u5c3c\u8328\uff1a\u63d0\u51fa\u903b\u8f91\u8bed\u8a00\uff0c\u7b80\u5386\u4eba\u5de5\u8bed\u8a00\u7684\u52aa\u529b
\u5f3a\u8c03\u81ea\u7136\u8bed\u8a00\u4f9d\u8d56\u4e8e\u77e5\u8bc6\uff0c\u56e0\u6b64\u5206\u6709\u77e5\u89c9\u7684\u6a21\u7cca\u3001\u6b67\u4e49\u7b49\u79cd\u79cd\u7f3a\u9677\u3002\u81ea\u7136\u8bed\u8a00\u4e0d\u662f\u63cf\u8ff0\u5ba2\u89c2\u4e8b\u7269\u7684\u6700\u4f73\u5de5\u5177\uff0c\u4e3a\u4e86\u63a2\u7a76\u771f\u7406\uff0c\u5fc5\u987b\u5efa\u7acb\u4e00\u4e2a\u7531\u666e\u904d\u7b26\u53f7\u7ec4\u6210\u7684\u66f4\u4e3a\u6e05\u695a\u7684\u7b26\u53f7\u4f53\u7cfb\u3002\u8fd9\u79cd\u52aa\u529b\u5728\u6570\u5b66\u65b9\u9762\u662f\u5353\u6709\u6210\u6548\u7684\uff0c\u6bd4\u5982\u5fae\u79ef\u5206\u7b26\u53f7\u3002
\u7d22\u7eea\u5c14\uff1a \u7d22\u7eea\u5c14\u6700\u5927\u7684\u5f71\u54cd\u662f\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u3002\u6211\u4eec\u4e00\u822c\u8ba4\u4e3a\u7d22\u7eea\u5c14\u662f\u4e00\u4f4d\u8bed\u8a00\u5b66\u5bb6\uff0c\u4f46\u662f\u4ed6\u5728\u8fd9\u672c\u4e66\u4e2d\u63d0\u51fa\u7684\u201c\u80fd\u6307\u201d\u4e0e\u201c\u6240\u6307\u201d\u7406\u8bba\uff0c\u662f\u54f2\u5b66\u91cc\u7684\u7b26\u53f7\u5b66\u7684\u5f00\u7aef\u3002
\u8bed\u8a00\u662f\u7528\u58f0\u97f3\u8868\u8fbe\u601d\u60f3\u7684\u7b26\u53f7\u7cfb\u7edf\uff0c\u7b26\u53f7\u662f\u7528\u4ee5\u8868\u793a\u8005\u548c\u88ab\u8868\u793a\u8005\u7684\u7ed3\u5408\u3002
\u6211\u4eec\u4f1a\u8bf4\uff0c\u58f0\u97f3\u672c\u8eab\u4e0d\u80fd\u65bd\u6307\uff0c\u53ea\u6709\u5904\u5728\u67d0\u79cd\u7279\u5b9a\u5173\u7cfb\u4e2d\uff08\u8bed\u8a00\u5b9a\u4e49\u4e86\u58f0\u97f3\u548c\u5b9e\u4f53\u4e4b\u95f4\u7684\u5173\u7cfb\uff09\uff0c\u58f0\u97f3\u624d\u6709\u4e86\u610f\u4e49\u3002
\u4efb\u610f\u6027\u539f\u5219\u662f\uff0c\u5982\u6b64\u8fd9\u822c\u7684\u65bd\u6307\u548c\u5982\u6b64\u8fd9\u822c\u7684\u6240\u6307\u7ed3\u5408\u800c\u6210\u7684\u4e00\u4e2a\u7b26\u53f7\uff0c\u662f\u4efb\u610f\u7684\u3002eg. \u989c\u8272\u4e0e\u989c\u8272\u8bcd\u7684\u8054\u7ed3\u662f\u4efb\u610f\u7684\uff0c\u989c\u8272\u7684\u754c\u9650\u4e0e\u989c\u8272\u8bcd\u7684\u8054\u7ed3\u4e5f\u662f\u4efb\u610f\u7684\u3002
\"\u7eff\"\u4e0d\u4ec5\u548c\u7eff\u989c\u8272\u76f8\u8fde\uff0c\u800c\u4e14\u548c\u201c\u84dd\u201d\u201c\u9752\u201d\u7b49\u8bed\u8bcd\u76f8\u8fde\u3002\n\u5982\u679c\u6ca1\u6709\u201c\u84dd\u201d\u201c\u9752\u201d\uff0c\u6211\u4eec\u5c31\u4e0d\u80fd\u77e5\u9053\u201c\u7eff\u201d\u6240\u754c\u5b9a\u7684\u989c\u8272\u8303\u56f4\u3002\n\n\u201c\u4e03\u8272\u5f69\u8679\u201d\n\u65e5\u8bed\u4e0d\u533a\u5206\u201c\u84dd\u201d\u548c\u201c\u7eff\u201d\uff0c\u53ea\u6709\u4e00\u4e2a\u5355\u8bcd\u201c\u9752\u201d\uff08aoi\uff09\uff0c\u65e5\u8bed\u6bcd\u8bed\u8005\u5728\u9274\u522b\u84dd\u8272\u548c\u7eff\u8272\u65f6\u53cd\u5e94\u65f6\u9ad8\u4e8e\u82f1\u8bed\u6bcd\u8bed\u8005\u3002\n\u4e00\u79cd\u5317\u6b27\u8bed\u8a00\u6709\u4e03\u79cd\u84dd\u8272\u7684\u540d\u79f0\u3002\n
\u6211\u4eec\u4e60\u60ef\u628a\u8bed\u8bcd\u548c\u60c5\u5883\u7684\u8054\u7cfb\u79f0\u4f5c\u7eb5\u5750\u6807\u6216\u8bed\u5883\u5750\u6807\uff0c\u628a\u8bed\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u79f0\u4f5c\u6a2a\u5750\u6807\u548c\u903b\u8f91\u5750\u6807\u3002
eg. \u5b8c\u5f62\u586b\u7a7a\u9898
eg. \u6570\u636e\u5e93\u5173\u7cfb\u6a21\u578b\u7684\u5c5e\u6027\u3001\u5143\u7ec4
\u975e\u5e38\u6709\u8da3\uff0c\u7d22\u7eea\u5c14\u5199\u8fd9\u672c\u8bed\u8a00\u5b66\u6559\u6750\u65f6\uff0c\u4e16\u754c\u4e0a\u5e76\u6ca1\u6709\u7b26\u53f7\u5b66\u8fd9\u4e2a\u5b66\u79d1\u3002\u5728\u4ed6\u63d0\u51fa\u201c\u80fd\u6307\u201d\u201d\u6240\u6307\u201c\u8fd9\u4e2a\u6982\u5ff5\u540e\uff0c\u7b26\u53f7\u5b66\u5728\u4ed6\u201d\u80fd\u6307\u201c\u5728\u201d\u6240\u6307\u201c\u7684\u94fe\u6761\u4e0a\u6ed1\u52a8\u8fd9\u4e00\u8bba\u65ad\u7684\u57fa\u7840\u4e0a\u8bde\u751f\uff0c\u5e76\u81f3\u4eca\u6210\u4e3a\u6cd5\u56fd\u54f2\u5b66\u7684\u4e00\u4e2a\u91cd\u8981\u95ee\u9898\u3002
\u5f17\u96f7\u683c\uff1a
\u5f17\u96f7\u683c\u662f\u516c\u8ba4\u7684\u5206\u6790\u54f2\u5b66\u3001\u8bed\u8a00\u54f2\u5b66\u548c\u73b0\u4ee3\u6570\u7406\u903b\u8f91\u7684\u5f00\u521b\u8005\u3002
\u300a\u6982\u5ff5\u6587\u5b57\uff1a\u4e00\u79cd\u6a21\u4eff\u7b97\u672f\u8bed\u8a00\u6784\u9020\u7684\u7eaf\u601d\u7ef4\u7684\u5f62\u5f0f\u8bed\u8a00\u300b\u4e3b\u8981\u5de5\u4f5c\u662f\uff0c\u8bbe\u8ba1\u4e86\u4e00\u5957\u4eba\u5de5\u7b26\u53f7\u7cfb\u7edf\uff0c\u6392\u9664\u4e86\u81ea\u7136\u8bed\u8a00\u4e2d\u4fee\u8f9e\u4e4b\u7c7b\u7684\u4e1c\u897f\uff0c\u4e13\u6ce8\u4e8e\u6982\u5ff5\u672c\u8eab\u548c\u6982\u5ff5\u4e4b\u95f4\u7684\u8054\u7cfb\uff0c\u56e0\u6b64\uff0c\u5b83\u5c06\u6392\u9664\u81ea\u7136\u8bed\u8a00\u7684\u6a21\u7cca\u6027\u548c\u4e0d\u786e\u5b9a\u6027\u3002\u7528\u8fd9\u5957\u7b26\u53f7\u7cfb\u7edf\u6765\u91cd\u65b0\u8868\u8ff0\u7b97\u672f\u7684\u57fa\u672c\u6982\u5ff5\u548c\u63a8\u7406\u89c4\u5219\uff0c\u660e\u786e\u6240\u6709\u63a8\u7406\u7684\u524d\u63d0\uff0c\u4fdd\u8bc1\u4e00\u4e2a\u8bc1\u660e\u4e2d\u5404\u4e2a\u547d\u9898\u95f4\u7684\u6240\u6709\u63a8\u7406\u89c4\u5219\uff0c\u4f7f\u63a8\u7406\u4e0d\u518d\u57fa\u4e8e\u76f4\u89c9\uff0c\u4e5f\u6ca1\u6709\u8df3\u8dc3\u548c\u8131\u8282\u3002
\u5bf9\u8bed\u8a00\u54f2\u5b66\u5f71\u54cd\u6700\u6df1\u7684\u662f\u4ed6\u5728\u300a\u7b97\u672f\u57fa\u7840\u300b\u4e2d\u63d0\u51fa\u7684\u4e09\u6761\u8457\u540d\u539f\u5219\uff1a
\u4e24\u4e2a\u601d\u7ef4\u5b9e\u9a8c\uff1a
\u6307\u79f0\u76f8\u540c\u800c\u610f\u4e49\u4e0d\u540c\u7684\u8bcd
\u201c\u542f\u660e\u661f\u201d\u548c\u201c\u957f\u5e9a\u661f\u201d\u662f\u540c\u4e00\u9897\u884c\u661f\u2014\u2014\u2014\u2014\u91d1\u661f\u3002\n\u4f46\u662f\u4e24\u4e2a\u540d\u8bcd\u7684\u610f\u4e49\u4e0d\u540c\uff0c\u5927\u591a\u6570\u65f6\u5019\u4e0d\u80fd\u66ff\u6362\u3002\n\u201c\u4ed6\u5929\u8fd8\u6ca1\u4eae\u5c31\u8d77\u8eab\uff0c\u8fce\u7740\u542f\u660e\u661f\u5411\u4e1c\u8d70\u53bb\u3002\u201d\n
\u51fd\u5f0f\u7406\u8bba
\uff08 \uff09\u662f\u4e2d\u56fd\u7684\u9996\u90fd\n\uff08 \uff09= \"\u4f26\u6566\"\u3001\"\u5317\u4eac\"\n\u53ea\u6709\u586b\u5165\u5317\u4eac\u7684\u65f6\u5019\u624d\u662f\u771f\u547d\u9898\n
\u7f57\u7d20\uff1a\u903b\u8f91
\u6df1\u5165\u4e13\u540d\u548c\u901a\u540d\u3001\u6096\u8bba\u3001\u6392\u4e2d\u5f8b\u3002
\u7ef4\u7279\u6839\u65af\u5766\uff1a
\u524d\u671f\u601d\u60f3\u300a\u903b\u8f91\u54f2\u5b66\u8bba\u300b
\u201c\u4e16\u754c\u662f\u4e8b\u5b9e\u7684\u7efc\u5408\u201d\uff1a\u201c\u53f8\u9a6c\u5149\u662f\u5510\u671d\u4eba\u201d\u7b26\u5408\u903b\u8f91\uff0c\u4f46\u4e0d\u7b26\u5408\u4e8b\u5b9e\u3002
\u56fe\u50cf\u8bba
\u8bed\u8a00\u662f\u547d\u9898\u7684\u603b\u548c\u800c\u4e0d\u662f\u540d\u79f0\u7684\u603b\u548c\u3002
\u4eba\u5728\u4ea4\u6d41\u601d\u60f3/\u547d\u9898\u65f6\uff0c\u4ea4\u6d41\u7684\u662f\u8111\u4e2d\u7684\u56fe\u50cf\u3002
\u4ed6\u7684\u524d\u671f\u601d\u60f3\u542f\u53d1\u4e86\u7ef4\u4e5f\u7eb3\u5b66\u6d3e\uff1a\u4eba\u5de5\u8bed\u8a00\uff0c\u903b\u8f91\u8bed\u8a00
\u5341\u4e5d\u4e16\u7eaa\u672b\u4ee5\u6765\u4eba\u5de5\u8bed\u8a00\u7684\u5c1d\u8bd5\uff1a\u201c\u4e16\u754c\u8bed\uff08Esperanto\uff09\u201d\uff0c\u4e18\u5409\u5c14\u63a8\u5d07\u7684\u57fa\u672c\u82f1\u8bed\uff0c\u81ea\u7136\u8bed\u8a00\u4e2d\u5bf9\u201c\u5973\u4eba\u201d\u201c\u5973\u6027\u201d\u201c\u5973\u58eb\u201d\u201c\u5987\u5973\u201d\u8fd9\u6837\u7684\u6307\u79f0\u7684\u89c4\u8303\u5c1d\u8bd5\u3002
\u540e\u671f\u601d\u60f3\u300a\u54f2\u5b66\u7814\u7a76\u300b
\u8bed\u8a00\u6e38\u620f\uff08Sprachspiel\uff09
\u8bed\u8a00\u7684\u529f\u80fd\u7684\u672c\u8d28\uff1a\u4e00\u65b9\u558a\u51fa\u8bed\u8bcd\uff0c\u53e6\u4e00\u65b9\u4f9d\u7167\u8fd9\u4e9b\u8bed\u8bcd\u6765\u884c\u52a8\u3002
\u8001\u5e08\u6307\u7740\u77f3\u5934\u8bf4\u201c\u77f3\u5934\u201d\uff0c\u5b66\u751f\u8ddf\u7740\u8bf4\u201c\u77f3\u5934\u201d\u3002\n
\u4e22\u624b\u7ee2\u65f6\u5531\u7740\u201c\u8f7b\u8f7b\u5730\u653e\u5728\u5c0f\u670b\u53cb\u7684\u8eab\u540e\u201d\uff0c\u628a\u624b\u7ee2\u653e\u5728\u5c0f\u670b\u53cb\u7684\u8eab\u540e\n
\u4e0e\u524d\u671f\u56fe\u50cf\u7406\u8bba\u7684\u5bf9\u6bd4\uff1a\u5728\u56fe\u50cf\u7406\u8bba\u4e2d\uff0c\u8bed\u8a00\u4ece\u6839\u672c\u4e0a\u662f\u4e00\u79cd\u53cd\u6620\uff1b\u5728\u8bed\u8a00\u6e38\u620f\u8bf4\u4e2d\uff0c\u8bed\u8a00\u9996\u5148\u662f\u4e00\u79cd\u6d3b\u52a8\u3002
\u610f\u4e49\u6765\u6e90\u4e8e\u4f7f\u7528\u3002
\u6211\u4eec\u5173\u5fc3\u201c\u9524\u5b50\u201d\u662f\u4ec0\u4e48\u65f6\uff0c\n\u5173\u5fc3\u7684\u662f\u201c\u4f7f\u7528\u4e00\u628a\u9524\u5b50\u201d\uff0c\n\u800c\u4e0d\u662f\u201c\u9524\u5b50\u610f\u5473\u7740\u2026\u2026\u201d\n\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u6b63\u662f\u4ece\u201c\u4f7f\u7528\u4e00\u628a\u9524\u5b50\u201d\u6765\u5b9a\u4e49\u9524\u5b50\n
\u5982\u4f55\u533a\u5206\u201c\u4f7f\u7528\u201d\u201c\u6709\u7528\u201d\u201c\u5229\u7528\u201d\uff1f\n\u5728\u4e00\u4e9b\u60c5\u5883\u4e2d\u80fd\u7528\uff0c\u5728\u4e00\u4e9b\u60c5\u5883\u4e2d\u4e0d\u80fd\u7528\u3002\n
\u8bed\u8a00\u6e38\u620f\u7684\u7c7b\u522b
\u5bb6\u65cf\u76f8\u4f3c\u7406\u8bba\uff08Familien\u00e4hnlichkeiten\uff09
\u201c\u4e00\u4e2a\u5bb6\u65cf\u7684\u6709\u4e9b\u6210\u5458\u6709\u4e00\u6837\u7684\u9f3b\u5b50\uff0c\u53e6\u4e00\u4e9b\u6709\u4e00\u6837\u7684\u7709\u6bdb\uff0c\u8fd8\u6709\u4e00\u4e9b\u6709\u4e00\u6837\u7684\u6b65\u6001\uff1b\u8fd9\u4e9b\u76f8\u4f3c\u4e4b\u5904\u4ea4\u53c9\u91cd\u53e0\u3002\u201c
\u5185\u6db5\uff1a\u4e00\u4e2a\u6982\u5ff5\u7684\u5b9a\u4e49
\u5916\u5ef6\uff1a\u4e00\u4e2a\u6982\u5ff5\u5305\u542b\u7684\u4e0b\u5c5e\u6982\u5ff5\u7684\u8303\u56f4
\u901a\u540d\u7684\u4e0b\u5c5e\u8bcd\uff0c\u5404\u79cd\u4e13\u540d\u4e4b\u95f4\u5e76\u6ca1\u6709\u4e25\u683c\u7684\u754c\u9650\uff0c\u4e00\u4e2a\u76f8\u4f3c\u53e6\u4e00\u4e2a\uff0c\u5206\u4eab\u4e0d\u540c\u7684\u5171\u540c\u7279\u5f81\u3002
\u751f\u6d3b\u5f62\u5f0f\uff08Lebens Form\uff09\uff1a\u5e38\u8bc6\u7684\u91cd\u8981\u6027
\u201c\u626b\u5e1a\u5728\u90a3\u91cc\u201d\u5df2\u7ecf\u8db3\u591f\u6e05\u6670\u3002\n\u201c\u626b\u5e1a\u628a\u548c\u626b\u5e1a\u5934\u5728\u90a3\u91cc\u201d\uff0c\u867d\u7136\u5206\u6790\u5f97\u66f4\u6e05\u695a\uff0c\u4f46\u5728\u4ea4\u9645\u4e2d\u8ba9\u4eba\u8d39\u89e3\u3002\n
\u4eff\u4f5b\u6211\u4eec\u53ea\u8981\u66f4\u591a\u8bf4\u4e00\u70b9\uff0c\u591a\u5206\u6790\u4e00\u70b9\uff0c\u4e8b\u60c5\u5c31\u4f1a\u66f4\u6e05\u695a\uff0c\u4eff\u4f5b\u6ca1\u6709\u4e00\u53e5\u8bdd\u672c\u8eab\u5c31\u662f\u8db3\u591f\u6e05\u695a\u7684\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#conclusion-of-agreements","title":"Conclusion of Agreements","text":"\u963f\u4f69\u5c14\u603b\u7ed3\u897f\u65b9\u54f2\u5b66\u7684\u53d1\u5c55\uff1a
\u53e4\u4ee3\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u672c\u4f53\u8bba\uff0c\u4ece\u8fd1\u4ee3\u5f00\u59cb\uff0c\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u8ba4\u8bc6\u8bba\uff0c\u523020\u4e16\u7eaa\uff0c\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u8bed\u8a00\u3002
\u672c\u4f53\u8bba\u7684\u95ee\u9898\uff1a\u4ec0\u4e48\u4e1c\u897f\u5b58\u5728\uff0c\u4ec0\u4e48\u662f\u5b9e\u5728\u7684\u57fa\u672c\u5b58\u5728\u5f62\u5f0f\u3002
\u8ba4\u8bc6\u8bba\u7684\u95ee\u9898\uff1a\u54ea\u4e9b\u4e1c\u897f\u662f\u6211\u4eec\u80fd\u8ba4\u8bc6\u7684\uff0c\u6211\u4eec\u662f\u600e\u6837\u8ba4\u8bc6\u8fd9\u4e9b\u4e1c\u897f\u7684\u3002
\u8bed\u8a00\u7684\u95ee\u9898\uff1a\u6211\u4eec\u5728\u4f55\u79cd\u610f\u4e49\u4e0a\u80fd\u591f\u8ba4\u8bc6\u5b58\u5728\u2014\u2014\u800c\u610f\u4e49\u7684\u9996\u8981\u8f7d\u4f53\u662f\u8bed\u8a00\u3002\u2192 Linguistic Turn
PoL\u7684\u5176\u5b83topic\uff1a 1. \u6307\u79f0\u4e0e\u5b9e\u4f53\uff0c\u8bed\u8a00\u4e0e\u610f\u4e49\u7684\u5173\u7cfb 2. \u901a\u540d\u4e0e\u4e13\u540d\uff0c\u8bcd\u4e49\u7684\u8303\u56f4 3. \u771f\u7406\u7406\u8bba 4. \u300a\u6211\u4eec\u8d56\u4ee5\u751f\u5b58\u7684\u9690\u55bb\u300b\uff1a\u9690\u55bb\u65e0\u5904\u4e0d\u5728\uff0c\u4e0d\u4ec5\u5b9a\u4e49\u4e2d\u7684\u201cxx\u662fxx\u201d\u662f\u9690\u55bb\uff0c\u6709\u65f6\u5355\u4e2a\u8bcd\u5c31\u662f\u4e00\u4e2a\u9690\u55bb\u3002
\u52a8\u8bcd\u662f\u9690\u55bb
\u65f6\u95f4\u5728\u6d41\u901d\u3002\n
\u4ecb\u8bcd\u662f\u9690\u55bb
I\u2019m feeling up today.\nHe is down.\n\u9ad8\u5174\u4e3a\u4e0a\uff0c\u60b2\u4f24\u4e3a\u4e0b\u3002\nWake up.\nHe fell asleep.\n\u6709\u610f\u8bc6\u4e3a\u4e0a\uff0c\u65e0\u610f\u8bc6\u4e3a\u4e0b\u3002\nHe fell ill.\nShe dropped dead.\n\u5065\u5eb7\u548c\u751f\u547d\u4e3a\u4e0a\uff0c\u75be\u75c5\u548c\u6b7b\u4ea1\u4e3a\u4e0b\u3002\nI have controlled over her.\nHe fell from power.\n\u63a7\u5236\u6216\u5f3a\u8feb\u4e3a\u4e0a\uff0c\u88ab\u63a7\u5236\u6216\u88ab\u5f3a\u8feb\u4e3a\u4e0b\u3002\nMy income rose last year.\nThe number of errors is low.\n\u66f4\u591a\u4e3a\u4e0a\uff0c\u66f4\u5c11\u4e3a\u4e0b\u3002\n
\u4e54\u59c6\u65af\u57fa\uff1a
\u7ed3\u6784\u4e3b\u4e49\u8bed\u8a00\u5b66\u5230\u8f6c\u6362\u751f\u6210\u8bed\u6cd5\u3002
\u8bed\u8a00\u5b66\u7684\u5de5\u4f5c\u4e0d\u5e94\u5f53\u662f\u641c\u96c6\u8bed\u8a00\u7d20\u6750\u52a0\u4ee5\u5f52\u7eb3\uff0c\u800c\u662f\u8981\u89e3\u91ca\u8bed\u8a00\u7684\u521b\u9020\u6027\u3002
CNF
S -> AB\nA -> AA | a\nB -> b | e\n
\u8f6c\u6362\u751f\u6210\u8bed\u6cd5\u89c4\u5219 \\(\\Sigma = \\{NP, Vp, T, N, Npsing, NPpl, Aux, V, C, M, En, S, Past, Af\\}\\)
S -> NP + VP\nVP -> Verb + NP\nNP -> Det + N\nVerb -> Aux + V\nDet -> the, a...\nN -> man, ball...\nAux -> will, can...\nV -> hit, see...\n
\u4f20\u7edf\uff08\u6210\u5206\uff09\u8bed\u6cd5\u89c4\u5219
1. \u4e3b + \u8c13\n2. \u4e3b + \u8c13 + \u5bbe\n3. \u4e3b + \u7cfb + \u8868\n4. \u4e3b + \u8c13 + \u5bbe + \u53cc\u5bbe\n5. \u4e3b + \u8c13 + \u5bbe + \u5bbe\u8865\n6. \u4e3b + \u8c13 + \u5e76\u5217\u5bbe\n\n...\n
\u300a\u53e5\u6cd5\u7ed3\u6784\u300b\uff081957\uff09\u6838\u5fc3\u53e5\u548c\u8f6c\u6362\u6982\u5ff5\u3002
\u751f\u6210\u6b65\u9aa4 1. \u751f\u6210\u6838\u5fc3\u53e5\u3002
S -> X1 | X2 | ... Xn\n
\u8f6c\u6362\u7ed3\u6784\uff08\u66ff\u6362\u3001\u7701\u7565\u3001\u6dfb\u52a0\u3001\u6362\u4f4d\uff09\u3002
X1 -> Y1Z1 | ...\n...\n
\u6dfb\u52a0\u5f62\u6001\u97f3\u4f4d\u89c4\u5219\u3002
Z1 -> W1\n...\nZn -> Wn\n
\u8f6c\u6362\uff1a\u6574\u4e2a\u8f6c\u6362\u751f\u6210\u8fc7\u7a0b\u53ef\u4ee5\u5206\u4e3a\u4e09\u4e2a\u6b65\u9aa4
\u6df1\u5c42\u7ed3\u6784\u548c\u8868\u5c42\u7ed3\u6784
\u4e54\u59c6\u65af\u57fa\u8bed\u6cd5\u4f53\u7cfb\u4e2d\uff0c\u6307\u53e5\u5b50\u751f\u6210\u8fc7\u7a0b\u4e2d\u7279\u5b9a\u9636\u6bb5\u6240\u91c7\u7528\u7684\u4e00\u79cd\u7279\u6b8a\u64cd\u4f5c\u624b\u6bb5\u6216\u89c4\u5219\u3002\u6df1\u5c42\u7ed3\u6784\u662f\u5b83\u7684\u8f93\u5165\uff0c\u8868\u5c42\u7ed3\u6784\u662f\u5b83\u7684\u8f93\u51fa\u3002
\u6709\u7684\u53e5\u5b50\u8868\u5c42\u7ed3\u6784\u4e0d\u540c\uff0c\u6df1\u5c42\u7ed3\u6784\u76f8\u4f3c\u3002\u901a\u8fc7\u8f6c\u6362\u64cd\u4f5c\u53ef\u4ee5\u76f8\u4e92\u8f6c\u5316\u3002
\u6709\u7684\u53e5\u5b50\u6df1\u5c42\u7ed3\u6784\u4e0d\u540c\uff0c\u8868\u5c42\u7ed3\u6784\u76f8\u4f3c\u3002\u901a\u8fc7\u8f6c\u6362\u64cd\u4f5c\u4e0d\u80fd\u76f8\u4e92\u8f6c\u5316\u3002
\u4e3a\u4ec0\u4e48\u4eca\u5929\u6211\u4eec\u8981\u8c08\u8bed\u8a00\u54f2\u5b66\uff1f
\u9648\u5609\u6620\u8001\u5e08\uff1a\u79d1\u5b66\u662f\u4e00\u4e2a\u4e25\u5bc6\u7684\u6574\u6d01\u7684\u4f53\u7cfb\uff0c\u539f\u56e0\u662f\u5b83\u628a\u6240\u6709\u6df7\u6c8c\u7684\u65e0\u6cd5\u89e3\u51b3\u7684\u95ee\u9898\u629b\u5728\u4e86\u8fd9\u4e2a\u4f53\u7cfb\u4e4b\u5916\u3002[\u300a\u8d70\u51fa\u552f\u4e00\u771f\u7406\u89c2\u300b\uff0c2020]
\u6240\u4ee5\u54f2\u5b66\u7684\u95ee\u9898\u662f\u7814\u7a76\u88ab\u79d1\u5b66\u6254\u51fa\u53bb\u7684\u6df7\u6c8c\u3002
\u8bed\u8a00\u54f2\u5b66\u5c31\u50cf\u201c\u5165\u4fb5\u7684\u5b9e\u5728\u754c\u201d\uff0c\u201c\u8fb9\u754c\u7684\u6d4b\u8bd5\u70b9\u201d\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#recommended-reading","title":"Recommended Reading","text":"\u300a\u8bed\u8a00\u54f2\u5b66\u300b\u9648\u5609\u6620
\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u7d22\u7eea\u5c14
\u300a\u903b\u8f91\u54f2\u5b66\u8bba\u300b\u7ef4\u7279\u6839\u65af\u5766
\u300a\u54f2\u5b66\u7814\u7a76\u300b\u7ef4\u7279\u6839\u65af\u5766
\u300a\u6211\u4eec\u8d56\u4ee5\u751f\u5b58\u7684\u9690\u55bb\u300b\u4e54\u6cbb\u00b7\u83b1\u8003\u592b
\u300a\u5fc3\u667a\u3001\u8bed\u8a00\u548c\u673a\u5668\u300b\u5f90\u82f1\u747e
"},{"location":"docs/2-ling/philosophy/pol_zh/#_1","title":"\u8ba8\u8bba","text":"\u662f\u5426\u6240\u6709\u6ca1\u6709\u7528\u8bed\u8a00\u8868\u8fbe\u7684\u77e5\u8bc6\uff0c\u90fd\u53ef\u4ee5\u88ab\u7528\u8bed\u8a00\u8868\u8fbe\uff1f\uff08not NP or NP-hard\uff09
\u53ea\u5b66\u4e60\u8bed\u8a00\u662f\u5426\u80fd\u6a21\u62df\u4eba\u7684\u667a\u80fd\u6c34\u5e73\uff1f
\u6a21\u578b\u662f\u5426\u9700\u8981\u5e94\u5bf9\u6240\u6709\u7684\u5f02\u5e38\u60c5\u51b5/\u673a\u5668\u8bed\u8a00\u7684\u76ee\u6807\u672c\u8eab\u8981\u4e0e\u4eba\u7c7b\u8bed\u8a00\u6709\u6240\u533a\u522b
"},{"location":"docs/2-ling/philosophy/saussure/","title":"Reading Notes of Cours de linguistique g\u00e9n\u00e9rale, Ferdinand de Saussure","text":":material-circle-edit-outline: \u7ea6 685 \u4e2a\u5b57 :fontawesome-solid-code: 5 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u7d22\u7eea\u5c14 \u8bfb\u4e66\u7b14\u8bb0
\u7b2c\u96f6\u7f16\uff1a\u7eea\u8bba
\u7b2c\u4e09\u7ae0\uff1a\u8bed\u8a00\u5b66\u7684\u5bf9\u8c61
\u8bed\u97f3\u4e0e\u8bed\u4e49\u7684\u8054\u7cfb
_______________________\n | |\n | \u2228\nc <-> i i <-> i \n \u542c\u97f3 \u53d1\u97f3\n \u2227 |\n |_______________________|\n
c\uff1a\u6982\u5ff5 i\uff1a\u97f3\u54cd\u5f62\u8c61
\u8bed\u8a00\u7814\u7a76\u7684\u5bf9\u8c61
parole
\u8a00\u8bed\uff1a\u4e2a\u4eba\u7684\u3001\u6df7\u6742\u7684\u3001\u5f02\u8d28\u7684lingua
\u8bed\u8a00\uff1a\u793e\u4f1a\u7684\u3001\u660e\u786e\u7684\u3001\u540c\u8d28\u7684\u7b2c\u516d\u7ae0\uff1a\u6587\u5b57\u8868\u73b0\u8bed\u8a00
\u8bed\u97f3\u7684\u53d1\u5c55\u662f\u5386\u53f2\u6027\u7684\u3002
\u7b2c\u4e03\u7ae0\uff1a\u97f3\u4f4d\u5b66 phonetics
\u7b2c\u4e00\u7f16\uff1a\u4e00\u822c\u539f\u5219
\u7b2c\u4e00\u7ae0\uff1a\u8bed\u8a00\u7b26\u53f7\u7684\u6027\u8d28
\u7b26\u53f7\u7684\u7ed3\u6784\uff1a\n ________________ \u4e0a\n | \u6982\u5ff5 -> \u6240\u6307 |\n -----------------\n | \u97f3\u54cd\u5f62\u8c61 -> \u80fd\u6307 | \n |________________| \u4e0b\n
\u80fd\u6307\u7684\u5c5e\u6027
\u7b26\u53f7\u5728\u65f6\u95f4\u4e0a\u7684\u8fde\u7eed\u6027\u548c\u65f6\u95f4\u4e0a\u7684\u53d8\u5316\u76f8\u8fde\uff0c\u7b26\u53f7\u7684\u4efb\u610f\u6027\u4f7f\u5176\u65e0\u6cd5\u62b5\u5fa1\u4f7f\u80fd\u6307\u5728\u6240\u6307\u4e0a\u6ed1\u52a8\u7684\u56e0\u7d20\u3002
\u4e00\u5207\u79d1\u5b66
C\n |\n |\nA ------------- B \u540c\u65f6\u8f74\u7ebf\n |\n |\n D\n \u8fde\u7eed\u8f74\u7ebf\n
\u8bed\u8a00\u5b66
C\n |\n |\nA ------------- B \u9759\u6001\u8bed\u8a00\u5b66\uff08\u5171\u65f6\uff09\n |\n |\n D\n \u6f14\u5316\u8bed\u8a00\u5b66\uff08\u5386\u65f6\uff09\n
\u5185\u5728\u4e8c\u91cd\u6027\u4f8b\u8bc1
-> \u5171\u65f6\n \u00b7<--------->\u00b7 \u7532\u65f6\u671f\n | | |\n \u2228 \u2228 \u2228\n \u5386\u65f6 \u00b7<--------->\u00b7 \u4e59\u65f6\u671f\n
\u53ef\u4ee5\u6bd4\u4f5c\u4e0b\u68cb\uff1a\u8861\u5b9a\u7684\u89c4\u5219\u548c\u53d8\u52a8\u7684\u5c40\u52bf
\u7b2c\u4e8c\u7f16\uff1a\u5171\u65f6\u8bed\u8a00\u5b66
\u540c\u4e00\u6027\uff1a\u5171\u65f6 - \u97f3\u6bb5 -> \u610f\u4e49
\u666e\u904d\u4ef7\u503c\uff1a
\u8bed\u8a00\u4e4b\u4e2d\u53ea\u6709\u5dee\u522b -\u2014\u2014 \u6ca1\u6709\u79ef\u6781\u8981\u7d20\u7684\u5dee\u522b\u3002\u8bed\u8a00\u662f\u5f62\u5f0f\u800c\u4e0d\u662f\u5b9e\u8d28\u3002
\u7b2c\u4e94\u7ae0
\u7b2c\u516d\u7ae0\uff1a\u8bed\u8a00\u7684\u673a\u6784
\u53e5\u6bb5\u7684\u8fde\u5e26\u5173\u7cfb\uff1a\u6574\u4f53\u7684\u4ef7\u503c\u53d6\u51b3\u4e8e\u5b83\u7684\u90e8\u5206\uff0c\u90e8\u5206\u7684\u4ef7\u503c\u51b3\u5b9a\u4e86\u5b83\u4eec\u5728\u6574\u4f53\u4e2d\u7684\u5730\u4f4d\u3002
----------\n d\u00e9-faire\n ----------\n / \\\n d\u00e9coller faire\n / \\\n d\u00e9lancer refaire\n / \\\n d\u00e9cendre contrefaire\n
\u6b63\u662f\u8fd9\u4e9b\u4e0d\u540c\u7684\u5f62\u5f0f\u6f02\u6d6e\u5728\u5468\u56f4\uff0c\u8fd9\u4e24\u4e2a\u8bcd\u624d\u80fd\u5206\u89e3\u6210\u5355\u4f4d\uff0c\u6216\u6210\u4e3a\u53e5\u6bb5\u3002
\u53ea\u6709\u4e00\u90e8\u5206\u7b26\u53f7\u662f\u7edd\u5bf9\u4efb\u610f\u7684\uff0c\u4efb\u610f\u6027\u4e0d\u80fd\u53d6\u6d88\uff0c\u90fd\u6709\u7a0b\u5ea6\u5dee\u522b\uff0c\u7b26\u53f7\u53ef\u80fd\u662f\u76f8\u5bf9\u5730\u53ef\u4ee5\u8bba\u8bc1\u7684\u3002
\u6574\u4f53 > \u90e8\u5206\u4e4b\u548c\u3002poirexier > poiretier
------\n / \\\n \u8bcd\u6c47 - - \u8bed\u6cd5\n\u4e0d\u80fd\u8bba\u8bc1\u7684\u6781\u7aef \\ / \u53ef\u4ee5\u8bba\u8bc1\u7684\u6781\u7aef\n \u7b26\u53f7 ------- \u7ed3\u6784\n
\u7b2c\u4e03\u7ae0\uff1a\u8bed\u6cd5\u548c\u533a\u5206
\u62bd\u8c61\u5b9e\u4f53\uff0c\u6700\u540e\u5206\u6790\u8d77\u6765\uff0c\u603b\u662f\u4ee5\u5177\u4f53\u5b9e\u73b0\u4e3a\u57fa\u7840\u7684\u3002
\u7b2c\u4e09\u7f16\uff1a\u5386\u65f6\u8bed\u8a00\u5b66
\u7b2c\u4e09\u7ae0\uff1a\u8bed\u97f3\u6f14\u5316\u5728\u8bed\u6cd5\u4e0a\u7684\u540e\u679c
\u7b2c\u56db\u7ae0\uff1a\u7c7b\u6bd4
\u7b2c\u4e94\u7ae0\uff1a\u7c7b\u6bd4 -> \u6f14\u5316
viendre, monru, traisait
\u7b2c\u516d\u7ae0\uff1a\u6d41\u4fd7\u8bcd\u6e90
"},{"location":"docs/2-ling/pragmatics/ca_da/","title":"Research Methods: Conversation Analysis and Discourse Analysis","text":":material-circle-edit-outline: \u7ea6 275 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/ca_da/#discourse-analysis","title":"Discourse Analysis","text":"Some discourse analysis are taught in linguistic departments (Johnstone, 2018)
Foucault (1972, 1980) use 'discourse' to refer to the ways of talking and thinking constitute ideologies (set of interrelated ideas) and serve to circulate power in society, and in the sense involved patterns of belief and habitual actions as well as patterns of language.
Johnstone, Barbara. 2018. Discourse Analysis (3rd ed.). UK: Wiley-Blackwell.
"},{"location":"docs/2-ling/pragmatics/ca_da/#conversational-analysis","title":"Conversational Analysis","text":"Definition
Conversation analysis is the study of interactional activities. The object being studied involves at least two persons.
Unit
conversation > sequence > adjacency pair > turn
types of adjacency pairs
turn-taking feature
One involved in a conversation is supposed to give floor to the other party (parties) at a proper point of time. to keep the balance between the time one spends talking and the time the others spend talking.
pre-sequence
insertion sequence
A: Are you coming tonight?\nB: Can I bring a guest?\nA: Male or female?\nB: What difference does that make?\nA: An issue of balance.\nB: Female.\nA: Sure.\nB: Yeah, I\u2019ll be there.\n
preference organization
first part second part preferred dispreferred assessment agree disagree invitation accept refuse offer accept decline proposal agree disagree request acccept refuse"},{"location":"docs/2-ling/pragmatics/intro/","title":"Introduction and Concepts","text":":material-circle-edit-outline: \u7ea6 1923 \u4e2a\u5b57 :fontawesome-solid-code: 11 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/intro/#what-is-pragmatics","title":"What is Pragmatics","text":"Charles W. Morris (1901-1979) American semiotician and philosopher. supervised by Charles S. Pierce. In his Foundations of the Theory of Signs (1938), Morris proposed that semiotics should have three divisions:
syntax -------------> semantics -------------> pragmatics\n \u2b06\ufe0f\u00a0 \u2b06\ufe0f\u00a0 \n decoding use in context\n
During the course of everyday communication, human beings as social animals convey more than the literal, propositional meaning (i.e. we don\u2019t always mean what we say literally).
There is more to the literal meaning of a sentence when we consider the sentence in relation to the context, i.e., the situation of uttering the sentence.
Sentence that cannot be considered in isolation \u2192 utterance
Pragmatics looks beyond truth-conditional meanings, and explores non-literal, implicit, context-related meanings.
Thus both semantics and pragmatics deal with meaning, yet there is a division of labour: semantics deals with meaning in context.
"},{"location":"docs/2-ling/pragmatics/intro/#levels","title":"Levels","text":"Definition
Deixis and context: Deictic does not have concrete meanings. Deictic words depend on context for meaning.
linguistic context: refers to the language surrounding the expression in question
The boy said he has five girlfriends.\n
Both he and the boy refer to the boy.
He refers to the boy anaphorically, the boy refer to the boy deictically.
Types of deixis
defined in relation to the deictic center (person, time, place, discourse, social)
symbolic: symbolic usages of deictic terms
personal deixis
The deictic cycle. Harman, 1990.
"},{"location":"docs/2-ling/pragmatics/intro/#reference","title":"Reference","text":"Definition: The act of using a word/phrase to pick out something in the world.
Types of referring expressions (\u6307\u793a\u8bed)
Choice of referring expressions: based on the speaker\u2019s assumption about what the listener knows.
Conditions for successful reference: must be collaborative
Differences between semantic and pragmatic presuppositions
for pragmatic presupposition
cancellation of presuppositions
Presuppositions are cancellable or defeasible by changing the words to alter the previous proposition.
F: \u6709\u4e9b\u4eba\u517b\u732b\u4e86\n~F: \u6709\u4e9b\u4eba\u6ca1\u517b\u732b\n
projection problem
presupposition may not survive when simple sentences are projected into complex ones.
Mary didnt manage to find a job.\nMary didnt manage to find a job. In fact, she didnt even try.\n
Mike didnt date Mary again.\nMike didnt date Mary gain, if indeed he ever did.\n
presupposition triggers (\u89e6\u53d1\u8bed): how to determine speakers\u2019 presupposition in the course of verbal communication?
Definite descriptions \u6709\u5b9a\u63cf\u5199: It gives definite descriptions associated with presuppositions of existence. e.g. the/this/that + NP, 3rd person pronoun, possessive + N (my, your, his/her).
Sue's neighbour's daughter got married last week.\n=> Sue has a neighbour.\n=> The neighbour has a daughter.\n
Factive verbs \u5b9e\u60c5\u52a8\u8bcd: sth has happened. e.g. regret, realize, know, be aware that, be sorry that, be glad that, be proud that, be pleased that, be odd, be strange, be disappointed that.
John regretted having started the project.\n=> He started the project.\n
Implicative verbs \u542b\u84c4\u52a8\u8bcd: e.g. manage, forget, happen, avoid\u2026
I forgot to bring the book.\n=> I ought to have brought the book.\n\nWe happened to meet Bob in the cinema.\n=> We didnt expect to meet Bob in the cinema.\n
\u201cChange of state\u201d verbs \u8868\u72b6\u6001\u6539\u53d8\u7684\u52a8\u8bcd: e.g. finish, stop, begin, start, carry on, continue, cease, leave, arrive, enter, come, go, turn, transform..
He stopped / didnt stop smoking cigars\n
Iteratives \u8868\u53cd\u590d\u7684\u8bcd\u8bed: words expressing repetition. e.g. repeat, back, again, too, another time, any more..
The spaceship came back to earth.\n=> The spaceship used to be on earth.\n
Verbs of judging \u5224\u65ad\u6027\u52a8\u8bcd: accuse, charge, criticize \u603b\u611f\u89c9\u8fd9\u4e2a\u8ddf\u524d\u9762\u7684factive verb\u6709\u70b9\u50cf\uff0c\u53ef\u80fd\u662f\u524d\u9762\u90a3\u4e2a\u4e00\u822c\u662f\u52a0that\u8868that\u540e\u9762\u7684\u662fpresuppotion, \u800c\u8fd9\u4e2a\u8868\u793a\u52a8\u8bcd\u672c\u8eab\u7684\u5c5e\u6027(e.g. \u60c5\u611f\u8272\u5f69) \u4f46\u662f\u597d\u50cf\u533a\u522b\u4e5f\u4e0d\u5927
Joe accused Zeo of forgery.\n=> Joe thinks forgery is bad\n
Temporal clauses \u65f6\u95f4\u72b6\u8bed\u4ece\u53e5: before, after, since, ..
After his father died, he stepped into a large fortune.\n=> His father died.\n
Cleft sentence \u5207\u5206\u53e5/\u65ad\u88c2\u53e5: it is.. that/who.. = \u5f3a\u8c03\u53e5\u3002\u8fd9\u4e2a\u597d\u7275\u5f3a\u3002\u3002
What I lost is my passport\n=> I lost something.\n
Non-restrictive attributive clauses
Jack, who visited China last year, is fond of Chinese tea.\n=> Jack has been to China\n
Counterfactual conditionals
If I had not burnt the cake, we would be having it for tea.\n=> I burnt the cake.\n
Questions
Does Frank speak English or French?\n=> Frank speaks one of the two European languages.\n
Implicature
Grice\u2019s theory of conversational implicature, Logic and Conversation.
An outline of a systematic theory of language use, which can account for the way people read between the lines when understanding everyday language.
meaning of a sentence
Grice\u2019s new terms
Grice draws a distinction
- Smith doesn't seem to have a girlfriend these days.\n\n- He has been paying a lot of visits to New York lately.\n\n=> entailment: he visits New York recently\n=> implicature: Smith may be having a girlfriend in New York.\n
features
Grice\u2019s cooperative principle
common purpose/common direction: Conversational partners normally recognize a common purpose or a common direction in their conversation.
common objectives (~= joint project): At any point of a conversation, certain \u201cconversational moves\u201d are judged suitable or unsuitable for accomplishing their common objectives.
How the cooperative principle is applied:
How to follow the maxims:
How to break the maxims:
The cooperative maxims are guidelines instead of rules. They can be creatively infringed/violated.
quantity:
Chandler: Where is the book you are reading?\nMonica: Its in the living room where there is also light and no one will kick you in the shin.\n
quality
Two travelers arrived at the hotel and were shown a rather dirty room.\n\u201cWhat,\u201d said one, \u201cdoes this pigsty (\u732a\u5708) cost?\u201d Promptly the owner replied, \u201cFor one pig, two dollars; for two pigs, three dollars.\u201d\n
relation
(The American ambassador Joseph Chroates was once mistaken for a doorman by a guest at an embassy function).\nGuest: Call me a taxi.\nJC: OK, you\u2019re a taxi.\n
manner
Miss X sang \u201cHome Sweet Home\u201d vs.\nMiss X produced a series of sounds which corresponded closely with the score (\u4e50\u8c31) of \u2018Home Sweet Home\u2019.\n
The Horn scales & scalar implicature
When any form on a scale (most, some, always, often, must, may\u2026) is used or asserted, the negative of all forms higher on the scale is implicated.
types of implicature
graph TD\nimplicatures --> conventional/lexical\nimplicatures --> conversational\nconversational --> generalized\nconversational --> particularized\n
"},{"location":"docs/2-ling/pragmatics/intro/#lexical-pragmatics","title":"Lexical Pragmatics","text":"Criticism of relevance theory
To calculate the processing cost,
Lexical pragmatics
pragmatic enrichment
graph TD\n\npragmatic_enrichment --> pragmatic_narrowing\npragmatic_enrichment --> pragmatic_broadening\npragmatic_broadening --> approximation\npragmatic_broadening --> metaphorical_extension\n
pragmatic narrowing: superordinate \u2192 subordinate
Doctors also *drink*.\n=> drink alcohol\n
pragmatic broadening
:material-circle-edit-outline: \u7ea6 129 \u4e2a\u5b57
\u8fd9\u5757\u5185\u5bb9\u4f3c\u4e4e\u6ca1\u6709\u8bb2\u5f88\u591a\u4e1c\u897f. \u7c98\u4e00\u70b9ppt\u539f\u8bdd
Intercultural Pragmatics
Intercultural Pragmatics has the potential to help establish a \u201charmonious\u201d interaction and relationship between people from different cultures.
IP aims to study how to deal with the differences arising from cross-cultural communication and how they may affect the universality of pragmatic principles (theory of speech acts, co-
operative principle, politeness principle, etc.)
intercultural pragmatics\u2019 two way perspective
sociopragmatics
:material-circle-edit-outline: \u7ea6 810 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/theories/#speech-act-theory","title":"Speech Act Theory \u8a00\u8bed\u884c\u4e3a\u7406\u8bba","text":"Speech action definition:
Speech act theory:
locutionary act \u8a00\u5185\u884c\u4e3a: is the saying of it with the literal meaning
It's stuffy here.\n=> There isn't enough fresh air in here\n
illocutionary act \u8a00\u5916\u884c\u4e3a: the speaker\u2019s intention, can be a request
It's stuffy here.\n=> a request of the receiver to open the window.\n
perlocutionary act \u8a00\u540e\u884c\u4e3a: action or state of mind brought about by, or as a consequence of, saying something
It's stuffy here.\n=> the receiver opens the window or refuses\n
A speech act = locutionary act + illocutionary act + perlocutionary act
Illocutionary force \u8bed\u529b: communicative purposes or social functions
Classification of speech act
Funtion-based classification system:
by John Searle, UCB philosopher
Structure-based classification system:
Development of Gricean theory
Definition of politeness theory
Conversationalists work together, each trying to maintain his/her own face and the face of his/her counterpart.
type of face
Acts involved
Leech\u2019s six Politeness Principle: extension of Gricean theory
(Note that the term \u2018neo-Gricean\u2019 is most often used to describe the works of Laurence Horn, Stephen Levinson, etc. not other theories e.g. relevance theory)
"},{"location":"docs/2-ling/pragmatics/theories/#relevance-theory","title":"Relevance Theory","text":"Only preserving the maxim of relation in Gricean theory
Definition of relevance theory
its investigates how aspects of meaning are generated in context and in relation to the speakers intentions.
R(relevance) = E(#contextual effects)/C(cost of efforts in obtaining E)
Relevance is higher when cognitive effects are higher, but it is lower when more processing efforts is required.
Two aspects of relevance principle
cognitive principle of relevance
Human cognition is geared towards the maximization of relevance.
The degree of relevance of a cognitive activity is governed by
it is only worth an addressee\u2019s time and effort to process some information if the ratio of rewards to effort is sufficiently high.
Every act of ostensive communication automatically carries with it the utterer\u2019s belief in its optimal relevance.
Application of RT
disambiguation
(1) She has a mole on her left cheek.\n(2) They managed to place a mole in the rival organization.\n
assignment of reference
A: I\u2019ll make the salad dressing.\nB: The oil is on the top shelf.\nA: I can\u2019t see it.\n
enrichment
A: When you\u2019ve finished the dishes will you post these letters?\nB: I will.\n=> what B really means is \u201cI will post those letters when I\u2019ve finished the dishes.\n
implicature
A: Did Chris get invited to the conference?\nB: His paper was too long.\n=> Chris didn\u2019t get invited to the conference.\n
1 - Definition Clearification
This chapter provides a brief introduction to the terminologies involved in semantics.\n
2 - Logics & Formal Semantics
This chapter first introduces the semiotics in formal semantics (which adopts a similar system with that in the logics). It then discusses about the semantics in two perspectives: the propositional logic and the predicate logic. It also introduces several basic rules in logic inference.\n
3 - Scope Ambiguity
This chapter discusses on the unsolved questions in scope ambiguity.\n
"},{"location":"docs/2-ling/semantics/#grading","title":"Grading","text":"mid-term: 35%
final: 50%
participation: 15%
"},{"location":"docs/2-ling/semantics/#two-tests","title":"Two tests","text":"Two tests will be given during the term, one in the middle and one at the end of the term, covering all the material covered up to that point in the course. The tests will be a combination of various types of questions, including true/false and short essay.
"},{"location":"docs/2-ling/semantics/#final-review-for-fun","title":"Final Review & For Fun","text":":material-circle-edit-outline: \u7ea6 629 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
The following parts are written in preparation for the final review but I upload it as well for you to read for fun.
"},{"location":"docs/2-ling/semantics/#noble-semanticians","title":"Noble Semanticians","text":"Name Field Contribution Live Nation Institution Fun facts Noam Chomsky mainly in syntax generative grammar, transformational grammar, government and binding theory, minimalist program, productivity of language, recursivity of language 1928- USA MIT Most prominent linguist alive Ferdinand de Saussure linguist and semiotician founder of semiotics. concepts: sign, signifier vs. signified, diachronic vs. synchronic, language vs. parole, paradigmatic vs. syntagmatic 1857-1913 Switzerland University of Geneva, Switzerland Charles Sanders Peirce philosopher, mathematician, logician founder of semiotics. concepts: index, icon, symbol. 1839-1914 Milford Pennsylvania JHU Michel Br\u00e9al comparative grammar coined the term \u201csemantics\u201d, diachronic focus 1832-1915 born in Rheinlan (Germany), studied in Paris and Berlin in Paris Leonard Bloomfield structural linguistics structural linguistics, language as a self-regulating system, behaviorism(stimulus-response testing) 1887-1949 Yale University reject introspection Aristotle polymath term logic, initiator of western scientific tradition 384-322 BC Stagira, Greece tutor of Alexander the Great Gottlob Freg philosopher, logician, mathematician predicate logic, sense(sentence\u2019s proposition) vs. reference (its truth value) 1848-1925 German University of Jena extreme right-wing views Peter Geach philosopher, professor of logic donkey sentence (1962) 1916-2013 England Oxford Richard Montegue semanticist Montegue grammar: syntax and semantics go together 1930-1971 student of Alfred Tarski, gay man, killed in his apartment, four influential papers Gareth Evans philosopher philosophy of mind, work on reference, e-type anaphora 1946-1980 England Oxford Irene Heim semanticist definite and indefinite pronouns 1954- German, Munich MIT, phd 1982 advisor: Barbara Partee Hans Kamp philosopher and linguist discourse representation theory (DRT) 1954- Dutch Bertrand Russell philosopher, logician logic, philosophy of mathematician 1872-1970 Wales, Britain Cambridge Henri\u00ebtte de Swart linguist tense and aspect, negation, bare nominals and indefinite noun phrases. She has also investigated the role of semantics in language evolution, and was involved in the development of bidirectional optimality theory. 1961- Dutch director of Netherlands Graduate School of Linguistics and Utrecht Institute of Linguistics"},{"location":"docs/2-ling/semantics/#example-questions","title":"Example questions","text":"What is a donkey pronoun?
A donkey sentence is such that an expected existential is interpreted as universal taking wide scope.\n
What is a discourse pronoun:
outside the scope of existing quantifier\ne.g. No student studies semantics. He is outside.\n
The scope of a quantifier is always bound in the clause it appears.
True\n
What is quantifier raising?
Chmosky and May.\nLF, \n
What are De Morgan\u2019s laws?
~(p or q) <=> (~p) and (~q)\n~(p and q) <=> (~p) or (~q)\n
What are conditional laws
p -> q <=> ~p or q\n
When is the indefinite \u201ca\u201d not an existential quantifier?
1. donkey sentence\n2. generic noun phrase. A woman is difficult to please. \\forall x(Wx -> Dx)\n3. John is a plumber.pj\n
2 readings: Some boy smiled at Jane and some boy kissed Molly.
\\exist x(Bx and Sx,j and Kx,m)\n\\exist x(Bx and Sx,j) and \\forall y(By and Ky,m)\n
2 Types of Recursion
embedding and coordination\n
"},{"location":"docs/2-ling/semantics/ambiguity/","title":"Ambiguity","text":""},{"location":"docs/2-ling/semantics/ambiguity/#scope-ambiguity","title":"Scope Ambiguity","text":""},{"location":"docs/2-ling/semantics/ambiguity/#scope-and-anaphora","title":"Scope and Anaphora","text":"antecedent vs. postcedent
anaphor vs. cataphor
Predicate logic is suited to capture natural language meaning
allow recursion = recursivity
two sources of recursion
some boy kissed every girl.\n\nEvery girl was kissed by some boy.\n
Someone mentioned tehy called everyone.\n\n\\forall x: Px\\forall y(M(x, Cxy))\n
linear order: negative polarity item
graph TD\n DS -.Transformation.-> SS\n SS -.send off.-> PF\n SS -.send off.-> LF\n PF -.acoustic representation.-> SS\n LF -.semantic interpretation.-> SS\n
Transformation:
CALLOUT: annotation, connotation and denotation
annotation
connotation: intension.
A meaning of a word or phrase that is suggested or implied, as opposed to a denotation, or literal meaning. A characteristic of words or phrases, or of the contexts that words and phrases are used in.
The\u00a0connotations\u00a0of the phrase \"you are a dog\" are that you are physically unattractive or morally reprehensible, not that you are a canine.
A technical term in logic used by J. S. Mill and later logicians to refer to the attribute or aggregate of attributes connoted by a term, and contrasted with\u00a0denotation\u00a0.
The two expressions \"the morning star\" and \"the evening star\" have different\u00a0connotations\u00a0but the same denotation (i.e. the planet Venus).
denotation
Quantifier-raising - NC RM - syntactic structure comes before the semantic structure - The movement we make in SS to remove ambiguity in DS is called quantifier-raising. - take the quantifier to the higher position to show the scope
Quantifier-in - Montague grammar - The derivational illustration is called quantifier-in. - each predicate take an argument once a time
Quantifier storage - Cooper storage - semantic ambiguity not represented in syntactic structure - semantic representation in which scope ambiguities are obtained without special syntactic rules
"},{"location":"docs/2-ling/semantics/ambiguity/#quantifier-in","title":"Quantifier-in","text":"interrogative: asking a question
which woman does every man love?\n
which scopes over every.
"},{"location":"docs/2-ling/semantics/ambiguity/#scope-ambiguity_1","title":"Scope ambiguity","text":"e.g. some boy did not laugh.
\\exist x (Boy(x) and ~Laugh(x))\n~\\exist x (Boy(x) and Laugh(x))\n
some boy kissed no girl.
\\exist x (Boy(x) and ~\\exist y (Girl(y) and Kiss(x, y)))\n~\\exist y (Girl(y) and \\exist x (Boy(x) and Kiss(x, y))): there was no girl kissed by a boy\n
every boy kissed no girl.
\\forall x (Boy(x) and ~\\forall y(Girl(y) and Kiss(x, y)))\n
"},{"location":"docs/2-ling/semantics/ambiguity/#deictic","title":"Deictic","text":"No boy said he was hungry.
No boy was present. He was outside instead.: \u201che\u201d is trying to refer to \u201dno boy\u201d but outside the scope.
pronoun \\(\\sub\\) anaphora
"},{"location":"docs/2-ling/semantics/ambiguity/#discourse-anaphora","title":"Discourse Anaphora","text":"e.g.
Every student was present and she was interested.\n
every: scopes over \u201cEvery student was present\u201d
every: an indefinite quantifier. \u201cshe\u201d\u2019s antecedent is not clear
\u201cshe\u201d is hardly bound by the antecedent. \u201cshe\u201d is free * ungrammatical: \u4e0d\u5408\u8bed\u6cd5\u7684, syntactic
"},{"location":"docs/2-ling/semantics/ambiguity/#infelicitous-semantic-fit-the-context","title":"infelicitous: \u4e0d\u5408\u9002\u7684, semantic, fit the context","text":":material-circle-edit-outline: \u7ea6 1349 \u4e2a\u5b57 :fontawesome-solid-code: 15 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f
discourse pronoun: in separate clauses
sentence quantifier:
Some boy said he was hungry.\nNo boy said he was hungry.\n
discourse quantifier:
Some boy was present; he was hungry.\n#No boy was present; he was hungry. // he is free\n
coreference individual constants
Fred thought he was the the best\n
binding individual variables
Every student thinks he/she is the best\n
So we may conclude the following rules for e-type anaphora. BUT this part has NOT been verified with any authority. Do NOT take them as given truths during exams.
e.g. No boy thinks that he has a chance.
~\\exist x(Boy(x) and Think(x, Has-a-chance(x)))\n
A particular boy said he wanted to kiss every girl. He then did it.
\\exist !x(Bx and W(x, K(x, \\forall y(Gy -> K(x, y))))) and K(x, y)\n
"},{"location":"docs/2-ling/semantics/ambiguity/#donkey-anaphora","title":"Donkey anaphora","text":"if a farmer owns a donkey, he beats it.
* \\exist x (Fx and \\exist y (Dy and O(x, y))) -> B(x, y)\n\\forall x \\forall y (Fx and Dy and O(x, y) -> B(x, y))\n
= every farmer who owns a donkey beats it.
\\exist x(Fx and \\exist y (Dy and O(x, y)) -> B(x, y)) // y is free\n
\u2757\u2757\u2757
A donkey sentence is such that an expected existential is interpreted as universal taking wide scope.
donkey pronoun can be: it, him, they (can also be plural forms)
\u201ca\u201d: generic indefinite
A woman is a difficult thing to please.\n
[Every farmer [who owns a donkey] beats it.]
universal wide scope: it scopes more over the relative clause
The problem - Existential with narrow scope - interpreted as universal with wide scope - in conditional clauses - in restriction of every
Conclusion - the machinery of predicate logic is broken - cannot capture meaning of natural language
If a student tries, she passes the exam.
(\\exist x(Sx and Tx)) -> Py ; y is free\n\\exist x((Sx and Tx)) -> Py)\n
interpretation
\\forall x((Sx and Tx) -> px)\n
Solutions for donkey anaphora:
E-type anaphora
initial examples
A student came in. She had a question about the exam.\nshe = the student came in\n\nBill owns some sheep and Max vaccinates them.\nthem = the sheep Bill owns. E-type pronoun, some sheep scopes over the first half\n
If a student likes Copenhagen, she is happy.
she = for every case we examine, the student is \n
every student who reads a semantic paper likes it.
Bill owns a cat. Max takes care of it.\nBill is a cat-owner. #Max takes care of it.\n
DRT (Dynamic binding theory)
Unselective binding example of the subject is \u2018unselectively bound\u2019 by a special \u2018generic operator.
Dogs bark.\nA dog barks.\n
Reference: Unselective Binding
"},{"location":"docs/2-ling/semantics/ambiguity/#chapter-6-in-short-discoursedonkey-anaphora","title":"Chapter 6 in short: Discourse/Donkey Anaphora","text":"(\u52a0\u7c97\u7684\u662fDonkey anaphora\u548cE-type anaphora\u7684\u533a\u522b)
Discourse: basic unit of interpretation
Donkey sentence: is such that an expected existential is interpreted as universal taking wide scope. / sentences that contain a pronoun with clear meaning but whose syntactical role in the sentence poses challenges to grammarians (wikipedia)
e.g.
every farmer who owns a donkey beats *it*.\nit: (corresponding to the) existential (\"a\") but interpreted as universal\n
every police officer who arrested a murder insulted *him*.\nhim\n
every farmer who owns some sheep cleans *them*.\nthem\n
donkey anaphora = donkey pronoun: it, him, they (can also be plural forms)
Analysis of donkey anaphora: Montague grammar
e.g.
\\forall x(Farmer(x) and \\exist y (Donkey(y) and Owns(x,y)) -> Beat(x,y))\n
Anaphoric relations in sentence and discourse - E-type anaphora: pronoun outside the scope of binder, not bound, content of pronoun reconstructed, reconstruction based on context - in separate sentences
```\n A student came in. *She*(the student came in) had a question about the exam.\n ```\n\n- in the same sentence but outside the scope\n ```\n If a student likes Copenhagen, *she*(for every case we examine, the student in question who likes Copenhagen) is happy.\n ```\n\n- problem of compound: antecedent must appear as a noun?\n ```\n Bill owns a cat. Max takes care of it.\n Bill is a cat-owner. # Max takes care of it.\n ```\n
Anaphora resolution - TODO
"},{"location":"docs/2-ling/semantics/definitions/","title":"Definition Clarification","text":":material-circle-edit-outline: \u7ea6 1068 \u4e2a\u5b57 :fontawesome-solid-code: 53 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/2-ling/semantics/definitions/#what-is-semantics","title":"What is semantics?","text":"parenthesis
small dogs and cats: \n- small (dogs and cats)\n- (small dogs) and cats\n\n// example of scope of quantifier\n
logical quantifier
every body did not cry:\n- every not (boy did cry) 'no boy did cry'\n- not every (boy did cry) 'at least one boy did cry'\n
everything but the subject e.g. John likes grammar.
content verb or adjective taking arguments e.g. like (John, grammar).
graph TD\n Language_Ability --> Competence\n Language_Ability --> Performance\n Competence --> Grammar\n Competence --> Lexicon\n Grammar --> Semantics\n Grammar --> Phonology\n Grammar --> Syntax\n Grammar --> Pragmantics\n
"},{"location":"docs/2-ling/semantics/definitions/#semantics-syntax","title":"Semantics & Syntax","text":""},{"location":"docs/2-ling/semantics/definitions/#syntax-needs-semantics","title":"Syntax needs semantics","text":"We can/cannot study syntax without semantics.
Colorless green ideas sleep furiously.\n
Deixis is how objects, events and situations relate to the here and now of the speakers. It shows that utterance meaning cannot be fully determined by sentence meaning.
(Last week) (I) play(ed) tennis with Chris.\n
"},{"location":"docs/2-ling/semantics/definitions/#deictic-vs-anaphoric-use-of-pronouns","title":"Deictic vs. Anaphoric use of pronouns","text":"Deictic: pointing context Anaphoric: linguistic expression context. pronoun resolution: antecedent - pronoun
\ud83d\udcad index - indices (higher register) / indexes \ud83d\udcad Desiderata (high-register way to say Goal, desideratum. sl.)"},{"location":"docs/2-ling/semantics/definitions/#map-of-semantics-taxomony","title":"Map of Semantics / Taxomony","text":"Semantics - lexical semantics - meaning of lexical items - smaller unites - mainly words - morphemes - compositional semantics - meaning of larger units - phrases and sentences - word combination
"},{"location":"docs/2-ling/semantics/definitions/#utterance-sentence-proposition","title":"Utterance / Sentence / Proposition","text":"abiguity: bank, punch, pitcher\nsynonymy: beautiful-lovely, antonymy: male-female\nhyponymy: set -> superset\ntaxonomy: set -> subset\nsymmetric relation: marry. mutually entail each other\nconverse relation: send, sell\nmeronomy:
"},{"location":"docs/2-ling/semantics/definitions/#1-homonymy","title":"1) homonymy","text":"part-whole relationship
subtypes of meronymy
pistachio - almond taxonymy\nlaugh - cry move in - move out\ncry - weep\nRMB - monetary unit\ngrilfriend - wife\nsit - stand\njump - hop\ngood - bad\nbeat - beet\nrise - fall reverse\ncigarette - cigar taxonymy\nkid - goat dragon - monster\n
"},{"location":"docs/2-ling/semantics/definitions/#compositional-semantics","title":"Compositional semantics","text":"Michel Br\u00e9al: coined semantics
Ferdinand de Saussure: semiotician, diachronic vs. synchronic.
Leonard Bloomfield: structural linguistics, Language, behaviorism(stimulus-response testing). reject introspection(theorize about language learning by thinking about on ones own experience)
"},{"location":"docs/2-ling/semantics/definitions/#diachronic-synchronic","title":"Diachronic & Synchronic","text":"Noam Chomsky Syntax
"},{"location":"docs/2-ling/semantics/definitions/#generative-grammar","title":"Generative Grammar","text":"e.g. Flying planes can be dangerous.
graph TD\n are --> planes\n planes --> flying\n are --> dangerous\n
graph TD\n is --> flying\n flying --> planes\n is --> dangerous\n
"},{"location":"docs/2-ling/semantics/definitions/#pronoun-resolution","title":"pronoun resolution","text":"anaphora
John said he would helps.\nNo boy said he would help. no boy: all the boy not, not exist a boy\n
coreference(coreferential): refer to same person
notes: cf. compare, e.g. for example
graph TD\n Inference --> Entailment\n Inference --> Presuppositions\n Inference --> Implicature\n
any conclusion drawn from a set of propositions, from something someone has said and so on.
"},{"location":"docs/2-ling/semantics/definitions/#entailment","title":"Entailment","text":"Three girls were present. -> More than two girls were present.\nThree girls were not present. kills More than two girls were present.\n
Cannot be cancelled
# Three girls were present, but actually two girls come.\n#: semantically wrong\n
"},{"location":"docs/2-ling/semantics/definitions/#presupposition","title":"Presupposition","text":"Jim regrets ignoring the first problem. -> Jim has the first problem.\nJim does not regret ignoring the first problem. -> Jim has the first problem.\n
cannot be cancelled
# Jim regrets ignoring the first problem, but he does not have the first problem.\n
"},{"location":"docs/2-ling/semantics/definitions/#implicature","title":"Implicature","text":"Susan blushes when Jim looks at her, but she does not have a crush on him.\n
"},{"location":"docs/2-ling/semantics/definitions/#compositionality","title":"Compositionality","text":"Proposed by Noam Chomsky, the term compositionality entails three dimension.
The meaning of the whole is a function of the meaning of its parts and the way they are put together.: \u2026 is determined by\u2026
"},{"location":"docs/2-ling/semantics/formal_semantics/","title":"Logics & Formal Semantics","text":":material-circle-edit-outline: \u7ea6 2560 \u4e2a\u5b57 :fontawesome-solid-code: 24 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f
"},{"location":"docs/2-ling/semantics/formal_semantics/#metalanguage","title":"Metalanguage","text":"a. January has 31 days.\nb. *******January******* has 7 letters.\nb*. 'January' has 7 letters.\n
Liar sentence
(31) Sentence (31) is false.\n
solutions: (\u4e0d\u8003)
fuzzy logic
x = NOT(x)\nx = 1 - x\nx = 0.5\n
Alfred Tarski paradox arises only in languages that are \u201csemantically closed\u201d.
Arthur Prior equivalent
This statement is false.\nThis statement is true and this statement is false.\n
Saul Kripke Whether a sentence is paradoxical or not can be depend upon contingent facts.
A majority of what Jones says about me is false.\n
Smith is a big spender.\nSmith is soft on crime.\nEverything Smith says about me is true.\n
If a statement's truth value is ultimately tied up in some evaluable fact about the world, that statement is \"grounded\". If not, that statement is \"ungrounded\". Ungrounded statements do not have a truth value. Liar statements and liar-like statements are ungrounded, and therefore have no truth value.
Jon Barwise and John Etchemendy \u201cdenial\u201d or \u201cnegation\u201d
Dialetheism
Dialetheism is the view that there are true contradictions. Dialetheism raises its own problems. Chief among these is that since dialetheism recognizes the liar paradox, an intrinsic contradiction, as being true, it must discard the long-recognized\u00a0principle of explosion, which asserts that any proposition can be deduced from a contradiction, unless the dialetheist is willing to accept trivialism \u2013 the view that\u00a0all propositions are true. Since trivialism is an intuitively false view, dialetheists nearly always reject the explosion principle. Logics that reject it are called\u00a0paraconsistent.
Non-cognitivism
logic overview
graph TD\n Logic --> Logic_from_antiquity\n Logic --> Predicate_Logic\n Logic_from_antiquity --> Term_Logic\n Logic_from_antiquity --> Propositional_Logic\n
logic from antiquity: older
predicate logic: newer
Aristotle: term logic
Gottlob Frege: predicate logic
"},{"location":"docs/2-ling/semantics/formal_semantics/#history-of-logics","title":"History of Logics","text":"Not applied for - question (?) - exclamation - modal: modal logic
\ud83d\udcad ergo: therefore"},{"location":"docs/2-ling/semantics/formal_semantics/#term-logic","title":"Term logic","text":""},{"location":"docs/2-ling/semantics/formal_semantics/#modus-ponens","title":"Modus Ponens","text":"Means of putting, MP syllogism, affirming the antecedent
P(conditional statement): If it rain, I do not go to school.\nH: It rains.\nC: I do not go to class.\n
Formal fallacy: affirming the consequent. Abductive reasoning.
P: If it rains, I will not go to class.\nH: I do not go to class.\nC: * It rains.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#modus-tollens","title":"Modus Tollens","text":"Means of carrying, MT syllogism, denying the consequent.
P: If it has not been cloudy, it does not rain.\nH: It rains.\nC: It has been cloudy.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#hypothetical-syllogism","title":"Hypothetical syllogism","text":"principle of transitivity
P: If it rains, the soils goes wet. If the soil goes wet, the plants grow.\nH: It rains.\nC: The plants grow.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#disjunctive-syllogism","title":"Disjunctive syllogism","text":"two premises and a conclusion
P: It either rains or its sunny.\nH: It rains.\nC: It is not sunny.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#three-types-of-reasoning","title":"Three types of reasoning","text":"Deductive reasoning
general to the particular. based on entailment
Inductive reasoning
particular to the general. empiricism
Abductive reasoning
formal fallacy. All dogs bark, Fido barks, Fido is a dog.
Abductive reasoning allows inferring a as an explanation of b. As a result of this inference, abduction allows the precondition a to be abducted from the consequence b.
Properly used, abductive reasoning can be a useful source of\u00a0priors in\u00a0Bayesian statistics.
John is friendly or John is not friendly.\n
p V_e ~p T T F F T T John is friendly and John is not friendly.\n
p and ~p T F F F F T It is not the case that John is not friendly.\n
~ ~ p T F T F T F contingent.
It is not the case that John is hungry or John is not grumpy.\n
~( p or ~q F T T T F T T F F F T T T F F F"},{"location":"docs/2-ling/semantics/formal_semantics/#material-implication","title":"Material implication \u2192","text":"converse: q\u2192p. affirming the consequent
inverse: ~p\u2192~q. denying the antecedent
contrapositive: ~q\u2192~p. modus tollens
given p\u2192q.
Although it was extremely cold, Sally did not stay indoors.
~q->p\np and ~q\n
We get a holiday, or we protest.
~p->q\np or q\n
Jone said that Jane helped him.
p\np and q\n
John\u2019s sister burped
p: John has a sister. presupposition, assume it true\nq: This sister burped.\np\np and q\n
John arrives before Jane left
p before q\n
John did not arrive before Jane left.
~p before q\np ~before q\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#predication-and-quantification","title":"Predication and Quantification","text":"universal quantifier: every, each, all, any, only
existential quantifier: a, some, there is \\(\\exist\\), for all \\(\\forall\\)
predicate, argument
John may like Sally.
predicate: may like\n
John has a crush on Sally.
predicate: has a crush on\n
Frank is the father of Susan.
predicate: is the father of\n
Frank is Susan\u2019s father.
predicate: is...'s father\n
Adjunct: if, probably, means, of course, early
Valent, empty place holder: formal subject
"},{"location":"docs/2-ling/semantics/formal_semantics/#collective-and-distributive-readings","title":"Collective and distributive readings","text":"Jogn and Molly ate a pizza.\np: one pizza, ate one together. distributive\np and q: two pizzas, each ate a pizza. collective\n
Cinthia and Sam have saved 100 dollars.\np: together 100 dollars\np and q: 200 dollars\n
Content verb is a predicate, but functional verbs are not
John obviously spoke with Jane because he had to.
predicate: spoke with\nargument: John, Jane\nadjuncts: obviously, because he had to.\n
If I get a chance, I will probably try to avoid the mistake.
predicate: will try to \nargument: I, avoid the mistake\nadjuncts: If I get a chance, probably\n
John performed Jill\u2019s operation first.
\n
The person who talk loudly is Jim\u2019s father.
predicate: is someone's father\nargument: the person who talk loudly, Jim\nadjunct: \n
the talking loudly person
predicate: talking\nargument: person\nadjunct: loudly\n
predicate: the nodes that are connected in SUD parsing tree
universal dependency (UD)
syntactic-universal dependency (SUD)
graph TD\n Primitive_units_within_propositions --> Predicates\n Primitive_units_within_propositions --> Arguments\n Arguments --> individuals_Terms\n individuals_Terms --> constants\n individuals_Terms --> variables\n
lexical predicates vs. syntactic predicates
individual constants vs. individual variables
e.g. We think John likes Susan.
T(w, Lj,s)\n
Types of predicates:
e.g. Monica hid her bicycle.
x hide y: Hx,y\nMonica: m\nher bicycle: b\nHm,b\n
e.g. Monica did not hide her bicycle.
x hide y: Hx,y\nMonica: m\nher bicycle: b\n~Hm,b\n
e.g. Monica laughed and cried.
Monica: m\nlaugh: L()\ncry: C()\nLm and Cm\n
e.g. Jim sent Monica his dog.
Sj,m,d\n
e.g. William did not help or hinder Mike.
~ (H1w,m or H2w,m) \n
e.g. Jennifer promise to help.
P(j, Hj)\n
e.g. Jennifer did not promise to help.
~P(j,Hj)\n
e.g. Jennifer promise to not laugh.
P(j,~Lj)\n
e.g. Mike claimed he wanted to help.
C(m, W(m/x, Hm/x))\n\nm: Mike\nx: maybe some other\n
e.g. John asked Mandy to stop laughing.
A(j, m, S(m, Lm))\n
e.g. John and Larry called Molly.
Cj,m and Cl,m\nC(j and l, m)\n
e.g. Molly did not call John and Larry.
~C(m, j) and ~C(m, l)\n~C(m, j and l)\n~C(m, j) or ~C(m, l)\n
entailment: (universal instantiation)
every dog barks \u2192 if something is a dog, then it is a dog.
Universal quantification
\\(\\forall\\)x (Dx \u2192 Bx)
D = (d1, d2, d3,\u2026)
\\(\\forall\\)x (Dx \u2192 Bx)= (Bd1 and Bd2 and Bd3, \u2026.)
Existential quantification
\\(\\exist\\)x (Dx and Bx)
D = (d1, d2, d3,\u2026)
\\(\\exist\\)x (Dx and Bx) = (Bd1 or Bd2 or Bd3, \u2026.)
e.g. Every cat barfed.
\\forall x (Cx -> Bx)\n
e.g. The cat barfed.
Bc\n
e.g. Bill fed cat.
\\forall x (Cx -> Fb,x)\n
e.g. Some dog barked at Fred.
\\exist x (Dx and Bx,f)\n
e.g. Fred scolded some dog.
\\exist x (Dx and Sf,x)\n
e.g. Fred and Susan avoid some dog.
\\exist x (Dx and Af,x and As,x)\n\\exits x (Dx and Af,x) and \\exist y (Dy and Af,s)\n
e.g. No dog barks.
\\forall x (Dx -> ~Bx)\n~\\exist x (Dx and Bx)\n
e.g. Bill fed no dog.
~\\exist x (Dx and Fb,x)\n\\forall x (Dx -> ~Fb,x)\n
e.g. No dog barked at Susan or chased Fred.
~\\exist x ((Dx and (Bx,s or Cx,f))\n\\forall x ((Dx -> (~Bx,s and ~Cx,f))\n\\forall x ((Dx -> ~(Bx,s or Cx,f))\n
Scope ambiguity
e.g. Some boy kissed every girl.
\\exist x \\forall y (Bx and (Gy -> Kx,y)) = \\exist x(Bx and \\forall y (Gy -> Kx,y))\n\\forall y \\exist x (Gy -> (Bx and Kx,y)) = \\forall y (Gy -> \\exist x (Bx and Kx,y))\n
Every boy kissed some girl.
\\forall x (Bx -> \\exist (Gy and Kxy)) <=> \\forall x \\exist y (Gy and Kxy)\n
Every students did not laugh.
\\forall x (Sx -> ~Lx) <=> ! \\exist x (Sx and Lx)\n~\\forall x (Sx -> Lx) <=> \\exist (Sx and ~Lx)\n
Not every student laughs.
~\\forall x (Sx -> Lx) <=> \\exist (Sx and ~Lx)\n
graph TD\n laughed --> student\n student --> /every\n /every --> not\n
each studnet did not laugh.
\\forall x (Sx -> ~Lx) \n~\\forall x (Sx -> Lx)\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#polarity-item","title":"Polarity item","text":"any: negative polarity item
John did not pass every exam.
~\\forall x (Ex -> Pj,x) <=> \\exist x (Ex and Pj,x)\n\\forall x (Ex -> ~Pj,x)\n
John did not pass any exam.
\\forall x (Ex -> ~Pj,x)\n
e.g.
Jack saw a rat.
\\exist x (Rx and Sj,x) \n
Jack is a rat.
the quantifier is in the predicate but not the argument. here rat is a constant.
Rj\n
Jack knows no genius.
use not exist to render \u201cno\u201d
~\\exist x (Gx and Kj,x) <=> \\forall x (Gx -> ~Kj,x)\n
Jack is no genius. <=> Jack is not a genius.
~Gj\n
These problems are difficult.
Dp\n
These problems are difficult ones.
Dp\n
All the problems are difficult.
\\forall x (Px -> Dx)\n
These problems are all the problems.
Ap\n
These problems are not all the problems.
~Ap\n
Jack is our plumber.
Pj\n
Our plumer is Jack. (has presupposition)
Pj\n
Everything counts.
whether thing includes animate and inanimate.
\\forall x (Cx)\n\\forall x (Tx -> Cx)\n
Everybody counts.
*\\forall x (Cx)\n\\forall x (Px -> Cx)\n
predicates
some prepositions.
The present under the tree is big. (prepositions that gives location)
argument nouns.
common nouns
content verbs are the core of syntactic predicates
adjectives are most always the core of syntactic predicates.
e.g. Mike\u2019s wife thinks Mikes if lazy.
predicates inside individual constants are presuppositional
A thin man was present.
predicates inside \u2026 .are propositional
e.g. Every barking is harmless
has true or false impact on the truth
\\forall x ((Dx and Bx) -> Hx)\n
this proposition has to show up in the predicate
The barking dog is harmless.
Hd\n
the presupposition does not show in the predicate
John avoids every dog he sees.
\\forall x ((Dx and Sj,x) -> Aj,x)\n
John said every dog barks.
intensional
Sj\nS(j,\\forall x (Dx -> Bx)) \nSj,I ; I for intensional argument predicate\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#adjunct-predicates","title":"Adjunct predicates","text":"Jane probably teased Sam last night
John arrived drunk.
Jim burped twice.
twice: propositional or presuppositional
Susan did not cheat yesterday.
Mary stayed because John stayed.
Mary did not stay because John stayed
Every boy was hungry
\\forall x: Bx(Hx)\n
Some boy was hungry.
\\exist x: Bx(Hx)\n
Every cat barfed.
\\forall x: Cx(Bx)\n
Bill fed every cat.
\\forall x (Cx, Fb,x)\n\\forall x: Cx(Fb,x)\n
Some dog barked at Fred.
\\exist x (Dx, Bx,f)\n\\exist x: Dx(Bx,f)\n
Fred and Susan avoid some dog.
\\exist x(Dx and (Af,x and As,x))\n\\exist x: Dx (Af,x and Af,x)\n
No dog barks.
~\\exist x (Dx and Bx) <=> ~\\exist x: Dx (Bx)\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#formal-predicate-semantics","title":"Formal Predicate Semantics","text":"graph TD\n Semantic_Rules --> Model\n Semantic_Rules --> Valuation_Function\n Model --> Universe_of_Discourse\n Model --> Interpretation_Function\n Universe_of_Discourse --> entities\n
interpretation function I
I(name) \u2192 meaning\n
assignment function g[x/e]
g(type of object) -> meaning\n
valuation function V
V(p) = 1/0\nV(Bs) = 1/0\n
[[\\alpha]]^M the denotation of \\alpha wrt M (same as interpretation function I)
[[name]]^M -> meaning\n
:material-circle-edit-outline: \u7ea6 23 \u4e2a\u5b57
\u4e0d\u597d\u8bf4 \u65bd\u5de5\u4e2d
\u76ee\u5f55
:material-circle-edit-outline: \u7ea6 599 \u4e2a\u5b57 :fontawesome-solid-code: 30 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
"},{"location":"docs/2-ling/syntax/conv_gen/#x-bar-theory","title":"X-bar theory","text":"\u751f\u6210\u53e5\u6cd5\u548c\u6210\u5206\u53e5\u6cd5\u4e4b\u95f4\u7684\u533a\u522b
[The big book of poems with the blue cover] is on the table.\n
\u6210\u5206\u53e5\u6cd5\u505a\u51fa\u6765\uff0csubject\u662f\u4e00\u4e2a\u9ad8\u5ea6\u4e3a1\u7684\u6811
\u53e5\u5b50\u4e4b\u95f4\u7684\u6210\u5206\u901a\u8fc7\u4e24\u4e24\u7ec4\u5408\u8fd8\u80fd\u505a\u51fa\u65b0\u7684\u9ad8\u5ea6
one-replacement
\u7528one-replacement\u63a2\u6d4b\u9650\u5b9a\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u5173\u7cfb\uff08\u52a8\u8bcd\u7528did so/did too\uff09
Mika loved the policeman intensively.\nSusan did so half-heartedly.\n*Susan did so the baker.\n
graph TD\n NP --> D\n D --> the\n NP --> N1\n N1 --> AdjP\n AdjP --> big\n N1 --> N2\n N2 --> N3\n N2 --> PP1\n N3 --> N\n N --> book\n N3 --> PP2\n PP2 --> of_poems\n PP1 --> with_the_blue_cover\n
\u52a0\u5165\u4e86bar level\uff0cbook\u4e0eof poems\u6784\u6210\u4e00\u4e2a\u4e2d\u95f4\u6295\u5c04X-bar\uff0c\u6784\u6210\u4e00\u4e2aconstituent\u3002\u4f7f\u5f97\u6bcf\u4e2a\u53e5\u5b50\u90fd\u80fd\u88ab\u753b\u6210\u4e00\u4e2a\u4e8c\u53c9\u6811\u5f62\u5f0f
\u751f\u6210\u53e5\u6cd5\u5b66\u6d3e\uff1a\u4e0a\u4e16\u7eaa\u4e94\u5341\u5e74\u4ee3\u3002classical theory and standard theory\u30021988\u5e74\u63d0\u51fa\u4e86government and binding theory\u3002lexicon, D-S, S-S, PF, LF
"},{"location":"docs/2-ling/syntax/conv_gen/#n-bar","title":"N-bar","text":"\u539f\u672cNP\u6839\u636e\u4e00\u7cfb\u5217\u89c4\u5219\u4e0d\u662f\u4e8c\u53c9\u6811\uff0c\u6bd4\u5982N\u2192
N-bar theory\u8ba4\u4e3a\u53ef\u4ee5\u90fd\u53d8\u6210\u4e8c\u53c9\u6811
\u89c4\u5219\u6bd4\u5982
NP -> Det N'\nN' -> AP N'\nN' -> N PP\n
\u7b2c\u4e00\u6761\u79f0\u4e3a\u4e00\u4e2a\u6700\u5927\u6295\u5c04
"},{"location":"docs/2-ling/syntax/conv_gen/#v-bar","title":"V-bar","text":"VP -> V' // \u9884\u7559\u4e00\u4e2a\u4f4d\u7f6e\u7ed9\u6f5c\u5728\u7684specifier\uff0c\u5373\u4f7f\u6ca1\u6709\nV' -> AdvP V' | V' PP | V' AdvP\nV' -> V(NP)\n
"},{"location":"docs/2-ling/syntax/conv_gen/#abj-bar","title":"Abj-bar","text":"AdjP -> Adj'\nAdj' -> (AdvP) Adj' | Adj' (AdvP)\nAdj' -> Adj(PP)\n
"},{"location":"docs/2-ling/syntax/conv_gen/#p-bar","title":"P-bar","text":"PP -> P'\nP' -> P'(PP) | (AdvP)P'\nP' -> P(NP)\n
\u4e2d\u5fc3\u8bcdX \u2192 \u4e2d\u95f4\u6295\u5c04X\u2019 \u2192 \u6700\u5927\u6295\u5c04XP\u3002\u4e0d\u80fd\u76f4\u63a5\u5230XP\uff0c\u4e00\u5b9a\u8981\u6709\u4e2d\u95f4\u6295\u5c04
"},{"location":"docs/2-ling/syntax/conv_gen/#parameter-of-word-orders","title":"Parameter of Word Orders \u7ba1\u7ea6\u8bba\uff0c \u539f\u5219\u4e0e\u53c2\u6570\u7406\u8bba","text":"\u6839\u636eX-bar\u7406\u8bba\uff0c\u53ef\u4ee5\u5bf9\u4e00\u4e9b\u8bed\u8a00\u7684\u4e0d\u540c\u8bed\u5e8f\uff08\u5982SVO\uff0cSOV\u7b49\uff09\u7ed9\u51fa\u8bed\u6cd5\u53c2\u6570\u5316\u89e3\u91ca
specifier\u548ccomplement\u53ef\u4ee5\u51fa\u73b0\u5728\u5176sister\u7684\u4e24\u4fa7\uff0c\u8fd9\u79cd\u6295\u5c04\u7684\u5de6\u53f3\u533a\u522b\u88ab\u79f0\u4e3aparameter setting
"},{"location":"docs/2-ling/syntax/conv_gen/#_2","title":"\u753b\u6811\u7684","text":"head movement: movement from a head to another head position
\u53e5\u5b50\u53ef\u4ee5\u53d1\u751fmovement\u7684\u6807\u5fd7
"},{"location":"docs/2-ling/syntax/conv_gen/#-reading","title":"- \u4e00\u4e2a\u53e5\u6cd5\u7ed3\u6784\u5177\u6709\u4e24\u79cdreading","text":"shortest movement
shortest: let the path of a movement be the set of nodes that dominate the original position of the moved item, and do not dominate the leading site.
"},{"location":"docs/2-ling/syntax/ud_sud/","title":"\u4f9d\u5b58\u53e5\u6cd5 UD & SUD","text":":material-circle-edit-outline: \u7ea6 381 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
In full spelling, Universal Dependency gammar and Surface Syntax Universal Dependency grammar.
"},{"location":"docs/2-ling/syntax/ud_sud/#tools","title":"Tools","text":"AllenNLP Demo CoreNLP Tool
"},{"location":"docs/2-ling/syntax/ud_sud/#concepts","title":"Concepts","text":"Dependency grammar\u00a0(DG) is an approach to the study of the syntax and grammar of natural languages that is quite distinct from\u00a0phrase structure grammar\u00a0(PSG), which is also known as\u00a0constituency grammar. The modern history of DG begins with\u00a0Lucien Tesni\u00e8re's major oeuvre (1959), whereas the modern history of PSG begins arguably with\u00a0Noam Chomsky's first prominent work (1957).
DG views linguistic structures in terms of a\u00a0one-to-one mapping\u00a0of atomic linguistic units to the nodes in structure, whereas PSG assumes a\u00a0one-to-one-or-more mapping. The distinction is clearly visible when one compares the tree structures. The next trees are taken from the\u00a0Wikipedia article on DG:
"},{"location":"docs/2-ling/syntax/ud_sud/#sud","title":"SUD","text":"[Surface Syntactic Universal Dependencies (SUD) | SUD](https://surfacesyntacticud.github.io/ SUD is an annotation scheme for syntactic dependency treebanks, and has a nearly perfect degree of two-way convertibility with the Universal Dependencies scheme (UD). Contrary to UD, it is based on syntactic criteria (favoring functional heads) and the relations are defined on distributional and functional bases.
"},{"location":"docs/2-ling/syntax/ud_sud/#general-principles-of-sud","title":"General principles of SUD","text":"SUD has 4 specific syntactic relations and a few extended relations: - subj - udep - comp - comp:aux - comp:cleft - comp:obj - comp:obl - comp:pred - mod
"},{"location":"docs/2-ling/syntax/uni_gram/","title":"\u666e\u904d\u8bed\u6cd5 Universal Grammar","text":":material-circle-edit-outline: \u7ea6 260 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/2-ling/syntax/uni_gram/#introduction","title":"Introduction","text":"Syntax\u7684\u610f\u4e49\u5728\u4e8e\u627e\u5230\u4e00\u79cdgrammar\uff0c\u80fd\u591f\u751f\u6210\u67d0\u79cd\u8bed\u8a00\u4e2d\u7684\u6240\u6709\u53e5\u5b50\u3002
Grammar\u662f\u57fa\u4e8e\u89c4\u5219\u7684\uff0c\u4e0d\u80fd\u7528high order of statistical approximation to English\u6765\u66ff\u4ee3\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#basic-linguistics","title":"Basic Linguistics","text":"DFA & Regular language
\u8c13\u8bcd\u903b\u8f91\u3002\u4f46\u6211\u4eec\u4e0d\u5173\u5fc3\u5176\u4e2d\u7684\u8bed\u4e49\uff0c\u53ea\u9700\u5173\u5fc3CFG\u7684\u5f62\u5f0f\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#phrase-structure-limitation","title":"Phrase Structure & Limitation","text":"\u81ea\u7136\u8bed\u8a00\u7684CFG\uff08\u4ee5\u82f1\u8bed\u4e3a\u4f8b\uff09\u6784\u6210\u8bed\u6cd5\u7684\u57fa\u7840\u90e8\u5206\u3002
\u4f46\u8fd9\u6837\u63cf\u8ff0\u81ea\u7136\u8bed\u8a00\u7684\u5de5\u5177\u8fd8\u662f\u4e0d\u80fd\u751f\u6210\u6240\u6709\u5408\u7406\u7684\u53e5\u5b50\uff0c\u6545\u5f15\u5165a more powerful model combining phrase structure and grammatical transformation\uff0c\u5f97\u5230\u8f6c\u6362-\u751f\u6210\u6587\u6cd5\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#on-the-goals-of-linguistic-theory","title":"On the Goals of Linguistic Theory","text":"\u4ece\u4e00\u822c\u8bed\u6cd5\u4e2d\u5f52\u7eb3\u51faUG\u7406\u8bba\uff0c\u5bf9UG\u7684\u671f\u671b\u7531\u5f3a\u81f3\u5f31\u4e3a\uff1a
\u5e94\u8be5\u7814\u7a76competence\uff0c\u800c\u975eperformance
"},{"location":"docs/3-dl/","title":"Deep Learning","text":":material-circle-edit-outline: \u7ea6 26 \u4e2a\u5b57
"},{"location":"docs/3-dl/#contents","title":"Contents","text":"AI\u5185\u5bb9\u751f\u6210\uff08ai-gc\uff09
"},{"location":"docs/3-dl/basics/","title":"Index","text":":material-circle-edit-outline: \u7ea6 0 \u4e2a\u5b57
"},{"location":"docs/3-dl/basics/bpe/","title":"Byte pair encoding (BPE)","text":":material-circle-edit-outline: \u7ea6 144 \u4e2a\u5b57
The original version of this algorithem focuses on compression. It replaces the highest-frequency pair of bytes with a new byte that was not contained in the initial dataset. A lookup table of the replacement is required to rebuild the initial dataset. The modified version builds tokens that match varying amount of source text from single characters to whole words.
Example
Suppose the sentence to be
aaabbaaabac\n
Since the byte pair (each alphabet as a byte) 'aa' occurs the most often, it is replaced by a byte 'Z' (first match).
ZabbZabac\n
Then 'ab' with 'Y'
ZYbZYac\n
Then 'ZY' with X
XbXac\n
Then this sequence can not be further compressed since there are no byte pair appearing more than once.
This algorithm is effective for tokenization because it has low computational overhead and remains consistent and reliable.
References
Wikipedia - Byte Pair Encoding
"},{"location":"docs/3-dl/basics/elmo/","title":"ELMo","text":":material-circle-edit-outline: \u7ea6 207 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
ELMo (embeddings from language model) is a word embedding method for representing a sequence of words as a corresponding sequence of vectors. Its essence is a bidirectional LSTM which takes character-level as inputs and produces word-level embeddings.
According to its original paper (?), it requires training on a corpus of about 30 million sentences and a billion words.
Contributions:
An early example of pretraining-finetuning paradigm: after the ELMo model is pretrained, its parameters are frozen, except for the projection matrix which can be fine-tuned to minimize the loss on specific language.
Contextualized word representation:
e.g., for sentence
She went to the bank to withdraw money.\n
References
Wikipedia ELMo
"},{"location":"docs/3-dl/efficient-train/","title":"Efficient Training","text":":material-circle-edit-outline: \u7ea6 7 \u4e2a\u5b57
"},{"location":"docs/3-dl/efficient-train/#intro","title":"Intro","text":""},{"location":"docs/3-dl/efficient-train/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1101 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/3-dl/efficient-train/hardware/#gpu","title":"GPU","text":"A graphic processing unit (GPU) is an electronic circuit designed for accelerating computer graphics. It is now widely adopted for non-graphic calculations such as the training of neural networks.
GPU Parameters that are most cared about
Memory refers to the total amount of RAM available on a GPU. Since deep learning tasks require a significant amount of GPU, it determines the capacity for storing and accessing data required for processing tasks, impacting the efficiency and capability of the GPU to handle large datasets.
Theoretical Performance indicates the potential computational power of a GPU, typically measured in FLOPS (floating-point operations per second): $FLOPS = cores \\times (boost) clock speed \\times FMA $, where FMA stands for the fused multiply-add operations. This metric helps gauge the GPU's ability to perform complex calculations and handle intensive workloads.
Memory Speed/Bandwidth measures the rate at which data can be transferred between the GPU and its memory. Higher bandwidth allows for quicker data access and processing, enhancing overall GPU performance.
NVLink is a high-speed communication interface that connects multiple GPUs. It enables faster data transfer and synchronization between GPUs, improving the efficiency of parallel processing and multi-GPU setups.
Clock Speed refers to the frequency at which a GPU's cores operate, typically measured in megahertz (MHz) or gigahertz (GHz). Higher clock speeds can lead to faster processing and improved performance for graphics and computing tasks.
Tensor Cores are specialized processing units within a GPU designed to accelerate machine learning and AI workloads. They enable efficient handling of tensor operations, which are critical for deep learning applications.
Slot Width describes the physical space a GPU occupies on a motherboard, usually measured in terms of the number of expansion slots it covers. Wider GPUs may offer enhanced cooling and performance but require more space inside the computer case.
Power (TDP) stands for Thermal Design Power and represents the maximum amount of heat a GPU is expected to generate under typical workloads. It is measured in watts (W) and indicates the power consumption and cooling requirements of the GPU.
In a table:
GPU GPU Memory Memory Bandwidth NVLINK CUDA Cores Turning Tensor cores RT cores T4 16GB 320GB/s No 2,560 320 40 A40 48GB 696GB/s Yes 10,752 336 84 RTX 6000 48GB 960GB/s No 18,176 568 142"},{"location":"docs/3-dl/efficient-train/hardware/#a-taxonomy-of-parallelism","title":"A Taxonomy of Parallelism","text":""},{"location":"docs/3-dl/efficient-train/hardware/#data-parallelism","title":"Data Parallelism","text":"Data Parallelism replicates the model across multiple GPUs, usually with two specific techniques: (1) fully shared data parallelism (FSDP), and (2) distributed data parallelism (DDP).
We denote the training dataset as \\(D\\), the shared model parameters as \\(W\\), the model's operation on the dataset as \\(f(D_i, W)\\), the \\(i\\)th processor as \\(p_i\\), the number of processors as \\(P\\), the \\(i\\)th machine which may be mapped to multiple processors as \\(m_i\\), and the number of machines as \\(M\\). In FSDP, the dataset \\(D\\), ignoring its original division of batches, is further divided into \\(P\\) smaller batches \\(D = {D_1, D_2, ..., D_P}\\). Each processor \\(p_i\\) performs a \\(f(D_i, W)\\) on its small batch. Meanwhile, DDP extends the data parallelism technique across multiple machines. The dataset \\(D\\) is first divided into \\(M\\) subsets \\(D = {D_1, D_2, ..., D_M}\\) for each machine, and each subset on \\(m_i\\) is further divided into \\(P_i\\) subsets according to the number of processors on each machine. After each processor performs the processing \\(f(D_{i,j}, W_k)\\), synchronization will be taken across all machines to aggregate and update the model weights \\(W_k \\leftarrow Aggregate(W_1, W_2, ..., W_M)\\).
While the computation workload is efficiently distributed across GPUs, inter-GPU communication is required to keep the model replicas consistent between training steps.
"},{"location":"docs/3-dl/efficient-train/hardware/#model-parallelism","title":"Model Parallelism","text":"Model parallelism is a distributed model deployment method that partitions the model parameters across GPUs to reduce the need for per-GPU memory. Common techniques of model parallelism include (1) tensor parallelism, (2) pipeline parallelism, and (3) expert parallelism.
We denote the input data tensor as \\(W\\), the model parameters as \\(W\\), the function representing the model's operations as \\(f(X, W)\\), and the \\(i\\)th processor as \\(p_i\\), the number of processors as \\(P\\).
Tensor Parallelism distributes the parameter tensor of an individual layer across GPUs. The model weights are divided along specific dimensions into \\(W = {W_1, W_2, ..., W_P}\\), and thus each processor \\(p_i\\) processes part of the model weights \\(f(X, W_i)\\).
Pipeline Parallelism involves partitioning the computation graph of a model into several stages and assigning each stage to a different processor or machine, making it an analogy to the CPU's pipelining technique. The input tensor \\(X\\) sequentially passes through each processor in each time step until the processing steps finish. This allows for overlapping execution of different stages, increasing the throughput.
Expert Parallelism, also known as Mixture of Experts (MoE), involves dynamically selecting a subset of model parameters, to reach the original performance using the entire model. Additionally, MoE models require a gating network \\(g(X)\\) to select the expert to output, which selects a subset of networks from the total \\(E\\) sub-networks, as $ \\epsilon =g(X), \\epsilon \\subseteq E $. Only the selected networks will be involved in the generation of the output \\(\\sum_{k \\in \\epsilon} f(X, W_k)\\).
"},{"location":"docs/3-dl/efficient-train/hardware/#activition-partitioning","title":"Activition Partitioning","text":"In large language model training, a large memory space is needed to store the input activation of the network layers. The activation partitioning techniques, which involves efficiently distributing the activations to ensure GPU usage, is another crucial technique for efficient training. Commonly used activation partitioning techniques involve (1) sequence parallelism and (2) context parallelism. We denote the input sequence as \\(X\\), the context of this training, including the batches and environments, as \\(C\\), the processing function as \\(f(X, C, W)\\), and \\(P\\) the number of processors.
Sequence Parallelism suggests that partitions are made by distributing computing load and activation memory across multiple GPUs along the sequence dimension of transformer layers. The input sequence \\(X\\) is divided into sub-sequences \\(X = [X_1, X_2, ..., X_P]\\). Each sub-sequence is sent into a processor with inner tensor forwarding techniques from the previous sub-sequence, denoted as \\(f(X_i, C, W_{i-1})\\).
Context Parallelism distributes different contexts, usually including batches and environments, across multiple processors. It is useful in multi-task learning and reinforcement learning scenarios. The context \\(C\\) is divided among processors \\(C = [C_1, C_2, ..., C_P]\\), and each processor processes the context with the entire input sequence, denoted as \\(f(X, C_i, W_i)\\).
"},{"location":"docs/3-dl/efficient-train/hardware/#multi-gpu-training","title":"Multi-GPU Training","text":"TODO
Reference: \ud83e\udd17 Efficient Training on Multiple GPUs
"},{"location":"docs/3-dl/efficient-train/parameter/","title":"Parameter","text":":material-circle-edit-outline: \u7ea6 664 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
"},{"location":"docs/3-dl/efficient-train/parameter/#parameter-level","title":"Parameter-level","text":"Huggingface's efficient training guide discusses a number of parameters and their effect on training efficiency.
torch_empty_cache_step
is allowed to be set to the model training procedure to clear the unused cache. This technique helps avoid CUDA out-of-memory errors by lowering peak VRAM usage at a cost of around 10\\% slower performance (See https://github.com/huggingface/transformers/issues/31372).torch.compile()
is a feature introduced by Pytorch 2.0 that automatically builds a computation graph for the model and optimizes the computing orders. It optimizes the training efficiency.Relevant table:
Method/tool Improves training speed? Optimizes memory utilization? Batch size choice True True Gradient accumulation False True Gradient checkpointing False True Mixed precision training True Maybe Torch empty cache steps False True Optimizer choice True True Data preloading True False DeepSpeed Zero False True torch.compile True False Parameter-efficient Tuning (PEFT) False True"},{"location":"docs/3-dl/formal-language/","title":"Introduction to Formal Languages","text":":material-circle-edit-outline: \u7ea6 4 \u4e2a\u5b57
"},{"location":"docs/3-dl/formal-language/lecture/","title":"Lectures","text":":material-circle-edit-outline: \u7ea6 411 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/3-dl/formal-language/lecture/#language-model-and-formal-language","title":"Language Model and Formal Language","text":"ACL tutorial 4
big promises
neural language models - expressiblity - formal language
useful tools - RNN: sequntial automata - Transformer: circuits
Definition
a language model p is a distribution on *\\Sigma.
Two language models are equal if p(y) = q(y) for all y on *\\Sigma.
Any language model can be written as an autogressive one.
tightness: for arbituary language model, the sum of all p(y) < 1 can happen. If the sum of all p(y) = 1, it is tight.
A minimum non-tight example: To set the probablity of EOS as 0, thus the generation might never stop.
special features of automaton: parity, hierachy detection
simplist RNN: Elman RNN
RNNs can be both as language models / recognizors (to classify grammatical or not)
RNNs work like language model (TODO: photo)
infinite state automata - with unbounded precision and computation time
a turing machine is equivalent to a two-stack pushdown automaton. (tape = two-stacks)
Theorem: an infinite-precision RNNs with unbounded computation time are Turing complete.
implies: - TODO: photo - we need the hidden states to encode the stacks
stack = neuron
drawbacks: - numbers are in finite precision - RNNs stop within finite time
"},{"location":"docs/3-dl/formal-language/lecture/#improvement-theoretical-model-rnns-with-bounded-computation-time-and-finite-precision","title":"improvement theoretical model: RNNS with bounded computation time and finite precision","text":"Theorem: Finite-precision real-time RNNs are equivalent to FSAs (without stacks, taking the training and inference procedure apart. )
clear: - any finite-precision RNN will define a finite number of states - it can thus be represented by a FSA - an upper bound RNNs can do at most what finite-state automata can
=> Elman RNNs can simulate deterministic FSAs (any non-deterministic FSA can be => deterministic ones)
main differences: - automaton: tabular rules - RNNs: matrix multiplications
Any simple family of automata can efficient simulation of RNNs?
TODO: photo
Some FSA with |Q| states can be compressed into an RNN with O(log|Q|) hidden states.
Takeaways:
an RNN can end up in any rung of the NC hierarchy depending on - whether allowing unbounded processing time - whether allowing unbounded precision
QAs:
the missing bit:
probablistic finite-state automata also compute probalisties
Beyond Binary States: LSTMs and counting
Counter machine:
TODO: photo, position on NC hierarchy
no model currently reach the computation ability of Turing machine. Some advanced models (e.g. ChatGPT) happen to recognize some programs.
LSTM as a counter machine, the memory cell works as the counter. set (TODO: some parameters) as 1 and the updating function of mem cells are as the counter.
"},{"location":"docs/3-dl/formal-language/lecture/#transformers-and-formal-language-theory-part-on-encoder","title":"Transformers and formal language theory, part on encoder","text":"bolean circuits, definition:
runtime without parallelism
definition (depth): longest path from input to output runtime with parallelism (?)
need sth dependent on input time
formal models: Boolean circuits
(what is ACC here)
formal models: first order logic (how did this appear)
TODO: photo, NC hierarchy interact with language classes
does circuits recognize parity?
decisions to make: attention, softmax
uniformity:
dependence on - number of parameters
unique hard attention:
linear temporal logic
TODO: photo on example of L=\\Sigma*ab\\Sigma*
"},{"location":"docs/3-dl/formal-language/lecture/#adding-sequentiality-to-transformers-chain-of-thought-part-of-decoder","title":"adding sequentiality to Transformers, chain-of-thought, part of decoder","text":"so far, only deterministic automata
non-deterministic
"},{"location":"docs/3-dl/formal-language/lecture/#takeaways","title":"takeaways","text":"QAs - the Turing machines can move head left-to-right and right-to-left. if taking that into account, we might
Reference
"},{"location":"docs/3-dl/survey/","title":"Misc Survey","text":":material-circle-edit-outline: \u7ea6 32 \u4e2a\u5b57
If I have written about some topics that I don't read anymore, they will be thrown into this section.
"},{"location":"docs/3-dl/survey/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1084 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
TODO
"},{"location":"docs/3-dl/survey/explainable-nlp/#survey","title":"Survey","text":""},{"location":"docs/3-dl/survey/explainable-nlp/#a-survey-of-the-state-of-explainable-ai-for-natural-language-processing","title":"A Survey of the State of Explainable AI for Natural Language Processing","text":"This survey thoroughly explains the state of explainable NLP. The Introduction discusses two distinguishing criteria for explanability models (1) whether the explanation is for each prediction individually or the model\u2019s prediction process as a whole, and (2) determining whether generating the explanation requires post-processing or not. In Categorization of Explanations, this paper categorizes the explanation models into local (provides information or justification for the model's prediction on a specific input) vs. global (provides similar justification by revealing how the model's predictive process works, independently of any particular input), and self-explaining (also directly interpretable, generates the explanation at the same time as the prediction, e.g. decision trees, rule-based models, and feature saliency models like attention models) vs. post-hoc (an additional operation is performed after the predictions are made). This section also states that the different categories of models can overlap. In section Aspects of Explanations, this paper introduces three types of explanation techniques: (1) explainability techniques (feature importance, surrogate model, example-driven, provenance-based, declarative induction), (2) operations to enable explainability (first-derivation saliency, layer-wise relevance propagation, and input perturbations, attention, LSTM gating signals, explainability-aware architecture design) and (3) visualization techniques (saliency, raw declarative representations, natural language explanation). The section Evaluation introduces several evaluating metrices.
"},{"location":"docs/3-dl/survey/explainable-nlp/#opinion-papers","title":"Opinion Papers","text":""},{"location":"docs/3-dl/survey/explainable-nlp/#climbing-towards-nlu-on-meaning-form-and-understanding-in-the-age-of-data-2020","title":"Climbing towards NLU: On Meaning, Form, and Understanding in the Age of Data (2020)","text":"This paper argues that the modern NLP models trained on form has no abilities in understanding natural languages based on both the science and philosophy theories. It is structured as follows. In section Large LMs: Hype and analysis, this paper samples example pieces from news and academic literature that exaggerate the understanding abilities in using words including \"understand\"\"comprehension\"\"recall factual knowledge\", and argues that the current LMs have the ability no other than learning the surface linguistic forms of language rather than understanding them. In section What is meaning?, this paper clarifies the meaning of language as the communicative intent that a parole intends to express, and distinguishes the concept \"meaning\" and \"truth\" as the truth is the meaning that is \"grounded\" to the real world. In section The octopus test, this paper detailedly tells a thought experiment of a super intelligent octopus who can mimic the human response by never receiving the knowledge of the grounded real world of the language meaning, by which this paper argues that it might be that how the language receiver decodes the communicative intends affects the conventional meaning of language. In section More constrained thought experiments, two more thought experiments are provided, training the JAVA and training the English LMs without providing the executing methods the communicative intends, and the paper argues that such tasks are impossible. In section Human language acquisition, this paper supports its idea by providing the example of human children's acquiring knowledge is not only grounded on the world image, but also in the interaction with other people. In section Distributional semantics, this paper argues that in NLP, two methods based on the instincts above are training distributional models on corpora augmented with perceptual data, and looking to interaction data (according to Wittgenstein's \"meaning in use\").
"},{"location":"docs/3-dl/survey/explainable-nlp/#information-theory-based-compositional-distributional-semantics-2021","title":"Information Theory-based Compositional Distributional Semantics (2021)","text":"According to the abstract, the contribution of this paper can be concluded as proposing the notion of Information Theory-based Compositional Distributional Semantics (ICDS): (i) We first establish formal properties for embedding, composition, and similarity functions based on Shannon\u2019s Information Theory; (ii) we analyze the existing approaches under this prism, checking whether or not they comply with the established desirable properties; (iii) we propose two parameterizable composition and similarity functions that generalize traditional approaches while fulfilling the formal properties; and finally (iv) we perform an empirical study on several textual similarity datasets that include sentences with a high and low lexical overlap, and on the similarity between words and their description. In section Introduction, the author introduces Frege's concepts of compositionality and contextuality, which respectively refers to that \"the meaning of the whole is a function of the meaning of its parts and the syntactic way in which they are combined\", and that \"the meaning of words and utterances is determined by their context\". This section also introduces the main concern of lacking systematicity by the linguists to the NLP, where systematicity is defined as \"A system is said to exhibit systematicity if, whenever it can process a sentence, it can process systematic variants, where systematic variation is understood in terms of permuting constituents or (more strongly) substituting constituents of the same grammatical category.\" Thus, this section introduces that this paper aims to propose a novel system called Information Theory-based Compositional Distributional Semantics (ICDS). In section Related Work, the author introduces a set of properties in selective proper text representation paradigms which includes \"systematicity\", \"usage context\", \"continuity\", and \"information measurbility\", and introduces a series of previous work under this standard. In section Theoretical Framework, this paper first establishes a geometric interpretation of ICDS, that \"The direction of an embedding represents the pragmatic meaning, and the vector norm of embedding represents how much information the literal utterance provides about its meaning in the pragmatic context\", and then proposes the concept of ICDS as \"there are minimal linguistic units whose semantics are determined by their use and whose amount of information is determined by their specificity. On the other hand, the systematicity of language can be captured by compositional mechanisms while preserving the amount of information of the composite utterance\". Section Formal Definition and Properties formally defines the concepts involved in ICDS, where (\\(\\pi\\),\\(\\delta\\), \\(\\bigodot\\)) stand for \"embedding\", \"semantic similarity\", and \"composition function\" respectively. This section points out the embedding function properties (information measurability and angular isometry), composition function properties (composition neutral element, composition norm monotonicity, and sensitivity to stricture), and similarity function properties (angular distance simialrity monotonicity, orthogonal embedding similarity monotonicity, and equidistant embedding simialrity monotonicity). In section Function Analysis and Generalization, this research evaluates several current embedding vector with the proposed framework, while in section Experiment, the semantic representation abilities of several prevailing LLMs including BERT and GPT are evaluated.
"},{"location":"docs/3-dl/survey/explainable-nlp/#contrastive-explanations-for-model-interpretability-2021","title":"Contrastive Explanations for Model Interpretability (2021)","text":"This paper proposes a data augmentation method to generate counterexample on the bases of NLI datasets, and proves that by training on patterns \"why A rather than B\" with contrastive learning methods, the model performs better than the previous NLI baselines.
"},{"location":"docs/3-dl/survey/explainable-nlp/#using-counterfactual-contrast-to-improve-compositional-generalization-for-multi-step-quantitative-reasoning-2023","title":"Using counterfactual contrast to improve compositional generalization for multi-step quantitative reasoning (2023)","text":""},{"location":"docs/3-dl/survey/llama3_405b/","title":"Llama-3.1-405B \u6280\u672f\u62a5\u544a","text":":material-circle-edit-outline: \u7ea6 3436 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f
"},{"location":"docs/3-dl/survey/llama3_405b/#_1","title":"\u7b80\u4ecb","text":"\u8fd9\u7bc7\u6280\u672f\u62a5\u544a\u662f MetaAI \u5728 2024 \u5e74 7 \u6708 23 \u65e5\u968f 405B \u6a21\u578b\u53d1\u5e03\u7684\u3002\u5148\u524d Llama 3 \u7cfb\u5217\u5df2\u7ecf\u53d1\u5e03\u8fc7 8B \u548c 70B \u4e24\u4e2a\u5927\u5c0f\u7684\u6a21\u578b\uff0c\u672c\u6b21\u53d1\u5e03\u7684\u6a21\u578b\u5728\u89c4\u6a21\u4e0a\u589e\u91cf\u975e\u5e38\u5927\u3002\u5c3d\u7ba1\u89c4\u6a21\u7684\u63d0\u5347\u4f7f\u5176\u6210\u4e3a\u6700\u5f3a\u7684\u5f00\u6e90\u5927\u8bed\u8a00\u5bf9\u8bdd\u6a21\u578b\uff08\u5728\u672c\u6587\u5199\u6210\u65f6\uff0c2024 \u5e74 8 \u6708 1 \u65e5\uff0c\u6839\u636e\u516c\u8ba4\u6bd4\u8f83\u53ef\u4fe1\u7684\u8bc4\u4ef7\u6307\u6807 Chatbot Arena\uff0c\u622a\u56fe\u5982\u4e0b\uff09\uff0c\u4f46\u672c\u6587\u5728 benchmark \u4e0a\u5c55\u73b0\u51fa\u6765\u7684\u6027\u80fd\u6570\u503c\uff0c\u76f8\u6bd4 70B \u63d0\u5347\u4e0d\u5927\uff0c\u666e\u904d\u5728 1-3 \u4e2a\u70b9\u3002\u4e14\u8003\u8651\u5230\u6a21\u578b\u5360\u7528\u7684 GPU \u6210\u672c\uff0c\u5bf9\u4e8e\u666e\u901a\u4eba\u65e5\u5e38\u7528\u9014\uff0c405B \u53ef\u80fd\u6027\u4ef7\u6bd4\u4e0d\u5982 70B \u9ad8\u3002
\u62a5\u544a\u7684\u539f\u6587\u89c1\u6587\u672b ArXiv \u94fe\u63a5\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_2","title":"\u6587\u7ae0\u7ed3\u6784","text":"Llama-3.1-405B \u6709\u6587\u5b57\u3001\u89c6\u9891/\u56fe\u50cf\u548c\u8bed\u97f3\u7b49\u591a\u4e2a\u6a21\u6001\u7684\u80fd\u529b\u3002\u672c\u6587\u7684\u67b6\u6784\u5206\u4e3a\u591a\u4e2a\u7ae0\u8282\uff0c\u5148\u8bb2\u6587\u5b57\u80fd\u529b\u7684\u9884\u8bad\u7ec3\uff08pre-training\uff09\u3001\u5fae\u8c03\uff08post-training\uff09\u3001\u5b9a\u6027\u80fd\u529b\u3001\u5b9a\u91cf\u80fd\u529b\u3001\u5c40\u9650\u6027\u7b49\uff0c\u518d\u8bb2\u89c6\u9891/\u56fe\u50cf\u548c\u8bed\u97f3\u7684\u8bad\u7ec3\u8fc7\u7a0b\u548c\u6027\u80fd\u6570\u503c\u3002
\u6280\u672f\u62a5\u544a\u539f\u6587\u7684\u7ed3\u6784\u5982\u4e0b\uff1a
Data: \u8bad\u7ec3\u7528\u4e86 15T \u7684\u591a\u8bed\u8a00\u6570\u636e\uff0c\u4e3b\u8981\u5728\u8d28\u91cf\u4e0a\u6709\u63d0\u5347\uff08\u6bd4\u5982\u91c7\u53d6\u4e86\u66f4\u6fc0\u8fdb\u7684\u6570\u636e\u8fc7\u6ee4\u7b56\u7565\uff09\u3002\u674e\u6c90\u8868\u793a 15T \u7684\u6570\u636e\u91cf\u8bad\u7ec3\u76ee\u524d\u80fd\u8bad\u7ec3\u7684\u8bed\u8a00\u6a21\u578b\u5df2\u8db3\u591f\u4e86\uff0c\u63a5\u4e0b\u6765\u9700\u8981\u5728\u8d28\u91cf\u800c\u975e\u6570\u91cf\u4e0a\u8fdb\u4e00\u6b65\u63d0\u5347\u3002
Scale: \u8bad\u7ec3\u4f7f\u7528\u4e86 \\(3.8 \\times 10^25\\) FLOPs\uff0cscaling law \u8868\u793a\u66f4\u5927\u7684\u53c2\u6570\u91cf\u5e94\u8be5\u4f1a\u4f7f performance \u66f4\u597d\u3002
Managing Complexity: Llama-3.1-405B \u6a21\u578b\u6ca1\u6709\u91c7\u53d6\u73b0\u5728\u5e38\u7528\u7684 MoE \u67b6\u6784\uff0c\u800c\u662f\u628a\u666e\u901a\u7684 dense Transformer \u7ed3\u6784\u76f4\u63a5\u505a\u5927\uff0c\u5e76\u4e14\u4f7f\u7528\u4e86\u76f8\u5bf9\u7b80\u5355\u7684\u5fae\u8c03\u7b56\u7565\uff08SFT, RS, DPO\uff09\u7b49\uff0c\u6240\u4ee5\u79f0\u4f5c\u6b65\u9aa4\u4e0d\u662f\u7279\u522b\u590d\u6742\u3002\u4e5f\u6709\u6d88\u606f\u79f0 MetaAI \u672c\u6765\u5c06\u4e00\u4e2a MoE \u67b6\u6784\u548c\u4e00\u4e2a dense Transformer \u4e00\u8d77\u8bad\u7ec3\uff0c\u4f46\u662f MoE \u67b6\u6784\u7684\u6a21\u578b\u6548\u679c\u4e0d\u592a\u597d\uff0c\u6240\u4ee5\u53ea\u653e\u51fa\u4e86 dense Transformer \u67b6\u6784\u7248\u7684\u3002\u5176\u4e2d\uff1a
\u5728\u591a\u4e2a benchmark \u4e0a\u6d4b\u8bd5 Llama-3.1-405B \u7684\u6027\u80fd\u3002\u6b64\u5904\u60f3\u5bf9\u672c\u6587\u7528\u5230\u7684 benchmark \u8fdb\u884c\u4e00\u70b9\u6982\u8ff0\u3002
pre-train \u9636\u6bb5\u7ed3\u675f\u540e\uff0c\u7528\u4e8e\u6d4b\u8bd5\u7684 benchmark \u6709\uff1a
SQuAD V2
(Rajpurkar et al., 2018) stf \u505a\u7684\u4e00\u4e2a\u9605\u8bfb\u7406\u89e3 benchmark\uff0c\u6536\u96c6\u4e86 wikipedia \u6587\u7ae0\uff0c\u5bf9\u91cc\u9762\u5185\u5bb9\u505a QA\u3002QuaC
(Choi et al., 2018) \u5168\u79f0\u662f QA in context\uff0c\u4e5f\u662f\u5bf9 wikipedia \u6587\u7ae0\u505a QA\uff0c\u4f46\u662f\u6240\u6807\u6ce8\u7684 QA \u6570\u636e\u662f\u8fde\u7eed\u7684\u5f88\u957f\u7684\u5bf9\u8bdd\u3002\u6bd4\u5982\u683c\u5f0f\u662f\uff0cspeaker A \u95ee\uff0c\u8fd9\u4e2a\u4eba\u51fa\u751f\u5730\u662f\u54ea\u91cc\uff0cB \u56de\u7b54\uff0cA \u518d\u95ee\u8fd9\u4e2a\u4eba\u54ea\u4e00\u5e74\u505a\u4e86\u54ea\u4e2a\u4e8b\u7b49\uff0c\u5982\u6b64\u7ee7\u7eed\u3002RACE
(Lai et al., 2017) \u662f\u4e2d\u56fd\u7684\u82f1\u8bed\u8003\u8bd5\u9605\u8bfb\u7406\u89e3\u9898\u3002HumanEval
(Chen et al., 2021) \u683c\u5f0f\u6709\u70b9\u50cf leetcode \u9898\u76ee\uff0c\u6bcf\u6761\u6570\u636e\u5305\u542b\u9898\u76ee\u8981\u6c42\u548c\u4e00\u7ec4\u6d4b\u8bd5\u70b9\uff0c\u81ea\u52a8\u6d4b\u8bd5\u7a0b\u5e8f\u4f1a\u8fd0\u884c\u6a21\u578b\u751f\u6210\u7684\u4ee3\u7801\uff0c\u5224\u65ad\u901a\u8fc7\u591a\u5c11\u6d4b\u8bd5\u70b9\u3002MBPP
(Austin et al., 2021) \u683c\u5f0f\u5927\u81f4\u540c\u4e0a\u3002CommonSenseQA
(Talmor et al., 2019) \u5728 conceptnet \u6570\u636e\u96c6\u7684\u57fa\u7840\u4e0a\u4ea7\u751f multichoice \u95ee\u9898\u3002PiQA
(Bisk et al., 2020) physical ... \u7269\u7406\u9886\u57df\u7684\u5e38\u8bc6\u63a8\u7406\u3002SiQA
(Sap et al., 2019) social ... \u793e\u4ea4 / \u6587\u5316\u9886\u57df\u7684\u5e38\u8bc6\u63a8\u7406\u3002OpenBookQA
(Mihaylov et al., 2018) \u57fa\u7840\u79d1\u5b66\u95ee\u9898\u3002WinoGrande
(Sakaguchi et al., 2021) adversarial Winograd challenge\uff0c\u56e0\u4e3a Winograd \u5df2\u7ecf\u88ab\u5f88\u591a\u6a21\u578b\u8bad\u7ec3\u8fc7\u4e86\uff0c\u5236\u4f5c\u4e86\u4e0e Winograd \u6570\u636e\u96c6\u540c\u683c\u5f0f\u7684\u65b0\u6570\u636e\u3002GSM8K
(Cobbe et al., 2021) \u5c0f\u5b66\u6570\u5b66\u95ee\u9898\uff0c\u95ee\u9898\u662f\u5e94\u7528\u9898\uff0c\u63d0\u4f9b\u4e00\u7cfb\u5217\u601d\u7ef4\u94fe\u89e3\u9898\u8fc7\u7a0b\uff0c\u6bcf\u4e2a\u6b65\u9aa4\u90fd\u80fd\u7528\u7b80\u5355\u7684\u52a0\u51cf\u4e58\u9664\u89e3\u51b3\u3002MATH
(Hendrycks et al., 2021b) \u7ade\u8d5b\u6570\u5b66\u9898\uff0c\u4e0e GSM8K \u540c\u683c\u5f0f\uff0c\u590d\u6742\u7684\u6570\u5b66\u7b26\u53f7\u7528 LaTeX \u5199\u6210\u3002ARC Challenge
(Clark et al., 2018) \u5168\u79f0 AI2's Reasoning Challenge\uff0c\u662f 3-9 \u5e74\u7ea7\u7684\u79d1\u5b66\u9898\uff0c\u683c\u5f0f\u662f multichoice\u3002DROP
(Dua et al., 2019) discrete reasoning over paragraphs \u6587\u672c\u6bb5\u843d\u4e2d\u5939\u6742\u6570\u5b57\u6216\u5927\u5c0f\u7b49\u5173\u7cfb\uff0c\u5bf9\u8fd9\u4e9b\u6570\u5b57\u6216\u6587\u672c\u8fdb\u884c\u63a8\u7406\u3002WorldSense
(Benchekroun et al., 2023) \u7528\u6587\u672c\u63cf\u8ff0\u7684\u56fe\u5f62\u548c\u7a7a\u95f4\u65b9\u4f4d\u5173\u7cfb\uff0c\u5bf9\u56fe\u5f62\u5c5e\u6027\u548c\u7a7a\u95f4\u65b9\u4f4d\u8fdb\u884c\u63a8\u7406\u3002Adv SQuAD
(Jia and Liang, 2017) \u624b\u52a8\u9020\u4e86 SQuAD \u683c\u5f0f\u7684\u66f4\u96be\u7684\u95ee\u9898\u3002Dynabench SQuAD
(Kiela et al., 2021) dynamic benchmark collection\uff0c\u6709\u4e00\u4e2a\u7f51\u7ad9 Dynabench\uff0c\u5141\u8bb8\u7528\u6237\u968f\u65f6\u4e0a\u4f20\u65b0\u7684\u6570\u636e\u3002GSM-Plus
(Li et al., 2024c) \u5c06 GSM8K \u91cc\u9762\u7684\u6570\u5b57\u6539\u6389\uff0c\u6bd4\u5982 3 \u6539\u6210 30\uff0c\u6574\u6570\u6539\u6210\u5c0f\u6570\u7b49\u3002PAWS
(Zhang et al., 2019) \u95ee\u9898\u683c\u5f0f\u662f\uff0c\u4ea4\u6362\u67d0\u4e2a\u8868\u8fbe\u4e2d\u7684\u4e24\u4e2a\u8bcd\uff08\u6bd4\u5982\uff0cflight from NYC to Florida \u4e2d\u7684 NYC \u548c Florida\uff09\uff0c\u5224\u65ad\u662f\u5426\u7b49\u4ef7\u3002QuALITY
(Pang et al., 2022) \u957f\u6587\u672c\u4e0a\u7684 multichoice \u95ee\u9898\u3002many-shot GSM8K
(An et al., 2023a) \u4f3c\u4e4e\u8fd9\u4e2a benchmark \u641c\u5173\u952e\u8bcd\u6ca1\u6709\u627e\u5230\uff0c\u539f\u6587\u4e2d\u5f15\u7528\u5bf9\u5e94\u7684\u6587\u7ae0\u4e5f\u4e0d\u662f\u8fd9\u4e2a\u540d\u5b57\u3002MMLU
(Hendrycks et al., 2021a) massive multi-task language understanding\uff0c\u5305\u542b 57 \u4e2a STEM \u5b66\u79d1\uff0c\u7528\u6765\u6d4b\u91cf\u5927\u6a21\u578b\u5728\u9884\u8bad\u7ec3\u4e2d\u83b7\u5f97\u7684\u77e5\u8bc6\u3002\u56e0\u4e3a\u6bd4\u8f83\u8001\u4e86\uff0c\u5f88\u591a\u5927\u8bed\u8a00\u6a21\u578b\u90fd\u5728\u8fd9\u4e2a\u6570\u636e\u96c6\u4e0a overfit \u4e86\u3002MMLU-Pro
(Wang et al., 2024b) \u5728 MMLU \u4e2d\u53bb\u6389\u4e86\u4e00\u90e8\u5206\u8d28\u91cf\u5dee\u7684\u95ee\u9898\uff0c\u505a\u4e86\u4e00\u4e2a\u66f4 challenging \u7684 test set\u3002\uff08\u53d1\u73b0\u8fd8\u662f\u5373\u5c06\u4e00\u8d77\u53bb Waterloo \u7684 Yubo \u540c\u5b66\u4e00\u4f5c\uff09AGIEval
(Zhong et al., 2023) \u7531\u4e00\u4e9b\u8003\u8bd5\u9898\u7ec4\u6210\uff0c\u9ad8\u8003\uff0cSAT\uff0cGRE ... \u7b49\u3002BIG-Bench Hard
(Suzgun et al., 2023) \u4e13\u95e8\u9009\u62e9\u4e86\u4e00\u4e9b\u8868\u73b0\u4e0d\u5982\u4eba\u7c7b\u597d\u7684 benchmark \u96c6\u5408\u8d77\u6765\u3002post-train \u9636\u6bb5\u7ed3\u675f\u65f6\uff0c\u6d4b\u8bd5\u7528\u7684 benchmark \u5982\u4e0b\uff1a
MMLU
(Hendrycks et al., 2021a) \u540c\u524d\u6587\u3002MMLU-Pro
(Wang et al., 2024b) \u540c\u524d\u6587\u3002IFEval
(Zhou et al., 2023) Instruction-following evaluation for LLMs\uff0c\u5b9a\u4e49\u4e86\u4e00\u7cfb\u5217\u201c\u53ef\u4ee5\u9a8c\u8bc1\u7684\u6307\u4ee4\u201d\uff0c\u6bd4\u5982\u201c\u5199 400 \u5b57\u201d\u201c\u81f3\u5c11\u8bf4 3 \u6b21\u5173\u952e\u8bcd\u201d\uff0c\u6d4b\u8bd5\u6a21\u578b\u9075\u5b88\u6307\u4ee4\u7684\u80fd\u529b\u3002GSM8K
(Cobbe et al., 2021) \u540c\u524d\u6587\u3002MATH
(Hendrycks et al., 2021b) \u540c\u524d\u6587\u3002GPQA
(Rein et al., 2023) graduate-level Google-proof QA benchmark\uff0c\u7531 biology, physics, chemistry \u9886\u57df\u7684\u4e13\u5bb6\u5199\u6210\u7684\u975e\u5e38\u96be\u7684\u95ee\u9898\u3002ARC-Challenge
(Clark et al., 2018) \u540c\u524d\u6587\u3002HumanEval
(Chen et al., 2021) \u540c\u524d\u6587\u3002MBPP
(Austin et al., 2021) \u540c\u524d\u6587\u3002HumanEval+
(Liu et al., 2024a) \u5c06 HumanEval \u6269\u5927\u4e86 80 \u500d\u505a\u6210\u4e86\u8fd9\u4e2a\u6570\u636e\u96c6\u3002MBPP EvalPlus (base)
(Liu et al., 2024a) \u5c06 MBPP \u6269\u5927\u4e86 35 \u500d\u505a\u6210\u4e86\u8fd9\u4e2a\u6570\u636e\u96c6\u3002MultiPL-E
(Cassano et al., 2023) \u6269\u5c55 HumanEval \u548c MBPP \u5230\u4e86 18 \u79cd\u7f16\u7a0b\u8bed\u8a00\u3002MGSM
(Shi et al., 2022) \u5c06 GSM8K \u6570\u636e\u96c6\u7ffb\u8bd1\u6210\u4e86 10 \u79cd\u6587\u5b57\u4e0d\u540c\u7684\u8bed\u8a00\u3002\uff08\u662f\u6211\u535a\u5bfc\u7684\u5de5\u4f5c\uff09Multilingual MMLU
(internal benchmark) \u5185\u90e8\u6570\u636e\u96c6\uff0c\u6ca1\u6709\u641c\u5230\uff0c\u53ef\u80fd\u6ca1\u6709\u516c\u5f00\u3002Nexus
(Srinivasan et al., 2023) \u5f88\u5947\u602a\uff0c\u8fd9\u4e2a\u6570\u636e\u96c6\u80fd\u641c\u5230\u7684\u6761\u76ee\u53ea\u6709 huggingface \u5e76\u4e14\u70b9\u5f00 404 \u4e86\u3002API-Bank
(Li et al., 2023b) \u7531 73 \u4e2a API \u5de5\u5177\u6784\u6210\uff0c\u6839\u636e\u6a21\u578b\u4ea7\u751f\u7684\u5bf9\u8bdd\u4e2d\u8c03\u7528 API \u7684\u60c5\u51b5\uff0c\u6d4b\u8bd5\u6a21\u578b\u662f\u5426\u80fd\u8c03\u7528\u3001\u68c0\u7d22+\u8c03\u7528\u3001\u89c4\u5212+\u68c0\u7d22+\u8c03\u7528 API\u3002API-Bench
(Patil et al., 2023) \u5206\u4e3a\u4e24\u4e2a subtask\uff1aquery-based API\uff08\u6839\u636e\u81ea\u7136\u8bed\u8a00\u63cf\u8ff0\u7684\u9700\u6c42\u8f93\u51fa API\uff09 \u548c code-based API\uff08\u6839\u636e\u6316\u53bb API \u7684\u4ee3\u7801\u586b\u7a7a\uff09\u3002\u5206\u4e3a Python \u548c Java \u8bed\u8a00\u7248\u672c\u3002BFCL
(Yan et al., 2024) Berkeley function calling leaderboard\uff0c\u591a\u7f16\u7a0b\u8bed\u8a00\uff0c\u4e14\u6709 function call \u7c7b\u578b\u7684\u6570\u636e\u3002ZeroSCROLLS
(Shaham et al., 2023) zero-shot benchmark for long text understanding\uff0c\u4e00\u4e2a\u7efc\u5408\u7684\u957f\u6587\u672c\u591a\u4efb\u52a1\u6570\u636e\u96c6\u3002Needle-in-a-Haystack
(Kamradt, 2023) \u5927\u6d77\u635e\u9488\u5b9e\u9a8c\u3002InfiniteBench
(Zhang et al., 2024) \u591a\u4efb\u52a1 100K token \u957f\u6587\u672c\u6570\u636e\u96c6\u3002\u5728\u8fd9\u4e9b benchmark \u4e0a\u6d4b\u8bd5\u65f6\uff0c\u7531\u4e8e\u5355\u6b21\u7ed3\u679c\u4e0d\u7a33\u5b9a\uff08\u5148\u524d\u6211\u4eec\u666e\u904d\u7684\u505a\u6cd5\u5e38\u5e38\u662f\u591a\u6b21\u7ed3\u679c\u6c42\u5e73\u5747\u503c\u7b49\uff09\uff0c\u672c\u6280\u672f\u62a5\u544a\u91c7\u7528 Maddan et al.(2024) \u63d0\u51fa\u7684 95% confidence interval (CIs) \u65b9\u6cd5\uff0c\u901a\u8fc7\u8ba1\u7b97\u7f6e\u4fe1\u533a\u95f4\u6765\u4f30\u8ba1\u65b9\u5dee\u3002\u8fd9\u4e2a\u65b9\u6cd5\u5047\u8bbe\u6d4b\u8bd5\u5f97\u5230\u7684\u6570\u503c\u670d\u4ece\u6b63\u6001\u5206\u5e03\uff0c\u5982\u679c\u5355\u6b21\u6d4b\u8bd5\u5f97\u5230\u7684\u6570\u503c\u4e3a S\uff0c\u6570\u636e\u96c6\u5927\u5c0f\u4e3a N\uff0c\u90a3\u4e48\u7f6e\u4fe1\u533a\u95f4\u4e3a
\\[ CI(S) = 1.96 \\times \\sqrt{\\frac{S \\times (1 - S)}{N}} \\]\u7531\u7f6e\u4fe1\u533a\u95f4\u5bbd\u5ea6\u9664\u4ee5\u4e34\u754c\u503c 1.96 \u53ef\u4ee5\u5f97\u5230\u6807\u51c6\u5dee -> \u65b9\u5dee\u3002
post-train \u5b8c\u6210\u540e\uff0c\u7ed3\u679c\u7684\u603b\u8868\u5982\u4e0b
\u53ef\u4ee5\u770b\u51fa\u5176\u5b9e Llama-3.1-405B \u5728 70B \u4e0a\u6709\u63d0\u5347\uff0c\u4f46\u76f8\u6bd4\u53c2\u6570\u91cf\u7684\u63d0\u5347\uff0c\u6027\u80fd\u63d0\u5347\u5e76\u4e0d\u662f\u5f88\u5927\uff0c\u5f88\u591a benchmark \u4e0a\u90fd\u5728 2-3 \u4e2a\u70b9\u3002\u8003\u8651\u5230\u524d\u9762\u63d0\u5230\u53ef\u80fd 405B \u53ef\u80fd\u8bad\u7ec3\u4e86 MoE \u548c dense Transformer \u4e24\u4e2a\u6a21\u578b\u4f46\u662f\u540e\u8005\u6ca1\u8bad\u6210\u529f\uff0c\u4e0d\u77e5\u9053\u53d1\u5e03\u7248 405B \u6027\u80fd\u6bd4\u9884\u671f\u4f4e\u662f\u4e0d\u662f\u4e5f\u662f\u8fd9\u4e2a\u539f\u56e0\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_5","title":"\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/llama3_405b/#pre-train","title":"Pre-train \u9884\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/llama3_405b/#_6","title":"\u6574\u4f53\u95ee\u9898","text":"\u9884\u8bad\u7ec3\u7275\u626f\u5230\u7684\u95ee\u9898\u6709\u56db\u5757\uff1a
\u9884\u8bad\u7ec3\u5927\u7ea6\u7528\u4e86\u534a\u5e74\uff0c\u8c03\u53c2\u662f\u5e74\u521d\u5f00\u59cb\u7684\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_7","title":"\u6570\u636e\u6e05\u6d17","text":"\u7528\u5230\u7684\u6570\u636e\u662f\u5728\u4e92\u8054\u7f51\u4e0a common crawl \u4e0b\u6765\u7684\u622a\u81f3 2023 \u5e74\u7684\u6570\u636e\uff0c\u4e4b\u540e\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u3002\u6570\u636e\u7684\u9009\u7528\u4e00\u822c\u5c5e\u4e8e\u516c\u53f8\u79d8\u5bc6\uff0c\u4e0d\u80fd\u8bb2\u592a\u6e05\u695a\u3002\u6e05\u6d17\u7684\u6b65\u9aa4\u867d\u7136\u4e5f\u6ca1\u6709\u8bb2\uff0c\u4e0d\u8fc7\u5927\u81f4\u9075\u5faa\uff081\uff09\u627e\u4e00\u6279\u6570\u636e\u89c2\u5bdf\u5927\u591a\u662f\u5982\u4f55\u810f\u7684 -> \uff082\uff09\u5199\u811a\u672c\u6d17\u6389\u8fd9\u79cd\u7279\u70b9 -> \uff083\uff09\u8fd4\u56de\uff081\uff09\u5faa\u73af\u3002\u6709\u660e\u786e\u8bb2\u7684\u6570\u636e\u6e05\u6d17\u539f\u5219/\u7c7b\u522b\u6709\u4ee5\u4e0b\u51e0\u6761\uff1a
\u6d17\u6389 personally identifiable information (PII) \u5373\u4e00\u4e9b\u4e2a\u4eba\u59d3\u540d\u3001\u90ae\u7bb1\u3001url\uff0c\u548c\u6210\u4eba\u5185\u5bb9\uff1b\u4f46\u674e\u6c90\u8868\u793a\u8fd9\u4e24\u79cd\u4e1c\u897f\u4e5f\u4e0d\u4f1a\u6d17\u592a\u5e72\u51c0\uff0c\u524d\u8005\u6d17\u592a\u5e72\u51c0\u4e86\u53ef\u80fd\u4f1a\u4f7f\u8bad\u7ec3\u6587\u6863\u672c\u8eab\u7684\u610f\u601d\u6709\u53d8\u5316\uff0c\u540e\u8005\u592a\u5e72\u51c0\u4e86\u53ef\u80fd\u6a21\u578b\u5728\u4e00\u4e9b\u6253\u64e6\u8fb9\u7403\u5e94\u7528\u4e0a\u6548\u679c\u4e0d\u592a\u597d\uff0c\u6240\u4ee5\u505a\u6cd5\u53ef\u80fd\u662f\u5bf9\u6587\u6863\u9274\u5b9a\u4e00\u4e2a\u767e\u5206\u6bd4\uff0c\u5982\u679c\u5176\u4e2d\u9700\u8981\u6d17\u6389\u7684\u5185\u5bb9\u5360\u6bd4\u592a\u591a\uff0c\u5219\u4e0d\u8981\u4e86\u3002
\u5728\u7ed3\u6784\u5316\u6587\u6863\u4e2d\u63d0\u53d6\u6587\u672c\uff0c\u6bd4\u5982\u53bb\u6389 html \u548c markdown \u7684\u6807\u7b7e\uff0c\u53ea\u4fdd\u7559\u6587\u672c\u3002
\u5206\u522b\u505a\u4e86 url\u3001\u6587\u6863\u548c\u884c\u7ea7\u522b\u7684\u53bb\u91cd\u3002\u5728 url \u7ea7\u522b\uff0c\u4fdd\u7559\u4e86\u6240\u6709\u9875\u9762\u6700\u65b0\u7684\u7248\u672c\uff1b\u5728\u6587\u6863\u7ea7\u522b\uff0c\u4f7f\u7528\u4e86 MinHash \u7b97\u6cd5\uff1b\u5728\u884c\u7ea7\u522b\uff0c\u5c06\u6bcf 30M \u91cc\u8d85\u8fc7 6 \u6b21\u7684\u884c\u53bb\u9664\u6389\u4e86\uff0c\u8fd9\u663e\u8457\u63d0\u5347\u4e86\u8bc4\u6d4b\u8868\u73b0\u3002
\u5176\u4e2d MinHash \u7b97\u6cd5\u662f\u4e00\u79cd\u5feb\u901f\u6bd4\u8f83\u4e24\u4e2a\u96c6\u5408\u76f8\u4f3c\u5ea6\u7684\u7b97\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7\u6bd4\u8f83\u5355\u8bcd\u76f8\u4f3c\u5ea6\u6765\u5b9e\u73b0\u6587\u672c\u805a\u7c7b\u3002\u5b83\u9884\u8bbe\u4e24\u4e2a\u6587\u672c\u7684\u76f8\u4f3c\u5ea6\u662f\u901a\u8fc7\u8ba1\u7b97\u8bcd\u96c6 A \u548c\u8bcd\u96c6 B \u7684 Jaccard \u76f8\u4f3c\u5ea6 $ J(A, B) = \\frac{| A \\cap B |}{| A \\cup B |} $\u3002\u76ee\u7684\u662f\u4e0d\u9700\u8981\u5b9e\u9645\u8ba1\u7b97\u4e24\u4e2a\u96c6\u5408\u7684\u4ea4\u548c\u5e76\u3002\u5177\u4f53\u6211\u8ba4\u4e3a\u8fd9\u7bc7\u5e16\u5b50\u8bb2\u5f97\u5f88\u6e05\u6670 LSH\u7cfb\u52172\uff1aMinHash&LSH\u2014\u2014\u6587\u6863\uff08\u96c6\u5408\uff09\u76f8\u4f3c\u6027\u3002
\u542f\u53d1\u5f0f\u8fc7\u6ee4\uff0c\u8fc7\u6ee4\u4e86\u4ee5\u4e0b\u4e09\u79cd\u5185\u5bb9\uff1a\u7528 n-gram \u8fc7\u6ee4\u4e86\u4e00\u4e9b\u884c\u91cd\u590d\u6ca1\u53bb\u6389\u7684\u5185\u5bb9\uff0c\u7528\u810f\u8bcd\u8868\u8fc7\u6ee4\u810f\u8bcd\uff0c\u7528 K-L \u6563\u5ea6\u8fc7\u6ee4\u5206\u5e03\u592a\u7279\u6b8a\u7684 token\u3002
\u4ee3\u7801\u548c\u63a8\u7406\u6570\u636e\u3002\u4ece\u722c\u7684\u6570\u636e\u91cc\uff0c\u7528 fasttext \u6216 Llama 2 \u6765\u5224\u522b\u51fa\u4e00\u4e9b\u4ee3\u7801\u3001\u6570\u5b66\u7b49 STEM \u6587\u7ae0\u3002\u8fd9\u4e9b\u6587\u7ae0\u8fdb\u4e00\u6b65\u7528 DistlRoberta \u9009\u51fa\u4e86\u9ad8\u8d28\u91cf\u7684\u8bad\u7ec3\u6570\u636e\u3002
\u591a\u8bed\u8a00\u6570\u636e\u3002\u7528 fasttext \u4ece\u722c\u4e0b\u6765\u7684\u6570\u636e\u4e2d\u8bc6\u522b\u51fa\u4e86 176 \u79cd\u8bed\u8a00\uff0c\u8fd9\u4e9b\u591a\u8bed\u8a00\u6570\u636e\u4e5f\u8fdb\u884c\u4e86\u53bb\u91cd\u3001\u7b5b\u9009\u7b49\u6e05\u6d17\u6b65\u9aa4\u3002
\u5982\u4f55\u51b3\u5b9a\u8bad\u7ec3\u6570\u636e\u7684\u5206\u5e03\u6bd4\u4f8b\uff1a
\u77e5\u8bc6\u5206\u7c7b\u3002\u901a\u8fc7\u4e00\u4e2a\u5206\u7c7b\u5668\u5bf9\u6587\u7ae0\u6240\u5c5e\u7684\u77e5\u8bc6\u79cd\u7c7b\u8fdb\u884c\u5206\u7c7b\uff0c\u4e4b\u540e\u51cf\u5c11\u90a3\u4e9b\u5206\u5e03\u8fc7\u591a\u4f46\u5bf9\u6a21\u578b\u6548\u679c\u5e2e\u52a9\u4e0d\u5927\u7684\u7c7b\u522b\uff0c\u6bd4\u5982\u827a\u672f\u3001\u5a31\u4e50\u3002
scaling law\u3002\u7528\u4e00\u79cd\u6df7\u5408\u6bd4\u4f8b\u5148\u8bad\u7ec3\u4e00\u4e2a\u5c0f\u7684\u6a21\u578b\uff0c\u6d4b\u8bd5\u8868\u73b0\uff0c\u7528 scaling law \u8ba1\u7b97\u51fa\u5728\u66f4\u5927\u6a21\u578b\u4e0a\u4f7f\u7528\u8be5\u6df7\u5408\u6bd4\u4f8b\u7684\u8868\u73b0\uff0c\u8fdb\u800c\u786e\u5b9a\u6df7\u5408\u6bd4\u4f8b\u3002
\u8bad\u7ec3\u6570\u636e\u6df7\u5408\u6bd4\u4f8b\u7684\u603b\u7ed3\uff1a
\u53ef\u89c1\u591a\u8bed\u8a00\u6570\u636e\u4e0d\u9700\u8981\u592a\u591a\uff0c\u4e3b\u8981\u77e5\u8bc6\u7528\u82f1\u8bed\u5b66\u8fc7\u540e\u53ef\u4ee5\u6cdb\u5316\u5230\u5176\u5b83\u8bed\u8a00\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_9","title":"\u9000\u706b","text":"\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u968f\u7740\u6a21\u578b\u9010\u6e10\u63a5\u8fd1\u8bad\u7ec3\u5b8c\u6210\uff0c\u9010\u6e10\u964d\u4f4e\u5bf9\u65b0\u6570\u636e\u7684\u6743\u91cd\uff0c\u53ef\u4ee5\u8ba9\u6a21\u578b\u66f4\u52a0\u7a33\u5b9a\u5730\u9002\u5e94\u65b0\u6570\u636e\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6a21\u578b\u53c2\u6570\u5267\u70c8\u6ce2\u52a8\u3002\u968f\u7740\u5b66\u4e60\u7387\u964d\u4f4e\uff0c\u53ea\u6709\u9ad8\u8d28\u91cf\u7684\u6570\u636e\u624d\u80fd\u663e\u8457\u63d0\u5347\u6a21\u578b\u7684\u6027\u80fd\u3002\u56e0\u6b64\u9000\u706b\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u6709\u6548\u7684\u65b9\u6cd5\u6765\u8bc4\u4f30\u5c0f\u578b\u7279\u5b9a\u9886\u57df\u6570\u636e\u96c6\u7684\u4ef7\u503c\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#model-architecture","title":"Model Architecture \u6a21\u578b\u67b6\u6784","text":"\u6027\u80fd\u7684\u63d0\u5347\u4e3b\u8981\u6765\u6e90\u4e8e\u6570\u636e\u8d28\u91cf\u7684\u63d0\u9ad8\u548c\u6a21\u578b\u66f4\u5927\u4e86\u3002
\u6a21\u578b\u4e0e\u4e4b\u524d\u7684\u533a\u522b\uff1agroup query attention (GQA) \u53ef\u4ee5\u5e26\u6765\u5185\u5b58\u7684\u8282\u7701\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#post-train","title":"Post-train \u5fae\u8c03","text":"TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_10","title":"\u591a\u6a21\u6001\u80fd\u529b","text":"\u89c6\u9891/\u56fe\u50cf\u80fd\u529b\u7684\u8bad\u7ec3\u5728\u6587\u5b57\u80fd\u529b\u8bad\u7ec3\u7ed3\u675f\u4e4b\u540e\uff0c\u6709\u989d\u5916\u7684 encoder \u548c decoder\uff0c\u8bad\u7ec3\u65f6\u5c06\u6587\u5b57\u80fd\u529b\u7684\u6743\u91cd\u51bb\u7ed3\uff0c\u53ea\u8c03\u5176\u5b83\u6a21\u6001\u7684\u53c2\u6570\u3002
TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_11","title":"\u76f8\u5173\u5de5\u4f5c","text":"TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_12","title":"\u53c2\u8003\u8d44\u6599","text":":material-circle-edit-outline: \u7ea6 1080 \u4e2a\u5b57 :fontawesome-solid-code: 15 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/3-dl/survey/math-word-problem/#an-introduction-to-math-word-problems","title":"An Introduction to Math Word Problems","text":"The math word problem (MWP) aims to solve simple primary school math problems (in plain-text format) with deep learning methods. The problems usually consists of numbers no larger than 100 and only 5 operators (+, -, *, / and =). This blog is structured as follows. The Dataset part will introduce two main types, one indicating the locations of variables, and the other simply embedding the math formula within the natural language texts. The Methods parts will introduce several prevailing methods in solving this task, including both the models and workflows that improves the accuracy of models.
"},{"location":"docs/3-dl/survey/math-word-problem/#surveys","title":"Surveys","text":""},{"location":"docs/3-dl/survey/math-word-problem/#the-gap-of-semantic-parsing-a-survey-on-automatic-math-word-problem-solvers-2019","title":"The Gap of Semantic Parsing: A Survey on Automatic Math Word Problem Solvers (2019)","text":"This survey provides a comprehensive introduction to the MWP datasets and methods prior to 2019. This survey defines three stages of MWP solving, the Rule-based matching stage (1960-2010), Semantic parsing, feature engineering and statistical learning stage (2011-2017), and Deep learning and reinforcement learning stage (2017-2019).
"},{"location":"docs/3-dl/survey/math-word-problem/#towards-tractable-mathematical-reasoning-challenges-strategies-and-opportunities-for-solving-math-word-problems-2021","title":"Towards Tractable Mathematical Reasoning: Challenges, Strategies, and Opportunities for Solving Math Word Problems (2021)","text":"This survey introduces the contemporary MWP datasets til 2021, and methods including rule-based, and neural network encoder-decoder structures. Specifically, this paper concludes three strategies for math word solving, (i) direct answer generation, (ii) expression tree generation for inferring answers, and (iii) template retrieval for answer computation. Considering the type of problem solving method, this paper concludes two classes. The first class is non-neural approaches (rule-base or pattern matching approaches, semantic parsing, and statistical machine learning approaches), within which a particular strategy of applying domain knowledge in classifying the problems (e.g. into change, part-whole and compare classes). The second class is neural approaches, including intuitions of (i) predicting the answer directly (ii) generating a set of equations or mathematical expressions and inferring answers from the by executing them (iii) retrieving the templates from a pool of templates derived from training data and augmenting numerical quantities to compute the answer. These neural approaches generally follow encoder-decoder architectures, which fall in four types (i) seq-to-seq (ii) Transformer-to-tree (iii) seq-to-tree (iv) graph-to-tree. Among the four methods, the tree-structured decoder attend both parents and siblings to generate the next token, while the bottom-up representation of sub-tree of a sibling could further help to derive better outcomes. The graph-based encoder aims to learn different types of relationships among the constituents of MWPs. This section also mentions that \"Data augmentation is a popular preprocessing technique to increase the size of training data\" (reverse operation-based augmentation techniques, different traversal orders of expression trees, and weak supervision). In section Math Reasoning in Neural Approaches, this paper mentions several further topics under math reasoning, interpretability and explainability, infusing explicit and definitive knowledge, and reinforcement learning.
"},{"location":"docs/3-dl/survey/math-word-problem/#datasets","title":"Datasets","text":""},{"location":"docs/3-dl/survey/math-word-problem/#mawps-a-math-word-problem-repository-2016","title":"MAWPS: A Math Word Problem Repository (2016)","text":"sroy9/mawps: Code for MAWPS: A Math Word Problem Repository (github.com) The data format is as follows.
[\n{\n\"iIndex\": 1,\n\"sQuestion\": \"Joan found 70.0 seashells on the beach. She gave Sam some of her seashells . She has 27.0 seashells . How many seashells did she give to Sam ?\",\n\"lEquations\": [\"X=(70.0-27.0)\"],\n\"lSolutions\": [43.0]\n},\n]\n
"},{"location":"docs/3-dl/survey/math-word-problem/#math23k-deep-neural-solver-for-math-word-problems-2017","title":"Math23k: Deep Neural Solver for Math Word Problems (2017)","text":"Deep Neural Solver for Math Word Problems (aclanthology.org) This dataset is in Chinese.
Problem: Dan have 2 pens, Jessica have 4 pens. How many pens do they have in total ? \nEquation: x = 4+2 \nSolution: 6\n
"},{"location":"docs/3-dl/survey/math-word-problem/#mathqa-2019","title":"MathQA (2019)","text":"MathQA-Dataset (math-qa.github.io) This paper proposes a math dataset which enhances the AQuA dataset by providing fully-specified operational programs. This dataset has a diverse range of operators.
"},{"location":"docs/3-dl/survey/math-word-problem/#math-2021","title":"MATH (2021)","text":"arxiv.org/pdf/2103.03874.pdf MATH is a LaTeX format dataset, with its answer highlighted in a square block.
"},{"location":"docs/3-dl/survey/math-word-problem/#svmap","title":"SVMAP","text":"arkilpatel/SVAMP: NAACL 2021: Are NLP Models really able to Solve Simple Math Word Problems? (github.com) This dataset does not distinguish the data with the texts. An example data is as follows.
"},{"location":"docs/3-dl/survey/math-word-problem/#gsm8k-grade-school-math-2021","title":"GSM8k: grade school math (2021)","text":"Collected by OpenAI, this dataset consists of math problems in natural language descriptions, with the math formulas highlighted with special notes.The numbers are not explicitly highlighted with special symbols. Several examples of the data format are as follows.
"},{"location":"docs/3-dl/survey/math-word-problem/#draw","title":"DRAW","text":"Providing 1000 grounded word problems.
"},{"location":"docs/3-dl/survey/math-word-problem/#algebra","title":"Algebra","text":""},{"location":"docs/3-dl/survey/math-word-problem/#asdiv","title":"AsDiv","text":""},{"location":"docs/3-dl/survey/math-word-problem/#multiarith","title":"MultiArith","text":""},{"location":"docs/3-dl/survey/math-word-problem/#singleeq","title":"SingleEq","text":""},{"location":"docs/3-dl/survey/math-word-problem/#methods","title":"Methods","text":""},{"location":"docs/3-dl/survey/math-word-problem/#models","title":"Models","text":"Prior to 2017, the models for solving MWP are mainly concerning with neural networks. After Transformer has been released in 2017, attention-based models have been thriving. The novel models based on Transformer are mainly modifying the encoder and decoder structures, among which there are graph-encoder and tree-decoders.
"},{"location":"docs/3-dl/survey/math-word-problem/#graph-to-tree-learning-for-solving-math-word-problems-2020","title":"Graph-to-Tree Learning for Solving Math Word Problems (2020)","text":"This paper proposes a attention-based model Graph2Tree, consisting of graph-based encoder and a tree-based decoder. The math word problems are constructed into Quantity Comparison Graph.
"},{"location":"docs/3-dl/survey/math-word-problem/#math-word-problem-solving-with-explicit-numerical-values-2021","title":"Math Word Problem Solving with Explicit Numerical Values (2021)","text":"A novel approach called NumS2T is proposed to solve MWP. NumS2T is constructed with (a) an attention-based seq2seq model to generate its math expressions, (b) a numerical value encoder to obtain the number-aware problem state which are then concatenated with the problem hidden state in (a) to obtain number-aware problem representation, and (c) a numerical properties prediction mechanism for comparing the paired numerical values, determining the category of each numeral and measuring whether they should appear in the target expression.!
"},{"location":"docs/3-dl/survey/math-word-problem/#learning-to-reason-deductively-math-word-problem-solving-as-complex-relation-extraction-2022","title":"Learning to Reason Deductively: Math Word Problem Solving as Complex Relation Extraction (2022)","text":"This paper proposes a novel approach
"},{"location":"docs/3-dl/survey/math-word-problem/#workflows","title":"Workflows","text":"Most of the recent works follow the method of knowledge distilling, which means to generate high quality data with LLMs and then train a small model with the generated (and sometimes then augmented) data. The workflow of such tasks mainly assembles that of the following paper.
"},{"location":"docs/3-dl/survey/math-word-problem/#large-language-models-are-reasoning-teachers","title":"Large Language Models Are Reasoning Teachers","text":"This paper proposes a knowledge distilling method in solving math reasoning problems.
"},{"location":"docs/3-dl/survey/math-word-problem/#solving-math-word-problems-via-cooperative-reasoning-induced-language-models-acl-2023","title":"Solving Math Word Problems via Cooperative Reasoning induced Language Models (ACL 2023)","text":"This paper develops a cooperative reasoning-induced PLM for solving MWPs called Cooperative Reasoning (CoRe), with a generator to generate reasoning paths and a verifier to supervise the evaluation.
"},{"location":"docs/3-dl/survey/math-word-problem/#scaling-relationship-on-learning-mathematical-reasoning-with-large-language-models-2023","title":"Scaling Relationship on Learning Mathematical Reasoning with Large Language Models (2023)","text":"This paper mainly focus on the following two questions: (i) Which is a better performance indicator of LLMs? (pre-training loss amount/model size) (ii) How to improve small model's performance by data augmentation? To answer the second question, this paper proposes a novel methods in data augmentation in the LLM data generation step which is called Rejection Finetuning (RFT). The algorithm of sampling data in RFT mainly adopts the thought of rejection sampling, which is expressed in the following pseudo-code. This paper assumes such an algorithm will yield as many as possible diverse reasoning paths. The workflow of the RFT method is illustrated as follows, where the SFT stands for supervised finetuning. With the novel method RFT, small models such as Llama-7b yields an accuracy of at most 49.7% on GSM8k, 14% higher than the previous SOTA method SFT.
"},{"location":"docs/3-dl/survey/math-word-problem/#pal","title":"PAL","text":"This work is a prompt engineering work.
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? \nA: Roger started with 5 tennis balls. tennis_balls = 5 2 cans of 3 tennis balls each is bought_balls = 2 * 3 tennis balls. The answer is answer = tennis_balls + bought_balls \nQ: The bakers at the Beverly Hills Bakery baked 200 loaves of bread on Monday morning. They sold 93 loaves in the morning and 39 loaves in the afternoon. A grocery store returned 6 unsold loaves. How many loaves of bread did they have left?\n
A: The bakers started with 200 loaves loaves_baked = 200 They sold 93 in the morning and 39 in the afternoon loaves_sold_morning = 93 loaves_sold_afternoon = 39 The grocery store returned 6 loaves. loaves_returned = 6 The answer is answer = loaves_baked - loaves_sold_morning - loaves_sold_afternoon + loaves_returned\n
"},{"location":"docs/3-dl/survey/math-word-problem/#preview","title":"Preview","text":""},{"location":"docs/3-dl/survey/multilingual/","title":"Multilingual Task Survey","text":":material-circle-edit-outline: \u7ea6 768 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/3-dl/survey/multilingual/#introduction","title":"Introduction","text":"\u591a\u8bed\u8a00\u6a21\u578b multilingual models \u5c31\u662f\u80fd\u89e3\u51b3\u591a\u8bed\u8a00\u4efb\u52a1\u7684\u6a21\u578b\u3002\u5728\u4e3b\u6d41\u8bad\u7ec3\u6570\u636e\u662f\u82f1\u8bed\u3001\u7a00\u6709\u8bed\u8a00\u6570\u636e\u7a00\u7f3a\u7684\u80cc\u666f\u4e0b\uff0c\u5982\u4f55\u5c06\u6a21\u578b\u80fd\u529b\u6cdb\u5316\u5230\u7a00\u6709\u8bed\u8a00\u662f\u91cd\u8981\u7684\u95ee\u9898\u3002\u9664\u4e86\u6700\u8fd1\u7684\u5927\u8bed\u8a00\u6a21\u578b\u5916\uff0c\u8fd8\u4f1a\u4ecb\u7ecd\u4f20\u7edf\u65b9\u6cd5\u548c\u4f20\u7edf\u6a21\u578b\u3002
"},{"location":"docs/3-dl/survey/multilingual/#survey","title":"Survey","text":""},{"location":"docs/3-dl/survey/multilingual/#a-survey-on-large-language-models-with-multilingualism-recent-advances-and-new-frontiers-2024","title":"A Survey on Large Language Models with Multilingualism: Recent Advances and New Frontiers (2024)","text":""},{"location":"docs/3-dl/survey/multilingual/#_1","title":"\u7b80\u4ecb","text":"\u672c\u6587\u4ecb\u7ecd\u591a\u8bed\u8a00\u5927\u8bed\u8a00\u6a21\u578b\u7684\u8bad\u7ec3\u3001\u4f7f\u7528\u3001\u6311\u6218\u3001\u672a\u6765\u7814\u7a76\u65b9\u5411\u7b49\u3002\u7531 Beijing Jiaotong University, University of Montreal \u548c Tsinghua University \u53d1\u5e03\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_2","title":"\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/multilingual/#_3","title":"\u6709\u591a\u8bed\u8a00\u80fd\u529b\u7684\u5927\u8bed\u8a00\u6a21\u578b\u6982\u89c8","text":""},{"location":"docs/3-dl/survey/multilingual/#_4","title":"\u591a\u8bed\u8a00\u63a8\u7406\u7b56\u7565","text":""},{"location":"docs/3-dl/survey/multilingual/#_5","title":"\u5b89\u5168\u6027","text":""},{"location":"docs/3-dl/survey/multilingual/#_6","title":"\u591a\u9886\u57df\u591a\u8bed\u8a00\u5927\u8bed\u8a00\u6a21\u578b","text":""},{"location":"docs/3-dl/survey/multilingual/#_7","title":"\u591a\u8bed\u8a00\u6570\u636e\u8d44\u6e90","text":""},{"location":"docs/3-dl/survey/multilingual/#_8","title":"\u591a\u8bed\u8a00\u8bc4\u6d4b","text":""},{"location":"docs/3-dl/survey/multilingual/#_9","title":"\u504f\u89c1\u548c\u516c\u5e73\u6027","text":""},{"location":"docs/3-dl/survey/multilingual/#models","title":"Models","text":""},{"location":"docs/3-dl/survey/multilingual/#datasets","title":"Datasets","text":""},{"location":"docs/3-dl/survey/multilingual/#studies","title":"Studies","text":""},{"location":"docs/3-dl/survey/multilingual/#do-llamas-work-in-english-2024-epfl","title":"Do Llamas Work in English? (2024, EPFL)","text":"\u731c\u60f3\uff1a\u591a\u8bed\u8a00\u6a21\u578b\uff08\u6bd4\u5982 Llama\uff09\u5728\u4f7f\u7528\u4ee5\u82f1\u8bed\u4e3a\u4e3b\u7684\u8bed\u6599\u8fdb\u884c\u8bad\u7ec3\u65f6\uff0c\u4f1a\u5c06\u82f1\u8bed\u4f5c\u4e3a\u4e00\u79cd\u601d\u8003\u7684\u4e2d\u95f4\u6b65\u9aa4 pivot language\u3002
\u5b9e\u9a8c\u65b9\u6cd5\uff1a\u5bf9 Llama-2 \u7cfb\u5217\u6a21\u578b\uff0c\u8bbe\u8ba1\u6570\u636e\u5bf9 (\u975e\u82f1\u8bed\u63d0\u793a\u8bcd\uff0cnext token)\u3002\u4ece\u9876\u5c42\u5411\u91cf\u7a7a\u95f4 high-dimensional space \u63a2\u7d22\u4e2d\u95f4\u5d4c\u5165 intermediate embeddings \u5982\u4f55\u8ba1\u7b97\u4e0b\u4e00\u4e2a\u5355\u8bcd\u7684\u89c4\u5f8b\u3002
\u53d1\u73b0\u4e09\u4e2a\u9636\u6bb5\uff1a
\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1aimtermediate embedding \u6240\u4ee3\u8868\u7684\u62bd\u8c61\u6982\u5ff5\u7a7a\u95f4 concept space \u66f4\u63a5\u8fd1\u82f1\u8bed\uff0c\u53ef\u80fd\u5bfc\u81f4\u591a\u8bed\u8a00\u6a21\u578b\u4e2d\u7684\u504f\u89c1\u95ee\u9898\u3002
"},{"location":"docs/3-dl/survey/multilingual/#language-specific-neurons-the-key-to-multilingual-capability-in-large-language-models-2024-ruc","title":"Language-Specific Neurons: The Key to Multilingual Capability in Large Language Models (2024, RUC)","text":""},{"location":"docs/3-dl/survey/multilingual/#_10","title":"\u80cc\u666f","text":"\u8bc6\u522b\u591a\u8bed\u8a00\u5927\u6a21\u578b\u91cc\uff0c\u4ea7\u751f\u7279\u5b9a\u8bed\u8a00\u80fd\u529b\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u975e\u5e38 challenging\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_11","title":"\u65b9\u6cd5","text":"\u63d0\u51fa\u4e86 language activation probability entropy (LAPE) \u6765\u68c0\u6d4b\u5927\u8bed\u8a00\u6a21\u578b\u4e0d\u540c\u8bed\u8a00\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u3002
LAPE: \u4e3a\u4e86\u51cf\u5c11 RLHF \u53ef\u80fd\u5e26\u6765\u7684\u5bf9\u8bed\u8a00\u504f\u597d\u7684\u7684\u5f71\u54cd\uff0c\u4e3b\u8981\u5173\u6ce8\u9884\u8bad\u7ec3\u8fc7\u7684\u6a21\u578b\uff0c\u800c\u4e0d\u662f\u5fae\u8c03\u540e\u7684\u6a21\u578b\u3002
\u5bf9\u4e8e\u5728\u7b2c i \u5c42\u7684\u7b2c j \u4e2a neuron\uff0c\u5b9a\u4e49\u5728\u8bed\u8a00 k \u4e0a\u7684\u6fc0\u6d3b\u6982\u7387 activation probability
\\[ p_{i,j}^k = E(I(act_fn(\\tilde{h}^iW_1^i)_j \\lt 0 | language\\spacek)) \\]I \u662f indicator function\uff08\u5f53\u7ed9\u5b9a\u6761\u4ef6\u4e3a\u771f\u65f6\uff0c\u6307\u793a\u51fd\u6570\u7684\u503c\u4e3a 1\uff1b\u5f53\u7ed9\u5b9a\u6761\u4ef6\u4e3a\u5047\u65f6\uff0c\u6307\u793a\u51fd\u6570\u7684\u503c\u4e3a 0\uff09\u3002
\u4ee5\u6b64\u53ef\u4ee5\u83b7\u5f97\u6bcf\u4e2a\u795e\u7ecf\u5143\u5bf9\u8bed\u8a00\u7684\u5206\u5e03
\\[ p_{i,j} = (p_{i,j}^1, ... , p_{i,j}^k, ... , p_{i,j}^l) \\]\u5b9a\u4e49\u4e0a\u8ff0\u5206\u5e03\u7684\u71b5\u4e3a language activation probability entropy (LAPE) \u3002
\\[ LAPE_{i,j} = -\\sum^{l}_{k=1} p^{\\prime k}_{i,j} log(p^{\\prime k}_{i,j}) \\]\u4f7f\u7528 Llama-2, BLOOM, Mistral \u548c Phi-2 \u8fdb\u884c\u5b9e\u9a8c\uff0c\u53d1\u73b0\u8fd9\u4e9b\u795e\u7ecf\u5143\u4e3b\u8981\u5728\u9876\u5c42\u548c\u5e95\u5c42 embedding \u4e0a\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_12","title":"\u53d1\u73b0","text":":material-circle-edit-outline: \u7ea6 13 \u4e2a\u5b57
Any tool recommendations, or any tutorial or tutorial remmondations.
"},{"location":"docs/3-dl/tools/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 2098 \u4e2a\u5b57 :fontawesome-solid-code: 82 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f
"},{"location":"docs/3-dl/tools/codabench/#_1","title":"\u7b80\u4ecb","text":"Codabench \u662f\u4e00\u4e2a\u4e3a\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u6bd4\u8d5b\u8bbe\u8ba1\u7684\u4f4e\u4ee3\u7801\u6a21\u578b\u6d4b\u8bd5\u5e73\u53f0\u3002\u5e73\u53f0\u63d0\u4f9b CPU\uff0c\u5141\u8bb8\u6bd4\u8d5b\u521b\u529e\u8005\u901a\u8fc7\u4e0a\u4f20\u811a\u672c\u548c\u6570\u636e\u7684\u65b9\u5f0f\u521b\u529e\u6bd4\u8d5b\uff0c\u5e76\u5141\u8bb8\u5176\u5b83\u7528\u6237\u4f7f\u7528\u5e73\u53f0 CPU \u6765\u8fd0\u884c\u4ee3\u7801\u5f97\u5230\u7ed3\u679c\u3002\u524d\u5e8f\u5de5\u4f5c\u662f CodaLab\uff0c2023 \u5e74 Codabench \u56e2\u961f\u4eff\u7167 CodaLab \u6539\u8fdb\u51fa\u4e86 Codabench\u3002
Codabench \u7684\u4f18\u70b9\u662f\u63d0\u4f9b\u516c\u5171 CPU\uff0c\u4f7f\u6bd4\u8d5b\u521b\u529e\u65b9\u5728\u5c06\u6b63\u786e\u7b54\u6848\u4fdd\u5bc6\u7684\u60c5\u51b5\u4e0b\uff0c\u4e0d\u5fc5\u4eb2\u624b\u6536\u96c6\u53c2\u8d5b\u8005\u7684\u7b54\u6848\u5e76\u4e00\u4e00\u4eb2\u624b\u6d4b\u8bd5\uff0c\u800c\u662f\u5141\u8bb8\u7528\u6237\u81ea\u884c\u901a\u8fc7\u5e73\u53f0\u6d4b\u8bd5\u5e76\u5f97\u5230\u7ed3\u679c\uff0c\u51cf\u8f7b\u8d1f\u62c5\u3002\u800c\u7528\u6237\u4e5f\u53ef\u4ee5\u66f4\u8fc5\u901f\u77e5\u9053\u81ea\u5df1\u7684\u5206\u6570\uff0c\u4e0d\u5fc5\u7b49\u5f85\u6bd4\u8d5b\u65b9\u9a8c\u8bc1\u8fd9\u4e2a\u65f6\u95f4\u8f83\u957f\u7684\u6d41\u7a0b\u3002
"},{"location":"docs/3-dl/tools/codabench/#_2","title":"\u8fd0\u4f5c","text":"\u6bd4\u8d5b\u521b\u529e\u8005\u901a\u8fc7\u4e0a\u4f20\u6bd4\u8d5b\u914d\u7f6e\u540e\uff0c\u6bcf\u5f53\u6709\u7528\u6237\u52a0\u5165\u5e76\u63d0\u4ea4\u4e00\u4e2a\u8fd0\u884c\u8bf7\u6c42\uff0c\u5e73\u53f0\u5c06\u5728 CPU \u4e0a\u4e3a\u6bcf\u4e2a\u63d0\u4ea4\u521b\u5efa\u4e00\u4e2a Docker\uff0c\u5305\u542b\u6bd4\u8d5b\u521b\u529e\u8005\u63d0\u4f9b\u7684\u6bd4\u8d5b\u914d\u7f6e\u548c\u8be5\u7528\u6237\u63d0\u4ea4\u7684\u6570\u636e\uff0c\u5728 Docker \u4e2d\u8fd0\u884c\u6307\u5b9a\u8def\u5f84\u7684\u4ee3\u7801\uff0c\u5e76\u5c06\u7ed3\u679c\u663e\u793a\u5728\u5e73\u53f0\u5c55\u793a\u7684 terminal \u4e0a\u3002
"},{"location":"docs/3-dl/tools/codabench/#_3","title":"\u521b\u5efa","text":"\u5728 Codabench \u5b98\u7f51\u6ce8\u518c\u767b\u9646\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2 Benchmark
-> Management
\uff0c\u53ef\u4ee5\u9009\u62e9 Create
\u6216 Upload
\u6765\u521b\u5efa\u6bd4\u8d5b\u3002
Create
\u662f\u4f7f\u7528\u5e73\u53f0 UI \u521b\u5efa\u6bd4\u8d5bUpload
\u662f\u5728\u672c\u5730\u5199\u597d\u914d\u7f6e\u6587\u4ef6\uff0c\u76f4\u63a5\u4e0a\u4f20\u540e\u88ab\u89e3\u6790\u4e3a\u4e00\u4e2a\u6bd4\u8d5b\u66f4\u63a8\u8350\u7528 Upload
\u6765\u521b\u5efa\uff0c\u56e0\u4e3a UI \u7684\u7528\u6237\u63d0\u793a\u6bd4\u8f83\u6b20\u7f3a\u3002
'bundle' \u6307\u6bd4\u8d5b\u521b\u5efa\u8005\u4e0a\u4f20\u7684\u538b\u7f29\u6587\u4ef6\u3002\u91cc\u9762\u542b\u6709\uff1a
competition.yaml
\u662f\u6bd4\u8d5b\u7684 metadata\u9700\u8981\u671f\u5f85\u7528\u6237\u4e0a\u4f20\uff1a
\u4e0b\u9762\u4ecb\u7ecd\u51e0\u4e2a\u5b98\u65b9\u6587\u6863\u8bb2\u5f97\u4e0d\u592a\u6e05\u695a\u7684\u7ec6\u8282\u3002
"},{"location":"docs/3-dl/tools/codabench/#competitionyaml","title":"competition.yaml
\u6587\u4ef6","text":"competition.yaml
\u6587\u4ef6\u4e0d\u80fd\u6539\u540d\uff0c\u4e14\u5fc5\u987b\u4f4d\u4e8e .zip \u4e2d\u7684\u6700\u9876\u5c42\uff08\u5373\u591a\u9009 competition.yaml
\u548c\u5176\u5b83\u6587\u4ef6\u5939\u540e\u521b\u5efa .zip\uff0c\u800c\u975e\u628a\u542b\u6709 competition.yaml \u548c\u5176\u5b83\u6587\u4ef6\u5939\u7684\u4e0a\u5c42\u6587\u4ef6\u5939\u521b\u5efa\u4e3a .zip\uff09\u3002\u5177\u4f53\u5982\u56fe\u6240\u793a\u3002\u4e0b\u6587\u6240\u63d0\u5230\u7684\u65e0\u9876\u5c42\u6587\u4ef6\u5939 / \u6587\u4ef6\u4f4d\u4e8e\u538b\u7f29\u5305\u9876\u5c42\uff0c\u90fd\u662f\u6307\u5982\u56fe\u6240\u793a\u7684\u538b\u7f29\u5305\u7ed3\u6784\u3002
competition.yaml
\u652f\u6301\u7684\u5b57\u6bb5\u6709\uff1a
title: # \u6bd4\u8d5b\u540d\nversion: # 1 \u6307\u662f CodaLab bundle\uff0c2 \u6307 CodaBench bundle\uff0c\u533a\u522b\u662f\u6709\u4e9b competition.yaml \u5b57\u6bb5\u4e0d\u517c\u5bb9\ndescription: # \u6bd4\u8d5b\u63cf\u8ff0\nimage: # \u6bd4\u8d5b logo.png\nregistration_auto_approve: True # do not require approval from organizers to join\ndocker_image: codalab/codalab-legacy:py39 # the Docker image in which submissions are run\uff0c\u7528\u6b64 default \u5373\u53ef\nenable_detailed_results: True # \u4e0d\u660e\uff0c\u53ef\u4ee5 default\n# Documentation web pages\nterms: pages/terms.md # \u5fc5\u987b\u6709\u4e00\u4e2a terms\npages: # \u53ef\u4efb\u610f\u52a0\u9875\u9762\n- title: # e.g., Overview\nfile: # e.g., pages/overview.md\n# Definition of the tasks\ntasks:\n- index: 0\nname: # e.g., Development Task\ndescription: # \u63cf\u8ff0\nis_public: true # \u516c\u5f00\u53ef\u89c1\ninput_data: # e.g., feedback_phase/input_data, \u6b64\u5904\u53ca\u4e0b\u5217\u8def\u5f84\u9700\u8981\u586b\u5199\u6240\u4e0a\u4f20 bundle \u91cc\u7684\u8def\u5f84\uff0c\u800c\u975e\u6240\u751f\u6210 Docker \u4e2d\u7684\nreference_data: # e.g., feedback_phase/reference_data\nscoring_program: # e.g., scoring_program\ningestion_program: # e.g., ingestion_program\nsolutions: [] # \u4e0d\u660e\n# Sample code submission\nsolutions: # \u53ef\u80fd\u4f1a\u663e\u793a\u5728\u6bd4\u8d5b\u9996\u9875\u7684 resources \u5217\u8868\n- index: 0\ntasks:\n- 0\n- 1\npath: solution/\nphases:\n- index: 0\nname: # phase \u6807\u9898\ndescription: # \u63cf\u8ff0\nstart: 1-1-2024 # Month / Day / Year\nend: 1-30-2024 # end \u7ed3\u675f\u65f6\u95f4\u53ef\u4ee5\u7f3a\u5931\uff0c\u8868\u793a\u6c38\u8fdc\u53ef\u63d0\u4ea4\nmax_submissions_per_day: 5 # \u6700\u5927\u4f3c\u4e4e\u662f 100\uff1f\nmax_submissions: 100 # \u6700\u5927\u4f3c\u4e4e\u662f 10000\uff1f\nexecution_time_limit: 600 # \u6bcf\u6b21\u63d0\u4ea4\u5141\u8bb8\u7684\u6700\u957f\u8fd0\u884c\u65f6\u95f4\uff0c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u5c06\u663e\u793a run time exceed\ntasks: # \u4e0e\u8be5 phase \u5173\u8054\u7684 tasks\n- 0\nsolutions: []\nstarting_kit: # e.g., starting_kit, \u53ef\u80fd\u4f1a\u663e\u793a\u5728\u6bd4\u8d5b\u9996\u9875\u7684 resources \u5217\u8868\npublic_data: # e.g., starting_kit, feedback_phase/input_data\n# Fact sheets to add more information in the leaderboard\nfact_sheet: { # \u4f3c\u4e4e\u662f\u5c55\u793a\u5728 leaderboard \u4e2d\u652f\u6301\u7528\u6237\u4fee\u6539\u7684\u66f4\u591a\u4fe1\u606f\u3002`method_name` \u8be5\u5b57\u6bb5\u5e94\u4e0e\u4e0b\u65b9 `results` \u5e73\u7ea7\u3002\n\"method_name\": {\n\"key\": \"method_name\",\n\"type\": \"text\",\n\"title\": \"Method name\",\n\"selection\": \"\",\n\"is_required\": \"false\",\n\"is_on_leaderboard\": \"true\"\n}\n}\n# Leaderboard\nleaderboards:\n- index: 0\ntitle: Results # leaderboard \u7684 title\nkey: Results # `output.json` \u4e2d\u7528\u4e8e\u5b9a\u4f4d\u7684 key\nsubmission_rule: \"Force_Last\" # \u53ef\u4ee5\u53bb\u6389\uff0c\u9ed8\u8ba4\u4f3c\u4e4e\u662f\u5141\u8bb8\u5c55\u793a\u591a\u4e2a\u7ed3\u679c\ncolumns:\n- title: Average Accuracy # \u5728 output.json \u4e2d\uff0c\u8bfb\u53d6\u8be5 json \u7684\u54ea\u4e2a key\nkey: avg_accuracy # `output.json` \u4e2d\u7528\u4e8e\u5b9a\u4f4d\u7684 key\nindex: 0 # \u5c55\u793a\u5728 leaderboard \u8868\u683c\u4e2d\u7684\u7b2c\u51e0\u5217\nsorting: desc # \u5347\u5e8f/\u964d\u5e8f\u6392\u5217\ncomputation: avg # \u540c\u4e00\u7528\u6237\u7684\u591a\u4e2a\u63d0\u4ea4\uff0c\u6309\u4ec0\u4e48\u8ba1\u7b97\u65b9\u6cd5\u6392\u5e8f\uff1f\ncomputation_indexes: # \u5728\u54ea\u4e00\u5217\u4e0a\u8ba1\u7b97\n- 1\n
"},{"location":"docs/3-dl/tools/codabench/#scoring-program","title":"scoring program \u7684\u8def\u5f84\u8bf4\u660e","text":"\u5947\u5f02\u7684\u662f\uff0c\u6bd4\u8d5b\u8fd0\u884c\u65f6\u6240\u521b\u5efa\u7684 Docker \u4e2d\u6587\u4ef6\u7ed3\u6784\u5e76\u4e0d\u662f bundle \u7684\u7ed3\u6784\uff0c\u6216\u8005\u793a\u4f8b competition.yml \u4e2d\u6307\u793a\u7684\u8def\u5f84\uff0c\u800c\u662f\u4f1a\u628a\u5404\u79cd\u8d44\u6e90\u7ed3\u6784\u6253\u4e71\u653e\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u3002\u5bf9\u6211\u4eec\u5f71\u54cd\u5c31\u662f\uff0c\u5982\u679c scoring program \u9700\u8981\u8bfb\u5176\u5b83\u6587\u4ef6\uff08\u591a\u4ee3\u7801\u6587\u4ef6 / gold answer \u7b49\uff09\uff0c\u5c31\u9700\u8981\u6309\u521b\u5efa\u597d\u7684 Docker \u4e2d\u7684\u65b0\u6587\u4ef6\u8def\u5f84\u8bfb\u53d6\u3002
\u6bd4\u5982\uff0c\u5728\u6211\u7684\u6d4b\u8bd5\u4e2d\uff0cDocker \u7684\u5b9e\u9645\u6587\u4ef6\u5939\u7ed3\u6784\u5982\u4e0b\uff1a
.\n- app\n - codalab // \u4e0d\u660e\n - data // \u4e0d\u660e\n - input\n - res // \u7528\u6237\u7ed3\u679c\n - ref // gold anwser\n - shared // \u4e0d\u660e\n - program // \u6240\u4e0a\u4f20\u811a\u672c\n - score.py\n - metadata.yaml\n - output // \u811a\u672c\u8f93\u51fa\uff0c\u7528\u4e8e leaderboard \u8bfb\u53d6\n - output.json\n
\u5982\u679c\u4e0a\u8ff0\u8def\u5f84\u5728\u4f60\u7684\u6d4b\u8bd5\u4e2d\u4e0d work\uff0c\u53ef\u4ee5\u5148\u4e0a\u4f20\u4e00\u4e2a\u542b\u6709 competition.yaml / scoring program / reference data / result data / ingestion program \u7b49\u6240\u6709\u8d44\u6e90\u7684\u6d4b\u8bd5 bundle\uff0c\u8981\u6c42 scoring program \u8f93\u51fa Docker \u7684\u6587\u4ef6\u5939\u7ed3\u6784\u6811\uff0c\u5728 terminal \u4e2d\u4f9d\u6b21\u8bb0\u4e0b\u8d44\u6e90\u7684\u8def\u5f84\u3002
"},{"location":"docs/3-dl/tools/codabench/#scoring-program_1","title":"scoring program \u7684\u8f93\u51fa\u8bf4\u660e","text":"scoring program \u5728\u8fd0\u884c\u5b8c\u6210\u540e\u88ab\u671f\u5f85\u5199\u4e00\u4e2a output.json \u6587\u4ef6\uff0c\u5176\u8def\u5f84\u5728\u524d\u4e00\u8282\u6709\u8bf4\u660e\u3002\u5176\u7ed3\u6784\u636e\u63a8\u6d4b\u5e94\u5f53\u662f\uff0c
{\n\"leaderboards_key\": {\n\"column_key1\": 0,\n\"column_key2\": 0,\n...\n}\n}\n
\u5176\u4e2d\u51e0\u4e2a 'key' \u5206\u522b\u5bf9\u5e94\u5728 competition.yaml \u7684 leaderboards \u8bbe\u7f6e\u4e2d\u81ea\u5b9a\u4e49\u7684 key\u3002
"},{"location":"docs/3-dl/tools/codabench/#_5","title":"\u5e38\u89c1\u62a5\u9519","text":"\u5c06 bundle \u62d6\u5165 Upload \u9875\u9762\u540e\uff0c\u5982\u679c\u62a5\u9519\u663e\u793a Creation Fail\uff0c\u6b64\u65f6\u9996\u5148\u5e94\u5f53\u68c0\u67e5\u662f\u5426\u6709 competition.yaml
\u6587\u4ef6\uff0c\u6587\u4ef6\u540d\u548c\u5185\u5bb9\u683c\u5f0f\u6b63\u786e\uff0c\u5e76\u4e14\u4f4d\u4e8e\u538b\u7f29\u5305\u9876\u5c42\uff08\u53c2\u7167\u4e0a\u65b9\u538b\u7f29\u56fe\u793a\uff09\u3002\u4e00\u822c\u662f\u6b64\u9519\u8bef\u3002
codalab/competition-examples/codabench \u5b98\u65b9\u63d0\u4f9b\u7684\u51e0\u4e2a bundle \u6a21\u677f\uff0c\u53ef\u4ee5\u5bf9\u6bd4 Codabench \u4e0a\u540c\u540d\u6bd4\u8d5b\u67e5\u770b\u521b\u5efa\u7ed3\u679c\uff0c\u5728\u672c\u4ed3\u5e93\u62ff\u4e00\u4e9b\u9700\u8981\u7684\u5199\u6cd5\u3002
"},{"location":"docs/3-dl/tools/codabench/#ui","title":"UI \u521b\u5efa","text":"\u8fdb\u5165 Codabench \u9996\u9875\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2 Benchmark
-> Management
\uff0c\u9009\u62e9 Upload
\u6765\u521b\u5efa\u6bd4\u8d5b\u3002
\u9876\u5c42\u6709 Details
/ Participation
/ Pages
/ Phases
/ Leaderboard
/ Administrators
\u516d\u4e2a\u9875\u9762\uff0c\u5176\u5b83\u8f83\u6613\u61c2\uff0c\u4e0d\u518d\u8d58\u8ff0\uff0cPhases
\u7684\u8bbe\u7f6e\u6bd4\u8f83\u590d\u6742\u3002
Phases \u6784\u6210\u6bd4\u8d5b\u4e3b\u4f53\u3002\u4e00\u4e2a\u6bd4\u8d5b\u53ef\u4ee5\u6709\u4e00\u4e2a\u6216\u591a\u4e2a phase\uff0c\u8fd9\u6837\u8bbe\u8ba1\u53ef\u80fd\u662f\u6709\u4e9b\u6bd4\u8d5b\u5206\u6210\u5728\u591a\u4e2a\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\uff1b\u4e00\u4e2a phase \u53c8\u53ef\u4ee5\u5305\u542b\u591a\u4e2a tasks\uff0c\u53ef\u80fd\u662f\u4e3a\u4e86\u652f\u6301\u6709\u4e9b\u6bd4\u8d5b\u6bcf\u4e2a phase \u53c8\u6709\u591a\u4e2a\u6570\u636e\u96c6\u3002phase \u4e4b\u95f4\u4e0d\u5171\u4eab\u8d44\u6e90/Docker \u73af\u5883\uff0c\u540c\u4e00\u4e2a phase \u7684\u4e0d\u540c task \u4e4b\u95f4\u5171\u4eab\u8d44\u6e90/\u73af\u5883\u3002
\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u53ef\u4ee5\u53ea\u5b9a\u4e49\u4e00\u4e2a phase\u3002\u533a\u5206\u6570\u636e\u96c6\u751a\u81f3\u53ef\u4ee5\u53ea\u901a\u8fc7 scoring program \u6765\u5b9e\u73b0\u3002
\u5728 phase \u7684 edit \u754c\u9762\u6700\u4e0b\u65b9\uff0c\u53ef\u4ee5\u901a\u8fc7 Manage tasks \u6309\u94ae\u6253\u5f00 task \u7684 edit \u754c\u9762\u3002
\u8be5\u754c\u9762\u4e2d Submission
/ Datasets and programs
/ Bundles
\u4e09\u4e2a\u9875\u9762\u90fd\u53ef\u4ee5\u5ffd\u89c6\uff0c\u53ea\u9700\u8981\u4f7f\u7528 Tasks
\u8fd9\u4e2a\u9875\u9762\u3002
task \u7684\u672c\u8d28\u610f\u4e49\u662f scoring program \u548c reference data / ingestion program / result data \u7684\u5173\u8054\u65b9\u5f0f\u3002
\u5982\u679c\u5b9a\u4e49\u4e00\u4e2a phase \u6709\u591a\u4e2a tasks\uff0c\u5728\u7528\u6237\u63d0\u4ea4\u65f6\uff0c\u4f1a\u663e\u793a\u9009\u62e9\u63d0\u4ea4\u54ea\u4e2a task \u7684\u590d\u9009\u6846\u3002\u5f53\u590d\u9009\u6846\u88ab\u52fe\u9009\u65f6\uff0ctask \u6240\u5173\u8054\u7684 scoring program \u88ab\u8fd0\u884c\u3002
\u5f53\u7136\u4e5f\u6709\u4e0d\u521b\u5efa\u591a\u4e2a task\uff0c\u5c06\u591a\u4e2a\u8bc4\u6d4b\u5408\u5e76\u4e3a\u4e00\u4e2a\u811a\u672c\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u91cc\u68c0\u6d4b\u7528\u6237\u4e0a\u4f20\u4e86\u54ea\u4e9b\u7ed3\u679c\uff0c\u636e\u6b64\u9009\u62e9\u8fd0\u884c\u54ea\u4e9b\u8bc4\u6d4b\u3002\u8fd9\u91cc scoring program \u7684\u8bbe\u8ba1\u81ea\u7531\u5ea6\u6bd4\u8f83\u9ad8\u3002
\u5728 task \u7684\u7f16\u8f91\u9875\u9762\u91cc\uff0c
\u8d44\u6e90\u6587\u4ef6\u5939\u540d\u5fc5\u987b\u4e0e\u6bd4\u8d5b\u521d\u59cb\u5316\u65f6 competition.yaml
\u6307\u5b9a\u7684\u6587\u4ef6\u5939\u540d\u76f8\u540c\uff0c\u538b\u7f29\u5305\u540d\u548c\u5728\u8fd9\u91cc\u586b\u5199\u7684\u8d44\u6e90\u522b\u540d\u5219\u4efb\u610f\u3002\u4f8b\u5982\uff0c\u5728 competition.yaml
\u4e2d\u6307\u5b9a\u4e86 reference data \u7684\u6587\u4ef6\u5939\u540d\u662f ref_data
\uff0c\u90a3\u4e48\u5728\u4e0a\u4f20\u65f6\u4e5f\u9700\u8981\u5c06\u4e00\u4e2a\u540d\u4e3a ref_data
\u7684\u6587\u4ef6\u5939\u8fdb\u884c\u538b\u7f29\u3002\u4f46\u662f\u538b\u7f29\u540e\u5f97\u5230\u7684\u538b\u7f29\u5305\u540d\u5b57\u968f\u610f\uff0c\u53ef\u4ee5\u53eb AAA.zip
\u7b49\uff1b\u4e0a\u4f20\u540e\u5728 UI \u5904\u4f1a\u5141\u8bb8\u4f60\u4e3a\u8fd9\u6b21\u4e0a\u4f20\u7684\u8d44\u6e90\u8d77\u4e00\u4e2a\u522b\u540d\uff0c\u4e5f\u662f\u968f\u610f\u7684\uff0c\u53ef\u4ee5\u53eb ref_data20240925
\u7b49\u3002\u5982\u9047\u5230\u8d44\u6e90\u4e0a\u4f20\u5931\u8d25\u4f46\u65e0\u62a5\u9519\uff0c\u53ef\u4ee5\u4f18\u5148\u8003\u8651\u8fd9\u4e2a\u539f\u56e0\u3002
\u6bcf\u4e2a task \u4e2d\uff0c\u5fc5\u987b\u6dfb\u52a0\u7684\u8d44\u6e90\u662f scoring program\uff0c\u6709\u8fd9\u4e2a\u624d\u80fd\u8fd0\u884c\u3002\u53ef\u6839\u636e\u9700\u8981\u6dfb\u52a0 reference data\u3002
\u8d44\u6e90\u53ea\u6709\u5728\u6ca1\u6709\u4e0e\u4e4b\u5173\u8054\u7684 task \u65f6\u624d\u80fd\u88ab\u4ece\u8d44\u6e90\u5217\u8868\u4e2d\u5220\u9664\u3002\u5f53\u5b58\u5728\u6ca1\u6709 task \u5173\u8054\u7684\u8d44\u6e90\u65f6\uff0c\u4e0b\u9762 Quota and Cleanup \u4e2d\u4f1a\u9ad8\u4eae Delete unused datasets/programs\uff0c\u53ef\u4ee5\u70b9\u51fb\u4e00\u952e\u6e05\u9664\u3002
"},{"location":"docs/3-dl/tools/codabench/#_6","title":"\u4fee\u6539","text":"\u53ea\u652f\u6301\u901a\u8fc7 UI \u4fee\u6539\u3002\u4e0d\u80fd\u91cd\u65b0\u4e0a\u4f20 bundle\uff0c\u6bcf\u6b21\u91cd\u65b0\u4e0a\u4f20 bundle \u5c31\u89c6\u4e3a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6bd4\u8d5b\u3002
\u8fdb\u5165 Codabench \u9996\u9875 -> \u53f3\u4e0a\u89d2 Benchmark
-> Management
-> \u9009\u62e9\u4e00\u4e2a\u5df2\u6709\u7684\u6bd4\u8d5b\u53f3\u4fa7 Edit
\u6309\u94ae\u3002
\u5176\u4f59\u6b65\u9aa4\u540c\u4e0a\u65b9 ### UI \u521b\u5efa
\u4e00\u8282\u3002
Download \u4e2d\u53ef\u4ee5\u4e0b\u8f7d\u5230\u7684\u5185\u5bb9\u4e0e logs \u4e2d\u80fd\u8f93\u51fa\u7684\u5185\u5bb9\u76f8\u4f3c\uff0c\u76f4\u63a5\u67e5\u770b logs \u5373\u53ef\u3002
terminal \u7684\u5de6\u4fa7\u5206\u4e3a prediction \u548c scoring \u4e24\u79cd\uff0c\u5f53\u6709 ingestion program \u65f6\u7b2c\u4e00\u4e2a terminal \u624d\u4f1a\u6709\u8f93\u51fa\u3002stdout \u548c stderr \u5c06 terminal \u8f93\u51fa\u5206\u5f00\u4e86\uff0cstdout \u662f\u7a0b\u5e8f\u6307\u5b9a\u7684\u6b63\u5e38\u8f93\u51fa\uff0cstderr \u662f error \u8f93\u51fa\uff0c\u6709\u65f6\u5019\u4f1a\u5b58\u5728\u5176\u4e2d\u4e00\u4e2a\u6ca1\u6709\u8f93\u51fa\u7684\u60c5\u51b5\uff0c\u53ef\u5207\u6362\u67e5\u770b\u3002
Leaderboard \u7684\u7ed3\u679c\u4e0d\u4f1a\u81ea\u52a8\u66f4\u65b0\u5230 Leaderboard\uff0c\u9700\u8981\u7528\u6237\u540c\u610f\u3002\u70b9\u51fb\u8fd0\u884c\u7ed3\u679c\u53f3\u4fa7\u7684\u6309\u94ae\u66f4\u65b0\u5230 Leaderboard\u3002
"},{"location":"docs/3-dl/tools/codabench/#_8","title":"\u53c2\u8003\u8d44\u6599","text":"\u73b0\u6709\u5b98\u7f51\u53c2\u8003\u8d44\u6599\u4f3c\u4e4e\u90fd\u4e0d\u592a\u5168\u9762\uff0c\u4e0d\u80fd\u8986\u76d6\u5404\u79cd\u5e38\u89c1\u9519\u8bef\uff0c\u56e0\u6b64\u4e00\u4e9b\u521b\u5efa\u6b65\u9aa4\u548c\u884c\u4e3a\u662f\u901a\u8fc7\u6d4b\u8bd5\u548c\u63a8\u6d4b\u5f97\u77e5\u7684\u3002\u5982\u679c\u672c\u6587\u6709\u8bef\uff0c\u6b22\u8fce\u8054\u7cfb\u4f5c\u8005\u6539\u6b63\uff01
"},{"location":"docs/3-dl/tools/nlp_resources/","title":"DL & NLP Resources","text":":material-circle-edit-outline: \u7ea6 213 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u8fd9\u4e2a\u9875\u9762\u7528\u6765\u6536\u96c6 nlp \u5165\u95e8\u8d44\u6599\u7684 minimal closure\uff08\u6307\u8db3\u591f\u5b66\u4f1a\u7684\u6700\u5c0f\u8d44\u6e90\u96c6\u5408\uff09
"},{"location":"docs/3-dl/tools/nlp_resources/#machine-learning-theory","title":"Machine Learning Theory","text":"Google\u7684\u4e00\u4e2a\u6559\u7a0b\uff0c\u91cc\u9762\u7684playground\u505a\u5f97\u6bd4\u8f83\u76f4\u89c2\uff0c\u65e0\u9700\u4ee3\u7801
Machine Learning \u00a0|\u00a0 Google for Developers
"},{"location":"docs/3-dl/tools/nlp_resources/#machine-learning-technology","title":"Machine Learning Technology","text":"TODO
"},{"location":"docs/3-dl/tools/nlp_resources/#deep-learning-theory","title":"Deep Learning Theory","text":"TODO
"},{"location":"docs/3-dl/tools/nlp_resources/#deep-learning-technology","title":"Deep Learning Technology","text":"Pytorch\u6559\u7a0b\uff0c\u53ef\u4ee5\u770b\u7740\u4ee3\u7801\u624b\u6284\u4e00\u4e0b
Welcome to PyTorch Tutorials \u2014 PyTorch Tutorials 2.0.1+cu117 documentation
numpy: numpy 100 exercise
rougier/numpy-100: 100 numpy exercises (with solutions) (github.com)
Pytorch
PyTorch\u6df1\u5ea6\u5b66\u4e60\u5feb\u901f\u5165\u95e8\u6559\u7a0b\uff08\u7edd\u5bf9\u901a\u4fd7\u6613\u61c2\uff01\uff09\u3010\u5c0f\u571f\u5806\u3011_\u54d4\u54e9\u54d4\u54e9_bilibili
Attention-based Models and Transformer
Let's build GPT: from scratch, in code, spelled out. - YouTube
"},{"location":"docs/3-dl/tools/nlp_resources/#natural-language-processing-theory","title":"Natural Language Processing Theory","text":"Stanford CS224N: NLP with Deep Learning | Winter 2021 | Lecture 1 - Intro & Word Vectors - YouTube
"},{"location":"docs/3-dl/tools/nlp_resources/#natural-language-processing-technology","title":"Natural language processing technology","text":"Stanford CS 224N | Natural Language Processing with Deep Learning
"},{"location":"docs/3-dl/tools/nlp_resources/#reinforcement-learning","title":"Reinforcement Learning","text":"\u8611\u83c7\u4e66EasyRL (datawhalechina.github.io)
Codes:
boyu-ai/Hands-on-RL: https://hrl.boyuai.com/ (github.com) datawhalechina/easy-rl: \u5f3a\u5316\u5b66\u4e60\u4e2d\u6587\u6559\u7a0b\uff08\u8611\u83c7\u4e66\uff09\uff0c\u5728\u7ebf\u9605\u8bfb\u5730\u5740\uff1ahttps://datawhalechina.github.io/easy-rl/
"},{"location":"docs/3-dl/tools/nlp_resources/#computer-vision","title":"Computer Vision","text":"Computer Vision | Universit\u00e4t T\u00fcbingen (uni-tuebingen.de)
"},{"location":"docs/4-opinion/","title":"Opinions","text":":material-circle-edit-outline: \u7ea6 1 \u4e2a\u5b57
"},{"location":"docs/4-opinion/plan/","title":"Academic Plans \u5b66\u4e1a\u89c4\u5212","text":":material-circle-edit-outline: \u7ea6 27 \u4e2a\u5b57
!!! \u672c\u7ae0\u8282 bullshits \u548c exaggerations \u542b\u91cf 200%\uff0c\u76f8\u4fe1\u524d\u4e00\u5b9a\u8c28\u614e\u8c28\u614e\u518d\u8c28\u614e
"},{"location":"docs/4-opinion/plan/24fall/","title":"24fall \u7533\u8bf7\u8bb0\u5f55","text":":material-circle-edit-outline: \u7ea6 5341 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 18 \u5206\u949f
\u5199\u4e8e 2024 \u5e74 3 \u6708\u5e95\uff0c\u7ed3\u679c\u5dee\u4e0d\u591a\u51fa\u4e86\uff0c\u6839\u636e\u7ed3\u679c\u53cd\u601d\u4e0b\u5728\u7533\u8bf7\u8def\u7a0b\u4e2d\u505a\u5f97\u5bf9\u4e0e\u4e0d\u5bf9\u7684\u5730\u65b9\uff0c\u5e76\u603b\u7ed3\u4e00\u4e9b\u6709\u7528\u8d44\u6e90\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u5230\u548c\u6211\u4e00\u6837\u7eaf DIY \u7533\u8bf7\u7684\u540c\u5b66\u3002
"},{"location":"docs/4-opinion/plan/24fall/#master","title":"master \u9009\u6821","text":"master \u9009\u9879\u76ee\u4e3b\u8981\u7ecf\u5386\u4e86\u201c\u6dfb\u52a0\u5fc3\u613f\u5355\u201d+\u201c\u7b5b\u9009\u201d\u4e24\u4e2a\u6d41\u7a0b\u3002
\u201c\u6dfb\u52a0\u5fc3\u613f\u5355\u201d\u4e00\u6b65\u4e3b\u8981\u53c2\u7167 zju \u5185\u90e8\u7684\u98de\u8dc3\u624b\u518c + OpenCSApp + GlobalCS + \u5370\u8c61\uff08e.g. \u5b66\u957f\u5b66\u59d0\uff0c1p3a\uff09\u7b49\uff0c\u5148\u5217\u51fa\u5927\u7ea6\u4e09\u4e94\u5341\u4e2a\u5408\u9002\u7684\u9879\u76ee\u3002
\u201c\u7b5b\u9009\u201d\u4e00\u6b65\u4e2d\u518d\u8003\u8651\u5404\u79cd\u9650\u5236\u6761\u4ef6\uff08\u6bd4\u5982\u6211\u7684\uff1a\u5b66\u8d39\u9ad8/\u5c31\u4e1a\u5bfc\u5411\u7684/\u4e0d\u5b89\u5168\u7684/\u5f3a\u5236\u8bed\u8a00\u7684\u4e0d\u7533\uff09\uff0c\u4ee5\u53ca\u6240\u6709\u7533\u5230\u4e5f\u4e0d\u60f3\u53bb\u7684\u90a3\u79cd\u4fdd\u5e95\u9879\u76ee\u4e5f\u65e0\u9700\u7533\u8bf7\u3002 \u5b66\u8d39\u53ef\u4ee5\u53c2\u7167\u7684\u8d44\u6599\u6bd4\u5982 Compare cost of living between cities \u548c\u5404\u4e2a\u9879\u76ee\u5b98\u65b9\u62a5\u7684\u6570\u76ee\u3002
\u53e6\u5916\u5728 UCSD CS37 \u7684\u9879\u76ee\u9875\u9762\u770b\u8fc7\u201c\u5982\u679c\u786e\u5b9a\u7533\u8bf7 PhD\uff0c\u5c31\u4e0d\u8981\u7533\u8bf7 master \u4e86\u201d\uff0c\u53ef\u80fd\u80fd\u4ee3\u8868\u4e00\u90e8\u5206\u5b66\u6821\u8fd9\u4e24\u79cd\u9879\u76ee\u7684\u5b9a\u4f4d\u3002
"},{"location":"docs/4-opinion/plan/24fall/#phd","title":"PhD \u9009\u5bfc","text":"\u6211\u9996\u5148\u9760\u8ddf\u7ec4\u91cc\u540c\u884c\u8ba4\u8bc6\u7684\u5b66\u957f\u5b66\u59d0\u4ea4\u6d41\uff0c\u88ab\u63a8\u8350\u4e86\u4e00\u4e9b\u5f53\u5e74\u6b63\u5728\u62db\u751f\u7684\u4f18\u79c0 prof\u3002\u6b64\u5916\u81ea\u5df1\u4e3b\u8981\u53c2\u8003\u4e86 CSrankings\uff0c\u6328\u4e2a\u6253\u5f00 Google Scholar \u53bb\u8bfb\u6587\u7ae0\u3002\u4e5f\u6709\u53d1\u6325\u6211\u7684\u793e\u725b\u5c5e\u6027\u53bb X(twitter) \u4e0a\u628a\u5927\u5bb6\u90fd\u5173\u6ce8\u7136\u540e\u5237\u6587\u7ae0\u8fd9\u6837\u505a\u3002\u7ecf\u5e38\u5237 Arxiv \u4e5f\u662f\u597d\u4e60\u60ef\uff0c\u53ef\u60dc\u6211\u8fd8\u6ca1\u517b\u6210\u3002\u8fd9\u4e9b\u90fd\u6709\u5229\u4e8e\u773c\u719f\u6559\u6388\uff0c\u4e00\u6bb5\u65f6\u95f4\u540e\u5c31\u53ef\u5f62\u6210\u81ea\u5df1\u7684\u9009\u62e9\u3002
\u53e6\u5916\u9009\u5b66\u6821\u65f6\u5982\u9700\u53c2\u8003 Stipend\uff1aCSStipendRankings\u3002
\u6700\u7ec8 master + PhD \u6211\u4e00\u5171\u7533\u8bf7\u4e86\u4f3c\u4e4e\u662f 14 \u4e2a\uff08\u542b 3 \u4e2a\u514d\u8d39\uff09\u3002\u8fd9\u4e2a\u6570\u76ee\u56e0\u4eba\u800c\u5f02\uff0c\u4e3b\u8981\u770b\u4e0e\u63a8\u8350\u4eba\u6c9f\u901a\u3002\u8eab\u8fb9\u4e5f\u6709\u670b\u53cb\u7533\u5230 50 \u4e2a\u7684\uff0c\u60ca\u4eba\u4f46\u662f\u5c0a\u91cd\u7406\u89e3\u3002
\u6700\u65b0\u5728 24fall \u7fa4\u91cc\u770b\u5230\u7684\u9009\u5bfc\u5e08\u7684\u5176\u5b83\u5de5\u5177
\u5982\u679c\u7533\u8bf7 PhD\uff0c\u90a3\u4e48\u5927\u5bb6\u7684\u7ecf\u9a8c\u6765\u770b\u8fc7\u7ebf\u5c31\u591f\uff0c\u4e0d\u592a\u4f1a\u4e25\u5361\uff0c\u91cd\u70b9\u65e0\u9700\u5728\u8bed\u8a00\u6210\u7ee9\u3002
master \u5219\u5e94\u8be5\u662f\u8bed\u8a00\u6210\u7ee9\u8d8a\u9ad8\u8d8a\u597d\u4e86\uff0c\u5c24\u5176\u5982\u679c\u7ee9\u70b9 below average\uff0c\u90a3\u4e48\u8bed\u8a00\u786e\u5b9e\u9700\u8981\u8003\u9ad8\u4e00\u4e9b\u3002
\u4ee5\u53ca\u6211\u5728\u7533\u8bf7\u5b63\u7684\u51e0\u4e2a\u6708\u91cc\u4e00\u76f4\u6ca1\u80fd\u6253\u5f00 GRE \u7684\u5b98\u7f51\uff08\u4e0d\u662f\u5bc6\u7801\u4e0d\u6b63\u786e\uff0c\u5bc6\u7801\u901a\u8fc7\u53d1\u90ae\u4ef6\u5c31\u80fd\u627e\u56de\u6765\u4e86\uff0c\u662f\u767b\u5f55\u540e\u8df3\u8f6c\u53ea\u80fd\u5230 error \u9875\u9762\uff09\uff0c\u6362\u7f51\u6362\u8bbe\u5907\u6362\ud83e\ude9c\u90fd\u8fd8\u662f\u4e00\u76f4\u5237\u65b0\u4e0d\u51fa\u6765\uff0c\u5bfc\u81f4\u8003\u4e86\u4e5f\u6ca1\u6cd5\u67e5\u5206\uff0c\u6ca1\u6cd5\u591a\u6dfb\u52a0\u9001\u5206\u3002\u56e0\u4e3a\u4e3b\u8981\u76ee\u6807\u8fd8\u662f\u7533 PhD \u4e8e\u662f\u6700\u540e\u5c31\u4e0d\u518d\u6323\u624e\u4e86\u3002GRE \u5b98\u7f51\u662f\u7ecf\u5e38\u62bd\u98ce\u7684\uff0c\u770b\u5230\u8eab\u8fb9\u4e00\u4e9b master \u7533\u8bf7\u8005\u4f1a\u9009\u62e9\u5728\u5927\u4e09\u5c31\u628a GRE \u8003\u51fa\u6765\uff0c\u5efa\u8bae\u4e5f\u50cf\u4ed6\u4eec\u4e00\u6837\u63d0\u524d\u51c6\u5907\uff0c\u5982\u679c\u4e5f\u767b\u9646\u4e0d\u8fdb\u53bb\uff0c\u591a\u6c42\u52a9\u6c42\u52a9\u8eab\u8fb9\u7684\u4eba\u501f\u8bbe\u5907\u8bd5\u8bd5\uff0c\u6700\u597d\u63d0\u524d\u51c6\u5907\uff0c\u907f\u514d\u5230\u7533\u8bf7\u5b63\u53d1\u73b0\u5f71\u54cd\u9001\u5206\u3002
\u9001\u5206 Code \u8fd8\u6709\u4e00\u4e9b\u5e16\u5b50\u603b\u7ed3\u8fc7\u7684\uff08\u53ef\u81ea\u884c\u641c\u7d22\uff09\uff0cTG \u90fd\u662f\u7528\u7684\u662f\u540c\u4e00\u4e2a\u9001\u5206 Code\uff0c\u4ee5\u53ca GRE \u5728\u8003\u573a\u91cc\u90a3\u6b21\u514d\u8d39\u9001\u5206\u673a\u4f1a\u4e0d\u7528\u80cc\u9001\u5206 Code\uff0c\u5728\u8003\u573a\u91cc\u4e5f\u53ef\u4ee5\u6309\u6821\u540d\u641c\u7d22\u6dfb\u52a0\u7684\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_2","title":"\u63a8\u8350\u4fe1","text":"\u63a8\u8350\u4fe1\u5982\u4f55\u88ab\u5ba1\u6838\uff1a\u636e\u8bf4\u4e00\u822c\u5728\u62db\u751f\u5b98\u624b\u91cc\uff0c\u63a8\u8350\u4fe1\u662f\u4e0e\u7533\u8bf7\u8005\u7684\u5176\u5b83\u6750\u6599\u4e00\u8d77\u62fc\u6210\u4e00\u957f\u4efd\u591a\u9875 PDF \u4e00\u8d77\u88ab\u5ba1\u6838\u7684\uff0c\u51e0\u4efd\u63a8\u8350\u4fe1\u524d\u540e\u5e76\u5217\u3002\u6240\u4ee5\u5173\u4e8e\u201c\u98ce\u683c\u660e\u663e\u4e0d\u660e\u663e\u201d\u201c\u5f3a\u5ea6\u660e\u663e\u4e0d\u660e\u663e\u201d\u201c\u4f1a\u5ba1\u6587\u4ef6\u4fe1\u606f\u201d\u7b49\u95ee\u9898\u53ef\u4ee5\u60f3\u8c61\u4e00\u4e0b\u5ba1\u6750\u6599\u7684\u8fd9\u4e2a\u573a\u666f\uff0c\u4ece\u8fd9\u4e2a\u89d2\u5ea6\u6765\u8003\u8651\u3002
\u5173\u4e8e\u627e\u591a\u4f4d\u63a8\u8350\u4eba\uff1a\u5927\u7ea6 12.2 \u53f7\u770b\u5230 PhD \u7533\u8bf7\u7fa4\u91cc\u6709\u4eba\u8bf4\uff0c\u5176\u5b9e\u4e0d\u8981\u627e 3 \u4e2a\u63a8\u8350\u4eba\u5c31\u7ed3\u675f\uff0c\u6700\u597d\u63d0\u524d\u627e 4 \u5230 5 \u4e2a\uff0c\u56e0\u4e3a\u591a\u4ea4\u6ca1\u6709\u5173\u7cfb\uff0c\u5927\u90e8\u5206\u5b66\u6821\u90fd\u6709\u6dfb\u52a0\u591a\u4e2a\u63a8\u8350\u4eba\u7684\u9009\u9879\uff08\u6211\u7684\u9009\u6821\u91cc\u53ea\u6709loo\u548cumich\u4e0a\u9650\u4e09\u4e2a\uff09\uff0c\u4f46\u662f\u7ecf\u5e38\u6709\u63a8\u8350\u4eba\u5fd9\u5fd8\u4e86\u6700\u540e\u6ca1\u4ea4\u7684\u60c5\u51b5\u3002\u518d\u95ee\u53e6\u4e00\u4e2a\u7fa4\uff0c\u5f97\u77e5\u5982\u679c\u662f US PhD\uff0c\u4e0d\u4f1a\u56e0\u4e3a\u6709\u4e00\u4e2a\u63a8\u8350\u4eba\u5fd8\u4e86\u4ea4\u62d2\u4f60\uff0c\u4f46\u662f\u5927\u591a master 3 \u5c01\u4ea4\u4e0d\u9f50\u5c31\u65e0\u6cd5\u5f00\u59cb\u5ba1\u6750\u6599\uff0c\u53ef\u80fd\u56e0\u6b64\u4e00\u76f4\u7559\u5728\u6c60\u5b50\u91cc\uff0c\u6216\u8005\u53ef\u80fd\u56e0\u6b64\u9ed8\u62d2\u3002\u4e5f\u6709\u542c\u8bf4\u5982\u679c\u672c\u8be5\u4ea4 3 \u5c01\u4ea4\u4e86 4 \u5c01\uff0c\u53ef\u80fd\u56e0\u6b64\u964d\u4f4e\u5176\u4e2d\u6700\u91cd\u8981\u7684\u90a3\u5c01\u7684\u6548\u529b\uff0c\u8fd9\u70b9\u5982\u679c\u6536\u5230 >3 \u5c01\u63a8\u8350\u4fe1\u5176\u5b9e\u53ef\u4ee5\u901a\u8fc7 exclude \u4e00\u4efd\u6765\u89e3\u51b3\uff0c\u7ecf\u9a8c\u6765\u770b\u70b9 exclude \u65f6\u63a8\u8350\u4eba\u5e94\u8be5\u4e0d\u4f1a\u6536\u5230\u901a\u77e5\u3002
\u540c\u4e00\u5b66\u6821\u53ef\u4ee5\u5171\u7528\u63a8\u8350\u4fe1\u5417: \u4e00\u822c\u4e0d\u80fd\u3002\u6211\u7533\u8bf7\u7684\u5b66\u6821\u4e2d\u53ef\u4ee5\u7684\u6709
\u63a8\u8350\u4fe1\u7cfb\u7edf\u4e0d\u5927\u667a\u80fd\u7684\u5730\u65b9:
\u542c\u8bf4\u8fc7\u67e5 IP/MAC \u5730\u5740\u7684: \u76ee\u524d\u5927\u8305\u548c\u54e5\u5927\u6709\u89c1\u8fc7 DP \u6536\u5230\u5b66\u6821\u90ae\u4ef6\u8bf4\u67e5\u5230\u4fe1\u662f\u81ea\u5df1\u53d1\u7684\u3002\u636e\u6b64\u770b\u6765\u662f\u4e0d\u662f\u85e4\u6821\u4e25\u4e00\u4e9b\u3002IP/MAC addr \u5982\u679c\u67e5\u5e94\u8be5\u662f\u989d\u5916\u67e5\u7684\uff0c\u4e0d\u662f\u5ba1\u6750\u6599\u7684\u62db\u751f\u5b98\u8d1f\u8d23\u67e5\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_3","title":"\u5957\u74f7","text":"\u4e00\u5f00\u59cb\u770b\u5230\u7684\u6d88\u606f\u662f\u5957\u5230\u74f7\u624d\u80fd\u7533\u8bf7\uff0c\u540e\u6765\u770b\u5230 n+e's blog \u77e5\u9053\u4e5f\u4e0d\u4e00\u5b9a\uff0c\u5148\u6295\u4e86\u518d\u5957\u4e5f\u53ef\u4ee5\uff0c\u6709\u4e9b\u6559\u6388\u7279\u522b\u5fd9\uff0c\u53ef\u80fd\u62c5\u5fc3\u6709\u4e9b\u5b66\u751f\u804a\u4e86\u4e5f\u6ca1\u6295\uff0c\u53ef\u80fd\u503e\u5411\u5b66\u751f\u786e\u5b9e\u6295\u4e86\u518d\u804a\uff0c\u6216\u8005\u7b49\u5230\u4ed6\u4eec\u81ea\u5df1\u4ece\u6c60\u5b50\u91cc\u635e\u4eba\u7684\u65f6\u95f4\u7ebf\u518d\u804a\u3002\u4e5f\u53ef\u4ee5\u53c2\u8003\u5f3a prof \u548c\u5f3a committee \u5b66\u6821\u7684\u4e00\u4e9b\u540d\u5355\uff08\u76ee\u524d\u770b\u5230\u4e00\u4e2a CS PhD\u5f3acommittee&\u5f3aprofessor List(\u4ec5\u4f9b\u53c2\u8003) \u4e0d\u8fc7\u4e0d\u4e00\u5b9a\u5f88\u51c6\uff0c\u5370\u8c61\u4e2d\u91cc\u9762\u8bf4\u662f\u5f3a committee \u7684\u4e00\u4e9b\u4e5f\u6709\u4e0e prof \u804a\u597d\u5c31\u5f55\u4e86\u7684 DP\uff09\u3002
double \u7684\u7fa4\u91cc\u8fd8\u6709\u4e2a\u670b\u53cb\u505a\u4e86\u4e2a\u533f\u540d google docs \u4f9b\u7fa4\u53cb\u5206\u4eab\u62ff\u5230\u9762\u8bd5\u7684\u5927\u81f4\u65f6\u95f4\u6bb5\uff0c\u5171\u4eab\u5404\u5b66\u6821\u9762\u8bd5\u53d1\u5230\u4ec0\u4e48\u8fdb\u5ea6\u4e86\uff0c\u53ef\u60dc\u8be5\u8868\u683c\u4e0d\u5e0c\u671b\u88ab\u5916\u4f20\u3002\u4ee5\u540e\u7684\u7533\u8bf7\u7fa4\u91cc\u5927\u5bb6\u4e5f\u53ef\u4ee5\u81ea\u53d1\u521b\u5efa\u4e00\u4e2a\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_4","title":"\u7f51\u7533","text":"\u5bfb\u627e\u7f51\u7533\u9875\u9762\u7684\u901a\u7528\u505a\u6cd5\u4e00\u822c\u662f\u641c\u7d22\u5f15\u64ce\u641c\u7d22 \u5b66\u6821\u548c program \u540d\u5b57
+ application
\uff0c\u7ed3\u679c\u524d\u51e0\u6761\u4e2d\u4e00\u822c\u5c31\u542b\u6b63\u786e\u7684\u7533\u8bf7\u754c\u9762\u3002\u7f51\u7533\u5185\u5bb9\u611f\u89c9\u8fd8\u662f\u9700\u8981\u81ea\u5df1\u586b\uff0c\u4e0d\u8981\u627e\u4ee3\u586b\uff0c\u4fe1\u606f\u5f88\u591a\uff0c\u975e\u672c\u4eba\u4e0d\u719f\u6089\u592a\u5bb9\u6613\u586b\u9519\u4e86\u3002
\u4e0b\u9762\u8bb0\u5f55\u4e00\u4e9b program-specific \u7684\u5751\u70b9\u3002
CMU: \u5982\u679c\u76f4\u63a5\u641c\u7d22 MLT application \u51fa\u73b0\u7684\u4ee5\u4e0b\u9875\u9762\u53ca\u7533\u8bf7\u94fe\u63a5\u662f\u627e\u4e0d\u5230MLT\u9879\u76ee\u7684
Application Management (cmu.edu) \u8fd9\u4e2a\u9875\u9762\u548c\u4ee5\u4e0b\u622a\u56fe\u662f\u6b63\u786e\u7684\uff0c\u540c\u7406mscv\u548cmsaii\u4ec0\u4e48\u7684\u9879\u76ee\u4e5f\u5728\u8fd9\u91cc\u7533\u8bf7\u3002
mscs \u7684 video essay \u662f\u63d0\u524d\u5f55\u597d\u4e86\u4e0a\u4f20\u5230 youtube \u8fd9\u79cd\u7684\uff0c\u53ef\u4ee5\u81ea\u5df1\u968f\u610f\u5f55\u591a\u6b21\uff0c\u4f46\u6211\u4f30\u8ba1\u4e0d\u8981\u62fc\u63a5\u75d5\u8ff9\u592a\u91cd\uff0c\u4e00\u53e3\u6c14\u8bf4\u4e0b\u6765\u6700\u597d\u3002\u5185\u5bb9\u6211\u8bb0\u5f97\u6ca1\u6709\u9650\u5236\uff0c\u968f\u610f\u8bbe\u8ba1\u81ea\u6211\u4ecb\u7ecd\uff0c\u636e\u8bf4\u4e3b\u8981\u662f\u4e3a\u4e86\u770b\u7533\u8bf7\u4eba\u6027\u683c\u3001\u53e3\u8bed\u3001\u8868\u8fbe\u80fd\u529b\u4e4b\u7c7b\u7684\u6f5c\u5728\u7279\u70b9\u3002
\u5728\u7ec6\u5206\u7684\u90a3\u51e0\u4e2a ai \u9879\u76ee\u7684 video earry \u662f\u9650 3 \u6b21\u673a\u4f1a\uff0c\u6bcf\u6b21\u968f\u673a\u95ee\u9898\uff0c\u9650\u65f6\u51c6\u5907\uff0c\u9650\u65f6\u8bf4\u3002\u6211\u770b\u5230\u7684\u7f51\u4e0a\u7684\u5e16\u5b50\u8bf4\u597d\u50cf miis ini ece\uff08\u8bb0\u4e0d\u4f4f\u8fd9\u51e0\u4e2a\u9879\u76ee\u540d\u5b57\uff0c\u603b\u4e4b\u7c7b\u4f3c\uff09\u662f 30s \u51c6\u5907\uff0c180s \u8bf4\uff0c\u95ee\u7684\u95ee\u9898\u5927\u7c7b\u6709\uff1a\u4f60\u961f\u53cb\u600e\u4e48\u8bc4\u4ef7\u4f60\uff0c\u4f60\u6536\u5230\u7684\u961f\u53cb\u7684\u4e00\u6761\u8d1f\u9762\u8bc4\u4ef7\u662f\uff0c\u4f60\u600e\u4e48\u9886\u5bfc project\uff0c\u4e00\u4e2a\u6210\u529f\u7684 project \u5bf9\u4f60\u6765\u8bf4\u662f\u600e\u6837\u7684\uff0c\u4f60\u559c\u6b22\u4ec0\u4e48\u6c9f\u901a\u6a21\u5f0f\uff0c\u5bf9\u4f60\u6765\u8bf4\u4ec0\u4e48\u662f\u5f88\u96be\u505a\u7684\u51b3\u5b9a\uff0c\u4f60\u9047\u5230\u632b\u6298\u4e86\u4f1a\u600e\u4e48\u6837...\u8fd9\u79cd\u5f88\u8ddf course project \u548c\u5408\u4f5c\u6709\u5173\u7684\u3002
\u4f46\u662f\u6211\u5728 mlt \u91cc\u6253\u5f00\u9047\u5230\u7684\u662f 10s \u51c6\u5907\uff0c210s \u8bf4\uff0c\u9047\u5230\u7684\u4e24\u4e2a\u95ee\u9898\u4f9b\u53c2\u8003:
\u8fd9\u6837\u5f88\u7814\u7a76\u5bfc\u5411\u7684\u95ee\u9898\uff0c\u4e00\u822c\u90fd\u6765\u81ea SoP\u3002
UWaterloo: \u7533\u8bf7\u5206\u4e3a\u4e24\u4e2a\u9636\u6bb5\uff0c\u7b2c\u4e00\u4e2a\u9636\u6bb5\u91cc\u4ea4\u6389\u624d\u80fd\u5728\u7b2c\u4e8c\u4e2a\u9636\u6bb5\u4e0a\u4f20 cv \u6587\u4e66 \u8bed\u8a00\u6210\u7ee9\u7b49\u4e1c\u897f\uff0c\u7b2c\u4e8c\u9636\u6bb5\u7684\u94fe\u63a5\u4f1a\u5728\u7b2c\u4e00\u9636\u6bb5\u540e 2-4 \u5929\u6536\u5230\u3002\u7533\u8bf7\u8d39\u5728\u7b2c\u4e00\u9636\u6bb5\u4ea4\u3002\u63a8\u8350\u4eba\u5728\u7b2c\u4e00\u9636\u6bb5\u6dfb\u52a0\uff0c\u90ae\u4ef6\u968f\u7740\u7b2c\u4e00\u9636\u6bb5\u63d0\u4ea4\u88ab\u53d1\u51fa\u3002\u7b2c\u4e00\u4e2a\u9636\u6bb5\u4e00\u5b9a\u8981\u6bd4 ddl \u63d0\u524d\u4e24\u4e09\u5929\u4ea4\u3002\u4e14 loo \u7684\u7cfb\u7edf\u597d\u50cf\u7ef4\u62a4\u6bd4\u8f83\u9891\u7e41\uff0c\u53ef\u4ee5\u591a\u9884\u7559\u4e00\u4e9b\u65f6\u95f4\u3002
UT-Austin: \u540c\u7533\u8bf7\u5206\u4e3a\u4e24\u4e2a\u9636\u6bb5\uff0c\u7b2c\u4e00\u4e2a\u9636\u6bb5\u4ed8\u6b3e\uff0c\u5ba1\u6838 1-3 \u5929\u540e\u624d\u80fd\u5f00\u59cb\u7b2c\u4e8c\u4e2a\u9636\u6bb5\uff08\u542b\u6dfb\u52a0\u63a8\u8350\u4eba\u7b49\uff09\u3002\u7b2c\u4e00\u9636\u6bb5\u63d0\u4ea4\u4e00\u5b9a\u8981\u6bd4 ddl \u65e9\u4e24\u4e09\u5929\u3002
Umich\uff1a\u7f51\u7533\u7cfb\u7edf\u4e00\u5f00\u59cb\u56db\u4e94\u4e2a\u9875\u9762\u8981\u987a\u5e8f\u586b\u5b8c\uff08\u5305\u62ec\u6dfb\u52a0\u63a8\u8350\u4eba\u7684\u90e8\u5206\uff09\uff0c\u540e\u9762\u7684\u9875\u9762\u624d\u80fd\u8df3\u7740\u586b\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_5","title":"\u6587\u4e66","text":"\u6211\u5199\u6587\u4e66\u4e3b\u8981\u53c2\u7167\u7684\u8d44\u6599\u6709 CS-SOP, CMU sop guideline, \u548c\u4e24\u4e09\u4f4d\u5b66\u957f\u5b66\u59d0\u548c peer \u7684\u4fee\u6539\u610f\u89c1\u3002
CV \u6211\u8ba4\u4e3a\u4e00\u822c\u5927\u5bb6\u505a\u51fa\u6765\u7684\u90fd\u6ca1\u95ee\u9898\uff0c\u5c11\u91cf\u503c\u5f97 comment \u7684\u4e00\u4e9b\u70b9\u6709\uff1a
(1) \u8d1f\u8d23\u4ec0\u4e48 (2) \u9047\u5230\u4e86\u4ec0\u4e48\u95ee\u9898 (3) \u81ea\u5df1\u63d0\u51fa\u4e86\u4ec0\u4e48\u65b9\u6cd5\u6765\u89e3\u51b3 (4) \u8fbe\u5230\u4e86\u600e\u6837\u7684\u91cf\u5316\u7684\u7ed3\u679c
\u7684\u516c\u5f0f\u6765\u5206\u4e3a\u4e09\u56db\u4e2a\u5c0f\u70b9\u5199\u3002\u8fd9\u6837\u5927\u81f4\u4fdd\u8bc1\u4e86\u591a\u6761\u7ecf\u5386\u7684\u683c\u5f0f\u6574\u9f50\uff0c\u4e14\u6bd4\u8f83\u660e\u786e\u81ea\u5df1\u7684\u8d21\u732e\uff0c\u89c2\u611f\u4e0a\u4f1a\u6e05\u6670\u4e9b\u3002SOP
SOP \u53ef\u4ee5\u7406\u89e3\u4e3a\u5173\u4e8e\u81ea\u5df1\u5b66\u672f\u7ecf\u5386\u548c\u8ba1\u5212\u7684\u4e00\u4efd\u6587\u4e66\u3002\u7ecf\u9a8c\u6765\u770b\u5982\u679c\u4e00\u4e9b\u5b66\u6821\u53ea\u8981\u6c42 PS \u4e0d\u8981\u6c42 SOP\uff0c\u90a3\u4e48 PS \u5e94\u5f53\u5f53\u4f5c\u4e00\u4e2a\u683c\u5f0f\u4e0d\u90a3\u4e48\u4e25\u683c\u7684 SOP \u6765\u5199\u3002
\u6240\u6709\u9879\u76ee\u7684\u6587\u4e66\u52a0\u8d77\u6765\u5927\u7ea6\u751f\u4ea7\u4e86\u8fd1 20 \u4efd\uff0c\u5176\u4e2d\u5982\u679c\u5185\u5bb9\u76f8\u4f3c\u7684\u5408\u5e76\u4e3a\u540c\u4e00\u4efd\uff0c\u90a3\u5927\u6982\u4e5f\u6709\u516d\u4e03\u4efd\u5b8c\u5168\u4e0d\u540c\u7684\u3002\u4e00\u4e2a\u6709\u70b9\u7384\u5b66\u7684\u611f\u89c9\u662f\u6211\u4e13\u95e8\u4e3a\u5176\u5199\u4e86\u4e00\u4efd\u65b0\u6587\u4e66\u7684\u9879\u76ee\uff0cPhD \u5bfc\u5e08\u5c31\u53d1\u4e86\u9762\u8bd5\uff0cmaster \u5c31\u53d1\u4e86 offer\uff0c\u800c\u4ece\u522b\u7684\u9879\u76ee\u6539\u6539\u800c\u6765\u7684\u90a3\u4e9b\u4e00\u5b9a\u6ca1\u6709\u53d1\u9762\u8bd5/\u62ff offer\u3002\u6709\u53ef\u80fd\u56e0\u679c\u5173\u7cfb\u6709\u201c\u6211\u611f\u89c9\u4e0d\u4f1a\u4e2d/\u4e0d\u662f\u7279\u522b\u5408\u9002\u201d -> \u201c\u56e0\u6b64\u66f4\u52a0\u6ca1\u6709\u8ba4\u771f\u51c6\u5907\u6587\u4e66\u201d -> \u201c\u56e0\u6b64\u5f53\u7136\u62ff\u4e0d\u5230\u201d\u8fd9\u4e00\u5c42\u3002
\u4e00\u822c\u662f\u81ea\u5df1\u62df\u597d\u8349\u7a3f\u540e\u4ea4\u7ed9\u5b66\u957f\u5b66\u59d0\u6216 peer \u6765\u6539\uff0c\u540e\u6765\u8d76 ddl \u5927\u5bb6\u90fd\u6bd4\u8f83\u5fd9\uff0c\u6709\u4e9b\u5c31\u81ea\u5df1\u5199\u597d\u76f4\u63a5\u4ea4\u4e86\u3002\u5012\u662f\u89c9\u5f97\u81ea\u5df1\u5199\u5b8c\u6709\u6ca1\u6709\u627e\u4eba review \u8fd9\u70b9\u5bf9\u7ed3\u679c\u7684\u5f71\u54cd\u6ca1\u6709\u5f88\u5927\uff0cPhD \u5bfc\u5e08\u4eec\u4e5f\u8868\u793a\u770b\u91cd\u7684\u66f4\u591a\u662f\u65b9\u5411 match \u4e0d match\uff0c\u4fe1\u606f\u8868\u8fbe\u6b63\u786e\u5230\u4f4d\u662f\u6700\u91cd\u8981\u7684\uff0c\u8bed\u8a00\u7f8e\u5316\u5012\u5728\u5176\u6b21\u3002\u4e14\u4e00\u4e9b\u5b66\u6821\uff08Waterloo, UW, Uchi\uff09\u6587\u4e66\u4e5f\u4f1a\u9650\u5236 500/1000 words\uff0c\u8fd9\u6837\u77ed\u7684\u9650\u5236\u91cc\u786e\u5b9e\u8868\u8fbe\u4e0d\u4e86\u591a\u5c11\uff0c\u4e5f\u8bf4\u660e\u4f20\u8fbe\u4fe1\u606f\u662f\u7b2c\u4e00\u4f4d\u7684\u3002\u81ea\u5df1\u5199\u4e5f\u6709\u4e00\u5957\u6bd4\u8f83\u9ad8\u6548\u7684\u6d41\u7a0b\uff0c\u7075\u611f\u6765\u6e90\u4e8e\u5927\u4e00\u4e0a EW1 \u7684\u9b54\u9b3c\u5916\u6559\u8001\u5e08\u8bb2\u7684 shitty first draft \u6982\u5ff5\uff1a\u7b2c\u4e00\u7a3f\u96be\u4e0b\u624b\u5e38\u5e38\u662f\u56e0\u4e3a\u60f3\u8981\u540c\u65f6\u517c\u987e\u4fe1\u606f\u548c\u8868\u8fbe\uff0c\u90a3\u4e48\u628a\u4e24\u4ef6\u4e8b\u62c6\u5f00\uff0c\u7b2c\u4e00\u7a3f\u5148\u4e00\u53e3\u6c14\u5199\u51fa\u4e2a\u8868\u8fbe\u4fe1\u606f\u5168\u9762\u6b63\u786e\u4f46\u7528\u8bed\u975e\u5e38 shitty \u7684\u6587\u7ae0\uff0c\u7b2c\u4e8c\u7a3f\u53ea\u987e\u4f18\u5316\u8868\u8fbe\uff0c\u90a3\u5c31\u4e0d\u4f1a\u5361\u58f3\u3002\u6211\u5199\u7684\u6d41\u7a0b\u4e5f\u5927\u81f4\u662f\u8fd9\u6837\uff0c\u5148\u628a\u6240\u6709\u60f3\u8868\u8fbe\u7684\u4fe1\u606f\u5410\u51fa\u6765\uff0c\u5f62\u6210\u4e00\u7bc7\u81f3\u5c11\u957f\u5f97\u50cf\u6587\u7ae0\u7684\u6587\u7ae0\uff08\u4f46\u751a\u81f3\u4e0d\u4f1a\u987e\u53ca\u7528\u4ec0\u4e48\u8bed\uff0c\u7ecf\u5e38\u4e00\u534a\u82f1\u8bed\u4e00\u534a\u4e2d\u6587\uff09\uff0c\u7136\u540e\u4e00\u6bb5\u4e00\u6bb5\u8f93\u5165 ChatGPT \u8bf7\u5b83 \"please refine this paragraph from a {\u6587\u4f53} for me: {paragraph}\"\uff0c\u518d\u4e00\u53e5\u4e00\u53e5\u6bd4\u5bf9 ChatGPT \u8f93\u51fa\u7ed3\u679c\u4e0e\u81ea\u5df1\u7684\u5199\u4f5c\uff0c\u624b\u52a8\u628a\u4e00\u4e2a\u89c9\u5f97\u66f4\u597d\u7684\u7ed3\u679c\u6572\u56de\u5230\u6587\u7ae0\u4e2d\uff08\u8fd9\u91cc\u6211\u4e2a\u4eba\u8ba4\u4e3a\u8fc7\u4e00\u904d\u8111\u5b50\u540e\u4eb2\u81ea\u51b3\u5b9a\u600e\u4e48\u6539\u662f\u6bd4\u76f4\u63a5\u590d\u5236\u66f4\u9ad8\u6548\u66f4\u660e\u667a\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a ChatGPT \u5bf9\u4e8e\u7533\u8bf7\u6587\u4e66\u7c7b\u7684\u6587\u4f53\u5e38\u5e38\u6709\u4e00\u5957\u7279\u522b\u56fa\u5b9a\u4e14\u5b98\u65b9\u7684\u7528\u8bcd\uff0c\u4f7f\u5176\u4e0d\u592a\u5408\u9002\u4e14\u592a\u5bb9\u6613\u8bc6\u522b\u51fa\u662f\u673a\u5668\u5199\u7684\uff09\u3002\u6700\u540e\u628a\u8fd9\u904d\u81ea\u5df1\u6539\u8fc7\u7684\u5199\u4f5c\u8fc7\u4e00\u904d grammarly \u68c0\u67e5\u8bed\u6cd5\uff0c\u7b80\u5355\u68c0\u67e5\u540e\u5c31\u57fa\u672c\u53ef\u4ee5\u5b9a\u7a3f\u4e86\u3002
\u6b64\u5916\u8fd8\u6709\u4e00\u70b9\u662f\uff0c\u6211\u4e2a\u4eba\u8ba4\u4e3a\u5728\u5ba1\u6587\u4e66\u65f6\u6bcf\u4efd\u6587\u4e66 5-10 \u5206\u949f\uff0c\u53ef\u80fd\u6240\u6709\u4eba\u80fd\u4e00\u773c\u770b\u5230\u7684\u662f (1) \u5c0f\u6807\u9898 (2) \u52a0\u7c97\u7684\u5173\u952e\u8bcd\uff0c\u6700\u540e\u624d\u4f1a\u7ec6\u770b\u5927\u91cf\u666e\u901a\u6587\u5b57\u3002\u4e00\u4e2a\u4f8b\u5b50\u662f\u6211\u4e0a\u6b21\u53c2\u52a0\u4e00\u95e8\u8bfe\u7684 group tutorial \u65f6\uff0c\u5f53\u65f6\u5c0f\u7ec4\u6210\u5458\u5408\u5199\u4e86\u4e00\u4efd rp\uff0c\u5176\u4e2d\u6211\u5199\u7684\u662f\u6700\u6666\u6da9\u7684 lit review\uff0c\u5373\u4e13\u4e1a\u672f\u8bed\u5bc6\u5ea6\u6700\u9ad8\u8fd8\u53e5\u5b50\u6700\u957f\uff0c\u4f46\u662f\u6211\u7ed9\u6bcf\u4e2a\u5206\u4e3b\u9898\u52a0\u4e86\u5c0f\u6807\u9898\uff0c\u5176\u5b83\u540c\u5b66\u5199\u7684\u90e8\u5206\u6ca1\u6709\u52a0\u3002\u8001\u5e08\u5728\u4e0e\u6211\u4eec\u8c08\u8bdd\u7684\u95f4\u9699\u7784\u4e86\u51e0\u773c\u6211\u4eec\u7684\u6587\u4ef6\uff0c\u77ed\u77ed\u7684\u65f6\u95f4\u91cc\u5c31\u53ea\u770b\u8fdb\u53bb\u4e86 lit review \u7684\u5c0f\u6807\u9898\uff0c\u70b9\u8bc4\u4e86\u4e00\u4e0b\u8fd9\u90e8\u5206\u3002\u56e0\u6b64\u505a\u6e05\u6670\u7684\u5206\u6bb5\u548c\u5c0f\u6807\u9898\u5f88\u91cd\u8981\uff08\u8fd9\u91cc\u771f\u7684\u6709\u70b9\u50cf\u8bbe\u8ba1\u56db\u539f\u5219\uff0c\u5bf9\u6bd4/\u805a\u5408\uff09\uff0c\u5c24\u5176\u662f\u65f6\u95f4\u7cbe\u529b\u4e0d\u591f\u65f6\uff0c\u5176\u4e2d\u7684\u7ec6\u8282\u5185\u5bb9\u8bf4\u4e0d\u5b9a\u4e0d\u7528\u62a0\u592a\u7ec6\uff0c\u53ef\u80fd\u62db\u751f\u5b98\u548c prof \u5728\u77ed\u6682 review \u7684\u65f6\u95f4\u91cc\u6355\u6349\u5230\u7684\u4fe1\u606f\u4e5f\u53ea\u6709\u5c11\u91cf\u6700\u663e\u773c\u7684\u3002\u56e0\u6b64\u6211\u7684\u6bcf\u4efd\u6587\u4e66\u90fd\u505a\u4e86\u52a0\u7c97 \\noindent \u8fd9\u6837\u7684\u5c0f\u6807\u9898\u6765\u5f15\u5bfc\u62db\u751f\u5b98\uff0c\u4e0d\u77e5\u9053\u5408\u4e0d\u5408\u89c4\uff0c\u4f46\u662f\u5e94\u8be5\u4e5f\u6ca1\u6709\u89c4\u77e9\uff0c\u4e14 CS-SOP \u4e0a\u4e0d\u5c11\u6587\u4e66\u4e5f\u662f\u8fd9\u6837\u52a0\u5c0f\u6807\u9898\u5199\u7684\uff0c\u6211\u8ba4\u4e3a\u8fd9\u6837\u6bd4\u8f83\u6709\u5229\u6240\u4ee5\u5c31\u8fd9\u6837\u505a\u597d\u4e86\u3002
\u9644\u81ea\u5df1\u9605\u8bfb CS-SOP \u540e\u5199\u81ea\u5df1\u7684 SOP \u524d\uff0c\u7ed9\u81ea\u5df1\u5199\u7684\u7ed3\u6784\u6307\u5bfc
\u7b2c\u4e00\u6bb5\uff1axxx \u662f\u5f88\u91cd\u8981\u7684\uff0c\u6211\u4e00\u76f4\u5bf9 xxx \u611f\u5174\u8da3\uff0c\u6211\u9009\u62e9\u5728 x \u6821\u8bfb phd is naturally a continuation of my previous interests and experiences\u3002\u5177\u4f53\u800c\u8a00\uff0c\u6211\u7684\u7814\u7a76\u5174\u8da3\u4e3a\uff1a ( \u6b64\u5904\u53ef\u4ee5\u6709\u5c0f\u6807\u9898\u548c\u4e00\u53e5\u8bdd\u4ecb\u7ecd \\1. AAA aaaa \\2. BBB bbbb \\3. CCC cccc )
\u7b2c\u4e8c\u6bb5\uff1aAAA \uff08\u5c0f\u6807\u9898\u53ef\u4ee5\u5199\u5b8c\u4e00\u6574\u6bb5\u540e\u6700\u540e\u518d\u8d77\uff09
\u7b2c\u4e09\u6bb5\uff1aBBB \u540c\u4e0a
\u6211\u5728\u5199\u6587\u4e66\u4e4b\u524d\uff0c\u4e00\u76f4\u8ba4\u4e3a\u6211\u7684\u8fc7\u53bb\u7814\u7a76\u7ecf\u5386\u4e0e\u6211\u672a\u6765\u7684\u76ee\u6807\u65b9\u5411\u4e0d\u76f8\u4f3c\uff0c\u4f46\u662f\u6700\u540e push \u81ea\u5df1\u5fc5\u987b\u53bb\u5bfb\u627e\u4e00\u4e2a\u5e73\u8861\u70b9\uff0c\u5bfb\u627e\u80fd\u628a\u5b83\u4eec\u90fd\u6982\u62ec\u4f4f\u7684\u4e24\u4e09\u4e2a\u5c0f\u6807\u9898\u3002\u8fd9\u4e24\u4e09\u4e2a\u5c0f\u6807\u9898\u7684\u9009\u62e9\u9996\u5148\u8981\u670d\u52a1\u4e8e\u672a\u6765\u65b9\u5411\uff0c\u7136\u540e\u56e0\u4e3a\u8fc7\u53bb\u7684\u6bcf\u4e2a\u9879\u76ee\u4e0d\u53ef\u80fd\u53ea\u6709\u4e00\u4e2a\u5c5e\u6027/\u9886\u57df\uff0c\u53ef\u4ee5\u9009\u62e9\u80fd\u591f\u670d\u52a1\u4e8e\u672a\u6765\u65b9\u5411\u7684\u65b9\u9762\u6765\u652f\u6491\u8fd9\u4e9b\u5c0f\u6807\u9898\uff0c\u7528\u201c\u6211\u53d7\u5230\u4e86 xx \u65b9\u9762\u7684\u542f\u53d1\u201d\u201c\u5728\u505a\u8be5\u9879\u76ee\u7684\u65f6\u5019\u4e00\u76f4\u5728\u601d\u8003\u67d0\u65b9\u9762\u4e0d\u8db3\u201d\u4e4b\u7c7b\u7684\u8bdd\u8fde\u63a5\u8d77\u6765\u3002\u6700\u540e\u7684\u611f\u609f\u662f\u5199\u4f5c\u6587\u4e66\u7684\u8fc7\u7a0b\uff08\u63cf\u8ff0\u81ea\u5df1\u7684\u8fc7\u7a0b\uff09\u5373\u8ba4\u8bc6\u548c\u5b9a\u4e49\u81ea\u5df1\u8fc7\u53bb\u7684\u7814\u7a76\u7684\u8fc7\u7a0b\uff0c\u611f\u89c9\u5199\u5b8c\u540e\u6211\u5bf9\u4e4b\u524d\u7814\u7a76\u7684\u8ba4\u8bc6\u4e5f\u786e\u5b9e\u53d8\u6210\u4e86\u8fde\u8d2f\u7684\u4e00\u4e2a\u6574\u4f53\uff0c\u4e14\u4ea7\u751f\u4e86\u4e00\u4e9b\u5bf9\u672a\u6765\u7814\u7a76\u7684\u542f\u53d1\u3002
\u4ee5\u53ca\u90e8\u5206\u9879\u76ee\u4e5f\u4f1a\u5728\u7f51\u7533\u9875\u9762\u7ed9\u51fa\u6587\u4e66\u5199\u4f5c\u6307\u5bfc\uff08e.g. UCSD, CMU\uff09\uff0c\u53ef\u7559\u610f\u9605\u8bfb\u8fd9\u4e9b\u6307\u5bfc\uff0c\u6309\u5177\u4f53\u9879\u76ee\u7684\u6765\u589e\u5220\u6539\u3002
PS
\u5982\u4e0a\u6587\u63d0\u5230\uff0c\u5982\u679c\u90e8\u5206\u5b66\u6821\u53ea\u8981\u6c42\u4e00\u4efd PS\uff0c\u90a3\u4e48\u5e94\u5f53\u662f\u9700\u8981\u5f53\u4f5c SOP \u6765\u5199\u5b66\u672f\u548c\u804c\u4e1a\u5185\u5bb9\u7684\u3002\u6211\u662f\u8fd9\u6837\u89c4\u5212\u7ed3\u6784\u7684\uff1a
\u5982\u679c PS \u548c SOP \u540c\u65f6\u9700\u8981\uff0c\u90a3\u4e48 PS \u7528\u6765\u8bb2\u6545\u4e8b\u6bd4\u8f83\u597d\u3002\u6211\u6ca1\u6709\u8bbe\u8ba1\u4e00\u4efd\u901a\u7528\u7684\u6545\u4e8b\uff0c\u57fa\u672c\u662f\u770b\u9879\u76ee\u8981\u6c42\u3001\u5f55\u53d6\u504f\u597d\u7136\u540e\u5199\u5bf9\u5e94\u7684\u6545\u4e8b\uff0c\u6bd4\u5982 NEU MSCS \u6211\u5199\u4e86\u4e00\u7bc7\u201c\u81ea\u5df1\u5982\u4f55\u4e00\u76f4\u559c\u6b22 cs \u5e76\u4e00\u70b9\u4e00\u70b9\u505a\u5f00\u6e90\u9879\u76ee\u201d\u7684\u6545\u4e8b\uff0cRice \u8ba9\u5199\u4e00\u4e2a\u514b\u670d\u56f0\u96be\u7684\u6545\u4e8b\uff0c\u6211\u5c31\u5199\u6211\u53d7\u5230\u4e86\u4e00\u4e9b\u4e13\u4e1a\u6b67\u89c6\u4f46\u8fd8\u662f\u52aa\u529b\u53bb\u53c2\u4e0e CS \u8bfe\u7a0b\u548c\u793e\u7fa4\u7684\u7ecf\u5386\u3002\u8fd9\u4e24\u6bb5\u90fd\u662f\u6bd4\u8f83\u4e2a\u4eba\u5316\uff0c\u6709\u70b9 emotional\uff0c\u4f46\u662f\u4e3b\u9898\u53c8\u8ddf\u4e2a\u4eba\u54c1\u8d28\u548c\u5b66\u4e1a\u6709\u5173\u7684\uff0c\u6839\u636e\u9762\u8bd5\u6216 offer \u7b49\u9014\u5f84\u7684\u53cd\u9988\u6765\u770b\u611f\u89c9\u62db\u751f\u5b98\u8fd8\u6bd4\u8f83\u770b\u597d\u3002
\u6210\u7ee9\u5355
\u628a\u6210\u7ee9\u5355\u5217\u4e3a\u6587\u4e66\u662f\u56e0\u4e3a\u6211\u4ea4\u4e86\u4e00\u4efd\u975e\u5e38\u4e0d\u5bfb\u5e38\u7684\u6210\u7ee9\u5355\uff0c\u5728\u6210\u7ee9\u5355\u524d\u9762\u9644\u4e86 4 \u9875 cover letter \u8bba\u8ff0\u6211\u8fd9\u51e0\u5e74\u901a\u52e4\u7389\u6cc9\u5927\u6982\u82b1\u8d39\u603b\u65f6\u95f4\u591a\u5c11\uff0c\u6211\u7684\u603b\u5b66\u5206\u6bd4\u522b\u4eba\u591a\u591a\u5c11\uff0c\u6211\u7533\u8bf7\u540e\u6bd5\u4e1a\u524d\u9884\u8ba1\u5b8c\u6210\u7684\u8bfe\u7a0b\u8fd8\u6709\u54ea\u4e9b\uff0c\u603b\u4e4b\u786e\u5b9e\u4e0a\u8bfe\u7684\u5de5\u4f5c\u91cf\u5927\uff0c\u5e0c\u671b\u62db\u751f\u5b98\u4e5f\u80fd\u8003\u8651\u8fd9\u4e2a\u56e0\u7d20\u7b49\u3002\u4e5f\u4e0d\u77e5\u9053\u5408\u4e0d\u5408\u89c4\uff0c\u4f46\u8fd9\u4e9b\u4e1c\u897f\u786e\u5b9e\u4e0d\u77e5\u9053\u54ea\u91cc\u53bb\u5199\u3002\u76ee\u524d\u8fd8\u6ca1\u6709\u76f4\u63a5\u6216\u95f4\u63a5\u7684\u53cd\u9988\u80fd\u544a\u8bc9\u6211\u8fd9\u6837\u505a\u5bf9\u4e0d\u5bf9\u6216\u597d\u4e0d\u597d\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_6","title":"\u6691\u7814","text":"\u5bf9\u4e8e\u6691\u7814\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684 comment \u662f\u5982\u679c\u60f3\u7533\u5317\u7f8e PhD \u5c31\u76f4\u63a5\u53bb\u9676\u74f7\u5317\u7f8e\uff0c\u4e0d\u8981\u5728\u610f\u201c\u5317\u7f8e rank \u4e0d\u597d\u7684\u5b66\u6821\u662f\u4e0d\u662f\u4e0d\u5982\u522b\u7684\u5730\u533a rank \u597d\u7684\u5b66\u6821\u201d\uff0c\u56e0\u4e3a\u5730\u533a\u5185\u5708\u5b50\u7684\u8001\u5e08\u8fd8\u662f\u4f1a\u6bd4\u5730\u533a\u5916\u719f\u4e00\u4e9b\uff0c\u4e14\u90e8\u5206\u8001\u5e08\u6691\u7814\u7684\u98ce\u683c\u662f\u628a\u597d\u5b66\u751f\u63a8\u5411\u66f4\u597d\u7684\u8001\u5e08\u4ee5\u5efa\u7acb\u5b66\u672f connection\u3002\u4ee5\u53ca\u867d\u7136\u5728\u5317\u7f8e onsite \u7814\u7a76\u786e\u5b9e\u5bf9\u793e\u4ea4\u6709\u5229\uff0c\u4f46\u6761\u4ef6\u5f88\u96be\u5177\u5907\uff0c\u56e0\u4e3a\u7b7e\u8bc1\u529e\u7406\u96be\u5ea6\u5927\uff0c\u5bf9\u6559\u6388\u6765\u8bf4\u5e38\u5e38\u6295\u5165\u5927\u4e8e\u56de\u62a5\uff0c\u5b66\u751f\u9002\u5e94\u6210\u672c\u4e5f\u9ad8\uff0c\u4e0d\u4e00\u5b9a\u80fd\u6709\u5229\u4e8e\u6548\u7387\uff0c\u6240\u4ee5\u5982\u679c\u6709 prof \u8ddf\u6211\u8bf4\u4e0d\u613f\u4e3a\u6211\u529e\u7b7e\u8bc1\u6211\u662f\u80fd\u7406\u89e3\u7684\u3002online \u6548\u529b\u4e5f\u4e0d\u4f4e\u7684\u3002
\u5e38\u5e74\u5f00\u653e\u7684\u51e0\u4e2a\u6691\u7814\uff08\u4e0d\u5168\u9762\uff0c\u5efa\u8bae\u591a\u65b9\u53c2\u8003\uff0c\u66f4\u5efa\u8bae\u5927\u80c6\u76f4\u63a5\u90ae\u4ef6\u5957\u74f7\uff09
https://github.com/zhanglj37/Tutorial-on-PhD-Application
"},{"location":"docs/4-opinion/plan/asundergrad/","title":"As An Undergrad \u672c\u79d1\u7684\u4e00\u8def\u8d70\u6765","text":":material-circle-edit-outline: \u7ea6 284 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u4e00\u5207\u8981\u4ece\u5927\u5b66\u662f\u4ec0\u4e48\u7684\u5b9a\u4e49\u8c08\u8d77
\u662f\u5426\u6709\u5fc5\u8981\u8c08\u8fd9\u4e48\u6839\u672c\uff1f\u6709
\u3002\u3002\u3002\u6551\u547d
\u5148\u5806\u79ef\u4e00\u4e9b\u60f3\u5bf9\u672a\u6765\u7684\u81ea\u5df1\u8bf4\u7684\u53e5\u5b50\u5427
\u53c8\u56de\u5bb6\u770b\u5230\u8001\u5e08\u5728\u4f53\u7cfb\u7fa4\u6f47\u6d12\u7559\u4e0b\u4e00\u884c\uff1a\u201c\u8981\u5728\u6da7\u6c34\u6cc9\u58f0\u3001\u6797\u6d9b\u677e\u98ce\u3002\u201d\uff08\u6211\u6ca1\u6709\u67e5\u5230\u8fd9\u53e5\u7684\u51fa\u5904\uff0c\u7591\u4f3c\u662f\u201c\u4e00\u79cd\u5b64\u9ad8\u4e0d\u6613\u6500\uff0c\u6b64\u8eab\u53ea\u5408\u4f4f\u6df1\u5c71\u3002\u517b\u6210\u9cde\u7532\u4e3a\u9f99\u53bb\uff0c\u5316\u4f5c\u4e91\u6d9b\u5f85\u9e64\u8fd8\u3002\u58f0\u5165\u7a7a\u6797\u4eba\u5bc2\u5bc2\uff0c\u54cd\u5f52\u5e7d\u6da7\u6c34\u6f7a\u6f7a\u3002\u53ee\u5b81\u83ab\u628a\u677e\u98ce\u5356\uff0c\u7559\u5728\u5343\u5ca9\u4e07\u58d1\u95f4\u3002\u201d\u4e00\u9996\u8bd7\uff1f\uff09\u6709\u540c\u5b66\u63a5\uff1a\u6362\u4e2a\u5f62\u5f0f\u966a\u5927\u5bb6\uff0c\u90fd\u5728\u7684\u3002\u4e8e\u662f\u53c8\u611f\u5230\u4f55\u5fc5\u9053\u522b\uff0c\u6211\u5df2\u7ecf\u628a\u8fd9\u4e9b\u5e74\u5404\u4f4d\u6240\u6709\u4eba\u8d60\u4e88\u6211\u7684\u77e5\u8bc6\u3001\u6027\u683c\u3001\u89c2\u5ff5\u3001\u529b\u91cf\u5168\u90e8\u5e26\u5728\u8eab\u4e0a\u5e26\u8d70\u4e86\u3002
"},{"location":"docs/4-opinion/plan/find1job/","title":"Find a job in academia or industries?","text":":material-circle-edit-outline: \u7ea6 23 \u4e2a\u5b57
"},{"location":"docs/4-opinion/plan/find1job/#opinions","title":"Opinions","text":"In academia
"},{"location":"docs/4-opinion/plan/find1job/#-","title":"-","text":"In industries
"},{"location":"docs/4-opinion/plan/find1job/#-_1","title":"-","text":""},{"location":"docs/4-opinion/plan/find1job/#my-choice","title":"My Choice?","text":""},{"location":"docs/4-opinion/plan/find1job/#resources","title":"Resources","text":":material-circle-edit-outline: \u7ea6 1 \u4e2a\u5b57
Reference
"},{"location":"docs/4-opinion/plan/zju_ling_cs/","title":"ZJU English Major to CS","text":":material-circle-edit-outline: \u7ea6 4032 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f
\u26a0\ufe0f \u611f\u89c9\u5f53\u65f6\u5199\u5f97\u4e0d\u662f\u5f88\u597d\uff0c\u73b0\u5728\u5f88\u591a\u89c2\u5ff5\u53c8\u6709\u4e9b\u6539\u53d8\uff0c\u53ef\u80fd24\u5e74\u6625\u8282\u671f\u95f4\u7a7a\u4e0b\u6765\u4f1a\u518d\u8ba4\u771f\u6539\u4e00\u4e0borz
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_1","title":"\u672c\u6587\u6863\u662f\u4ec0\u4e48\uff1f","text":"\u7b14\u8005\u8f6c\u4e13\u4e1a\u8e29\u8fc7\u7684\u5751\u548c\u5bf9\u540e\u8f88\u7684\u5efa\u8bae\uff0c\u771f\u5fc3\u60f3\u5efa\u7acb\u8d77ZJU\u5185\u90e8\u826f\u597d\u7684\u4f20\u5e2e\u5e26\u6c1b\u56f4\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_2","title":"\u89c2\u5ff5&\u4e60\u60ef\u95ee\u9898","text":"\u5728\u5177\u4f53\u5efa\u8bae\u524d\u9996\u5148\u56de\u7b54\u4e00\u4e9b\u5e38\u6709\u7684\u62c5\u5fe7+\u505a\u4e00\u4e9b\u4e60\u60ef\u65b9\u9762\u7684\u63d0\u9192
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#cs","title":"\u6211\u80fd\u8f6c\u5230CS\u5417\uff1f","text":"\u80fd\u3002\u6709\u5982\u4e0b\u6848\u4f8b\uff08\u4e0d\u4ee3\u8868\u6240\u6709\u4eba\u613f\u610f\u88ab\u8054\u7cfb\u5230\uff0c\u4e0d\u4fdd\u8bc1\u63d0\u4f9b\u8054\u7cfb\u65b9\u5f0f\uff09
\u60f3\u8c61\u4e00\u4e2a\u7b80\u5386 \u80fd\u5728\u7b80\u5386\u4e0a\u5f88\u663e\u773c\u548c\u4e00\u4e2a\u77ed\u8bed\u4ee5\u5185\u80fd\u8868\u8ff0\u7684\u7ecf\u5386\uff0c\u624d\u8981\u52aa\u529b\u53bb\u5237\u3002 \u6bd4\u5982\u76f8\u6bd4\u4e8e\u201c\u53cc\u4e13\u4e1a\uff0c\u662f\u4e00\u4e2azju\u7279\u6709\u7684\u8f85\u4fee\uff0c\u4e0d\u6c34\u7684\uff0c\u5b83\u8981\u6c42\u7684\u8bfe\u6bd4\u8f85\u4fee\u591a\uff0c\u4f8b\u5982\u6211\u4fee\u4e86xxx\uff0c\u6211\u53ea\u662f\u6ca1\u4feexxx\u201d\u548c\u201c\u4fee\u4e86\u4e00\u534aCS\u8bfe\u4e00\u534aAI\u8bfe\u201d\uff0c\u201cCS\u53cc\u5b66\u4f4d\u201d\u5c31\u66f4\u9002\u5408\u51fa\u73b0\u5728\u7b80\u5386\u4e0a\u3002
\u505a\u91cd\u5927\u51b3\u5b9a\u65f6\uff0c\u81f3\u5c11\u54a8\u8be220\u4e2a\u4eba\u7684\u5efa\u8bae\uff0c\u8981\u4e48\u54a8\u8be2\u4e86\u89e3n\u4e2a\u4eba\u5efa\u8bae\u7684\u4eba\uff08\u6bd4\u5982\u76f8\u5e94\u884c\u4e1a\u7684\u4eb2\u4eba\u670b\u53cb\u3001\u5b66\u751f\u5f88\u591a\u7684\u8001\u5e08\uff09\u6765\u62b5n\u4e2a\u4eba\uff0c\u603b\u4e4b\u603b\u548c\u8981\u62ff\u523020\u4e2a\u4eba\u5de6\u53f3\u7684\u5efa\u8bae\u3002
\u4e0d\u662f\u7684\u3002 - \u7406\u8bba\u4e0a\u662f\u5b8c\u5168\u53ef\u4ee5\u5b66\u597d\u7684\u3002NLP\u5708\u6709\u5f88\u591a\u7814\u7a76\u8005\u8bfb\u8fc7\u8bed\u8a00\u5b66\u548cCS\u53cc\u672c\u79d1\uff0c\u4ee3\u8868AP\u6709AllenNLP Noah Smitch, Colimbia University Zhou Yu\uff08ZJU\u7684\u672c\u79d1\uff09. \u8bfb\u8bed\u8a00\u5b66\u6ca1\u6709\u803d\u8bef\u4ed6\u4eec\u7684\u8111\u5b50\uff0c\u53cd\u800c\u662f\u4e00\u4e2a\u5f88\u597d\u7684idea\u6765\u6e90\u3002\u6211\u611f\u89c9\u6709\u5f88\u591a\u5929\u624d\u7684\u6848\u4f8b\u53ef\u4ee5\u8bc1\u660e\u4eba\u7684\u77e5\u8bc6\u5bb9\u91cf\u548c\u5b66\u4e60\u80fd\u529b\u4e0a\u9650\u662f\u8d85\u51fa\u5927\u5bb6\u60f3\u8c61\u7684\uff0c\u5b66\u4e24\u4e2a\u4e13\u4e1a\u8fd9\u4ef6\u5c0f\u4e8b\u8fdc\u8fdc\u5728\u8fd9\u4e2a\u4e0a\u9650\u4e4b\u4e0b\u3002\u6211\u6c38\u8fdc\u8ba4\u4e3a\u6bc5\u529b\u548c\uff08\u5bf9\u81ea\u5df1\u4eba\u751f\u4e0a\u9650\u7684\uff09\u60f3\u8c61\u529b\u6bd4\u5f53\u524d\u80fd\u529b\u66f4\u6709\u51b3\u5b9a\u4f5c\u7528\u3002 - \u5b9e\u9645\u82f1\u8bed\u4e13\u4e1a\u53bbCS\u53cc\u4e13\u4e1a\u5bb9\u6613\u5403\u4f4e\u7ee9\u70b9\u7684\u539f\u56e0\uff0c\u5f80\u5f80\u4e0d\u662f\u80fd\u529b\u667a\u529b\u4e0d\u8db3\uff0c\u800c\u662f\u6709\u4fe1\u606f\u5dee\uff1a\u751f\u6d3b\u5728\u6587\u79d1\u7684\u6563\u6f2b\u73af\u5883\u4e2d\u96be\u4ee5\u77e5\u9053\u5927\u90e8\u5206\u540c\u5b66\u7684\u81ea\u5b66\u8fdb\u5ea6\uff0c\u548c\u5982\u679c\u67d0\u4e9b\u8bfe\u7a0b\u6709\u5b9e\u8df5\u4e0a\u7684\u5751\uff0c\u6ca1\u6709\u4e0e\u5927\u90e8\u961f\u4e00\u8d77\u5b66\u4e60\u7684\u540c\u5b66\u5c31\u96be\u4ee5\u77e5\u9053\u600e\u6837\u7075\u6d3b\u5e94\u5bf9\u3002\u6240\u4ee5\u5efa\u8bae\u4e0e\u540c\u5b66\u4e00\u8d77\u5b66\u4e60\uff0c\u53c2\u89c1\u4e0b\u4e00\u6761\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#cscs","title":"\u8981\u62e5\u6709\u4e00\u4e2a\u6216\u51e0\u4e2a\u540c\u6837\u8de8\u4e13\u4e1a\u5b66CS\u7684\u670b\u53cb\uff0c\u6216\u76f4\u63a5\u878d\u5165\u540c\u4e00\u7ea7\u7684CS\u672c\u79d1\u751f\u5708\u5b50\u91cc\u3002\u5982\u679c\u5b9e\u5728\u6ca1\u6709\uff0c\u4e00\u4e9b\u5176\u5b83\u5de5\u79d1\u7684\u540c\u5b66\u4e5f\u53ef\u4ee5\u3002","text":"\u540c\u5b66\u7684\u7528\u5904\u6709\uff1a - \u5e2e\u52a9\u4f60\u8ddf\u4e0a\u5b66\u4e60\u8282\u594f\u3002CS\u7684\u751f\u6d3b\u8282\u594f\u662f\u82f1\u8bed\u4e13\u4e1a\u76842\u500d\uff0c\u662f\u7406\u79d1\u4e13\u4e1a\u76841.5\u500d\uff0c\u5982\u679c\u51b3\u5b9a\u8f6c\u4e13\u4e1a\u662f\u9700\u8981\u4e3b\u52a8\u63d0\u9ad8\u4e00\u4e0b\u751f\u6d3b\u8282\u594f\u7684\uff0c\u505a\u4e8b\u79ef\u6781\u4e00\u70b9\uff0c\u544a\u522b\u62d6\u5ef6\u3002 - \u4e92\u76f8\u63a8\u8350\u597d\u7684\u81ea\u5b66\u8d44\u6599\uff0c\u4e92\u76f8\u5206\u4eab\u7b14\u8bb0\u548c\u8ba8\u8bba\u9898\u76ee\uff0c\u5206\u5de5\u6574\u7406\u671f\u672b\u590d\u4e60\u8d44\u6599\uff0c\u671f\u672b\u4e92\u76f8\u63d0\u95ee\uff0c\u5f62\u6210\u81ea\u5b66\u6c1b\u56f4\uff0c\u8282\u7701\u4e00\u4e9b\u8e29\u5751\u65f6\u95f4\u3002 - \u5982\u679c\u67d0\u4e9b\u8bfe\u7a0b\u5b89\u6392\u6709\u6559\u5b66\u4e8b\u6545\uff0c\u4f60\u53ef\u4ee5\u53ca\u65f6\u77e5\u9053\u5927\u90e8\u5206\u540c\u5b66\u662f\u600e\u6837\u5e94\u5bf9\u7684\uff0c\u53ca\u65f6\u8c03\u6574\u81ea\u5df1\u7684\u5e94\u5bf9\u63aa\u65bd\uff0c\u9632\u6b62\u5982\u679c\u6210\u7ee9\u5360\u6bd4\u7a81\u7136\u8c03\u6574\uff0c\u81ea\u5df1\u5c06\u52aa\u529b\u82b1\u5728\u4e86\u6700\u540e\u5360\u6210\u7ee9\u6bd4\u91cd\u5f88\u5c0f\u7684\u5730\u65b9\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_5","title":"\u8981\u591a\u8bb0\u7b14\u8bb0","text":"\u8bb0\u7b14\u8bb0\u662f\u8d39\u66fc\u5b66\u4e60\u6cd5\u7684\u6295\u5165\u4ea7\u51fa\u6bd4\u6700\u9ad8\u7684\u5b9e\u8df5\u5f62\u5f0f\uff0c\u5373\u65e2\u5e2e\u52a9\u68c0\u67e5\u7406\u89e3\uff0c\u7b14\u8bb0\u53c8\u9020\u798f\u540e\u4eba\u3002\u4f60\u53ef\u4ee5\u79c9\u627f\u5f00\u6e90\u7cbe\u795e\uff0c\u50cf\u524d\u8f88\u4e00\u6837\u591a\u5c06\u7b14\u8bb0\u516c\u5e03\u9020\u798f\u540e\u4eba\uff08\u4e0d\u8fc7\u8bf7\u9075\u5b88\u8bda\u4fe1\u5b88\u5219\uff09\u3002\u975e\u5e38\u5e0c\u671bZJU\u80fd\u9010\u6e10\u5f62\u6210\u8f83\u597d\u7684\u4f20\u5e2e\u5e26\u6c1b\u56f4\uff0c\u8ba9\u540e\u8f88\u4e5f\u6709\u826f\u597d\u6821\u53cb\u8d44\u6e90\u53ef\u4eab\u7528\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_6","title":"\u6211\u53ef\u4ee5\u4ee5\u600e\u6837\u7684\u8eab\u4efd\u672c\u79d1\u6bd5\u4e1a\uff1f\u6211\u6709\u54ea\u4e9b\u53ef\u884c\u7684\u51fa\u8def\uff1f","text":"\u4ee5\u4e0b\u8fd9\u4e9b\u90fd\u662f\u53ef\u80fd\u505a\u5230\u7684\uff0c\u6211\u4e5f\u5206\u522b\u5217\u51fa\u4e86\u6211\u8ba4\u4e3a\u9700\u8981\u51c6\u5907\u7684\u80cc\u666f\u3002 - \u51fa\u56fdms\uff1a\u7ee9\u70b9\uff0c\u6691\u7814/\u5b9e\u4e60 - \u51fa\u56fd\u76f4\u63a5phd\uff1a\u6691\u7814\uff0cpaper - \u672c\u6821\u76f4\u535a\uff1a\u7ee9\u70b9\uff0c\u8fdb\u672c\u6821\u7ec4\uff0c\u590f\u4ee4\u8425\uff0cpaper - \u8de8\u6821\u76f4\u535a\uff1a\u7ee9\u70b9\uff0c\u5bf9\u65b9\u6821\u590f\u4ee4\u8425\uff0cpaper - \u5de5\u4f5c\uff1a\u5237\u9898\uff0c\u5b9e\u4e60 \u5176\u4e2d\u6211\u8ba4\u4e3a\u503c\u5f97\u6ce8\u610f\u7684\u8fd8\u6709\uff0c\u5177\u4f53\u6700\u597d\u7531\u8bfb\u8005\u518d\u54a8\u8be2\u76f8\u5e94\u8eab\u4efd\u7684\u4eba\u7684\u5efa\u8bae\u3002\u672c\u6761\u9002\u7528\u524d\u9762\u6240\u8ff0\u201c20\u4e2a\u4eba\u5efa\u8bae\u201d\u51c6\u5219\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_7","title":"\u8bfe\u7a0b","text":""},{"location":"docs/4-opinion/plan/zju_ling_cs/#cs_4","title":"CS\u5fc5\u4fee\u8bfe","text":"\u9996\u5148\u8981\u660e\u786e\u4e00\u4e2a\u8ba4\u77e5\u95ee\u9898\uff1a\u8bfbCS\u53cc\u5b66\u4f4d\u662f\u4e00\u4e2a\u539f\u5b50\u6027\u7684\u4e8b\u52a1\uff0c\u8981\u4e48\u4e0d\u8bfb\uff0c\u8981\u4e48\u6309\u9700\u6c42\u8bfb\u5b8c\u6216\u8f85\u4fee\u6216\u53cc\u5b66\u4f4d\uff0c\u8fd9\u4e24\u79cd\u9009\u62e9\u90fd\u662f\u6295\u5165\u4ea7\u51fa\u6bd4\u8f83\u9ad8\u7684\uff1b\u6295\u5165\u4ea7\u51fa\u6bd4\u6700\u4f4e\u7684\u662f\u8bfb\u4e00\u534a\uff08\u5fae\u8f85\u4fee\u6216\u53cc\u4e13\u4e1a\uff09\u3002 \u8be5\u56fe\u4e2d\u9664\u6570\u7406\u57fa\u7840\u6a21\u5757\u4e0d\u662f\u53cc\u5b66\u4f4d\u5fc5\u4fee\uff0c\u5176\u5b83\u662f\u5fc5\u4fee\u3002 \uff08\u8fd9\u4e2a\u56fe\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6709\u4e2a\u7ea2\u5708\uff0c\u627e\u4e0d\u5230\u539f\u56fe\u4e86\uff0c\u6279\u8bc4cyh\u540c\u5b66\u4e71\u753b\uff09
\u9009\u4e0d\u4e0aCS\u7684\u8bfe\u600e\u4e48\u529e\uff1f - \u6700\u6709\u6548\uff1a\u8865\u9009+\u5728\u8865\u9009\u7684\u51e0\u5929\u91cc\u7ebf\u4e0b\u53bb\u9009\u8bfe\u529e\u6216\u7ed9\u9009\u8bfe\u529e\u53d1\u90ae\u4ef6\u3002\u674e\u6653\u8001\u5e08\u548c\u5f20\u4f20\u534e\u8001\u5e08\u90fd\u5f88nice\uff0c\u8868\u793a\u81ea\u5df1\u5f88\u60f3\u9009\u8bfe\uff0c\u8ddf\u8001\u5e08\u8bf4\u660e\u539f\u56e0\u3002 - \u7b2c\u4e8c\u6709\u6548\uff1a\u5982\u679c\u4efb\u8bfe\u8001\u5e08\u5728\u8ba1\u9662\u8bdd\u8bed\u6743\u8f83\u5927\uff0c\u8bf7\u4efb\u8bfe\u8001\u5e08\u5e2e\u5fd9\u8ddf\u9009\u8bfe\u529e\u8bf4\uff0c\u80fd\u4fdd\u8bc1\u4f60\u9009\u4e0a\u8be5\u8001\u5e08\u7684\u8bfe\u3002 - \u7b2c\u4e09\u6709\u6548\uff1a\u9009\u8bfe\u65f6\u4e0eCS\u7684\u540c\u5b66\u5546\u91cf\uff0c\u505a\u51fa\u65f6\u95f4\u6b63\u597d\u7684\u4e00\u4e9b\u8bfe\u8868\u3002\u53ef\u80fd\u6d89\u53ca\u5230\u201c\u7528\u4e00\u4e9b\u8bfe\u5835\u4f4f\u53e6\u4e00\u4e9b\u8bfe\u201d\u8fd9\u79cd\u590d\u6742\u64cd\u4f5c\uff0c\u6240\u4ee5\u5408\u4f5c\u6bd4\u8f83\u5212\u7b97\u3002
\u600e\u4e48\u5b66\uff1f - ZJU\u8bfe\u7a0b\u5171\u4eab\u8ba1\u5212 https://github.com/QSCTech/zju-icicles - \u56fe\u7075\u73ed\u8bfe\u7a0b\u901f\u901a\u8ba1\u5212 https://github.com/ZJU-Turing/TuringCourses - \u4e00\u4f4d\u5b66\u957f\u7684\u4f18\u8d28\u7b14\u8bb0 \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4\uff01 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4 (xuan-insr.github.io) - \u4e00\u4f4d\u5b66\u957f\u7684\u4f18\u8d28\u7b14\u8bb0 https://github.com/Zhang-Each/CourseNoteOfZJUSE
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#ai","title":"AI","text":"AI\u8bfe\u4e00\u822c\u6bd4CS\u8bfe\u597d\u9009\uff0c\u4f46\u662f\u5982\u679c\u9009\u4e0d\u4e0a\u4e5f\u8bf7\u9075\u7167\u4e0a\u6761\u4e2d\u7684\u5efa\u8bae\u3002 \u975e\u5fc5\u8981\u4e0d\u9009AI\u8bfe\uff0cAI\u8bfe\u6700\u5927\u7684\u6536\u83b7\u662f\u5728\u7b80\u5386\u4e0a\u4f5c\u4e3a\u4e00\u4e2a90+\u8bfe\u7a0b\u51fa\u73b0\uff0c\u57fa\u672c\u5b66\u4e0d\u5230\u4e1c\u897f\uff08\u9664\u4e86NLP\u8bfe\u6211\u611f\u89c9\u542c\u8bfe\u6536\u83b7\u633a\u5927\u7684\uff09\uff0c\u4e3b\u8981\u9760\u81ea\u5b66\u540e\u5377\u51fa\u5927\u4f5c\u4e1a\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_8","title":"\u8bed\u8a00\u5b66","text":"\u56e0\u4e3a\u82f1\u4e13\u57f9\u517b\u65b9\u6848\u8fd8\u662f\u8981\u6c42\u4fee\u5927\u91cf\u4e13\u4e1a\u8bfe\u7684\uff0c\u611f\u89c9\u53ef\u4ee5\u5c3d\u91cf\u628a\u8bed\u8a00\u5b66\u6a21\u5757\u591a\u4fee\u4e00\u70b9\uff0c\u6709\u4e9b\u5728\u8fdb\u7ec4\u7684\u65f6\u5019\u53ef\u80fd\u8fd8\u662f\u8ba4\u53ef\u7684\u3002 \u4ee5\u4e0b\u8bfe\u7a0b\u5982\u679c\u62ff\u4e86\u9ad8\u5206\u503c\u5f97\u5728\u7b80\u5386\u4e0a\u4e00\u63d0 - \u5f53\u4ee3\u8bed\u8a00\u5b66 - \u8bed\u97f3\u5b66 - \u53e5\u6cd5\u5b66 - \u5fc3\u7406\u8bed\u8a00\u5b66 - \u8bed\u4e49\u5b66 - \u8bed\u7528\u5b66 - \u8bed\u6599\u5e93\u8bed\u8a00\u5b66
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_9","title":"\u6570\u5b66","text":"\u5bf9\u4e8ePhD\u3001\u627e\u5de5\u548c\u56fd\u5185\u76f4\u535a\uff1a \u53ef\u80fd\u4e0d\u9700\u8981\u6570\u5b66\u3002\u3002\u3002\u8ba4\u4e3a\u6700\u597d\u4e0d\u8981\u989d\u5916\u9009\u6570\u5b66\u8bfe \u6211\u81f3\u4eca\u9047\u5230\u7684\u8001\u5e08\u6ca1\u6709\u56e0\u4e3a\u6211\u7b80\u5386\u4e0a\u4efb\u4f55\u6570\u5b66\u76f8\u5173\u7684\u4e1c\u897f\u800c\u5f55\u6211\u6216\u62d2\u6211\u7684\uff0c\u90fd\u662f\u53ea\u95ee\u7f16\u7a0b\u3002 CS\u4e13\u4e1a\u8bfe\u91cc\u7684\u79bb\u6563\u6570\u5b66\u548c\u8ba1\u7b97\u7406\u8bba\uff08\u548c\u53ef\u80fd\u8fd8\u6709\u6570\u903b\uff09\u5df2\u7ecf\u8db3\u591f\u57f9\u517b\u6570\u5b66\u601d\u7ef4\u3002 \u5982\u679c\u62c5\u5fc3\u6570\u636e\u5206\u6790\u548c\u7edf\u8ba1\u6280\u80fd\uff0c\u6587\u6570\u91cc\u636e\u8bf4\u5e94\u7528\u7edf\u8ba1\u5b66\u8fd9\u95e8\u8bfe\u7a0b\u6bd4\u9ad8\u7b49\u6570\u5b66\u597d\u4f7f\uff0c\u8fd8\u6709\u673a\u4f1a\u7684\u540c\u5b66\u53ef\u4ee5\u8bd5\u4e00\u4e0b\u3002
\u5bf9\u4e8ems\uff1a \u786e\u5b9e\u6709\u4e00\u4e9b\u9879\u76ee\u8981\u6c42\u4fee\u8fc7\u4e00\u4e9b\u6570\u5b66\u8bfe\u7a0b\uff0c\u4f8b\u5982\u521a\u770b\u5230SUTD\u7684ISTD ms\u8981\u6c42\u4e24\u5b66\u671f\u5fae\u79ef\u5206\uff0c\u4e00\u5b66\u671f\u7ebf\u4ee3\u548c\u4e00\u5b66\u671f\u6982\u7edf\uff0c\u8fd9\u79cd\u65e0\u7591\u662f\u6bd4\u8f83\u4e0d\u53cb\u597d\u7684\u9879\u76ee\u4e86\u3002 \u4e5f\u6709\u6bd4\u8f83\u53cb\u597d\u7684\u9879\u76ee\uff0c\u5317\u7f8e\u4e00\u4e9b0\u57fa\u7840\u8f6c\u7801\u9879\u76ee\u53ef\u53c2\u7167OpenCSapp\uff0c\u82f1\u56fd\u7684IC\u548cUCL\u5728\u524d\u5e74\u4e5f\u5f00\u4e86\u96f6\u57fa\u7840\u8f6c\u7801\u9879\u76ee\uff0c\u4e0d\u8fc7\u51fa\u8def\u548c\u542b\u91d1\u91cf\u9700\u8981\u81ea\u5df1\u8861\u91cf\uff0c\u8fd8\u662f\u5efa\u8bae\u201c\u54a8\u8be220\u4e2a\u4eba\u201d\u51c6\u5219\u3002\u4ee3\u8868dp\u662f18\u7ea7SJTU\u82f1\u8bed\u4e13\u4e1a\uff0c4\u6bb5\u79d1\u7814\u6216\u4e92\u8054\u7f51\u5382NLP\u4ea7\u54c1\u5b9e\u4e60\uff0c\u5c11\u91cf\u9ad8\u5206\u6570\u5b66\u548c\u7f16\u7a0b\u8bfe\u7a0b\uff0c\u7ee9\u70b990+ \u2192 IC CS ms
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_10","title":"\u7ee9\u70b9","text":"\u53c2\u7167\u8fd9\u4e9b\u9876\u4f1a\u90fd\u6709\u4ec0\u4e48track\uff0c\u4e0b\u9762\u662f\u6700\u8fd1\u4e00\u671f\u6bcf\u4e2atrack\u7684best paper - Best Papers - ACL 2023 (aclweb.org) - Best Paper Awards - emnlp 2022 (balhafni.github.io) - Transactions of the Association for Computational Linguistics (transacl.org) - Announcing the NAACL 2022 Best Paper Awards! - NAACL-HLT 2022
\u7279\u522b\u5730\uff0c\u60f3\u5230NLP\u91cc\u6bd4\u8f83\u7eaf\u8bed\u8a00\u5b66\u7684\u4e3b\u9898/\u65b9\u6cd5\u4e5f\u6709\u4e00\u4e9b\uff0c\u6709\u5982\u4e0b\u51e0\u4e2a \u4e3a\u4ec0\u4e48\u8981\u8bb2\u8fd9\u4e00\u5757\u56e0\u4e3a\u62c5\u5fc3\u4f60\u5728\u9762\u8bd5\u7684\u65f6\u5019\u4f1a\u9700\u8981\u5411\u8001\u5e08\u8bc1\u660e\u4f60\u7684\u53e6\u4e00\u90e8\u5206\u4e13\u4e1a\u77e5\u8bc6\u4e5f\u662f\u6709\u7528\u7684 \u4e00\u822c\u6b27\u6d32\u7684NLP\u4f1a\u504f\u8bed\u8a00\u5b66\u4e00\u70b9 - \u5b9e\u9a8c\u8bed\u97f3\u548c\u97f3\u7cfb\u5b66 - \u7528\u8bed\u8a00\u5b66\u77e5\u8bc6\u505a\u6570\u636e\u548c\u6570\u636e\u589e\u5f3a - AI\u4e2d\u7684\u4f26\u7406\u9053\u5fb7\u95ee\u9898 - \u7a00\u6709\u8bed\u8a00\u6316\u6398
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_12","title":"\u5982\u4f55\u9009\u5bfc\uff1f","text":"\u56fd\u5916\u5bfc\u5e08\uff1a\u5e38\u8bfb\u6bcf\u5e74\u7684\u9876\u4f1a\u6709\u610f\u601d\u8bba\u6587\uff0c\u5e76\u53c2\u7167CSRankings: Computer Science Rankings\uff0c\u5173\u6ce8\u5b66\u672f\u5708\u517b\u597d\u53f7\u540e\u5e38\u5237Twitter \u56fd\u5185\u6821\u5185\u5bfc\u5e08\uff1a\u5982\u679c\u6709\u60f3\u8be2\u95ee\u7684\u5bfc\u5e08\u540d\u5355\u53ef\u4ee5\u90ae\u4ef6\u95ee\u6211 \u9009\u5bfc\u6216\u8005\u8054\u7cfbPhD\u7684\u65f6\u5019\u5982\u679c\u63a5\u5230\u7684\u4efb\u52a1\u662f\u4e8c\u4f5c\u4e09\u4f5c\u5f80\u540e\uff0c\u5f88\u53ef\u80fd\u662f\u6253\u767d\u5de5\uff0c\u57fa\u672c\u53ef\u4ee5\u62d2\u7edd\u3002\u9664\u975e\u4f60\u8ba4\u4e3a\u4f60\u627f\u62c5\u7684\u5de5\u4f5c\u8f83\u4e3a\u91cd\u8981\uff0c\u8001\u5e08\u53ef\u4ee5\u7ed9\u4f60\u63a8\u8350\u4fe1\uff0c\u4e8c\u4f5c\u4e09\u4f5c\u7684\u4f5c\u7528\u53ef\u80fd\u6ca1\u6709\u63a8\u8350\u4fe1\u5927\u3002 \u5982\u679c\u7533\u8bf7PhD\uff0c\u63a8\u8350\u4fe1\u7684\u529b\u5ea6\uff1a\u4f60\u4e0e\u63a8\u8350\u4eba\u7684\u4ea7\u51fa\u5f88\u91cd\u8981+\u76ee\u6807PhD\u5bfc\u8ba4\u8bc6\u7684\u4eba > \u4f60\u4e0e\u63a8\u8350\u4eba\u7684\u4ea7\u51fa\u5f88\u91cd\u8981+\u76ee\u6807PhD\u5bfc\u4e0d\u8ba4\u8bc6\u7684\u4eba > \u5176\u5b83
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_13","title":"\u7533\u8bf7","text":"\u56e0\u4e3a\u4fdd\u7814\u548c\u627e\u5de5\u6211\u786e\u5b9e\u4e0d\u61c2\uff0c\u8fd9\u91cc\u6682\u65f6\u53ea\u5199\u7533\u8bf7\u4e86\u3002\u540e\u7eed\u6709\u8bf7\u5171\u540c\u4f5c\u8005\u6269\u5c55\u5185\u5bb9\u7684\u8ba1\u5212\uff0c\u5982\u613f\u610f\u8d21\u732e\u8bf7\u8054\u7cfb\u6211\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#check-point","title":"Check Point","text":"\u5927\u4e00\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u4e13\u5fc3\u5b66\u4e13\u4e1a\u8bfe \u5927\u4e8c\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u8fdb\u7ec4\uff0c\u5b66\u4f1apytorch\uff0c\u8bad\u8fc7\u4e00\u4e9b\u5e38\u7528\u7684\u6a21\u578b \u5927\u4e09\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u4ea7\u51fa\u4e00\u4f5c\u6216\u5171\u4e00\u8bba\u6587
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_14","title":"\u6211\u8981\u4e0d\u8981\u627e\u4e2d\u4ecb\uff1f","text":"\u4e0d\u8981\u3002 \u539f\u56e0\u4e00\uff1aCS\u7684\u5728\u7ebf\u514d\u8d39\u8d44\u6599\u8db3\u591f\u4f7f\u7528 \u539f\u56e0\u4e8c\uff1a\u4e2d\u4ecb\u7684\u4fe1\u606f\u66f4\u65b0\u901f\u5ea6\u8d76\u4e0d\u4e0aCS\u5b66\u79d1\u7684\u53d1\u5c55\u901f\u5ea6
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_15","title":"\u6211\u7533\u8bf7\u53ef\u4ee5\u53c2\u8003\u54ea\u4e9b\u8d44\u6599\uff1f","text":"\u7533\u8bf7MS - \u5317\u7f8e\u7684CS master Home - Open CS Application - \u9664\u5317\u7f8e\u5916\u7684\u5176\u5b83CS master Global CS (global-cs-application.github.io) - \u4e00\u4ea9\u4e09\u5206\u5730/\u5bc4\u6258\u5bb6\u56ed\u7b49\u8bba\u575b - CC98\u4e0a\u6bcf\u4e00\u5e74CS\u7684\u98de\u8dc3\u624b\u518c
\u7533\u8bf7PhD - \u6b27\u7f8eNLP\u5708\u5bf9PhD\u7533\u8bf7\u7684\u5efa\u8bae https://github.com/zhijing-jin/nlp-phd-global-equality - \u4e86\u89e3\u5b66\u79d1\u4f18\u52bf\u5b66\u6821\u548c\u5bfc\u5e08 CSRankings: Computer Science Rankings - \u6ce8\u518c\u4e00\u4e2aTwitter\u8d26\u53f7\uff0c\u5f00\u59cb\u5173\u6ce8NLP\u5708\u7684PhD\u548cAP\uff0c\u5404\u79cd\u7533\u8bf7\u673a\u4f1a\u4ed6\u4eec\u90fd\u4f1a\u5c3d\u5feb\u53d1\u5e03\u7684\u3002\u6bd4\u5982\u4f60\u53ef\u4ee5\u5148\u4eceAndrew Ng\u3001Christopher Manning\u3001Geoffrey Hinton\u8fd9\u79cd\u8001\u6559\u6388\u5173\u6ce8\u8d77\uff0c\u7136\u540e\u5173\u6ce8\u4ed6\u4eec\u7684\u5173\u6ce8\u8fd9\u6837\u6765\u641e\u3002 - \u5173\u6ce8\u4e00\u4ea9\u4e09\u5206\u5730/CC98/\u4e00\u4e9b\u5fae\u4fe1\u516c\u4f17\u53f7/\u77e5\u4e4e\u7684\u62db\u751f\u4fe1\u606f
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_16","title":"\u6295\u9012\u6691\u7814\u6ce8\u610f\u4e8b\u9879","text":"\u6d41\u7a0b\u540c\u7533\u8bf7PhD \u5df2\u7ecf\u719f\u8bc6\u7684\u5bfc\u5e08\u63a8\u8350\u662f\u6700\u5feb\u7684\uff1b\u5426\u5219\u5c31\u81ea\u5df1\u6d77\u6295\uff0c\u6295\u53d1\u5e03\u8fc7\u62db\u751f\u5e7f\u544a\u6216\u4e3b\u9875\u8868\u660e\u6b63\u5728\u62db\u751f\u7684\u8001\u5e08\u662f\u6700\u5feb\u7684\u3002\u6709\u7684\u65f6\u5019\u53ef\u4ee5\u5c1d\u8bd5\u6295\u8ba4\u8bc6\u7684PhD\uff0c\u56e0\u4e3a\u6691\u7814\u671f\u95f4\u5927\u90e8\u5206\u60c5\u51b5\u8fd8\u662f\u8ddf\u7740PhD\u6253\u5de5\u3002 \u5982\u679c\u8001\u5e08\u7ed9\u4f60\u7684\u8d23\u4efb\u6bd4\u8f83\u91cd\uff0c\u4e14\u4f60\u6709\u6bd4\u8f83\u597d\u7684\u5de5\u4f5c\u73af\u5883\uff0c\u6211\u8ba4\u4e3a\u7ebf\u4e0a\u7ebf\u4e0b\u533a\u522b\u4e0d\u5927\u3002 \u60f3\u53bb\u5317\u7f8e\u5c31\u5957\u5317\u7f8e\uff0c\u6211\u89c9\u5f97\u6700\u597d\u4e0d\u8981\u627e\u8df3\u677f\uff0c\u6709\u5317\u7f8e\u7684\u7ebf\u4e0a\u6691\u7814\u4e5f\u5f88\u597d\uff0c\u53ea\u8981\u662f\u4f60\u4e00\u4f5c\uff0c\u65f6\u957f6\u4e2a\u6708\u4ee5\u4e0a\uff0c\u6bcf\u5468\u6c47\u62a5\u8fdb\u5ea6\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_17","title":"\u6295\u9012\u5b9e\u4e60\u6ce8\u610f\u4e8b\u9879","text":"\u9700\u8981\u5b9e\u4e60 iff \u4f60\u6253\u7b97\u627e\u5de5or\u8bfb\u5b8c\u7855\u58eb\u627e\u5de5\uff0c\u7533\u8bf7\u5b66\u672f\u7c7bms\u548cPhD\u7684\u8bdd\uff0c\u5b9e\u4e60\u4e0d\u5f3a\u6c42\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#-xuan-insrgithubio","title":"- \ud83c\udff3\ufe0f\u200d\ud83c\udf08 \u603b\u89c8 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4 (xuan-insr.github.io) \u627e\u6691\u671f\u5b9e\u4e60\u548c\u79cb\u62db\u7684\u7ecf\u9a8c\u5e16","text":"http://www-cc98-org-s.webvpn.zju.edu.cn:8001/topic/4950730
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_18","title":"\u5173\u4e8e\u7b14\u8005&\u8054\u7cfb\u7b14\u8005","text":"\u7b14\u8005\u4f30\u8ba1\u662f\u4ece\u82f1\u8bed\u4e13\u4e1a\u8f6cNLP\u89c4\u5212\u6700\u4e0d\u987a\u3001\u8fdb\u5ea6\u6700\u66f2\u6298\u7684\u4e00\u4e2a\u3002\u8fd9\u4efd\u6587\u6863\u4e0d\u662f\u4ec0\u4e48\u6210\u529f\u7ecf\u9a8c\u5206\u4eab\uff0c\u6211\u5e76\u4e0d\u6210\u529f\uff0c\u53ea\u662f\u60f3\u628a\u6211\u8e29\u8fc7\u7684\u5751\u544a\u8bc9\u540e\u4eba\uff0c\u5e0c\u671b\u5c11\u6709\u4eba\u91cd\u8e48\u6211\u7684\u8986\u8f99\u3002\u6211\u89c9\u5f97\u6211\u7684\u9ad8\u4e2d\u548c\u672c\u79d1\u8fc7\u5f97\u592a\u574e\u5777\u4e86\uff0c\u771f\u8bda\u5730\u60f3\u5e2e\u52a9\u5b66\u5f1f\u5b66\u59b9\uff0c\u5e0c\u671b\u4f60\u4eec\u4e00\u5207\u987a\u5229\u3002\u8bfb\u8005\u53ef\u4ee5\u4ee5\u6211\u4f5c\u4e3a\u57fa\u51c6\uff0c\u5728\u56db\u5e74\u540e\u4e0d\u80fd\uff08\u5f53\u7136\u5982\u679c\u65e9\u505a\u89c4\u5212\uff0c\u4e00\u76f4\u5728\u52aa\u529b\uff0c\u4e5f\u4e0d\u4f1a\uff09\u6bd4\u6211\u66f4\u5dee\u3002\u6bd5\u7adf\u4e00\u6761\u8def\u8d70\u7684\u4eba\u591a\u4e86\uff0c\u540e\u4eba\u4e00\u5b9a\u662f\u8981\u8d8a\u8d70\u8d8a\u987a\u7684\u3002
\u5982\u6709\u5efa\u8bae\u6216\u7591\u95ee\u8bf7\u901a\u8fc7\u90ae\u4ef6\u8054\u7cfb\u6211 RuoxiNing@outlook.com\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#recommended-readings","title":"Recommended Readings","text":":material-circle-edit-outline: \u7ea6 47 \u4e2a\u5b57
\u8bb0\u5f55\u4e00\u70b9\u597d\u7528\u7684\u5de5\u5177
"},{"location":"docs/4-opinion/tools/#contents","title":"Contents \u76ee\u5f55","text":"\u96f6\u6563\u7684\u5c31\u653e\u5728\u8fd9\u91cc
"},{"location":"docs/4-opinion/tools/#_2","title":"\u5728\u7ebf\u6253\u65f6\u95f4\u8f74\u5de5\u5177","text":"https://judes.me/lrc_editor/
"},{"location":"docs/4-opinion/tools/howtocite/","title":"How to cite elegantly?","text":":material-circle-edit-outline: \u7ea6 17 \u4e2a\u5b57
"},{"location":"docs/4-opinion/tools/howtocite/#which-format","title":"Which format?","text":""},{"location":"docs/4-opinion/tools/howtocite/#in-text-citation","title":"In-text citation","text":""},{"location":"docs/4-opinion/tools/howtocite/#references","title":"References","text":""},{"location":"docs/4-opinion/tools/howtocite/#tools","title":"Tools","text":"... But the best tool is by hand
"},{"location":"docs/4-opinion/tools/notes/","title":"\u5bf9\u7b14\u8bb0\u5de5\u5177\u548c\u4fe1\u606f\u8bb0\u5f55\u7684\u601d\u8003","text":":material-circle-edit-outline: \u7ea6 423 \u4e2a\u5b57 :fontawesome-solid-code: 3 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/4-opinion/tools/notes/#_2","title":"\u4e3a\u4ec0\u4e48\u8981\u5199\u8fd9\u4e9b\u7b14\u8bb0","text":"\u672c\u6765\u60f3\u5199\u591a\u4e00\u70b9\u7684\uff0c\u4f46\u662f\u592a\u61d2\u4e86
"},{"location":"docs/4-opinion/tools/notes/#_3","title":"\u7b14\u8bb0\u5de5\u5177\uff1f","text":"\u5bf9\u6211\u6765\u8bf4\u4e00\u4e2a\u5b8c\u5168\u9762\u5411\u8fc7\u7a0b\u7684 -> \u4e00\u4e2a\u5b8c\u5168\u9762\u5411\u5bf9\u8c61\u7684
\u6bd4\u5982 notion \u662f\u9762\u5411\u6d41\u7a0b\u7684
\u800c\u5982\u679c\u8981\u6709\u7ed3\u6784\u5199\u4f5c\uff0c\u5c31\u7528 mkdocs
"},{"location":"docs/4-opinion/tools/notes/#notionobsidian","title":"\u9009\u62e9Notion\u548cObsidian","text":"\u5148\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u7ed3\u8bba
\u4f18\u70b9/\u5de5\u5177 Notion Obsidian \u8bed\u6cd5 \u81ea\u5df1\u7684\u4e00\u5957\u8bed\u6cd5\uff0c\u90e8\u5206\u662fmarkdown \u7eafmarkdown \u4e66\u5199\u901f\u5ea6 \u6162 \u5feb \u6587\u6863\u6574\u9f50\u7a0b\u5ea6 \u9ad8 \u4f4e \u90e8\u7f72\u5230mkdocs\u96be\u6613 \u6613\uff0c\u53ef\u76f4\u63a5\u7528 \u96be\uff0c\u9700\u8c03\u6574\u5f88\u591a\u683c\u5f0f \u5bfc\u51fa\u4e2d\u6587\u652f\u6301\u7a0b\u5ea6 \u53ea\u6709\u4e09\u79cd\u5b57\u4f53\uff0c\u90e8\u5206\u4e2d\u6587\u7f3a\u5b57 \u5b57\u4f53\u591a\uff0c\u652f\u6301\u6bd4\u8f83\u597d\u76ee\u524d\u6211\u9009\u62e9\u7684 workflow: \u5b8c\u5168\u629b\u5f03 Ob \u4e86\uff01
graph TD\n \u542c\u5199 --> Notion \n Notion -- \u6709\u65f6\u95f4 --> mkdocs\n
"},{"location":"docs/4-opinion/tools/notes/#_4","title":"\u6587\u732e\u7ba1\u7406\u5de5\u5177","text":"TODO
\u5176\u5b9e\u4ed3\u5e93\u91cc\u672c\u6587\u4ef6\u5939\u4e0b\u7684asset\u91cc\u73b0\u5728\u6709\u4e2a\u600e\u4e48\u914d\u7f6ezotero\u7684ppt\uff0c\u592a\u61d2\u6ca1\u65f6\u95f4\u6574\u8fc7\u6765\uff0c\u53ef\u4ee5\u5148\u53bb\u4ed3\u5e93\u91cc\u627e\u627eorz
"},{"location":"docs/4-opinion/tools/notes/#_5","title":"\u8bba\u6587\u7b14\u8bb0","text":"TODO
"},{"location":"docs/4-opinion/tools/notes/#todolist","title":"TODOlist\uff1f","text":"\u5bf9\u6211\u6765\u8bf4\u4e5f\u9700\u8981\u4e00\u4e2a\u9762\u5411\u8fc7\u7a0b\u7684\uff08\u60f3\u5230\u9700\u8981\u505a\u6240\u4ee5\u8bb0\u4e0b\u6765\u7684\u6a21\u7cca\u4efb\u52a1\uff09+ \u4e00\u4e2a\u9762\u5411\u5bf9\u8c61\u7684\uff08\u4e00\u4e2a\u6709\u660e\u786e\u8d77\u6b62\u65f6\u95f4\u7684\u3001\u7ed3\u675f\u6807\u5fd7\u7684\u4efb\u52a1\uff09\u3002
\u524d\u8005\u6211\u5e0c\u671b\u662f\u4e00\u4e2a\u53ef\u4ee5\u65e0\u9650\u6269\u5c55\u7684 list\uff0c\u5e76\u4e14\u5141\u8bb8\u6dfb\u52a0\u5404\u79cd sublist -> \u4e00\u4e2a\u5f88\u8212\u670d\u7684 markdown \u7f16\u8f91\u5668\u5373\u53ef\u3002
\u540e\u8005\u5219\u6700\u597d\u6709\u5929\u3001\u5468\u3001\u6708\u7b49 view \u53ef\u4ee5\u770b\u4efb\u52a1\u7684 availability\u3002
\u6211\u73b0\u5728\u7684\u65b9\u6cd5
"},{"location":"docs/5-life/","title":"C'est la vie","text":":material-circle-edit-outline: \u7ea6 4 \u4e2a\u5b57
"},{"location":"docs/5-life/portfolio/","title":"Portfolio for CMU METALS Application","text":":material-circle-edit-outline: \u7ea6 80 \u4e2a\u5b57
Hi there! \ud83d\udc4b
This site is a temporary portfolio for CMU METALS application.
"},{"location":"docs/5-life/portfolio/#frontend-works","title":"Frontend Works","text":"GlyphGun violence in US visualization
"},{"location":"docs/5-life/portfolio/#graphic-design","title":"Graphic Design","text":"Calendar Card1 Card2 Card3
logo
"},{"location":"docs/5-life/annual-summary/","title":"Annual Summary \u5e74\u5ea6\u603b\u7ed3","text":"
:material-circle-edit-outline: \u7ea6 10 \u4e2a\u5b57
"},{"location":"docs/5-life/annual-summary/#contents","title":"Contents \u76ee\u5f55","text":":material-circle-edit-outline: \u7ea6 967 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
Never believe in anything that claims to bring you success, never, never, never.
We are what we talk about every day. Talking about math and science and technology makes us full of math and science and technology. Talking about the school administration fills us with nothing but only makes rule adaptors. Talking about unserious entertainment chores makes us trivial characters. Talking about the name of technologies instead of the real details and ideas behind them makes us only excited at the thoughts of 'I will learn/am learning this technology soon!' and become distracted suddenly after clicking into a post or a video about it.
The topic of rules and policies also reminds me of the story of a senior professor who works on computational syntax in the school of international studies at my undergrad school, who ended his 10-year career here and joined another school of a similar (or slightly lower) ranking in Shanghai this year. I saw in his annual summary a sentence going like, in the next 10 years I plan to deal less with the administration materials and procedures but to put the stress on the research that I am really fond of; now given this change in my career, this goal seems pretty at hand.
I sneered for sharing the same feeling with this prof. After joining UWaterloo, I felt that it was the first time in a long time that I was cared for by people around (administrators, profs, colleagues) as an ordinary student -- not because I was doing anything excellent -- in fact, I lagged behind my peers too much. And this is the reason why I should tell myself from time to time, that feeling well for now does not mean feeling well for good. Don't trust your feelings cause it does not lead you to the goal.
To be specific in my researches -- I am mainly in (or to say, leading?) 3 researches this year, and none of them finally yields any paper. Sarcastically, another research that I am not leading was accepted fluently by a top conference (I sincerely thank the talented first author and other helpful co-workers who made the acceptance of this work so undoubtful on the meanwhile of critizing my unintelligence).
I reflected a lot from the rest 3 research on why they currently failed (at least according to my criteria). The first research is a stupid (sorry) benchmark, whose birth now appears too reckless to me -- I was too slow to catch up with the user demands so now few people are using it. I think I will hereby say that I will not make a benchmark unless I desperately feel that a great number of people, or a few but important people, are or will be in need of it, or that I will be the only person who can make it across the world and during the following at least 10 years. Besides, my poor code and data management at the beginning of the year also led to several pitfalls which took me a great amount of time to fix, so now I would like to set up rules for myself, that is to always use unchangeable data ID to identify data pieces and to always consider the searching efficiency when designing the data structure, and to always think of reusing codes (thus I should maintain them more with oop structures). For the rest two projects which are on syntax and multimodal information encoding, I always felt that I didn't know how to introduce them to others esp. my roommates -- always commented that I had no improvement on the models and thus my research was of no use. Okay, I have no words to refute so how to refute will be one of the important questions that I will address in my papers.
Here should have been another paragraph about my another research. It was such a painful experience collaborating with those collaborators that I don't want to recall and write it down here. If you are interested, let's talk about it privately.
I spent much time pondering on choosing the industry or academia, some time looking for an internship, and little time submitting applications, and got response from none. I browsed several posts discussing the career planning for PhDs in the middle of which I found a website open-sourcing the salaries of employed professors from each Canadian university, with their real name. I am a bit shocked by the mere salaries of full professors. A solution to this question also desperately awaits in the following year.
I also traveled a lot and watched a lot of musicals and operas this year (if you are interested in my recommendations, I am working on a list of my favorite musical works), but again I think I should talk about them less and less, since we will become what we talk about. Let's make our conversations full of technologies and ideas that will nurture our knowledge and thoughts.
Anyway, my primary new year's resolution for 2025 is that,
to have a paper such that, whenever people talk about this research area, they think of me; and whenever they think of me, they think of my paper.
This will be the foundation of anything else.
Besides, I hope I can have time to
It was the most determined year and it was the most confused year, and it will be the most confused year and it will be the most determined year. I'm ready to see.
"},{"location":"docs/5-life/read-watch-listen/","title":"Read, Watch, Listen \u4e66\u5f71\u97f3","text":":material-circle-edit-outline: \u7ea6 14 \u4e2a\u5b57
"},{"location":"docs/5-life/read-watch-listen/#my-top-10-updating","title":"My Top 10 (Updating)","text":""},{"location":"docs/5-life/read-watch-listen/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 3094 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_2","title":"\u6982\u8ff0","text":"\u4e00\u4e9b\u7269\u7406\u6982\u5ff5
\u4e50\u7406\u7684\u57fa\u7840\u89c4\u5219\u6709\u4e09\u6761
\u4ee5\u53ca\u4ee5\u6b64\u5ef6\u4f38\u7684\u51e0\u6761\u89c4\u5219
!!! \ud83d\udca1 TODO: \u8fd9\u4e2a\u663e\u793a\u9891\u7387\u7684\u662f\u4ec0\u4e48\u5de5\u5177\uff1f
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_4","title":"\u7eaf\u97f3","text":"\u53ea\u5305\u542b\u4e00\u79cd\u9891\u7387\u7684\u97f3\u79f0\u4e3a\u7eaf\u97f3\u3002
\u591a\u79cd\u9891\u7387\u590d\u5408\u5728\u4e00\u8d77\u7684\u97f3\u79f0\u4e3a\u590d\u5408\u97f3\u3002
\u5b9e\u9645\u6f14\u594f\u4e2d\uff0c\u4e00\u822c\u6bd4\u5982\u6f14\u594f\u67d0\u9891\u7387\u7684\u97f3\u65f6\uff0c\u4e5f\u4f1a\u540c\u65f6\u4ea7\u751f2\u500d\u9891\u7387\uff08\u7b2c2\u6cdb\u97f3\uff0c\u57fa\u97f3\uff09\u30013\u500d\u9891\u7387\uff08\u7b2c3\u6cdb\u97f3\uff09\u2026\u7b49\u97f3\u3002\u8fd9\u662f\u7531\u4e8e\u58f0\u97f3\u5728\u7a7a\u6c14\u4e2d\u4f20\u64ad\u65f6\u53cd\u5c04\uff0c\u53cd\u5c04\u540e\u7684\u6ce2\u5f62\u4f1a\u4e0e\u539f\u6ce2\u5f62\u53e0\u52a0\u4ea7\u751fN\u500d\u6cdb\u97f3\u3002\u6bcf\u4e2a\u4e50\u5668\u7684\u97f3\u8272\u4e0d\u540c\uff0c\u672c\u8d28\u4e0a\u662f\u5b83\u4eec\u7684\u6cdb\u97f3\u7684\u632f\u5e45\u4e0e\u57fa\u97f3\u4e0d\u540c\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_5","title":"\u94a2\u7434","text":""},{"location":"docs/5-life/read-watch-listen/music-theory/#_6","title":"\u5c0f\u63d0\u7434","text":"\u51cf\u5f31\u5e45\u5ea6\u6ca1\u6709\u94a2\u7434\u5927\uff0c\u6240\u4ee5\u6bd4\u94a2\u7434\u5c16\u9510\uff08\u56e0\u4e3a\u9891\u7387\u8d8a\u9ad8\u8d8a\u5c16\u9510\uff09
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_7","title":"\u53cc\u7c27\u7ba1","text":"\u7b2c2\u6cdb\u97f3\u6bd4\u57fa\u97f3\u5927
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_8","title":"\u97f3\u5f8b","text":"\u97f3\u5f8b\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6307\u4e00\u79cd\u201c\u9009\u62e9\u54ea\u4e9b\u9891\u7387\u6765\u4f5c\u4e3a\u4e00\u4ef6\u4e50\u5668\u7684\u97f3\u201d\u8fd9\u79cd\u89c4\u5219\u6216\u4ee5\u6b64\u9009\u51fa\u6765\u7684\u4e00\u7ec4\u9891\u7387\u3002\u5982\u679c\u5177\u4f53\u4e00\u70b9\u6765\u8bb2\uff0c\u4e50\u5668\u53ef\u4ee5\u62bd\u8c61\u6210\u4e00\u7ec4\u957f\u5ea6\u4e0d\u540c\u7684\u5f26\uff0c\u7531\u4e8e\u957f\u5ea6\u4e0d\u540c\u6240\u4ee5\u53d1\u51fa\u4e0d\u540c\u9891\u7387\u7684\u97f3\uff0c\u800c\u4e50\u5668\u8bbe\u8ba1\u8005\u6700\u5173\u5fc3\u7684\u95ee\u9898\u5c31\u662f\u600e\u6837\u8bbe\u8ba1\u8fd9\u7ec4\u5f26\u957f\uff08\u8fd9\u7ec4\u9891\u7387\uff09\uff0c\u4ee5\u4f7f\u53d1\u51fa\u7684\u9891\u7387\u6700\u7b26\u5408\u542c\u4f17\u5fc3\u4e2d\u90a3\u4e9b\u548c\u8c10\u7684\u97f3\u3002
\u4e00\u4e2a\u5e38\u8bc6\u662f\uff0c\u4e00\u822c\u9700\u8981\u5dee\u5f02 5% \u53ca\u4ee5\u4e0a\u7684\u4e24\u4e2a\u9891\u7387\uff0c\u53ef\u4ee5\u88ab\u6b63\u5e38\u4eba\u5206\u8fa8\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u97f3\u3002\u6240\u4ee5\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u6700\u5c0f\u5dee\u8ddd\u4e0d\u5fc5\u5c0f\u4e8e\u8fd9\u4e2a\u9891\u7387\u5dee\u3002
\u5728\u6b64\u989d\u5916\u63d0\u51fa\u4e00\u4e2a\u97f3\u7a0b\u7684\u5b9a\u4e49\uff1a\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u9891\u7387\u4e4b\u5dee\u53eb\u97f3\u7a0b\u3002\u6211\u4eec\u5728\u8fd9\u91cc\u4e3b\u8981\u5173\u5fc3\u7684\u97f3\u7a0b\u662f\u4e00\u4e2a\u516b\u5ea6\u3002
\u8bbe\u5b9a\u97f3\u5f8b\u7684\u8457\u540d\u505a\u6cd5\u4e3b\u8981\u6709\u4ee5\u4e0b\u4e09\u79cd\uff0c\u4e09\u5206\u635f\u76ca\u6cd5\uff0c\u4e94\u5ea6\u76f8\u751f\u6cd5\uff0c\u548c\u5341\u4e8c\u5e73\u5747\u5f8b\uff0c\u6211\u4eec\u4f9d\u6b21\u4ecb\u7ecd\u3002
\u4e09\u5206\u635f\u76ca\u6cd5
\u53d6\u4e00\u6839\u5f26\uff0c\u5206\u522b\u5728\u51761/2\uff0c1/3\uff0c1/4\u5904\u53d6\u4e00\u4e2a\u97f3\u3002
\u4e94\u5ea6\u76f8\u751f\u6cd5
\u7531\u6bd5\u8fbe\u54e5\u62c9\u65af\u63d0\u51fa\u3002\u5206\u522b\u57282/3\uff0c4/9\uff0c8/27\uff0c16/81\uff0c32/243\u5904\u53d65\u4e2a\u97f3\u3002
\u5341\u4e8c\u5e73\u5747\u5f8b Equal temperament
\u7531\u660e\u4ee3\u6731\u8f7d\u5809\uff08y\u00f9\uff09\u5728\u4e07\u5386\u5341\u4e8c\u5e74\u63d0\u51fa\uff0c\u540e\u4f20\u5165\u897f\u65b9\uff0c\u5b83\u7684\u8d21\u732e\u4e3b\u8981\u662f\u4fee\u6b63\u4e86\u4e94\u5ea6\u76f8\u751f\u6cd5\u4ea7\u751f\u7684\u97f3\uff0c\u5728\u8f6c\u8c03\u540e\u4f1a\u4e0e\u539f\u6765\u7684\u97f3\u7a0b\u6709\u4e00\u4e9b\u533a\u522b\u8fd9\u4e2a\u95ee\u9898\u3002\u662f\u73b0\u4ee3\u97f3\u4e50\u4f53\u7cfb\u4e2d\u6700\u5e95\u5c42\u7684\u4e00\u4e2a\u8bbe\u5b9a\uff0c\u5b83\u89c4\u5b9a\u4e86\u4e24\u4e2a\u5355\u97f3\u7684\u76f8\u5bf9\u97f3\u9ad8\uff0c\u5177\u4f53\u505a\u6cd5\u662f\u5c06\u4e00\u4e2a\u7eaf\u516b\u5ea6\u5206\u621012\u4efd\uff0c\u6bcf\u4efd\u79f0\u4e00\u4e2a\u534a\u97f3\uff0c\u4e24\u4efd\u4e00\u4e2a\u5168\u97f3\uff0c\u8fd9\u6837\u5c31\u5b9a\u4e49\u51fa\u4e86\u6240\u6709\u4e2d\u95f4\u7684\u5355\u97f3\u3002\u516b\u5ea6\u97f3\u7684\u9891\u7387\u5206\u4e3a\u5341\u4e8c\u7b49\u4efd\u7684\u505a\u6cd5\uff0c\u5c31\u662f\u5206\u4e3a\u5341\u4e8c\u9879\u7b49\u6bd4\u6570\u5217\uff0c\u6bcf\u4e2a\u97f3\u7684\u9891\u7387\u4e3a\u524d\u4e00\u4e2a\u97f3\u7684 2 \u7684 12 \u6b21\u65b9\u6839\u3002
\u897f\u65b97\u97f3\u53d6\u7684\u662f\u5176\u4e2d7\u4e2a\uff08\u767d\u952e\uff09\uff0c\u4e1c\u65b95\u97f3\u53d6\u4e865\u4e2a\uff08\u9ed1\u952e\uff09\u3002
\u8c03\u6027\u4e3b\u8981\u5305\u542b\u4e86\u8c03\u9ad8\uff08\u4e3b\u97f3\uff09\u4e0e\u8c03\u5f0f\u4e24\u5927\u65b9\u9762\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_10","title":"\u8c03\u5f0f","text":"\u674e\u91cd\u5149\u300a\u57fa\u672c\u4e50\u7406\u901a\u7528\u6559\u7a0b\u300b\u4e2d\u5b9a\u4e49\u8c03\u5f0f\u4e3a
\u51e0\u4e2a\u97f3\uff08\u4e00\u822c\u4e0d\u8d85\u8fc7\u4e03\u4e2a\uff0c\u4e0d\u5c11\u4e8e\u4e09\u4e2a\uff09\u6309\u7167\u4e00\u5b9a\u7684\u5173\u7cfb\uff08\u9ad8\u4f4e\u5173\u7cfb\u3001\u7a33\u5b9a\u4e0e\u4e0d\u7a33\u5b9a\u7684\u5173\u7cfb\u7b49\uff09\u8054\u7ed3\u5728\u4e00\u8d77\uff0c\u6784\u6210\u4e00\u4e2a\u97f3\u7ec4\u7ec7\uff0c\u5e76\u4ee5\u67d0\u4e00\u4e2a\u97f3\u4e3a\u4e2d\u5fc3\uff0c\u8fd9\u4e2a\u97f3\u7ec4\u7ec7\u5c31\u53eb\u201c\u8c03\u5f0f\u201d\u3002
\u8c03\u5f0f\u4e4b\u95f4\u7684\u5dee\u5f02\u65e2\u6709\u97f3\uff0c\u4e5f\u6709\u97f3\u7a0b
e.g. \u5206\u6790\u4e24\u4e2a\u8c03\u6bcf\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u97f3\u7a0b\u5173\u7cfb\u3002
C\u81ea\u7136\u5927\u8c03\uff1a1\u30012\u30013\u30014\u30015\u30016\u30017\u30011 \u5168\u5168\u534a\u5168\u5168\u5168\u534a
\u97f3\u7a0b\u7ed3\u6784\u4e3a\u5927\u4e8c\u5ea6\uff081-2\uff09\uff0c\u5927\u4e8c\u5ea6\uff082-3\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff083-4\uff09\uff0c\u5927\u4e8c\u5ea6\uff084-5\uff09\uff0c\u5927\u4e8c\u5ea6\uff085-6\uff09\uff0c\u5927\u4e8c\u5ea6\uff086-7\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff087-1\uff09
a\u81ea\u7136\u5c0f\u8c03\uff1a6\u30017\u30011\u30012\u30013\u30014\u30015\u30016 \u5168\u534a\u5168\u5168\u534a\u5168\u5168
\u97f3\u7a0b\u7ed3\u6784\u4e3a\u5927\u4e8c\u5ea6\uff086-7\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff087-1\uff09\uff0c\u5927\u4e8c\u5ea6\uff081-2\uff09\uff0c\u5927\u4e8c\u5ea6\uff082-3\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff083-4\uff09\uff0c\u5927\u4e8c\u5ea6\uff084-5\uff09\uff0c\u5927\u4e8c\u5ea6\uff085-6\uff09
\u53e6\u4e00\u4e2a\u56de\u7b54\u5219\u8bf4\u533a\u522b\u5728\u4e0e\u4e3b\u97f3\u4e4b\u95f4\u7684\u97f3\u7a0b\u5173\u7cfb\u3002\u5e94\u8be5\u662f\u4e00\u6837\u7684\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_11","title":"\u5173\u7cfb\u5927\u5c0f\u8c03\u548c\u4e94\u5ea6\u5708","text":"\u4e0a\u8ff0\u4e24\u4e2a\u8c03\u662f\u5173\u7cfb\u5927\u5c0f\u8c03\uff0c\u4e5f\u5c31\u662f\u53ea\u6709\u5faa\u73af\u987a\u5e8f\u6539\u53d8\u4e86\uff0c\u5347\u964d\u5173\u7cfb\u662f\u76f8\u540c\u7684\u3002\u4ee5\u6b64\u6211\u4eec\u5f97\u5230\u4e00\u4e2a\u4e94\u5ea6\u5708
\u8fd9\u4e2a\u56fe\u4e0a\u53ef\u4ee5\u5f97\u5230\u7684\u4fe1\u606f\u6709\uff1a
\u5982\u4f55\u9ad8\u6548\u8bb0\u5fc6\u4e94\u5ea6\u5708\uff1a
\u4e0a\u534811\u70b9\uff0cFat Cat Go Down And Eat Bread\uff0c\u6240\u4ee5\u4e94\u5ea6\u5708\u4ece11\u70b9\u5f00\u59cb\u987a\u65f6\u9488\u65b9\u5411\u662fFCGDAEB
\u4e0b\u53486\u70b9\uff0cGo Down And Eat Bread\uff0c\u4ece6\u70b9\u65b9\u5411\u5f00\u59cb\u53c8\u662fGDAEB\uff0c\u7531\u4e8e\u662f\u665a\u4e0a\u6240\u4ee5\u90fd\u8981\u964d\u534a\u97f3
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_12","title":"\u5927\u8c03\u4e0e\u5c0f\u8c03","text":"\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u5f15\u5165\u4e86\u5927\u8c03\u4e0e\u5c0f\u8c03\u7684\u6982\u5ff5\u3002\u4e00\u4e2a\u66f4\u6b63\u5f0f\u7684\u5b9a\u4e49\u5982\u4e0b
\u5f53\u628a\u4e0a\u8ff0\u97f3\u7a0b\u5173\u7cfb\u5957\u5165\u4e00\u4e2a\u7528\u4efb\u610f\u4e3b\u97f3\u5f00\u59cb\u7684\u97f3\u8282\uff0c\u5c31\u4f1a\u51fa\u73b0\u5e26\u5404\u79cd\u5347\u964d\u53f7\u7684\u8c03\u6027\uff0c\u6bcf\u79cd\u6709\u4e00\u4e2a\u8c03\u53f7\u6765\u547d\u540d\u3002
\u8c03\u53f7\u7684\u4e00\u4e2a\u8bb0\u5fc6\u89c4\u5219\u662f
\u53d7\u9650\u4e8e\u4ee5\u524d\u7684\u5f8b\u5236\u548c\u6bcf\u4e2a\u97f3\u9891\u7387\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5173\u7cfb\uff0c\u4ee5\u524d\u662f\u65e0\u6cd5\u968f\u610f\u7ad9\u6362\u8c03\u6027\u7684\uff0c\u56e0\u4e3a\u5982\u679c\u8f6c\u6362\uff0c\u97f3\u7b26\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5c31\u4e0e\u4e4b\u524d\u4e0d\u4e00\u6837\u4e86\u3002\u4f46\u56e0\u4e3a\u6709\u5341\u4e8c\u5e73\u5747\u5f8b\uff0c\u8f6c\u8c03\u53d8\u5f97\u968f\u610f\u3002
\u4e0a\u8ff0\u8ba8\u8bba\u7684\u4e94\u5ea6\u5708\u548c\u5927\u5c0f\u8c03\u662f\u7406\u8bba\u5f97\u51fa\u7684\uff0c\u53ef\u80fd\u4e5f\u53ef\u4ee5\u79f0\u4e3a\u81ea\u7136\u97f3\u9636\u8c03\u5f0f\uff0c\u5f85\u8003\u8bc1\u3002\u4e0b\u9762\u6765\u4ecb\u7ecd\u4e00\u4e9b\u5386\u53f2\u4e0a\u5e38\u7528\u7684\u7ecf\u5178\u8c03\u5f0f\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#7","title":"7\u79cd\u4e2d\u53e4\u8c03\u5f0f\uff08\u6559\u4f1a\u8c03\u5f0f\uff09","text":"\u6559\u4f1a\u8c03\u5f0f \u97f3\u540d \u534a\u97f3\u95f4\u9694 \u7279\u70b9 Ionian\u5927 CDEFGAB 2212221 \u5927\u8c03\uff0c\u542c\u8d77\u6765\u660e\u6717\u5f00\u9614 Dorian DEFGABC 2122212 \u6c11\u65cf\u97f3\u4e50\uff0c\u5e38\u7528\u4e8e\u6e38\u620f\u548c\u7535\u5f71\u97f3\u4e50 Phrygian EFGABCD 1222122 \u5c0f\u4e8c\u5ea6\u7684Phrygian\u8c03\u5f0f\u542c\u8d77\u6765\u6c89\u91cd\uff0c\u5e38\u7528\u4e8e\u60b2\u5267\u7535\u5f71\u97f3\u4e50 Lydian FGABCDE 2221221 \u6ca1\u6709\u7eaf\u56db\u5ea6\u7684Lydian\u8c03\u5f0f\u9065\u8fdc\u6d69\u701a\uff0c\u6709\u79d1\u5e7b\u611f\uff0c\u5e38\u7528\u4e8e\u79d1\u5e7b\u7535\u5f71\u97f3\u4e50\u3002 Mixoly GABCDEF 2212212 \u6bd4\u5927\u8c03\u91cd\u53e0\u7387\u9ad8\uff08\u5177\u4f53\u91cd\u53e0\u7387\u7684\u8ba1\u7b97\u53ef\u4ee5\u89c1\u4e0b\u65b9\u5e16\u5b50\uff09\uff0c\u4e14\u660e\u6717\u751f\u52a8\u7684Mixoly\u5e38\u7528\u84dd\u8c03\u548c\u786c\u6838\u6447\u6eda Aeolian\u5c0f ABCDEFG 2122122 \u67d4\u548c\u6697\u6de1 Locrian BCDEFGA 1221222 \u6ca1\u6709\u7eaf\u4e94\u5ea6\u7684Locrian\u542c\u8d77\u6765\u6050\u6016\u9ed1\u6697\uff0c\u5e38\u7528\u4e8e\u707e\u96be\u6050\u6016\u7535\u5f71\u97f3\u4e50\u4e00\u4e2a\u6559\u4f1a\u8c03\u5f0f\u4e2d\u5177\u6709\u7684\u5ea6\u4e0e\u542c\u611f\u7684\u5173\u7cfb\u5206\u6790\u5982\u8fd9\u4e2a\u5e16\u5b50\u6240\u793a\uff1a
\u97f3\u7a0b - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_14","title":"\u8c03\u53f7\u4e0e\u60c5\u7eea\u8272\u5f69\u7684\u5173\u7cfb","text":"\u81ea\u7136\u97f3\u9636\u5404\u8c03\u5f0f\u4e0e\u60c5\u7eea\u8272\u5f69\u7684\u5173\u7cfb\u3002\u5f88\u6709\u610f\u601d
\u6211\u7684\u4e2a\u4eba\u89c2\u70b9\uff08TODO \u5f85\u66f4\u65b0\uff09
\u8c03\u5f0f \u8272\u5f69 \u610f\u8c61 C \u5927\u8c03 C \u5c0f\u8c03 D \u5927\u8c03 \u91d1\u8272 \u91d1\u78a7\u8f89\u714c\u7684\u5bab\u6bbf D \u5c0f\u8c03 E \u5927\u8c03 E \u5c0f\u8c03 F \u5927\u8c03 F \u5c0f\u8c03 \u58a8\u84dd\u8272 \u9ed1\u4e91\u5bc6\u5e03\u6d77\u6d6a\u7ffb\u6d8c G \u5927\u8c03 G \u5c0f\u8c03 A \u5927\u8c03 A \u5c0f\u8c03 \u51b0\u5ddd\u84dd \u707f\u70c2\u9633\u5149\u4e0b\u95ea\u8000\u7684\u51b0\u5ddd B \u5927\u8c03 B \u5c0f\u8c03"},{"location":"docs/5-life/read-watch-listen/music-theory/#_15","title":"\u548c\u58f0\u7406\u8bba","text":"\u62cd\u97f3\uff1a\u4e00\u79cd\u590d\u5408\u97f3\uff0c\u6765\u81ea\u4e8e\u540c\u4e00\u79cd\u4e50\u5668\u6216\u4e0d\u540c\u4e50\u5668\u7684\u4e24\u4e2a\u5355\u97f3\u76f8\u4e92\u53e0\u52a0\uff0c\u5f62\u6210\u5177\u6709\u89c4\u5f8b\u7684\u5f3a\u5f31\u53d8\u5316\u3002\u4e0e\u8c10\u6ce2\u4e0d\u540c\u7684\u662f\uff0c\u62cd\u97f3\u4e00\u822c\u8981\u6c42\u4e24\u4e2a\u97f3\u7684\u632f\u5e45\u76f8\u8fd1\uff0c\u4f46\u4e0d\u4e00\u5b9a\u9891\u7387\u4e3a\u500d\u6570\u5173\u7cfb\u3002\u5982\u56fe
\u548c\u58f0\uff1a\u7531\u8d85\u8fc7\u4e00\u4e2a\u5355\u97f3\u7ec4\u5408\u6210\u7684\u58f0\u97f3\u3002\u4e00\u822c\u897f\u65b9\u7406\u8bba\u4e2d\u548c\u58f0\u4e3b\u8981\u6307\u4e24\u4e2a\u97f3\u7684\u5173\u7cfb\uff0c\u800c\u4e09\u4e2a\u53ca\u4e09\u4e2a\u4ee5\u4e0a\u5219\u5c5e\u4e8e\u548c\u5f26\u7684\u8303\u7574\u3002
\u62cd\u97f3\u90fd\u662f\u548c\u58f0\uff0c\u4f46\u662f\u548c\u58f0\u4e0d\u4e00\u5b9a\u4ea7\u751f\u62cd\u97f3\uff0c\u56e0\u4e3a\u8d85\u51fa\u4eba\u8033\u53ef\u4ee5\u542c\u5230\u7684\u9891\u7387\u7684\u4e0d\u7b97\u62cd\u97f3\uff0c\u4e0d\u540c\u4e50\u5668\u53d1\u51fa\u7684\u4e5f\u4e0d\u53eb\u62cd\u97f3\uff0c\u540c\u65f6\u62cd\u97f3\u4e5f\u4e25\u683c\u8981\u6c42\u6240\u6709\u97f3\u7684\u9891\u7387\u8d77\u59cb\u4f4d\u7f6e\u4e25\u683c\u5bf9\u9f50\uff0c\u800c\u548c\u58f0\u53ea\u8981\u6709\u540c\u65f6\u53d1\u58f0\u7684\u65f6\u523b\u5373\u53ef\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_16","title":"\u548c\u58f0\u4e0e\u548c\u8c10\u7a0b\u5ea6\u7684\u5173\u7cfb","text":"\u9996\u5148\u6709\u76f8\u90bb\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u9891\u7387\u6bd4\u7ea6\u4e3a 1.06\uff08\u8bb0\u4e3ap\uff09\u3002\u5404\u4e2a\u97f3\u7a0b\u7684\u9891\u7387\u6bd4\uff08\u5373\uff0c\u76f8\u8ddd\u67d0\u4e2a\u97f3\u7a0b\u7684\u4f4e\u97f3\u4e0e\u9ad8\u97f3\u9891\u7387\u4e4b\u6bd4\uff09\u5219\u53ef\u4ee5\u7531\u5176\u97f3\u6570t\u6309\u516c\u5f0f\u7b97\u5f97 \\(1/2^{2t/12} = 1/06^{-2t}\\) \uff0c\u5176\u4e2d\uff0c\u7b49\u5f0f\u5de6\u8fb9\u662f\uff0c\u7b49\u5f0f\u53f3\u8fb9\u662f
\u4e8e\u662f\u5f97\u5230\u7684\u6240\u6709\u5173\u7cfb\uff08\u5e76\u7ecf\u8fc7\u5b9e\u9a8c\uff09\u5f97\u5230\u4e00\u4e2a\u7ecf\u9a8c\u8868\u683c\u3002\u8fd9\u4e2a\u8868\u683c\u5e94\u8be5\u6700\u65e9\u662f\u7531\u516c\u5143\u524d\u6bd5\u8fbe\u54e5\u62c9\u65af\u5f97\u51fa\u7684\uff0c\u4ed6\u8868\u8ff0\u4e3a\uff1a\u4e24\u4e2a\u97f3\u7684\u7434\u5f26\u957f\u4e4b\u6bd4\u7684\u6700\u5927\u516c\u7ea6\u6570\u8d8a\u5c0f\uff0c\u4e24\u4e2a\u97f3\u540c\u65f6\u5f39\u594f\u5c31\u8d8a\u548c\u8c10\u3002\uff08\u5982\u679c\u56de\u5fc6\u6211\u4eec\u4e0a\u9762\u8ba8\u8bba\u7684\u6cdb\u97f3\uff0c\u6cdb\u97f3\u91cd\u53e0\u6bd4\u4f8b\u8d8a\u9ad8\u5c31\u8d8a\u548c\u8c10\uff09
\u5341\u4e8c\u5e73\u5747\u5f8b\u97f3\u9ad8\u53c2\u8003\u7ebf\uff1a
\u53ef\u67e5\u9605\u7684\u548c\u8c10\u4e0e\u4e0d\u548c\u8c10\u8868\u683c\uff1a
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_17","title":"\u4f34\u594f","text":"\u6bcf\u79cd\u8c03\u5f0f\u53ef\u91c7\u7528\u7684\u548c\u5f26\u79cd\u7c7b\uff0c\u53ef\u4ee5\u7528\u4ee5\u4e0b\u8868\u683c\u6765\u67e5\u9605\u3002
\u4f34\u594f\u4e0d\u4e00\u5b9a\u662f\u548c\u5f26\u4e2d\u6240\u6709\u97f3\u4e00\u8d77\u5f39\uff0c\u4e5f\u53ef\u4ee5\u62c6\u89e3\u3002\u5e38\u89c1\u7684\u62c6\u89e3\u6cd5\u6709
\u4e09\u548c\u5f26\u8f6c\u4f4d TODO
\u6bd4\u5982\u6709\u4e00\u4e2a\u4e09\u548c\u5f26CEG\uff0c\u79f0\u4e3a\u539f\u4f4d\uff0c\u5c06C\u53d8\u6210\u9ad8\u516b\u5ea6\u7684C\uff0c\u79f0\u4e3a\u7b2c\u4e00\u8f6c\u4f4d\uff0c\u5728\u7b2c\u4e00\u8f6c\u4f4d\u57fa\u7840\u4e0a\u5c06E\u53d8\u6210\u9ad8\u516b\u5ea6\u7684E\uff0c\u79f0\u4e3a\u7b2c\u4e8c\u8f6c\u4f4d\u3002
\u7ec8\u6b62\u5f0f TODO
\u4e0d\u5b8c\u5168\u7ec8\u6b62\u5f0f TODO
\u4e03\u548c\u5f26 TODO
\u548c\u5f26 - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_18","title":"\u53c2\u8003\u8d44\u6599","text":"pianofanie - \u77e5\u4e4e (zhihu.com) \u3010\u8bfe\u7a0b\u3011\u4e50\u7406\u77e5\u8bc6\u8bb2\u91cd\u70b9
Devymex Wang - \u77e5\u4e4e (zhihu.com) \u5199\u7ed9\u7406\u5de5\u79d1\u4eba\u770b\u7684\u4e50\u7406
\u3010\u9633\u5149\u8bb2\u4e50\u7406\u3011\u5c0f\u767d\u5411\u4e50\u7406\u6559\u7a0b12\u96c6\u5168\u3010doyoudo\u51fa\u54c1\u3011_\u54d4\u54e9\u54d4\u54e9_bilibili
\u3010\u4e50\u7406\u77e5\u8bc6\u5165\u95e8\u3011\u4ec0\u4e48\u662f\u8c03\u6027\uff1f\u4ec0\u4e48\u662f\u5927\u5c0f\u8c03\u5f0f\uff1f\u79d1\u5b66\u7406\u89e3\u5927\u5c0f\u8c03\u77e5\u8bc6\uff0c\u63a2\u8ba8\u6709\u6548\u5b66\u4e60\u80cc\u540e\u7684\u601d\u7ef4\u6a21\u5f0f - \u77e5\u4e4e (zhihu.com)
\u6982\u8ff0 - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
\u5341\u4e8c\u5e73\u5747\u5f8b - \u7ef4\u57fa\u767e\u79d1\uff0c\u81ea\u7531\u7684\u767e\u79d1\u5168\u4e66 (wikipedia.org)
\u300a\u97f3\u4e50\u7406\u8bba\u57fa\u7840\u300b\uff0c\u674e\u91cd\u5149\u7f16\u8457\uff0c\u4eba\u6c11\u97f3\u4e50\u51fa\u7248\u793e\uff1b
\u300a\u57fa\u672c\u4e50\u7406\u6559\u7a0b\u300b\uff0c\u8d75\u5c0f\u5e73\u7f16\u8457\uff0c\u4eba\u6c11\u97f3\u4e50\u51fa\u7248\u793e\uff1b
\u300a\u57fa\u672c\u4e50\u7406\u6559\u7a0b\u300b\uff0c\u7ae5\u5fe0\u826f\u7f16\u8457\uff0c\u4e0a\u6d77\u97f3\u4e50\u51fa\u7248\u793e\u3002
:material-circle-edit-outline: \u7ea6 7 \u4e2a\u5b57
Musical Recommendations
"},{"location":"docs/5-life/read-watch-listen/musicals/#austrian-german-musicals","title":"Austrian & German Musicals","text":"TODO
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"\ud83c\udfdb\ufe0f Mini Babel Library","text":":material-circle-edit-outline: \u7ea6 231 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
La biblioteca de Babel
\u300c\u5b87\u5b99\uff08\u522b\u4eba\u7ba1\u5b83\u53eb\u56fe\u4e66\u9986\uff09\u7531\u8bb8\u591a\u516d\u89d2\u5f62\u7684\u56de\u5eca\u7ec4\u6210\uff0c\u6570\u76ee\u4e0d\u80fd\u786e\u5b9a\uff0c\u4e5f\u8bb8\u662f\u65e0\u9650\u7684\u300d \u2014\u2014 Jorge Luis Borges (1939)
\u8fd9\u662f\u6211\u4e3b\u8981\u7528\u4e2d\u6587\u5199\u7684 BLOG\uff0c\u5927\u90e8\u5206\u5185\u5bb9\u662f\u5b66\u4e60\u7b14\u8bb0\u3002\u6211\u7684\u7b14\u8bb0\u4e0d\u591a\uff01\u4ee5\u540e\u4e5f\u4e0d\u4f1a\u591a\u7684(\u4fdd\u8d28\u4e0d\u4fdd\u91cf) \u6b22\u8fce\u6765\u770b\u6211\u7684\u7b14\u8bb0\uff01
"},{"location":"#content-shortcut","title":"\ud83d\uded7 Content Shortcut\u23f0 \u66f4\u65b0\u8bb0\u5f55","text":"\ud83d\udcbb Computer Science
Selection
\ud83c\udf33 Linguistics
Selection
\ud83c\udf93 Deep Learning
Selection
\ud83d\udcad Opinions
Selection
\ud83c\udfb9 Life
Selection
2025-01-04\u00b6Music Theory \u4e50\u7406
French Tense \u6cd5\u8bed\u65f6\u6001
2025-01-01\u00b62024 Summary
2024-12-14\u00b6Main Page
\u8bb0\u5f55\u751f\u6210\u5de5\u5177\uff1aTonyCrane/mkdocs-changelog-plugin"},{"location":"#_1","title":"\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1 \u53cb\u94fe","text":"\u7ad9 \u5b9a\u4f4d\u662f \u672c\u7ad9\uff1a# \u63ba\u6742\u81ea\u5df1\u89c2\u70b9\u7684\u7b14\u8bb0 + \u5fc3\u5f97 \u4ed3\u5e93\uff1a\ud83d\udd17ZJUCourse \u5ba2\u89c2\u901a\u7528\u7684\u4e00\u4e2aZJU\u8bfe\u7a0b\u8d44\u6599\u5de5\u5177\u7bb1 \ud83d\udd17mem \u7684\u5c0f\u7ad9 \u5185\u5bb9\u4e3b\u8981\u662f\u7b97\u6cd5\u7b14\u8bb0 + ZJU \u8bfe\u7a0b\u7b14\u8bb0\u3002\u8c22\u8c22\u7b2c\u4e00\u4f4d\u627e\u6211\u6362\u53cb\u94fe\u7684\u5c0f\u670b\u53cb\uff01\u662f\u5f88\u5389\u5bb3\u7684 OIer \ud83d\udd17\u79d1\u5b66\u7a7a\u95f4 \u82cf\u5251\u6797\u82cf\u795e\u7684 blog\uff0c\u66f4\u65b0\u4e86\u5341\u51e0\u5e74\u4e86\uff0c\u4ef0\u6155"},{"location":"#_2","title":"\u260e\ufe0f \u8054\u7cfb\u4f5c\u8005","text":"\ud83d\udceb \u90ae\u7bb1 | \ud83e\uddd1\u200d\ud83d\udcbb \u4e3b\u9875
"},{"location":"docs/1-cs/","title":"Computer Science Notes","text":":material-circle-edit-outline: \u7ea6 460 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
This section mainly consists of my selected notes on the course/project/assignment of the computer science courses from Zhejiang University. \u672c\u7ae0\u8282\u5185\u5bb9\u4e3b\u8981\u4e3a\u6d59\u6c5f\u5927\u5b66\u8ba1\u7b97\u673a\u5b66\u9662\u8bfe\u7a0b\u7684\u8bfe\u7a0b/\u9879\u76ee/\u4f5c\u4e1a\u7b14\u8bb0\u3002
I respect the honest code of computer science school of Zhejiang University and do not publish any content against this code (e.g., solutions of the assignments or source codes of the projects). Please contact me if you find anything that has the risk to violate the code.
"},{"location":"docs/1-cs/#compass","title":"\ud83e\udded Compass","text":"\u5728\u7f51\u4e0a\u627e\u7b14\u8bb0/\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u6211\u7684\u6700\u5927\u611f\u53d7\u4e4b\u4e00\u662f\u867d\u7136\u8d44\u6e90\u5f88\u591a\u5f88\u591a\uff0c\u4f46\u662f\u5e38\u5e38\u4e0d\u77e5\u9053\u67d0\u4e2a\u8d44\u6e90\u6709\u591a\u91cd\u8981\uff0c\u65e0\u6cd5\u8bc4\u4f30\u91cc\u9762\u6db5\u76d6\u4e86\u591a\u5c11\u4e1c\u897f\u4ece\u800c\u4e0d\u77e5\u9053\u8981\u4e0d\u8981\u70b9\u5f00\uff0c\u6216\u8005\u65e0\u6cd5\u4f30\u8ba1\u5728\u671f\u672b\u6709\u9650\u7684\u65f6\u95f4\u91cc\u5e94\u8be5\u82b1\u591a\u5c11\u65f6\u95f4\u590d\u4e60\u67d0\u4e2a\u8d44\u6e90\u3002\u6211\u6b63\u5728\u52aa\u529b\u5728\u8fd9\u91cc\u5efa\u4e00\u4e2a\u5c1a\u80fd\u8bfb\u7684\u8d44\u6e90\u7684 pagetable\uff0c\u4ee5\u9632\u4e0d\u5e78\u7684\u6e38\u5ba2\u4ece\u4fa7\u8fb9\u680f\u6e38\u8d70\u8fdb\u672c\u56fe\u4e66\u9986\u7684\u5783\u573e\u5806\u6f29\u6da1\ud83c\udf00\u3002\u5982\u679c\u6211\u76ee\u524d\u7684\u7b14\u8bb0\u5728\u8fd9\u4e2a\u7ef4\u5ea6\u4e0a\u505a\u5f97\u4e0d\u597d\uff0c\u8bf7\u8054\u7cfb\u6211\u6216\u8005\u5411\u6211\u63d0 issue \u50ac\u6211\u6539 \u8c22\u8c22\uff01
\u56fe\u4f8b
\ufe0f\ud83d\udcd8 \ufe0f\ud83d\udcd6 \ud83e\uddea \ud83d\udd17 \u5b8c\u6210\u5ea6\u4e0d\u9ad8\uff0c\u5f03\u5751\u6216\u5728\u5199\uff0c\u4e0d\u63a8\u8350\u9605\u8bfb \uff08\u7279\u6307\u7406\u8bba\uff09\u5b8c\u6210\u5ea6\u8db3\u591f\u9ad8\uff0c\u53ef\u4ee5\u9605\u8bfb\uff01 \u4ec5\u5b9e\u9a8c\u8d44\u6e90\uff0c\u672a\u5199\u7406\u8bba\u90e8\u5206 \u540c\u7c7b\u4f18\u8d28\u6216\u66f4\u4f18\u8d44\u6e90\u63a8\u8350 \u7c7b\u522b \u8bfe.. \u7f16\u7a0b\u8bed\u8a00 \ud83d\udcd8C\u5c16 \ud83d\udcd8C++ \ud83d\udd17\u8bb2\u4e49@\u6684 \ud83d\udcd8Verilog \ud83d\udd17\u5b9e\u9a8c@\u74dc \ud83d\udd17playground@HDLB \ud83d\udcd8Python \ud83d\udcd6x86\u6c47\u7f16 \u8ba1\u7b97\u673a\u79d1\u5b66 \ud83d\udcd8\u79bb\u6563\u6570\u5b66 \ud83d\udd17\u8bb2\u4e49@Kaleo \ud83d\udcd8FDS \ud83d\udcd8ADS \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8\u8ba1\u7b97\u7406\u8bba \ud83d\udd17\u8bb2\u4e49@\u6684 \ufe0f\ud83d\udcd8\u7f16\u8bd1\u539f\u7406 \ud83d\udd17\u8bb2\u4e49@\u6684 \u8f6f\u4ef6 \ud83e\uddeaOS \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8DBMS \ud83d\udcd8\u8ba1\u7f51 \ud83d\udcd8\u8f6f\u5de5 \u786c\u4ef6 \ud83d\udcd8\u6570\u903b \ud83d\udd17\u8bb2\u4e49@\u4fee \ud83d\udcd8\u8ba1\u6982 \ud83d\udcd8\u8ba1\u7ec4 \ud83d\udd17\u8bb2\u4e49@\u6684&\u4fee \ud83d\udcd6\u4f53\u7cfb"},{"location":"docs/1-cs/#contents","title":"\ud83d\udcdd Contents","text":":material-circle-edit-outline: \u7ea6 5487 \u4e2a\u5b57 :fontawesome-solid-code: 47 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 19 \u5206\u949f
"},{"location":"docs/1-cs/assembly-x86/#lab","title":"Lab\u8bb0\u5f55","text":"Failure
Lab\u5df2\u7ecf\u5168\u90e8\u6362\u6389\uff0c\u8fd9\u90e8\u5206\u4f5c\u4e1a\u4ecb\u7ecd\u65e0\u6cd5\u53c2\u8003\u4e86\u3002
\u4f5c\u4e1a1: \u5b57\u7b26\u4e32\u8f6c\u6362
\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5c0f\u5199\u5b57\u6bcd\u5168\u90e8\u8f6c\u6362\u4e3a\u5927\u5199\u5b57\u6bcd\uff0c\u5220\u9664\u7a7a\u683c\u540e\u8f93\u51fa\u3002
\u8bb0\u5f97\u4ed6\u6709\u5b57\u7b26\u4e32\u8bfb\u5199\u7684\u6e90\u4ee3\u7801\u3002
\u4f5c\u4e1a2: \u6253\u5370ASCII\u7801\u8868
\u8fdb\u5165\u56fe\u5f62\u6a21\u5f0f\uff0c\u8f93\u51fa\u7ea2\u7684ascii\u7801\u548c\u7eff\u7684\u76f8\u5e94\u5341\u516d\u8fdb\u5236\u7f16\u53f7\u3002
\u4e2a\u4eba\u611f\u89c9\u5148\u628a\u4f4d\u79fb\u5199\u51fa\u6765\u518d\u586b\u91cc\u9762\u7684\u8f93\u51fa\u6bd4\u8f83\u597d\u5f04\u3002
\u53ef\u4ee5\u53c2\u7167\u4ed6\u7684\u6570\u5b57\u7528\u5faa\u73af\u5de6\u79fb\u8f93\u51fa\u6210\u5341\u516d\u8fdb\u5236\u4ee3\u7801\u3002
\u4f5c\u4e1a3: \u7b80\u6613\u8ba1\u7b97\u5668
\u6574\u4f53\u601d\u8def\uff1a80386\u8bed\u6cd5\u5199\uff0c\u5185\u5bb9\u90fd\u5b58\u5728\u5185\u5b58\u53d8\u91cf\u91cc
\u52a0\u6cd5\u601d\u8def\uff1a\u9ad8\u4f4d\u52a0\u9ad8\u4f4d\uff0c\u4f4e\u4f4d\u52a0\u4f4e\u4f4d
\u4e58\u6cd5\u601d\u8def\uff1a\u5206\u522b\u4e58\u4f4e\u4f4d\u548c\u9ad8\u4f4d\uff0c\u9ad8\u4f4d\u7ed3\u679c\u52a0\u8fdb\u4f4d
\u9664\u6cd5\u601d\u8def\uff1a\u5206\u522b\u9664\u9ad8\u4f4d\u548c\u4f4e\u4f4d\uff0c\u3002\u3002\u540e\u9762\u5fd8\u4e86
\u8f93\u51fa\u5341\u8fdb\u5236\u601d\u8def\uff1a\u9ad8\u4f4d\u4f4e\u4f4d
\u4f5c\u4e1a4: C\u4ee3\u7801\u6587\u4ef6\u67e5\u770b\u5668\u7ffb\u8bd1\u6210\u6c47\u7f16
\u4ed6\u4f1a\u7ed9\u4e00\u4e2ac\u6e90\u4ee3\u7801\uff0c\u7528c\u548c\u6c47\u7f16\u5939\u5fc3\u8c03\u8bd5\u628ac\u7ffb\u8bd1\u6210\u6c47\u7f16\u3002
\u903b\u8f91\u7684\u601d\u8def\uff1a
\u5bc4\u5b58\u5668\u72b6\u6001\u4fdd\u5b58 + \u521d\u59cb\u72b6\u6001 + \u5224\u65ad\u7ec8\u6b62 + \u64cd\u4f5c + \u50a8\u5b58 + \u5faa\u73af\u6761\u4ef6 + \u8df3\u8f6c + \u5bc4\u5b58\u5668\u72b6\u6001\u6062\u590d
\u6e90\u4ee3\u7801\u6587\u4ef6\u540dmytest.c
gcc -c -g -o mytest mytest.c\nobjdump -s -d main.o > main.o.txt\n
\u76ee\u6807\u6587\u4ef6\u53cd\u6c47\u7f16\uff0c\u540c\u65f6\u663e\u793a\u6e90\u4ee3\u7801
gcc -g -c -o main.o main.c\nobjdump -S -d main.o > main.o.txt\n
\u663e\u793a\u6e90\u4ee3\u7801\u7684\u540c\u65f6\u663e\u793a\u884c\u53f7
objdump -j .text -ld -C -S main.o > main.o.txt\n
\u53ef\u6267\u884c\u6587\u4ef6\u53cd\u6c47\u7f16
gcc -o main main.c\nobjdump -s -d main > main.txt\n
\u540c\u65f6\u663e\u793a\u6e90\u4ee3\u7801
gcc -g -o main main.c\nobjdump -S -d main > main.txt\n
"},{"location":"docs/1-cs/assembly-x86/#_1","title":"\u671f\u672b\u8003\u8bd5","text":"\u7a0b\u5e8f\u586b\u7a7a\u9898(3\u9898\uff0c\u6bcf\u989810\u5206\uff0c\u517130\u5206)
\u4e00\u822c\u90fd\u4f1a\u7528stack\u538b\u5165\u53c2\u6570 \u4f1a\u7ed9\u51fac\u8bed\u8a00\u7684\u539f\u578b\uff08\uff1f\uff0c\u53c2\u6570\u7684\u538b\u5165\u987a\u5e8f\u4ece\u53f3\u5230\u5de6\uff0ccaller\u6e05\u7406 pascal\uff0c\u4ece\u5de6\u5230\u53f3\uff0ccallee\u6e05\u7406 stdcall\uff0c\u4ece\u53f3\u5230\u5de6\uff0ccaller\u6e05\u7406 \u90fd\u7528ax\u8fd4\u56de\u53c2\u6570 \u4e00\u822c\u4e24\u4e2a\u7a7a\u4e0d\u53ef\u4ee5\u4ea4\u6362\u3002\u3002\u3002 \u5148\u81ea\u5df1\u5199\u4e00\u904d\u518d\u586b \uff08\u4e00\u822c20\u51e0\u884c\u7684\u7a0b\u5e8f\uff09
\u7a0b\u5e8f\u9605\u8bfb(2\u9898\uff0c\u6bcf\u98985\u5206\uff0c\u517110\u5206) \u4f1a\u95ee\u8fd0\u884c\u7ed3\u679c\u548c\u4e2d\u95f4\u7ed3\u679c\uff08#\uff09\uff08\u5982\u679c\u6709\u5faa\u73af\uff0c\u6bcf\u6b21\u5faa\u73af\u5230\u90fd\u8981\u5199\uff0c\u4f46\u662f\u4e0d\u4f1a\u592a\u591a\uff09
\u4e0d\u4f1a\u6709\u76f4\u63a5\u624b\u5199\u4e00\u6574\u4e2a\u7a0b\u5e8f\u7684\u9898
\u91cd\u70b9\uff1a \u51fd\u6570\u53c2\u6570\u4f20\u9012\uff0c\u5982\u4f55\u6784\u9020\u4e00\u4e2a\u5806\u6808\u6846\u67b6\uff0cebp\u3002\u3002 \u9700\u8981\u770b\u61c2\u662f\u4e0d\u662f\u9012\u5f52\uff0c \u6709\u4e00\u4e2a\u7a0b\u5e8f\u586b\u7a7a\u4f1a\u51fa\u5355\u6b65\u8c03\u8bd5\uff0c\u8fb9\u89e3\u5bc6\u8fb9\u52a0\u5bc6\u90a3\u4e2a\u3002\u3002 \u4e0d\u4f1a\u8003\u4fdd\u62a4\u6a21\u5f0f\u3002
"},{"location":"docs/1-cs/assembly-x86/#_2","title":"\u590d\u4e60","text":""},{"location":"docs/1-cs/assembly-x86/#intel-808680386-cpu","title":"Intel 8086/80386 CPU \u529f\u80fd\u7ed3\u6784","text":""},{"location":"docs/1-cs/assembly-x86/#_3","title":"\u5de5\u4f5c\u65b9\u5f0f","text":"\u8fd0\u7b97\u5668\u8fdb\u884c\u4fe1\u606f\u5904\u7406\uff0c\u5bc4\u5b58\u5668\u8fdb\u884c\u4fe1\u606f\u5b58\u50a8\uff0c\u63a7\u5236\u5668\u63a7\u5236\u5404\u79cd\u5668\u4ef6\u5de5\u4f5c\uff0c\u603b\u7ebf\u8fde\u63a5\u5404\u79cd\u5668\u4ef6\u3002
"},{"location":"docs/1-cs/assembly-x86/#163280x86-view","title":"16\u4f4d\u548c32\u4f4d\u768480x86\u7684\u533a\u522b - \u64cd\u4f5c\u7cfb\u7edfview","text":"1234h:0058h \u8f6c\u5316\u6210\u7269\u7406\u5730\u5740=12340h+0058h=12398h \u8865\u7801
"},{"location":"docs/1-cs/assembly-x86/#_5","title":"\u6807\u5fd7\u4f4d","text":"\u72b6\u6001\u6807\u5fd7\uff1aCF ZF SF OF AF PF \u63a7\u5236\u6807\u5fd7\uff1aDF(direction flags) TF(trace/trap flag) IF(interrupt flag)
"},{"location":"docs/1-cs/assembly-x86/#_6","title":"\u6570\u636e\u5728\u5185\u5b58\u4e2d\u7684\u5b58\u653e\u89c4\u5f8b\uff1a","text":"\u5c0f\u7aef\u683c\u5f0f\u3002\u4f4e\u5b57\u8282\u5728\u524d\uff0c\u9ad8\u5b57\u8282\u5728\u540e\u3002 \u8bbeds=1000h, bx=2000h, ax=1234h Mov ds:[bx], ax \u6267\u884c\u540e1000:2001\u6307\u5411\u7684\u5b57\u8282=12h
"},{"location":"docs/1-cs/assembly-x86/#_7","title":"\u5bc4\u5b58\u5668","text":"\u603b\u7ed3
\u5bc4\u5b58\u5668 \u7c7b\u522b \u7528\u9014 AX \u6570\u636e\u5bc4\u5b58\u5668 \u7b97\u672f\u8fd0\u7b97\u4e2d\u7684\u4e3b\u8981\u5bc4\u5b58\u5668\uff0c\u5728\u4e58\u9664\u8fd0\u7b97\u4e2d\u7528\u6765\u5236\u5b9a\u88ab\u9664\u6570\uff0c\u4e5f\u662f\u4e58\u9664\u8fd0\u7b97\u540e\u7ed3\u679c\u7684\u9ed8\u8ba4\u5b58\u50a8\u5355\u5143\u3002\u53e6\u5916I/O\u6307\u4ee4\u5747\u4f7f\u7528\u8be5\u5bc4\u5b58\u5668\u4e0eI/O\u8bbe\u5907\u4f20\u9001\u4fe1\u606f\u3002 BX \u6570\u636e\u5bc4\u5b58\u5668 \u6307\u4ee4\u5bfb\u5740\u65f6\u5e38\u7528\u505a\u57fa\u5740\u5bc4\u5b58\u5668\uff0c\u5b58\u5165\u504f\u79fb\u91cf\u6216\u504f\u79fb\u91cf\u7684\u6784\u6210\u6210\u5206 CX \u6570\u636e\u5bc4\u5b58\u5668 \u5728\u5faa\u73af\u6307\u4ee4\u64cd\u4f5c\u6216\u4e32\u5904\u7406\u6307\u4ee4\u4e2d\u9690\u542b\u8ba1\u6570 DX \u6570\u636e\u5bc4\u5b58\u5668 \u5728\u53cc\u5b57\u8282\u957f\u8fd0\u7b97\u4e2d\u4e0eAX\u6784\u621032\u4f4d\u64cd\u4f5c\u6570\uff0cDX\u4e3a\u9ad816\u4f4d\u3002\u5728\u67d0\u4e9bI/O\u6307\u4ee4\u4e2d\uff0cDX\u88ab\u7528\u6765\u5b58\u653e\u7aef\u53e3\u5730\u5740 SP \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u59cb\u7ec8\u662f\u6808\u9876\u7684\u4f4d\u7f6e\uff0c\u4e0eSS\u5bc4\u5b58\u5668\u4e00\u8d77\u6784\u6210\u6808\u9876\u6570\u636e\u7684\u7269\u7406\u5730\u5740 BP \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u7cfb\u7edf\u9ed8\u8ba4\u5176\u6307\u5411\u5806\u6808\u4e2d\u67d0\u4e00\u5355\u5143\uff0c\u5373\u63d0\u4f9b\u6808\u4e2d\u8be5\u5355\u5143\u7684\u504f\u79fb\u91cf\u3002\u52a0\u6bb5\u524d\u7f00\u540e\uff0cBP\u53ef\u4f5c\u4e3a\u975e\u5806\u6808\u6bb5\u7684\u5730\u5740\u6307\u9488 SI \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u4e0eDS\u8054\u7528\uff0c\u6307\u793a\u6570\u636e\u6bb5\u4e2d\u67d0\u64cd\u4f5c\u7684\u504f\u79fb\u91cf\u3002\u5728\u505a\u4e32\u5904\u7406\u65f6\uff0cSI\u6307\u793a\u6e90\u64cd\u4f5c\u6570\u5730\u5740\uff0c\u5e76\u6709\u81ea\u52a8\u589e\u91cf\u548c\u81ea\u52a8\u51cf\u91cf\u7684\u529f\u80fd\u3002\u53d8\u5740\u5bfb\u5740\u65f6\uff0cSI\u4e0e\u67d0\u4e00\u4f4d\u79fb\u91cf\u5171\u540c\u6784\u6210\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf DI \u6307\u9488\u53ca\u53d8\u5740\u5bc4\u5b58\u5668 \u4e0eDS\u8054\u7528\uff0c\u6307\u793a\u6570\u636e\u6bb5\u4e2d\u67d0\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf\uff0c\u6216\u4e0e\u67d0\u4e00\u4f4d\u79fb\u91cf\u5171\u540c\u6784\u6210\u64cd\u4f5c\u6570\u7684\u504f\u79fb\u91cf\uff0c\u4e32\u5904\u7406\u64cd\u4f5c\u65f6\uff0cDI\u6307\u793a\u9644\u52a0\u6bb5\u4e2d\u76ee\u7684\u5730\u5740\uff0c\u5e76\u6709\u81ea\u52a8\u589e\u91cf\u548c\u51cf\u91cf\u7684\u529f\u80fd\u3002 CS \u6bb5\u5bc4\u5b58\u5668 \u5b58\u653e\u5f53\u524d\u7a0b\u5e8f\u7684\u6307\u793a\u4ee3\u7801 DS \u6bb5\u5bc4\u5b58\u5668 \u5b58\u653e\u7a0b\u5e8f\u6240\u8bbe\u8ba1\u7684\u6e90\u6570\u636e\u6216\u7ed3\u679c SS \u6bb5\u5bc4\u5b58\u5668 \u4ee5\u201c\u5148\u5165\u540e\u51fa\u201d\u4e3a\u539f\u5219\u7684\u6570\u636e\u533a ES \u6bb5\u5bc4\u5b58\u5668 \u8f85\u52a9\u6570\u636e\u533a\uff0c\u5b58\u653e\u4e32\u6216\u5176\u5b83\u6570\u636e IP \u63a7\u5236\u5bc4\u5b58\u5668 \u5b83\u59cb\u7ec8\u6307\u5411\u5f53\u524d\u5c06\u8981\u6267\u884c\u6307\u4ee4\u5728\u4ee3\u7801\u6bb5\u4e2d\u7684\u504f\u79fb\u91cf FR \u63a7\u5236\u5bc4\u5b58\u5668 \u63a7\u5236\u6807\u5fd7\u4f4d "},{"location":"docs/1-cs/assembly-x86/#_8","title":"\u901a\u7528\u5bc4\u5b58\u5668","text":"IA-32\u67b6\u6784\u4e2d\u4e00\u5171\u67094\u4e2a32\u4f4d\u5bc4\u5b58\u5668\uff0c\u7528\u4e8e\u4fdd\u5b58\u4e34\u65f6\u6570\u636e\uff0c\u8fd94\u4e2a\u901a\u7528\u5bc4\u5b58\u5668\u53ef\u4ee5\u5f53\u4f5c16\u4f4d\u7528\uff0c\u4e5f\u53ef\u4ee5\u4f5c8\u4f4d\u7528\u3002
AX BX CX DX\uff1a\u6570\u636e\u5bc4\u5b58\u5668\uff0c\u6bcf\u4e2a\u6570\u636e\u5bc4\u5b58\u5668\u90fd\u53ef\u4ee5\u62c6\u6210\u4e24\u4e2a 8 \u4f4d\u5bc4\u5b58\u5668\u72ec\u7acb\u4f7f\u7528\uff0c\u5982 AX \u53ef\u62c6\u5206\u4e3a AH \u548c AL\uff0cBX \u62c6\u5206\u4e3a BH \u548c BL \u7b49\u3002H \u548c L \u5206\u522b\u8868\u793a\u9ad8 8 \u4f4d\u548c\u4f4e 8 \u4f4d\u3002
AX(accumulator)\uff1a\u7d2f\u52a0\u5668\u3002\u5728\u4e58\u9664\u6cd5\u8fd0\u7b97\u3001\u4e32\u8fd0\u7b97\u3001 I/O \u6307\u4ee4\u4e2d\u90fd\u4f5c\u4e3a\u4e13\u7528\u5bc4\u5b58\u5668\uff1b BX (base)\uff1a\u57fa\u5740\u5bc4\u5b58\u5668\uff0c\u5e38\u7528\u4e8e\u5b58\u6863\u5185\u5b58\u5730\u5740\u3002
CX (count)\uff1a\u8ba1\u6570\u5bc4\u5b58\u5668\u3002\u5e38\u7528\u4e8e\u5b58\u653e\u5faa\u73af\u8bed\u53e5\u7684\u5faa\u73af\u6b21\u6570\uff0c\u5b57\u7b26\u4e32\u64cd\u4f5c\u4e2d\u4e5f\u5e38\u7528\u3002
DX (data)\uff1a\u6570\u636e\u5bc4\u5b58\u5668\u3002\u5e38\u5e38\u548cEAX\u4e00\u8d77\u4f7f\u7528\u3002
"},{"location":"docs/1-cs/assembly-x86/#_9","title":"\u53d8\u5740\u5bc4\u5b58\u5668","text":"\u5b58\u653e\u5728\u53d8\u52a8\u7684\u5185\u5b58\u5730\u5740
ESI(source index): \u6e90\u53d8\u5740\u5bc4\u5b58\u5668\uff0c\u901a\u5e38\u5b58\u653e\u8981\u5904\u7406\u7684\u6570\u636e\u7684\u5185\u5b58\u5730\u5740\u3002
EDI(destination index)\uff1a\u76ee\u7684\u53d8\u5740\u5bc4\u5b58\u5668\uff0c\u901a\u5e38\u5b58\u653e\u5904\u7406\u540e\u7684\u6570\u636e\u7684\u5185\u5b58\u5730\u5740\u3002
ESI\u548cEDI\u5e38\u7528\u6765\u914d\u5408\u4f7f\u7528\u5b8c\u6210\u6570\u636e\u7684\u8d4b\u503c\u64cd\u4f5c
rep movs dword ptr[edi], dword ptr[esi];\n
\u8fd9\u53e5\u7684\u610f\u601d\u662f\u628aESI\u6307\u5411\u7684\u5185\u5b58\u5730\u5740\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230EDI\u6240\u6307\u5411\u7684\u5185\u5b58\u4e2d\uff0c\u6570\u636e\u957f\u5ea6\u5728ECX\u4e2d\u6307\u5b9a\u3002
"},{"location":"docs/1-cs/assembly-x86/#_10","title":"\u6307\u9488\u5bc4\u5b58\u5668","text":"ESP\uff08stack pointer\uff09\uff1a\u5806\u6808\u6307\u9488\u5bc4\u5b58\u5668\u3002SS\uff1aSP\u6307\u5411\u5806\u6808\u7684\u6808\u9876\uff0c\u56e0\u6b64\u867d\u7136\u662f\u901a\u7528\u5bc4\u5b58\u5668\uff0c\u4f46\u4e0d\u5e94\u968f\u4fbf\u6539\u53d8SP\u7684\u503c\u3002\u4e0d\u53ef\u4ee5\u4f5c\u4e3a\u901a\u7528\u5bc4\u5b58\u5668\u4f7f\u7528\uff0cESP\u5b58\u653e\u5f53\u524d\u5806\u6808\u6808\u9876\u7684\u5730\u5740\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cESP\u548cEBP\u8054\u5408\u4f7f\u7528\u6765\u8bbf\u95ee\u51fd\u6570\u4e2d\u7684\u53c2\u6570\u548c\u5c40\u90e8\u53d8\u91cf\u3002 EBP\uff08base pointer\uff09\uff1a\u57fa\u5740\u6307\u9488\u5bc4\u5b58\u5668\u3002\u53ef\u4ee5\u4f5c\u4e3a\u901a\u7528\u5bc4\u5b58\u5668\u7528\u4e8e\u5b58\u653e\u64cd\u4f5c\u6570\uff0c\u5e38\u7528\u6765\u4ee3\u66ff\u5806\u6808\u6307\u9488\u8bbf\u95ee\u5806\u6808\u7684\u6570\u636e\u3002 EIP\uff1a\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668\uff0c\u603b\u662f\u6307\u5411\u4e0b\u4e00\u6761\u8981\u6267\u884c\u7684\u6307\u4ee4\u7684\u5730\u5740\u3002 \u5e38\u89c1\u7684\u8bbf\u95ee\u5806\u6808\u6307\u4ee4\uff1a
push ebp\nmov ebp, esp\nsub esp, 78\npush esi\npush edi\ncmp dword ptr [ebp+8], 0\n
ss\u6808\u6bb5\u5bc4\u5b58\u5668 sp\u6808\u9876\u6307\u9488\u5bc4\u5b58\u5668 bp\u9ed8\u8ba4\u7684\u6808\u5bfb\u5740\u5bc4\u5b58\u5668
"},{"location":"docs/1-cs/assembly-x86/#_11","title":"\u6807\u5fd7\u5bc4\u5b58\u5668","text":"\u6807\u5fd7\u5bc4\u5b58\u5668EFLAGS\u4e00\u5171\u670932\u4f4d\uff0c\u5728\u8fd932\u4f4d\u4e2d\u5927\u90e8\u5206\u662f\u4fdd\u7559\u7ed9\u7f16\u5199\u64cd\u4f5c\u7cfb\u7edf\u7684\u4eba\u7528\u7684\u3002
IP (instruction pointer)\uff1a\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668\u3002\u4ee3\u7801\u6bb5\u5bc4\u5b58\u5668 CS \u548c\u6307\u4ee4\u6307\u9488\u5bc4\u5b58\u5668 IP \u662f 8086CPU \u4e2d\u6700\u5173\u952e\u7684\u4e24\u4e2a\u5bc4\u5b58\u5668\u3002\u5b83\u4eec\u5206\u522b\u7528\u6765\u63d0\u4f9b\u5f53\u524d\u6307\u4ee4\u7684\u6bb5\u5730\u5740\u548c\u504f\u79fb\u5730\u5740\u3002\u5373\u4efb\u610f\u65f6\u523b\uff0c8086CPU \u5c06 CS:IP \u6307\u5411\u7684\u5185\u5bb9\u5f53\u505a\u547d\u4ee4\u6267\u884c\u3002\u6bcf\u6761\u6307\u4ee4\u8fdb\u5165\u6307\u4ee4\u7f13\u51b2\u5668\u540e\u3001\u6267\u884c\u524d\uff0cIP += \u6240\u8bfb\u53d6\u6307\u4ee4\u7684\u957f\u5ea6\uff0c\u4ece\u800c\u6307\u5411\u4e0b\u4e00\u6761\u6307\u4ee4\u3002\u7528\u6237\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee IP \u5bc4\u5b58\u5668\u3002
FL (flags)\uff1a\u6807\u5fd7\u5bc4\u5b58\u5668\u3002\u4e0e\u5176\u4ed6\u5bc4\u5b58\u5668\u4e00\u6837\uff0c\u6807\u5fd7\u5bc4\u5b58\u5668\u4e5f\u6709 16 \u4f4d\uff0c\u4f46\u662f\u6807\u5fd7\u5bc4\u5b58\u5668\u53ea\u7528\u5230\u5176\u4e2d\u7684 9 \u4f4d\u3002\u8fd9 9 \u4f4d\u5305\u62ec 6 \u4e2a\u72b6\u6001\u6807\u5fd7\u548c 3 \u4e2a\u63a7\u5236\u6807\u5fd7\uff0c\u53c2\u89c1\u4e0b\u9762\u7684\u201c\u6807\u5fd7\u4f4d\u201d\u3002
OF\uff08Overflow Flag\uff09:\u6ea2\u51fa\u6807\u5fd7\uff0c\u6ea2\u51fa\u65f6\u4e3a1\uff0c\u5426\u5219\u7f6e0\u3002\u4e24\u4e2a\u6b63\u6570\u76f8\u52a0\u53d8\u8d1f\uff0c\u6216\u4e24\u4e2a\u8d1f\u6570\u76f8\u52a0\u53d8\u6b63\u4f1a\u6ea2\u51fa\u3002#
DF \uff08Direction Flag\uff09:\u65b9\u5411\u6807\u5fd7\uff0c\u5728\u4e32\u5904\u7406\u6307\u4ee4\u4e2d\u63a7\u5236\u4fe1\u606f\u7684\u65b9\u5411\u30020:\u6b63\u65b9\u5411\uff0c1\uff1a\u53cd\u65b9\u5411\u3002cld\uff0cstd\u3002#
IF (Interrupt Flag) :\u4e2d\u65ad\u6807\u5fd7\u3002\u7981\u6b62\u4e2d\u65ad0\uff0c\u5141\u8bb8\u4e2d\u65ad1\u3002cli\uff0csti\u3002#
AF (Auxiliary carry Flag) :\u8f85\u52a9\u8fdb\u4f4d\u6807\u5fd7\uff0c\u6709\u8fdb\u4f4d\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
ZF (Zero Flag) :\u96f6\u6807\u5fd7\uff0c\u8fd0\u7b97\u7ed3\u6784\u4e3a0\u65f6ZF\u4f4d\u4f4d\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
SF (Sign Flag):\u7b26\u53f7\u6807\u5fd7\uff0c\u7ed3\u679c\u4e3a\u8d1f\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002#
CF (Carry Flag): \u8fdb\u4f4d\u6807\u5fd7\uff0c\u8fdb\u4f4d\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002\u914d\u5957\u7684clc\uff0cstc\u4e24\u6761\u8bbe\u7f6e\u6307\u4ee4\uff1a\u6e05\u9664\u548c\u7f6e1\u3002#
PF (Parity Flag): \u5947\u5076\u6807\u5fd7\u3002\u7ed3\u679c\u64cd\u4f5c\u6570\u4e2d1\u7684\u4e2a\u6570\u4e3a\u5076\u6570\u65f6\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002
TF\uff1a\u5355\u6b65\u8c03\u8bd5\u8981\u7528\u3002#
EFLAGS\u662f\u5b9e\u73b0\u6761\u4ef6\u5224\u65ad\u548c\u903b\u8f91\u5224\u65ad\u7684\u4e00\u79cd\u673a\u5236\uff0c\u5728\u6c47\u7f16\u8bed\u8a00\u4e2d\u4e00\u822c\u4e0d\u76f4\u63a5\u8bbf\u95eeEFLAGS\u5bc4\u5b58\u5668\uff0c\u800c\u662f\u901a\u8fc7\u6307\u4ee4\u7684\u64cd\u4f5c\u9690\u542b\u8bbf\u95eeEFLAGS\u5bc4\u5b58\u5668\u3002
cmp dword ptr [ebp+8], 0. // \u5f71\u54cd\u6807\u5fd7\u4f4dCF\uff0cZF\uff0cSF\uff0cOF\uff0cAF\u548cPF\nJz 99495898 //\u5982\u679cZF\u7b49\u4e8e1\uff0c\u5219\u8df3\u8f6c\u523000405898
"},{"location":"docs/1-cs/assembly-x86/#_12","title":"\u6307\u4ee4","text":"\u603b\u7ed3
\u6307\u4ee4 \u4f5c\u7528 \u53c2\u6570 \u6539\u53d8\u6807\u5fd7\u4f4d mov \u8d4b\u503c \u88ab\u8d4b\u503c\u5bc4\u5b58\u5668\uff0c\u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\uff0c\u503c\u3011 no xchg \u6570\u636e\u4ea4\u6362 \u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\u3011\uff0c\u3010\u5bc4\u5b58\u5668\uff0c\u5185\u5b58\u3011 no push \u8fdb\u6808 \u6e90\u64cd\u4f5c\u6570\u3010\u5bc4\u5b58\u5668\u3011 pop \u51fa\u6808 \u76ee\u7684\u64cd\u4f5c\u6570\u3010\u5bc4\u5b58\u5668\u3011 pushf \u6807\u5fd7\u4f4d\u8fdb\u6808 \u65e0 popf \u6807\u5fd7\u4f4d\u51fa\u6808 \u65e0 lea Load effect address\uff0c\u5bfb\u5740\uff0c\u53d6\u504f\u79fb\u5730\u5740 lds \u5f53\u6307\u4ee4\u6307\u5b9a\u7684\u662f16\u4f4d\u5bc4\u5b58\u5668\u65f6\uff0c\u628a\u6e90\u64cd\u4f5c\u6570\u5b58\u50a8\u5355\u5143\u4e2d\u5b58\u653e\u7684\u5341\u516d\u4f4d\u504f\u79fb\u5730\u5740\u53d6\u51fa\u5b58\u653e\u5728\u5bc4\u5b58\u5668\u4e2d\uff0c\u7136\u540e\u628a\u6e90\u64cd\u4f5c\u6570+2\u7684\u5341\u516d\u4f4d\u6570\u88c5\u5165\u6307\u4ee4\u6307\u5b9a\u7684\u6bb5\u5bc4\u5b58\u5668\u3002\u5f53\u6307\u4ee4\u6307\u5b9a\u7684\u662f32\u4f4d\u5bc4\u5b58\u5668\u65f6 \u628a\u6e90\u64cd\u4f5c\u6570\u5b58\u50a8\u5355\u5143\u4e2d\u5b58\u653e\u768432\u4f4d\u504f\u79fb\u5730\u5740\u88c5\u5165\u5bc4\u5b58\u5668 \u7136\u540e\u628a \u6e90\u64cd\u4f5c\u6570+4 \u768416\u4f4d\u6570\u88c5\u5165\u6bb5\u5bc4\u5b58\u5668\u3002mem\u6307\u5411\u7684\u5730\u5740,\u9ad8\u4f4d\u5b58\u653e\u5728DS\u4e2d,\u4f4e\u4f4d\u5b58\u653e\u5728reg\u4e2d. LDS reg,mem les \u628a\u5185\u5b58\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7684\u53cc\u5b57\u64cd\u4f5c\u6570\u7684\u4f4e\u4f4d\u5b57\u88c5\u5165\u6307\u4ee4\u4e2d\u6307\u5b9a\u7684\u5bc4\u5b58\u5668\u3001\u9ad8\u4f4d\u5b57\u88c5\u5165ES\u5bc4\u5b58\u5668\u3002 cbw 8\u4f4d\u6570\u6269\u5c55\u4e3a16\u4f4d\u6570\uff0c\u6709\u7b26\u53f7\u6269\u5145 no cwd \u5b57(16\u4f4d)\u6269\u5c55\u4e3a\u53cc\u5b57(32\u4f4d)\uff0c\u6709\u7b26\u53f7\uff1f no add \u52a0 OPRDS\uff0cOPRDD adc \u5e26\u8fdb\u4f4d\u52a0\uff08\u7ed3\u679c\u542b\u6807\u5fd7\u4f4dCF\u7684\u503c\uff0c=OPRDS\uff0bOPRDD\uff0bCF\uff09 OPRDS\uff0cOPRDD sub \u51cf OPRDD\uff0cOPRDS sbb \u5e26\u8fdb\u4f4d\u51cf\uff08\u7ed3\u679c\u542b\u6807\u5fd7\u4f4dCF\u7684\u503c\uff0c=OPRDD\uff0dOPRDS\uff0dCF\uff09 OPRDD\uff0cOPRDS inc \u81ea\u589e1 \u5bc4\u5b58\u5668 dec \u81ea\u51cf1 \u5bc4\u5b58\u5668 mul 32\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aEAX\uff0c\u90a3\u4e48\u4e58\u79ef\u5c06\u5b58\u653e\u5728EDX\uff1aEAX\u4e2d 32\u4f4d\u4e58\u6570 16\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aAX\u90a3\u4e48\u4e58\u79ef\u5c06\u653e\u5728DX\uff1aAX\u4e2di 16\u4f4d\u4e58\u6570 8\u4f4d\uff1a\u88ab\u4e58\u6570\u9ed8\u8ba4\u4e3aAL\uff0c\u90a3\u4e48\u4e58\u79ef\u5c06\u653e\u5728AX 8\u4f4d\u4e58\u6570 div 32\u4f4d\uff1a\u88ab\u9664\u6570\u5c06\u662fEDX\uff1aEAX\uff0c \u6700\u7ec8\u7684\u5546\u5c06\u5b58\u653e\u5728EAX\uff0c \u4f59\u6570\u5c06\u5b58\u653e\u5728EDX\u4e2d 32\u4f4d\u4e58\u6570 16\u4f4d\uff1a\u88ab\u9664\u6570\u4e3aEAX\uff0c\u6700\u7ec8\u5f97\u5230\u7684\u5546\u653e\u5728AX\uff0c\u4f59\u6570\u653e\u5728EAX\u7684\u9ad816\u4f4d 16\u4f4d\u4e58\u6570 8\u4f4d\uff1a\u88ab\u9664\u6570\u662f16\u4f4d\uff0c\u6700\u7ec8\u5f97\u5230\u7684\u5546\u5c06\u653e\u5728AL\u4e2d\uff0c\u4f59\u6570\u653e\u5728AH\u4e2d 8\u4f4d\u4e58\u6570 imul \u65e0\u7b26\u53f7\u4e58 idiv \u65e0\u7b26\u53f7\u9664 xlat \u6362\u7801\u6307\u4ee4\uff0c\u4ee5bx\u4e3a\u9996\u5730\u5740\u7684\uff0c\u504f\u79fb\u5730\u5740\u4e3aal\u7684\u5185\u5bb9\u9001\u7ed9al\u3002 in \u7aef\u53e3\u8bfb\u5199\u6307\u4ee4 IN AL,21H\uff1b\u8868\u793a\u4ece21H\u7aef\u53e3\u8bfb\u53d6\u4e00\u5b57\u8282\u6570\u636e\u5230AL out \u7aef\u53e3\u8bfb\u5199\u6307\u4ee4 and \u6309\u4f4d\u4e0e or \u6309\u4f4d\u6216 xor \u6309\u4f4d\u5f02\u6216 not \u64cd\u4f5c\u6570\u6309\u4f4d\u53d6\u53cd neg \u64cd\u4f5c\u6570\u6309\u4f4d\u53d6\u53cd\u52a0\u4e00 test \u5bf9\u4e24\u4e2a\u64cd\u4f5c\u6570\u8fdb\u884c\u6309\u4f4d\u4e0e\u64cd\u4f5c\u3002\u4e0eand\u4e0d\u540c\uff0c\u4e0d\u5f71\u54cd\u76ee\u6807\u64cd\u4f5c\u6570\u7684\u503c\u3002 shl \u903b\u8f91\u5de6\u79fb\uff0c\u5c06\u4e00\u4e2a\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u6216\u5355\u5143\u4e2d\u7684\u6570\u636e\u5411\u5de6\u79fb\u4f4d\uff0c\u5c06\u6700\u540e\u79fb\u51fa\u7684\u4e00\u4f4d\u5199\u5165cf\u4e2d\u3002\u6700\u4f4e\u4f4d\u75280\u8865\u5145\u3002 shr \u903b\u8f91\u53f3\u79fb\uff0c\u5c06\u4e00\u4e2a\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u6216\u5355\u5143\u4e2d\u7684\u6570\u636e\u5411\u5de6\u79fb\u4f4d\uff0c\u5c06\u6700\u540e\u79fb\u51fa\u7684\u4e00\u4f4d\u5199\u5165cf\u4e2d\u3002\u6700\u9ad8\u4f4d\u75280\u8865\u5145\u3002 sal \u7b97\u672f\u5de6\u79fb\uff0c\u4e0eshl\u4e00\u6837\uff0c\u88650 sar \u7b97\u672f\u53f3\u79fb\uff0c\u4e0eshr\u4e0d\u4e00\u6837\uff0c\u7b97\u672f\u53f3\u79fb\u8865\u6700\u9ad8\u4f4d rol \u5faa\u73af\u5de6\u79fb ror \u5faa\u73af\u53f3\u79fb rcl \u5e26\u8fdb\u4f4d\u5faa\u73af\u5de6\u79fb\uff0c\u5de6\u79fb\u7684\u65f6\u5019\u79fb\u51fa\u53bb\u7684\u4f1a\u653e\u5728cf\uff1f rcr \u5e26\u8fdb\u4f4d\u5faa\u73af\u53f3\u79fb cmp \u6bd4\u8f83 ja jump if above jb Jump if below jae Jump if above or equal jbe Jump if below or equal jg jump if greater\uff0c\u6709\u7b26\u53f7\u5927\u4e8e\u8df3\u8f6c jl jump less\uff0c\u6709\u7b26\u53f7\u5c0f\u4e8e\u8df3\u8f6c jge jump if greater or equal jle Jump if less or equal jc jump if with carry, CF = 1 jnc jump if not with carry, CF = 0 je = jz jump if equal, ZF = 1 jne = jnz jump if not equal, ZF = 0 jz jump if zero, ZF = 1 jnz jump if not zero, ZF = 0 jcxz jump if cx equals zero js SF = 1 jns SF = 0 jo Jump if overflow, OF = 1 jno jump if not overflow, OF = 0 loop \u5faa\u73af \u4ee3\u7801\u6bb5\uff08\uff1f\uff09\u540d clc clear carry flag\uff0c\u5c06cf\u4f4d\u6e05\u96f6 stc set carry flag\uff0cCF\u7f6e1 cli clear interrupt endable flag\uff0cIF\u6e05\u96f6\uff0c\u5173\u95ed\u4e2d\u65ad sti set interrupt endable flag\uff0cIF\u7f6e\u4f4d1\uff0c\u6253\u5f00\u4e2d\u65ad CMC complement carry flag\uff0cCF\u53d6\u53cd CLD clear direction flag\uff0cDF\u6e05\u96f6 STD set interrupt endable flag\uff0cDF\u7f6e1 call \u8fd1\u8c03\u7528 ret \u8fd1\u8fd4\u56de call far ptr \u8fdc\u8c03\u7528\u3002\u4e09\u4e2apush\u4e00\u4e2ajmp\u3002push f\uff0cpush cs\uff0cpush ip\uff0cjump retf \u8fdc\u8fd4\u56de\u3002\u4e09\u4e2apop\u3002\u6307\u4ee4\u2f64\u6808\u4e2d\u7684\u6570\u636e\uff0c\u4fee\u6539CS\u548cIP\u7684\u5185\u5bb9\uff0c\u4ece\u2f7d\u5b9e\u73b0\u8fdc\u8f6c\u79fb int \u4e2d\u65ad\u6307\u4ee4 iret \u4e2d\u65ad\u8fd4\u56de jmp short \u6bb5\u5185\u77ed\u8f6c\u79fb\uff0c\u77ed\u662f\u6307\u8981\u8df3\u2f84\u7684\u2f6c\u6807\u5730\u5740\u4e0e\u5f53\u524d\u5730\u5740\u524d\u540e\u76f8\u5dee\u4e0d\u8d85\u8fc7128\u5b57\u8282 jmp near ptr \u6bb5\u5185\u8fd1\u8f6c\u79fb\u3002\u8fd1\u662f\u6307\u8df3\u8f6c\u7684\u2f6c\u6807\u5730\u5740\u4e0e\u5f53\u524d\u5730\u5740\u5728\u2f64\u2f00\u4e2a\u6bb5\u5185\uff0c\u5373CS\u7684\u503c\u4e0d\u53d8\uff0c\u53ea\u6539\u53d8EIP\u7684\u503c jmp far ptr \u6bb5\u95f4\u8f6c\u79fb\uff0c\u8fdc\u6307\u8df3\u5230\u53e6\u2f00\u4e2a\u4ee3\u7801\u6bb5\u53bb\u6267\u2f8f\uff0cCS/EIP\u90fd\u8981\u6539\u53d8 Jmp dword ptr \u6bb5\u95f4\u8f6c\u79fb\uff0c\u4ee5\u5185\u5b58\u5730\u5740\u5355\u5143\u5904\u7684\u53cc\u5b57\u6765\u4fee\u6539\u6307\u4ee4\uff0c\u2fbc\u5730\u5740\u5185\u5bb9\u4fee\u6539CS\uff0c\u4f4e\u5730\u5740\u5185\u5bb9 \u4fee\u6539IP\uff0c\u5185\u5b58\u5730\u5740\u53ef\u4ee5\u4ee5\u4efb\u4f55\u5408\u6cd5\u7684\u2f45\u5f0f\u7ed9\u51fa repe/renpe scasb \u5b57\u7b26\u4e32\u626b\u63cf\u6307\u4ee4\u3002cmp al, es:[di] di++; \u5f53DF=1\u65f6\uff0c\u4e3adi-- repne:\u5f53ECX!=0\u5e76\u4e14ZF==0\u65f6 \u91cd\u590d repe: cx != 0\u4e14zf != 0\u91cd\u590d repe/renpe cmpsb \u5b57\u7b26\u4e32\u6bd4\u8f83\u6307\u4ee4\u3002\u2f50\u8f83byte ptr ds:[si]\u4e0ebyte ptr es:[di] \u5f53DF=0\u65f6\uff0cSI++\uff0cDI++ \u5f53DF=1\u65f6\uff0cSI--\uff0cDI-- repne:\u5f53ECX!=0\u5e76\u4e14ZF==0\u65f6 \u91cd\u590d repe: cx != 0\u4e14zf != 0\u91cd\u590d rep movsb \u5b57\u7b26\u4e32\u79fb\u52a8\u6307\u4ee4\u3002\u5176\u4e2drep\u8868\u793arepeat\uff0cs\u8868\u793astring\uff0cb\u8868\u793abyte \u5728\u6267\u2f8f\u6b64\u6307\u4ee4\u524d\u8981\u505a\u4ee5\u4e0b\u51c6\u5907\u2f2f\u4f5c\uff1a \u2460ds:si lodsb \u5757\u88c5\u5165\u6307\u4ee4\uff0c\u628aSI\u6307\u5411\u7684\u5b58\u50a8\u5355\u5143\u8bfb\u5165\u7d2f\u52a0\u5668\uff0clodsb\u5c31\u8bfb\u5165ax\uff0clodsw\u5c31\u8bfb\u5165ax\uff0c\u7136\u540esi\u81ea\u52a8\u589e\u52a0\u6216\u51cf\u5c0f1\u62162 stosb/stosw/stosd SI\u6307\u5411\u7684\ud83d\udd17,\u5176\u4e2dLODSB\u662f\u8bfb\u5165AL, LODSW\u662f\u8bfb\u5165AX\u4e2d, \u7136\u540eSI\u81ea\u52a8\u589e\u52a0\u6216\u51cf\u5c0f1\u62162\u4f4d.\u5f53\u65b9\u5411\u6807\u5fd7\u4f4dDF=0\u65f6\uff0c\u5219SI\u81ea\u52a8\u589e\u52a0\uff1bDF=1\u65f6\uff0cSI\u81ea\u52a8\u51cf\u5c0f\u3002 rep stosb lodsb"},{"location":"docs/1-cs/assembly-x86/#_13","title":"\u6570\u636e\u4f20\u9001\u6307\u4ee4","text":"\u6570\u636e\u4f20\u9001\u6307\u4ee4\u662f\u4e3a\u4e86\u5b9e\u73b0CPU\u548c\u5185\u5b58\uff0c\u8f93\u5165\u548c\u8f93\u51fa\u7aef\u53e3\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u9001\u3002
mov
mov eax, 56 // \u5c0656H\u4f20\u9001\u5230eax\u5bc4\u5b58\u5668\nmov esi, dword ptr [eax * 2 + 1] // \u5c06\u5185\u5b58\u5730\u5740\u4e3aeax*2+1\u76844\u5b57\u8282\u6570\u636e\u4f20\u9001\u5230esi\u5bc4\u5b58\u5668\nmov ah, byte ptr [esi * 2 + eax] // \u5c06\u5185\u5b58\u5730\u5740\u4e3aesi*+eax\u5904\u76848\u4f4d\u6570\u636e\u4f20\u9001\u5230AH\u5bc4\u5b58\u5668\n
xchg
\u5bc4\u5b58\u5668\u548c\u5185\u5b58\u7684\u6570\u636e\u4ea4\u6362\uff0c\u4ea4\u6362\u7684\u6570\u636e\u53ef\u4ee5\u662f8\u5b57\u8282\u300116\u5b57\u8282\u621632\u5b57\u8282\uff0c\u5fc5\u987b\u683c\u5f0f\u76f8\u540c
xchg eax, edx; // \u5c06edx\u5bc4\u5b58\u5668\u7684\u503c\u548ceax\u5bc4\u5b58\u5668\u7684\u503c\u4ea4\u6362\nxchg [esp-55], edi; // \u5c06edi\u5bc4\u5b58\u5668\u7684\u503c\u548c\u5806\u6808\u5730\u5740\u4e3a[esp-55]\u5904\u7684\u503c\u4ea4\u6362\n
push pop
push\u548cpop\uff1a\u79f0\u4e3a\u538b\u5165\u5806\u6808\u6307\u4ee4\u548c\u5f39\u51fa\u5806\u6808\u6307\u4ee4\uff0c\u683c\u5f0f\u662fpush src(\u6e90\u64cd\u4f5c\u6570)\u548cpop dst(\u76ee\u7684\u64cd\u4f5c\u6570)\uff0cpush\u6307\u4ee4\u548cpop\u6307\u4ee4\u9700\u8981\u5339\u914d\u51fa\u73b0\uff0c\u5426\u5219\u5806\u6808\u4f1a\u4e0d\u5e73\u8861\u3002push\u6307\u4ee4\u5c06\u539f\u64cd\u4f5c\u6570src\u538b\u5165\u5806\u6808\uff0c\u540c\u65f6esp-4\uff08\u6808\u9876\u6307\u9488\u51cf\u4e00\u4e2a4\u4f4d\uff09\uff0c\u800cpop\u53cd\u4e4b\uff0c\u4ece\u5806\u6808\u7684\u9876\u90e8\u5f39\u51fa4\u5b57\u8282\u7684\u6570\u503c\u7136\u540e\u653e\u5165dst\u3002\u572832\u4f4d\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0cpush\u548cpop\u7684\u64cd\u4f5c\u662f\u4ee54\u5b57\u8282\u4e3a\u5355\u4f4d\u7684\uff0cpush\u548cpop\u6307\u4ee4\u5e38\u7528\u4e8e\u5411\u51fd\u6570\u4f20\u53c2\u3002
push eax // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u4ee54\u5b57\u8282\u538b\u5165\u5806\u6808\uff0c\u540c\u65f6esp-4\npush dword ptr [12FF8589] // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230\u5185\u5b58\u5730\u5740\u4e3a12FF8589\u6240\u6307\u5730\u65b9\uff0c\u540c\u65f6esp+4\n-----------------------------------------------------------------------------\npop dword ptr [12FF8589] // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230\u5185\u5b58\u5730\u5740\u4e3a12FF8589\u6240\u6307\u7684\u5730\u65b9\uff0c\u540c\u65f6esp+4\npop eax // \u5c06\u5806\u6808\u9876\u90e8\u76844\u5b57\u8282\u5f39\u51fa\u5230eax\u5bc4\u5b58\u5668\uff0c\u540c\u65f6esp+4\n
"},{"location":"docs/1-cs/assembly-x86/#_14","title":"\u5730\u5740\u4f20\u9001\u6307\u4ee4","text":"x86\u67093\u6761\u5730\u5740\u4f20\u9001\u6307\u4ee4\uff0c\u5206\u522b\u662fLEA\uff0cLDS\u548cLES\u3002\u5176\u5b9eLDS\u548cLES\u6307\u4ee4\u548c\u6bb5\u5bc4\u5b58\u5668\u6709\u5173\uff0c\u572832\u4f4d\u7684windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u4e00\u822c\u7684\u7a0b\u5e8f\u5458\u90fd\u4e0d\u9700\u8981\u7ba1\u7406\u6bb5\u5bc4\u5b58\u5668\uff0c\u6240\u4ee5\u76f8\u5bf9\u800c\u8a00\uff0cLDS\u548cLES\u5bc4\u5b58\u5668\u4f7f\u7528\u5f97\u6bd4\u8f83\u5c11\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u5e38\u89c1\u7684\u53ea\u6709LEA\u6307\u4ee4\u3002
LEA
\u79f0\u4e3a\u5730\u5740\u4f20\u9001\u6307\u4ee4\uff0c\u683c\u5f0f\u662f\u201cLEA DST, ADDR\u201d\u3002LEA\u5c06ADDR\u5730\u5740\u52a0\u8f7d\u5230DST\uff0c\u5176\u4e2dADDR\u53ef\u4ee5\u662f\u5185\u5b58\uff0c\u4e5f\u53ef\u4ee5\u662f\u5bc4\u5b58\u5668\uff0c\u800cDST\u5fc5\u987b\u662f\u4e00\u4e2a\u901a\u7528\u5bc4\u5b58\u5668\u3002
lea eax, [12345678]; // \u6307\u4ee4\u6267\u884c\u540eeax\u5bc4\u5b58\u5668\u7684\u503c\u4e3a12345678H\nmov eax, [12345678]; // \u800cmov eax, [12345678] \u6307\u4ee4\u6267\u884c\u540eeax\u5bc4\u5b58\u5668\u7684\u503c\u4e3a\u5185\u5b58\u5730\u574012345678\u6307\u5411\u7684\u90a3\u4e2a\u6570\u503c\n// LEA\u6307\u4ee4\u53ef\u7528\u4e8e\u7b97\u6cd5\u8fd0\u7b97\nlea ecx, [ecx + eax*4]; // ecx = ecx + eax * 4\n// \u76f8\u5f53\u4e8e\u8ba1\u7b97\u51faecx+eax*4\u7684\u6570\u503c\uff0c\u5728[]\u91cc\u662f\u4e00\u4e2a\u5730\u5740\uff0clea\u53d6\u5730\u5740\u540e\u5c31\u53d6\u5230\u4e86\u8fd9\u4e2a\u6570\u503c\n
"},{"location":"docs/1-cs/assembly-x86/#_15","title":"\u7b97\u6570\u8fd0\u7b97\u6307\u4ee4","text":"80x86\u63d0\u4f9b\u4e868\u6761\u52a0\u51cf\u6cd5\u6307\u4ee4\uff0c4\u6761\u4e58\u9664\u6cd5\u6307\u4ee4\u3002
ADD\uff1a\u52a0\u6cd5\u6307\u4ee4
add eax, esi; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u52a0\u4e0aesi\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u7684\u5bc4\u5b58\u5668\u4e2d\nadd ebx, dword ptr[12345678] // \u5c06ebx\u5bc4\u5b58\u5668\u7684\u503c\u52a0\u4e0a\u5185\u5b58\u5730\u5740\u4e3a12345678\u6240\u5728\u76844\u5b57\u8282\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728ebx\u5bc4\u5b58\u5668\u4e2d\n// \u4e0d\u540c\u7684\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u4e2d\uff0cdword\u5360\u7528\u7684\u5b57\u8282\u6570\u4e0d\u540c\uff0c\u572832\u4f4d\u7684windows\u4e2d\u4e00\u4e2aword\u536016\u5b57\u8282\uff0cdword\u536032\u5b57\u8282\n// 64\u4f4d\u4e2d\u4e00\u4e2aword\u536032\u5b57\u8282\uff0cdword\u536064\u5b57\u8282\n
sub \u51cf\u6cd5\u6307\u4ee4
sub ecx, 4H; // \u5c06ecx\u5bc4\u5b58\u5668\u7684\u503c\u51cf\u53bb4H\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\nsub byte ptr[eax], ch; // \u5c06\u5185\u5b58\u5730\u5740\u4e3aeax\u6240\u6307\u5411\u7684\u6570\u636e\u7ed3\u6784\u6309\u5b57\u8282\u4e3a\u5355\u4f4d\u548cch\u5bc4\u5b58\u5668\u76f8\u51cf\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u6309\u5b57\u8282\u4e3a\u5355\u4f4d\u4fdd\u5b58\u5728eax\u6240\u6307\u5411\u7684\u4f4d\u7f6e\n
inc\u52a01\u6307\u4ee4
inc eax; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u52a01\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u653e\u5728\u539f\u6765\u7684\u5730\u65b9\n
dec\u51cf1\u6307\u4ee4
dec edx; // \u5c06dec\u5bc4\u5b58\u5668\u7684\u503c\u51cf1\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u653e\u5728\u539f\u6765\u7684\u5730\u65b9\n
cmp\u6bd4\u8f83\u6307\u4ee4
\u79f0\u6bd4\u8f83\u6307\u4ee4\u683c\u5f0f\u662f\u201dcmp oper1, oper2\u201d
cmp\u6307\u4ee4\u5c06oper1\u51cf\u53bboper2\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4e0d\u4fdd\u5b58\uff0c\u53ea\u662f\u76f8\u5e94\u5730\u8bbe\u7f6e\u5bc4\u5b58\u5668eflags\u7684cf\uff0cpf\uff0czf\uff0caf\uff0csf\u548cof\u3002\u4e5f\u5c31\u662f\u8bf4\u53ef\u4ee5\u901a\u8fc7\u6d4b\u8bd5\u5bc4\u5b58\u5668eflags\u76f8\u5173\u7684\u6807\u5fd7\u503c\u5f97\u77e5cmp\u6267\u884c\u540e\u7684\u7ed3\u679c
cmp eax, 56H; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u51cf\u53bb56H\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4e0d\u4fdd\u5b58\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5bc4\u5b58\u5668eflags\u76f8\u5173\u7684\u6807\u5fd7\u4f4d\n
neg
neg\uff1a\u53d6\u8865\u6307\u4ee4\uff0c\u683c\u5f0f\u662fneg oper
neg\u6307\u4ee4\u5c06oper\u64cd\u4f5c\u6570\u53d6\u53cd\uff0c\u7b80\u800c\u8a00\u4e4b\u5c31\u662f\u5c060\u51cf\u53bboper\u64cd\u4f5c\u6570\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5b58\u5728oper\u81ea\u8eab\u4e2d\u3002
neg eax; \n
mul imul
\u65e0\u7b26\u53f7\u4e58\u6cd5\u6307\u4ee4\u548c\u6709\u7b26\u53f7\u4e58\u6cd5\u6307\u4ee4\u3002mul\u6307\u4ee4\u9690\u542b\u4e86\u4e00\u4e2a\u53c2\u52a0\u8fd0\u7b97\u7684\u64cd\u4f5c\u6570eax\u5bc4\u5b58\u5668\uff0c\u5c06eax\u5bc4\u5b58\u5668\u91cc\u7684\u503c\u4e58oper\uff0c\u7ed3\u679c\u4fdd\u5b58\u5728eax\u4e2d\u3002\u5982\u679c\u7ed3\u679c\u8d85\u8fc732\u4f4d\u5219\u9ad832\u4f4d\u4f7f\u7528edx\u5bc4\u5b58\u5668\u4fdd\u5b58\uff0ceax\u5bc4\u5b58\u5668\u4fdd\u5b58\u4f4e32\u4f4d\u3002
mul edx; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u4e58\u4ee5edx\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\n
div idiv
\u9664\u6cd5\u6307\u4ee4\u548c\u6709\u7b26\u53f7\u9664\u6cd5\u6307\u4ee4\u3002
div ecx; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u63094\u5b57\u8282\u4e3a\u5355\u4f4d\u9664\u4ee5ecx\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5546\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\uff0c\u4f59\u6570\u4fdd\u5b58\u5728edx\u5bc4\u5b58\u5668\u4e2d\u3002\ndiv word ptr [esp+36]; // \u5c06eax\u5bc4\u5b58\u5668\u7684\u503c\u6309word\u4e3a\u5355\u4f4d\u9664\u4ee5\u5806\u6808\u5730\u5740\u4e3aesp+36\u6240\u6307\u5411\u7684\u6570\u636e\uff0c\u5f97\u51fa\u7684\u7ed3\u679c\u5546\u4fdd\u5b58\u5728eax\u5bc4\u5b58\u5668\u4e2d\uff0c\u4f59\u6570\u4fdd\u5b58\u5728edx\u5bc4\u5b58\u5668\u4e2d\u3002\n
"},{"location":"docs/1-cs/assembly-x86/#80386","title":"\u9ad8\u7ea7\u8bed\u8a00\u4e2d\u7684\u6570\u636e\u7ed3\u6784\u4e0e80386\u95f4\u63a5\u5bfb\u5740","text":"BX BP SI DI
BX\uff1a
BP\uff1a
SI\uff1a
DI\uff1a
\u95f4\u63a5\u5bfb\u5740\uff1abx\uff0cbp\uff0csi\uff0cdi\uff0c\u53ef\u4ee5\u653e\u5728\u65b9\u62ec\u53f7\u5185
\u7f3a\u7701\u6bb5\u5740\uff1ads\u548css\uff0c\u5982\u679c\u65b9\u62ec\u53f7\u5185\u6709bp\uff0c\u4e00\u5b9a\u662fss\uff0cbx\u4e00\u5b9a\u662fds
CS (code segment): \u4ee3\u7801\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u4ee3\u7801\u6bb5\u7684\u6bb5\u5730\u5740\u3002
DS (data segment)\uff1a\u6570\u636e\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u6570\u636e\u6bb5\u7684\u6bb5\u5730\u5740\u3002
SS (stack segment)\uff1a\u5806\u6808\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u50a8\u5806\u6808\u6bb5\u7684\u6bb5\u5730\u5740\u3002
ES (extra segment)\uff1a\u9644\u52a0\u6570\u636e\u6bb5\u5bc4\u5b58\u5668\uff0c\u7528\u6765\u5b58\u653e\u9644\u52a0\u6bb5\u7684\u6bb5\u5730\u5740\u3002\u6709\u65f6\uff0c\u4e00\u4e2a\u6570\u636e\u6bb5\u4e0d\u591f\u7528\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u58f0\u660e\u4e00\u4e2a\u9644\u52a0\u6bb5\u6765\u5b58\u653e\u66f4\u591a\u7684\u6570\u636e\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u58f0\u660e 2 \u4e2a\u6570\u636e\u6bb5\uff0c\u5206\u522b\u7528 DS \u548c ES \u6307\u5411\u3002
\u7a0b\u5e8f\u5f00\u59cb\u8fd0\u884c\u65f6\uff0cDOS \u4f1a\u628a ds \u548c es \u8d4b\u503c\u4e3a psp(program segment prefix) \u6bb5\u5730\u5740\u3002psp \u6bb5\u4f4d\u4e8e\u7a0b\u5e8f\u9996\u4e2a\u6bb5\u7684\u524d\u9762\uff0c\u957f\u5ea6\u4e3a 100h \u5b57\u8282\uff0c\u5176\u7528\u9014\u662f\u4fdd\u5b58\u5f53\u524d exe \u76f8\u5173\u7684\u4e00\u4e9b\u4fe1\u606f\uff0c\u5982 psp:80h \u5f00\u59cb\u5b58\u653e\u4e86 exe \u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002
\u95f4\u63a5\u5bfb\u5740\uff1a \u53ef\u4ee5\u2f64\u4f5c\u95f4\u63a5\u5bfb\u5740\u7684\u5bc4\u5b58\u5668\u53ea\u6709\u56db\u4e2a\uff1abx, bp, si, di [bx], [bp], [si], [di]\u662f\u6700\u7b80\u5355\u7684\u95f4\u63a5\u5bfb\u5740 [bx + si], [bp + si], [bx + di], [bp + di]\u6ce8\u610f\u524d\u2faf\u5fc5\u987b\u662fbx/bp\uff0c\u540e\u2faf\u5fc5\u987b\u662fdi/si [bx+2] [bp-2] [si+1] [di-1] [bx+si+2] [bx+di-2]
[bp+si+1] [bp+di-1] tips\uff1a\u4e24\u4e2a\u5bc4\u5b58\u5668\u76f8\u52a0\u7684\u95f4\u63a5\u5bfb\u5740\u2f45\u5f0f\u4e2d, bx\u6216bp\u901a\u5e38\u2f64\u6765\u8868\u793a\u6570\u7ec4\u7684\u2fb8\u5730\u5740, \u2f7dsi\u6216di\u5219\u2f64\u6765\u8868\u793a\u4e0b \u6807\u3002
\u7f3a\u7701\u6bb5\u5740\uff1a\u4e0d\u542bbp\u7684\u6e90\u64cd\u4f5c\u6570\u2f00\u822c\u90fd\u7701\u7565\u7684\u6bb5\u5730\u5740ds\uff0c\u542b\u6709bp\u7684\u6e90\u64cd\u4f5c\u6570\u7701\u7565\u4e86ss\uff0c\u2f7d\u8fd9\u4e2a\u9ed8\u8ba4\u7684\u6bb5\u5730\u5740\u662f \u53ef\u4ee5\u88ab\u6539\u53d8\u7684
\u7528\u5806\u6808\u4f20\u9012\u53c2\u6570\u65f6\uff0c\u5982\u4f55\u7528[bp+]\u5b9e\u73b0\u5bf9\u53c2\u6570\u7684\u5f15\u7528\uff1f
bp + \u591a\u5c11\u5c31\u662f\u6808\u91cc\u7684\u591a\u5c11
\u738b\u723d\u300a\u6c47\u7f16\u8bed\u2f94\u300b\u7b2c\u56db\u7248 \u9644\u5f554:\u2f64\u6808\u4f20\u9012\u53c2\u6570
difcube:\n mov bp, sp\n mov ax, [bp+4] ;a\u7684\u503c\u9001\u5165ax\u4e2d\n sub ax, [bp+6] ;\u51cf\u6808\u4e2db\u7684\u503c\n mov bp, ax\n mul bp\n mul bp\n pop bp\n ret 4\n
"},{"location":"docs/1-cs/assembly-x86/#_16","title":"\u5176\u5b83\u7684\u7b14\u8bb0","text":""},{"location":"docs/1-cs/assembly-x86/#x86_1","title":"x86\uff1a","text":"Intel\u4ece16\u4f4d\u5fae\u5904\u7406\u56688086\u5f00\u59cb\u7684\u6574\u4e2aCPU\u82af\u7247\u7cfb\u5217\uff0c\u7cfb\u5217\u4e2d\u7684\u6bcf\u79cd\u578b\u53f7\u90fd\u4fdd\u6301\u4e0e\u4ee5\u524d\u7684\u5404\u79cd\u578b\u53f7\u517c\u5bb9\uff0c\u4e3b\u8981\u67098086\uff0c8088\uff0816\u4f4dCPU\uff09\uff0c80186\uff0c80286\uff08\u8fd9\u4e24\u4e2a\u662f\u8fc7\u6e21\u4ea7\u54c1\uff09\uff0c 80386\uff0c80486\u4ee5\u53ca\u4ee5\u540e\u5404\u79cd\u578b\u53f7\u7684Pentium\u82af\u7247\uff0832\u4f4dCPU\uff09\uff0c\u901a\u5e38\u6240\u8bf4\u7684x86\u90fd\u662f\u630732\u4f4dCPU
80386: 32\u4f4d\u6c47\u7f16\u3002
80836\u5bc4\u5b58\u5668
\u901a\u7528\u5bc4\u5b58\u5668(EAX EBX ECX EDX,ESP,EBP,ESI,EDI)
\u901a\u7528\u5bc4\u5b58\u5668\u4e0e8086\u7684\u5bc4\u5b58\u5668\u76f8\u6bd4,\u753116\u4f4d\u53d8\u4e3a\u4e8632\u4f4d
ESP:\u6808\u9876
EBP:\u6808\u5e95
EAX\uff0cEBX\uff0cECX\uff0cEDX\u901a\u7528\u5bc4\u5b58\u5668
EAX\uff1a\u7d2f\u52a0\u5668\uff08\u4e58\u6cd5\u7684\u65f6\u5019\u5b58\u4f4e\u4f4d\uff09
EBX\uff1a\u57fa\u5740\uff08\uff3bEBX\uff0b100\uff28\uff3d\uff09
ECX\uff1a\u8ba1\u6570\uff08\u5faa\u73af\u7684\u65f6\u5019\u8ba1\u6570\uff09
EDX\uff1a\u6570\u636e\uff08\u9ed8\u8ba4EDX\uff0a10H\uff0b\uff0e\uff0e\uff0e\uff1b\u4e58\u6cd5\u7684\u65f6\u5019\u5b58\u9ad8\u4f4d\uff09
ESI\uff0cEDI\uff1a\u53d8\u5740\u5bc4\u5b58\u5668
ESI\uff1a\u6e90\u53d8\u5740\u5bc4\u5b58\u5668
EDI\uff1a\u76ee\u7684\u53d8\u5740\u5bc4\u5b58\u5668\u3000\u4e0eEBX\u57fa\u5740\u642d\u914d\u4f7f\u7528
"},{"location":"docs/1-cs/assembly-x86/#_17","title":"\u53c2\u8003\u6587\u732e","text":"asm_sum.doc
xxjj\u7684\u300a\u6c47\u7f16\u8bed\u8a00\u8003\u8bd5\u603b\u7ed3\u300b https://www.yuque.com/xianyuxuan/coding/mkte6u
[80386]80x86\u6c47\u7f16\u6307\u4ee4_CarlosX\u7684\u535a\u5ba2-CSDN\u535a\u5ba2_80386\u6307\u4ee4\u96c6
80386 \u7b97\u672f\u8fd0\u7b97\u6307\u4ee4\uff0c\u903b\u8f91\u8fd0\u7b97\u6307\u4ee4\uff0c\u79fb\u4f4d\u6307\u4ee4 (\u4e09) _ttzyanswer\u7684\u535a\u5ba2-CSDN\u535a\u5ba2
"},{"location":"docs/1-cs/c-libgraphics/","title":"C\u5927\u7a0b libgraphics \u6587\u6863 \u4f7f\u7528\u8bb0\u5f55","text":":material-circle-edit-outline: \u7ea6 562 \u4e2a\u5b57 :fontawesome-solid-code: 162 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
\u26a0\ufe0f \u6ca1\u5199\u5b8c TODO
"},{"location":"docs/1-cs/c-libgraphics/#_1","title":"\u5df2\u77e5\u95ee\u9898","text":"\u2192\u4fee\u6539Makefile.win\uff0c\u5728\u672b\u5c3e\u52a0\u5165\uff08\u81ea\u5df1\u5b9e\u8df5\u7684\u65f6\u5019\u8fd9\u6b65\u4e0d\u52a0\u597d\u50cf\u4e5f\u884c\uff09
gratest1.o:gratest1.c\n$(CC) -c gratest1.c -o gratest1.o $(CFLAGS)\n
graphics.h \u4ec5\u63d0\u4f9b\u4ee5\u4e0b\u5c11\u91cf\u753b\u56fe\u51fd\u6570\u63a5\u53e3
InitGraphics();\nMovePen(x, y);\nDrawLine(dx, dy);\nDrawArc(r, start, sweep);\nGetWindowWidth();\nGetWindowHeight();\nGetCurrentX();\nGetCurrentY();\n
\u6211\u4eec\u5c06\u5728\u4e0b\u9762\u4ecb\u7ecd\u8fd9\u4e9b\u63a5\u53e3\u7684\u7528\u6cd5\u3002
"},{"location":"docs/1-cs/c-libgraphics/#_3","title":"\u521d\u59cb\u5316\u64cd\u4f5c","text":"\u5728main.c\u91cc\u9700\u8981\u8fdb\u884c\u5982\u4e0b\u521d\u59cb\u5316
#include \"graphics.h\"\n#include \"extragraph.h\"\n#include \"imgui.h\"\nvoid Main() // \u6ce8\u610f\u8fd9\u91cc\u9700\u8981\u4f7f\u7528\u5927\u5199Main\n{\nSet WindowTitle(\"Your Title\");\nInitGraphics(); // \u8c03\u7528\u4e86\u56fe\u5f62\u6a21\u5f0f\n}\n
InitGraphics(); \u8fd9\u4e2a\u51fd\u6570\u4f1a\u6253\u5f00\u4e00\u4e2a\u7a7a\u7684\u56fe\u5f62\u7a97\u53e3\u3002
"},{"location":"docs/1-cs/c-libgraphics/#_4","title":"\u7a97\u53e3","text":"\u4ee5\u4e0b\u56db\u4e2a\u51fd\u6570\u90fd\u4e0d\u9700\u8981\u4f20\u5165\u53c2\u6570\uff0c\u5206\u522b\u8fd4\u56de\u7a97\u53e3\u5bbd\u3001\u9ad8\uff0c\u5f53\u524dX\u3001Y\u5750\u6807\u3002
GetWindowWidth();\nGetWindowHeight();\nGetCurrentX();\nGetCurrentY();\n
"},{"location":"docs/1-cs/c-libgraphics/#_5","title":"\u597d\u7684\u7f16\u5199\u4e60\u60ef","text":"\u5e94\u8be5\u5148\u5b9a\u4e49\u4e00\u4e9b\u5e38\u91cf\uff0c\u7ed9\u8fd9\u4e9b\u5e38\u91cf\u53d6\u540d\u5b57
#define HouseHeight 2.0\n#define HouseWidth 3.0\n#define AtticHeight 0.7\n#define DoorWidth 0.4\n#define DoorKnobRadius 0.03\n#define DoorKnobInset 0.07\n#define PaneHeight 0.25\n#define PaneWidth 0.2\n#define FirstFloorWindows 0.3\n#define SecondFloorWindows 1.25\n
"},{"location":"docs/1-cs/c-libgraphics/#_6","title":"\u753b\u56fe\u5f62\u7684","text":""},{"location":"docs/1-cs/c-libgraphics/#movepen","title":"MovePen","text":"\u5c06\u7b14\u79fb\u52a8\u5230(x, y)\u8be5\u5750\u6807\u3002\u6ce8\u610f\u5f53\u753b\u56fe\u5f62\u65f6\uff0c\u540e\u9762\u51e0\u4e2a\u51fd\u6570\u7684\u76f8\u5bf9\u4f4d\u79fb\uff0c\u90fd\u662f\u76f8\u5bf9\u4e8e\u8fd9\u4e2a\u51fd\u6570\u8bbe\u7f6e\u7684\u7b14\u5750\u6807\u79fb\u52a8\u7684\u3002
MovePen(double x, double y);\n
"},{"location":"docs/1-cs/c-libgraphics/#drawline","title":"DrawLine","text":"\u5728\u753b\u7ebf\u4e4b\u524d\u4e00\u5b9a\u8981MovePen();
DrawLine(double dx, double dy);\n
\u753b\u7ebf\u7684\u65b9\u5411\uff1a
\u6a2a\u5750\u6807\u6700\u5de6\u8fb9\u662f0\uff0c\u5411\u53f3\u589e\u5927
\u7eb5\u5750\u6807\u6700\u4e0b\u9762\u662f0\uff0c\u5411\u4e0a\u589e\u5927
\u53ef\u4ee5\u7406\u89e3\u4e3a\u6211\u4eec\u5728\u7b2c\u4e00\u8c61\u9650
"},{"location":"docs/1-cs/c-libgraphics/#drawarc","title":"DrawArc","text":"\u5728\u753b\u5f27\u4e4b\u524d\u4e00\u5b9a\u8981MovePen();
DrawArc(double r, double start, double sweep);\n
"},{"location":"docs/1-cs/c-libgraphics/#_7","title":"\u6211\u4eec\u5e94\u5f53\u628a\u753b\u77e9\u5f62\u5c01\u88c5\u6210\u4e00\u4e2a\u65b0\u7684\u51fd\u6570","text":"void DrawBox (double x, double y, double width, double height)\n{\nMovePen(x, y);\nDrawLine(0, height);\nDrawLine(width, 0);\nDrawLine(0, height);\nDrawLine(-width, 0);\n}\n
void DrawCenteredBox(double x, double y, double width, double height)\n{\nDrawBox(w - width/2, y - height/2, width, height);\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_8","title":"\u753b\u5706\u7684\u51fd\u6570","text":"void DrawCenteredCircle(double x, double y, double r)\n{\nMovePen(x + r, y);\nDrawArc(r, 0, 360);\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_9","title":"\u6587\u5b57","text":"\u4ece\u5f53\u524d\u4f4d\u7f6e\u5f00\u59cb\u8f93\u51fa\u6587\u672c\u4e32
DrawTextString(string);\n
\u8fd9\u4e2a\u51fd\u6570\u7528\u4e8e\u83b7\u53d6\u67d0\u4e2a\u5b57\u7b26\u4e32\u957f\u5ea6
double stringLen = TextStringWidth(string);
"},{"location":"docs/1-cs/c-libgraphics/#_10","title":"\u67e5\u770b\u56de\u8c03\u51fd\u6570\u7c7b\u578b","text":"typedef void(* KeyboardEventCallback)(int key, int event);\n
"},{"location":"docs/1-cs/c-libgraphics/#_11","title":"\u5b9a\u65f6\u5668","text":""},{"location":"docs/1-cs/c-libgraphics/#_12","title":"\u65f6\u95f4\u56de\u8c03\u51fd\u6570","text":"registerTimerEvent(mytimer); //\u83b7\u53d6\u7535\u8111\u65f6\u949f\u4fe1\u606f\u8fd4\u56de\u7ed9mytimer\nstartTimer(0, (int)(1000/speed)); // \u8981\u8ba8\u8bba\u4f20\u8fdb\u6765\u7684timer\u662f\u4ec0\u4e48\n
"},{"location":"docs/1-cs/c-libgraphics/#_13","title":"\u5b9a\u65f6\u5668\u6d88\u606f\u56de\u8c03\u51fd\u6570","text":"void TimerEventProcess(int timerID);\n
\u793a\u4f8b
typedef enum\n{\nLabelTimer,\nBoxTimer,\n} MyTimer;\n
void mytimer(int timerID)\n{\nswitch (timerID)\n{\ncase LabelTimer:\nlabel_x += 0.5;\nif (label_x > 5.0) label_x = 1.0;\ndisplay();\nbreak;\ncase BoxTimer:\nbox_y += 0.5;\nif (box_y > 5.0) box_y = 1.0;\ndisplay();\nbreak;\nbreak;\n}\n}\n
registerTimerEvent(mytimer);\nstartTimer(LabelTimer, 100);\nstartTimer(BoxTimer, 200);\n
"},{"location":"docs/1-cs/c-libgraphics/#_14","title":"\u9f20\u6807","text":""},{"location":"docs/1-cs/c-libgraphics/#_15","title":"\u9f20\u6807\u6d88\u606f\u56de\u8c03\u51fd\u6570","text":"void MouseEventProcess(int x, int y, int button, int event);\n
x, y - \u4f4d\u7f6e\u5750\u6807
button - \u6309\u4e0b\u7684\u662f\u54ea\u4e2a\u952e
event - \u6309\u4e0b\uff0c\u677e\u5f00\uff0c\u79fb\u52a8\u7b49\u4e8b\u4ef6
void myMouseEvent (int x, int y, int button, int event)\n{\nmouse_x = ScaleXInches(x); // \u8fd9\u4e2a\u51fd\u6570\u5728extragraph\u5e93\u91cc\nmouse_y = ScaleYInches(y);\ndisplay();\n}\n
\u9700\u8981\u5728Main()\u91cc\u6dfb\u52a0\u8fd9\u4e00\u884c
registerMouseEvent(myMouseEvent);\n
\u5728display()\u91cc
void display()\n{\ndouble w = 1.0;\ndouble h = GetFontHeight() * 2;\n// \u6e05\u9664\u5c4f\u5e55\nDisplayClear();\n// draw a square\nSetPenColor(\"Red\");\ndrawLabel(label_x, label_y, \"Lable is Here\");\n//draw a rect/box to trace the mouse\n//drawRectangle(mouse_x, mouse_y, w, h, 0);\nSetPenColor(\"Blue\");\ndrawBox(mouse_x, mouse_y, w, h, 1, \"This box follows the mouse\", 'L', \"Red\");\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#linkedlist","title":"\u4f7f\u7528linkedlist\u5e93","text":"#include \"linkedlist.h\"\n
\u521b\u5efa\u4e00\u4e2a linkedlist \u540d\u53eb g_polylines
linkedlistADT g_polylines = NULL;\ng_polylines = NewLinkedList();\ndisplay();\n
void display()\n{\nlinkedlistADT poly = NextNode(g_polylines, g_polylines);\nSetPenColor(\"Blue\");\nif (poly) {\nPoint * p = (Point*) NodeObj(g_polylines, poly);\ndouble lx = p->x;\ndouble ly = p->y;\nMovePen(lx, ly);\nwhile (poly = NextNode(g_polylines, poly))\n{\np = (Point*) NodeObj(g_polylines, poly);\nDrawLine(p->x - lx, p->y - ly);\nlx = p->x;\nly = p->y;\n}\n}\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#button","title":"\u4f7f\u7528button\u548c\u952e\u76d8","text":"\u8fd9\u6b21\u9700\u8981\u7528\u5230\u7684\u5e93
#include <windows.h>\n#include <winuser.h>\n#include \"graphics.h\"\n#include \"extgraph.h\"\n#include \"imgui.h\"\n#include \"linkedlist.h\"\n
"},{"location":"docs/1-cs/c-libgraphics/#_16","title":"\u5b57\u7b26\u8f93\u5165\u56de\u8c03\u51fd\u6570","text":"void charEventProcess(char c);\n
c - \u8f93\u5165\u5b57\u7b26\u7684ASCII\u7801
"},{"location":"docs/1-cs/c-libgraphics/#_17","title":"\u952e\u76d8\u56de\u8c03\u51fd\u6570","text":"void KeyboardEventProcess(int key, int event);\n
key - \u54ea\u4e2a\u952e
event - \u6309\u4e0b\u8fd8\u662f\u677e\u5f00
\u793a\u4f8b
\u5728Main()\u4e2d
\n
void myKeyboardEvent(int key, int event)\n{\nuiGetKeyboard(key, event); // needed for using simpleGUI\ndisplay();\nswitch (event)\n{\ncase KEY_UP:\nif (key == VK_F1)\ng_add_point = !g_add_point;\nbreak;\ndefault:\nbreak;\n}\n}\n
"},{"location":"docs/1-cs/c-libgraphics/#_18","title":"\u989c\u8272\u5e93","text":"\u81ea\u5e26\u7684\u989c\u8272\u5217\u8868
char colorlist[100][100] = {\u201dBlack\u201d, \u201cDark Gray\u201d, \u201cGray\u201d, \u201cLight Gary\u201d, \u201cWhite\u201d, \u201cBrown\u201d, \u201cRed\u201d, \u201cOrange\u201d, \u201cYellow\u201d, \u201cGreen\u201d, \u201cBlue\u201d, \u201cViolet\u201d, \u201cMagenta\u201d, \u201cCyan\u201d};\nconst int colorNumber = 14;\n
\u81ea\u5b9a\u4e49\u989c\u8272
\u989c\u8272\u4f1a\u88ab\u52a0\u5165\u989c\u8272\u5e93\uff0cRGB\u7684\u53d6\u503c\u8303\u56f4\u90fd\u662f[0, 1]\u800c\u4e0d\u662f[0, 256)
DefineColor(\"Color Name\", R, G, B);\n
"},{"location":"docs/1-cs/c-libgraphics/#libgraphics","title":"libgraphics\u5176\u5b83\u5e38\u7528\u7684\u4e1c\u897f","text":""},{"location":"docs/1-cs/code-style/","title":"Pythons' Code Style Guide","text":":material-circle-edit-outline: \u7ea6 517 \u4e2a\u5b57 :fontawesome-solid-code: 71 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/1-cs/code-style/#pr","title":"PR","text":""},{"location":"docs/1-cs/code-style/#first-prototypes-and-implementations-then","title":"First prototypes, and implementations then","text":""},{"location":"docs/1-cs/code-style/#every-pr-should-be-meaningful-an-integral-element","title":"Every PR should be meaningful (an integral element)","text":""},{"location":"docs/1-cs/code-style/#split-to-the-smallest-elements","title":"Split to the smallest elements","text":"\u2705 each PR can be described within one sentence.
"},{"location":"docs/1-cs/code-style/#git-add-instead-of-git-add","title":"git add , instead of git add .","text":""},{"location":"docs/1-cs/code-style/#require-review-before-each-merging-by-setting-up-protecting-your-branch","title":"require review before each merging, by setting up \u2018protecting your branch\u2019","text":""},{"location":"docs/1-cs/code-style/#prs-title-same-as-git-commit-message","title":"PRs title - same as git commit messageformat [label] name + summary of change
admitted labels: Git Commit Style Guide
","text":""},{"location":"docs/1-cs/code-style/#pr-message-same-as-git-commit-message","title":"PR message - same as git commit message","text":""},{"location":"docs/1-cs/code-style/#file-management","title":"File management","text":""},{"location":"docs/1-cs/code-style/#oop","title":"oopEncompass each function (except main
) into a related class.
\u2705 Do models/models.py
\u274c Don't models_main.py
\u2705 Do path_checkpoint
.
\u274c Don't path_ckpt
.
_
to separate with the input parameters. e.g., the correct private number name should be
def __init__(self, foo):\n self._foo = foo # not recommended\n
instead of
def __init__(self, foo):\n self.foo = foo # recommended\n
And whenever an outer function requires a private member of a class, it is not recommended to directly use the private member from the class like
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\nfoo = Foo()\nfoo._bar # not recommnded\n
nor
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\n @property\n def get_bar(self):\n return self._bar\n\nfoo = Foo()\nfoo.get_bar()\n
instead, using a @property
decorator is recommonded.
class Foo:\n def __init__(self, bar):\n self._bar = bar\n\n @property\n def bar(self):\n return self._bar\n\nfoo = Foo()\nfoo.bar\n
","text":""},{"location":"docs/1-cs/code-style/#spacing","title":"Spacing","text":"From top to down - In every comment: 1 space-line between each section, i.e., - Except the file top, no more than 2 space-line
"},{"location":"docs/1-cs/code-style/#type-hints","title":"Type Hints","text":""},{"location":"docs/1-cs/code-style/#write-type-hints-no-need-to-write-types-in-the-comment","title":"write type hints, no need to write types in the comment\u2705 Do
def foo(bar: int) -> str:\n \"\"\"\n Args:\n bar: \n Returns:\n str: \n \"\"\"\n pass\n
\u274c Don't
def foo(bar: int) -> str:\n \"\"\"\n Args:\n bar (int): \n Returns:\n str (str): \n \"\"\"\n pass\n
","text":""},{"location":"docs/1-cs/code-style/#try-to-use-the-typing-library","title":"try to use the typing
library. Usual usage: when you want to indicat the element type of a Dict / a List / etc.
from typing import Dict\n\ntyping.Dict[str, Union[int, float]]\n
Supported types: - Dict[x, y] - Union[x, y, ...] -
After Python 3.10, this feature is included as an internal feature, with all types written as lower cases.
dict[str, int | float]\n
But to preserve the extenability to lower versions, I believe the importing method would be better.
","text":""},{"location":"docs/1-cs/code-style/#comments","title":"Comments","text":""},{"location":"docs/1-cs/code-style/#where-should-comments-appear","title":"Where should comments appear?Required: file docstring (on the top of the file), class docstring (after the class's name), function docstring (after the function's name).
Either a sentence or several paragraphs.
\"\"\"A sentence describing the file content.\"\"\"\n
or
\"\"\"A sentence describing the file content.\n\nDeclarations.\n\"\"\"\n
Function docstring's format
\"\"\"A sentence describing the function's content.\n\nArgs:\n arg1 : explain\n\nReturns:\n return1 : explain\n\"\"\"\n
No space between the docstring and the imports.
","text":""},{"location":"docs/1-cs/code-style/#be-sure-to-make-every-doc-a-sentence","title":"Be sure to make every doc a sentence\u2705 Do # a comment
.
\u274c Don't # a comment.
.
\u2705 Do
# comment 1.\n# comment 2.\n# comment 3.\n
\u274c Don't
# comment 1.\n# the comment 2.\n# comment 3.\n
","text":""},{"location":"docs/1-cs/code-style/#imports","title":"Imports","text":""},{"location":"docs/1-cs/code-style/#order","title":"Order One way to automatically sort the imports in VSCode (Don't sing an alphabet song every time you add an import): 1. Open the setting.json
. 2. Add or change the following setting
```json\n\"editor.codeActionsOnSave\": {\n \"source.organizeImports\": true,\n},\n```\n
","text":""},{"location":"docs/1-cs/code-style/#importing-names","title":"Importing Names \u2705 Do use import x
, x.y
to avoid the conflict of namespace, e.g.,
import torch\nimport transformers\n\ntorch.nn.Module\ntransformers.Trainer\n
\u274c Don't use from x import y
.
The only examptions are those well-established ones, e.g., from typing import Dict, List, Optional, Sequence, Union
.
This code style guide is an examplanation of the Google's Python Style Guide.
"},{"location":"docs/1-cs/architecture/","title":"\u7d22\u5f15","text":":material-circle-edit-outline: \u7ea6 318 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u6253\u7b97\u7a0d\u5fae\u5199\u4e00\u70b9\u662f\u56e0\u4e3a\u81ea\u5df1\u5b66\u4f53\u7cfb\u7684\u65f6\u5019\u6ca1\u627e\u5230\u7279\u522b\u5b8c\u6574\u7b14\u8bb0\u8d44\u6599 + \u6ca1\u4e0a\u8ba1\u7ec4\uff0c\u81ea\u5df1\u5b8c\u5168\u6ca1\u7406\u89e3\uff0c\u5355\u7eaf\u786c\u80cc\u901f\u6210\u7684\uff0c\u8bb0\u4e00\u4e0b\u81ea\u5df1\u901f\u6210\u770b\u4e86\u54ea\u4e9b\u4e1c\u897f
\u5f53\u7136\u9996\u5148\u82b1\u4e86\u4e24\u4e2a\u4e0b\u5348\u8fc7\u4e86\u4e00\u904d\u9a6c\u5fb7\u8ba1\u7ec4\u7684\u667a\u4e91 + xyx\u8ba1\u7ec4\u7b14\u8bb0\uff0c\u8fb9\u5b66\u8fb9\u52a8\u7b14
\u8fd8\u6709\u6284 A4 \u7684\u89c4\u5212\u8bf7\u89c1\u6211 github \u90a3\u4e2a ZJU \u8d44\u6e90\u4ed3\u5e93
\u53c2\u8003\u8d44\u6599
:material-circle-edit-outline: \u7ea6 3017 \u4e2a\u5b57 :fontawesome-solid-code: 28 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap2/#_1","title":"\u76ee\u5f55","text":"\u8fd9\u5757\u5e38\u8003\u5927\u9898\uff0c\u6bd4\u5982\u8ba1\u7b97\u5730\u5740\u957f\u5ea6\uff0c\u8ba1\u7b97 AMAT\uff0c\u8ba1\u7b97 miss \u6b21\u6570\u7b49\u3002
"},{"location":"docs/1-cs/architecture/chap2/#cache_1","title":"cache \u7684\u5206\u7c7b\u548c\u5730\u5740\u7684\u8ba1\u7b97\u65b9\u6cd5","text":"Warning
\u8fd9\u4e2a\u8868\u8bb0\u4e0d\u6e05\u4e86\u6253\u7b97\u7b49\u4e0a\u8ba1\u7ec4\u518d\u8865\u3002
\u7c7b\u522b \u89e3\u91ca \u6807\u8bb0\u9879\u7ed3\u6784 \u5730\u5740\u8ba1\u7b97 \u4f18\u70b9 \u7f3a\u70b9 direct-mapping \u76f4\u63a5\u6620\u5c04 fully associative \u5168\u5173\u8054 2^n-set associative 2^n\u8def\u7ec4\u5173\u8054\u8fd9\u5757\u5e38\u8003\u9009\u62e9\u3002
\u603b\u7ed3\u6027\u7684\u56fe
\u63a5\u4e0b\u6765\u5177\u4f53\u8bb2\u89e3\u6bcf\u4e00\u79cd\u4f18\u5316\u65b9\u6cd5\u3002
\u9996\u5148\u56db\u5927\u7c7b\u4f18\u5316\u7684\u601d\u8def\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff1f\u6765\u81ea\u4e8e\u8861\u91cf\u5185\u5b58\u6027\u80fd\u7684\u516c\u5f0f\uff1a
\\[ Average\\space Memory\\_access\\space Time\\space (AMAT) = Hit\\_time + Miss\\_rate \\times Miss\\_penalty \\]\u9996\u5148\u8fd9\u4e2a\u516c\u5f0f\u7684\u610f\u601d\u662f\uff0c\u5f53 CPU \u9700\u8981\u5185\u5b58\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u8bbf\u95ee\u65f6\u95f4\u7684\u8ba1\u7b97\u65b9\u6cd5\u662f\uff1a - \u5982\u679c\u5728 cache \u91cc\u627e\u5230\u4e86\uff0c\u5373\u53d1\u751f cache hit\uff0c\u90a3\u4e48\u9700\u8981\u7684\u65f6\u95f4\u53ea\u6709 cache \u7684\u8bbf\u95ee\u7528\u65f6\u5373hit_time\u3002 - \u5982\u679c\u5728 cache \u91cc\u6ca1\u627e\u5230\uff08\u6b64\u65f6\u5df2\u7ecf\u7528\u4e86\u4e00\u4e2a hit_time\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48 hit_time \u662f 100% \u8981\u7528\u6389\u7684\uff09\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u53bb\u5185\u5b58\u91cc\u627e\uff0c\u53bb\u5185\u5b58\u91cc\u627e\u7684\u7528\u65f6\u662f\u8fd9\u79cd\u60c5\u51b5\u6240\u5360\u7684\u767e\u5206\u6bd4 miss_rate \u4e58\u4e0a\u53bb\u5185\u5b58\u91cc\u627e\u4e00\u6b21\u7684\u8017\u65f6 miss_penalty\u3002
Note
\u5f53\u7136\u9898\u76ee\u91cc\u8fd8\u53ef\u80fd\u4f1a\u8bf4 \"cache \u548c memory \u662f\u540c\u65f6\u8bbf\u95ee\u7684\"\uff0c\u610f\u601d\u5c31\u662f cache \u548c memory \u4e00\u8d77\u627e\uff0c\u5982\u679c cache \u91cc\u627e\u5230\u4e86\uff0c\u5c31\u628a memory \u8bbf\u95ee\u6390\u6389\uff0c\u8fd9\u6837\u5728 miss \u7684\u60c5\u51b5\u4e0b\u662f\u6bd4\u5148\u5728 cache \u91cc\u627e\u5b8c\u518d\u53bb memory \u627e\u66f4\u5feb\u7684\u3002\u8fd9\u6837\u7684\u6761\u4ef6\u4e0b\u8ba1\u7b97 AMAT \u5c31\u9700\u8981\u628a hit_time \u4e58\u4e0a\u4e00\u4e2a hit_rate\uff0c\u4e0d\u518d\u662f 100% \u7528\u6389\u4e86\u3002
\u603b\u4e4b\uff0cAMAT \u7684\u8868\u8fbe\u5f0f\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e09\u79cd\u4f18\u5316\u7684\u5927\u65b9\u5411\uff0c\u5373 (1)\u964d\u4f4e hit_time (2)\u51cf\u5c0f miss_rate (3)\u51cf\u5c0f miss_penalty\u3002\u6b64\u5916\u8fd8\u6709\u4e00\u4e2a\u5927\u65b9\u5411\u53eb (4)\u505a\u5e76\u884c\u7684 cache\uff0c\u5728\u6709\u7684\u8001\u5e08\u7684 PPT \u91cc\u7b2c(4)\u9879\u597d\u50cf\u4f1a\u62c6\u51fa\u4e24\u7c7b\u6765\u8bb2\uff0c\u4e0d\u8fc7\u6211\u4eec\u8fd9\u91cc\u5c31\u6309\u603b\u5171\u56db\u79cd\u5927\u65b9\u5411\u6765\u5199\uff0c\u8ddf\u56fe\u4e00\u81f4\uff0c\u6bd4\u8f83\u8212\u670d\u3002
"},{"location":"docs/1-cs/architecture/chap2/#miss-penalty","title":"Miss Penalty","text":"Multilevel Caches
\u7ecf\u5178\u7684\u5185\u5b58\u6a21\u578b\u662f
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
\u8fd9\u4e2a\u65b9\u6cd5\u662f\u628a\u5b83\u53d8\u6210
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [\u5c0fcache] - [\u5927cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
\u6bd4\u5982\u5c0f cache \u6ca1\u627e\u5230\u7684\u5148\u4ece\u5927 cache \u627e\uff0c\u5927 cache \u6ca1\u627e\u5230\u7684\u518d\u53bb\u5185\u5b58\u627e\u3002\u6b64\u7c7b\u53ef\u80fd\u51fa AMAT \u7684\u8ba1\u7b97\u9898\uff0c\u628a\u5404\u79cd rate \u62ce\u6e05\u4ee5\u540e\u5c31\u50cf\u4f55\u8001\u5e08\u8bf4\u7684\u201c\u5f53\u6210\u521d\u4e2d\u7269\u7406\u9898\u505a\u5c31\u884c\u201d\u3002 Early Resart & Critical Word 1st
\u4f17\u6240\u5468\u77e5\uff08\u81f3\u5c11\u4f60\u73b0\u5728\u77e5\u9053\u4e86\uff09cache \u7684\u4e00\u4e2a block \u7ecf\u5e38\u662f\u542b\u6709\u591a\u4e2a word \u7684\uff08\u4f60\u53ef\u80fd\u4f1a\u604d\u7136\u5927\u609f\u6709\u4e9b\u9898\u76ee\u91cc\u8bf4\u7684\u201ccache \u6309 word \u7f16\u5740\u201d\u662f\u4ec0\u4e48\u610f\u601d\uff09\uff0c\u800c block \u5f80\u5f80\u662f\u5927\u4e8e cache \u548c\u5185\u5b58\u4e4b\u95f4\u7684\u6570\u636e\u7ebf\u4f4d\u5bbd\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u60f3\u8981\u66ff\u6362\u4e00\u4e2a block\uff0c\u9700\u8981\u5728 cache \u548c\u5185\u5b58\u4e4b\u95f4\u4f20\u9001\u597d\u51e0\u8d9f\u624d\u80fd\u628a\u4e00\u4e2a block \u66ff\u6362\u5b8c\u3002
\u4f46\u662f miss \u53d1\u751f\u65f6 CPU \u9700\u8981\u7684\u53ef\u80fd\u53ea\u6709\u4e00\u4e2a word\uff0c\u90a3\u4e48\u53ef\u4ee5\u5148\u628a CPU \u9700\u8981\u7684\u8fd9\u4e2a word \u5199\u56de\u6765\uff0c\u8ba9 CPU \u5148\u7ee7\u7eed\u8dd1\u8d77\u6765\uff0c\u5728 CPU \u7ee7\u7eed\u8dd1\u7684\u540c\u65f6\u518d\u628a\u5269\u4e0b\u7684 word \u5199\u8fdb cache\u3002
Priority to Read Miss
\u5728\u4f7f\u7528 write buffer \u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c write \u7684\u6570\u636e\u5f88\u5feb\u5c31\u8981 read\uff0c\u53ef\u4ee5\u5148\u4e0d\u5c06 buffer \u7684\u6570\u636e\u5199\u8fdb\u5185\u5b58\uff0c\u800c\u662f\u7b49\u5230read\u7684\u65f6\u5019\u76f4\u63a5\u4ecebuffer\u91cc\u8bfb\uff0c\u8bfb\u591a\u6b21\u4e4b\u540e\u518d\u4e00\u6b21\u4ecebuffer\u91cc\u5199\u5185\u5b58\u3002
\u5176\u4e2d\uff0cwrite buffer \u662f\u4e00\u4e2a\u53ef\u4ee5\u8bbe\u5728 cache \u548c\u5185\u5b58\u4e4b\u95f4\u7684\u7ed3\u6784\uff0c\u610f\u601d\u662f\uff0c\u5047\u8bbe\u5185\u5b58\u53ea\u6709\u4e00\u4e2a\u8bfb\u5199\u7aef\u53e3\uff0c\u5199\u5165\u5185\u5b58\u975e\u5e38\u6162\uff0c\u90a3\u4e48 cache \u53ef\u4ee5\u5c06\u9700\u8981\u5199\u5230\u5185\u5b58\u7684\u4e1c\u897f\u5148\u642c\u5230 write buffer \u91cc\uff0c\u7136\u540e cache \u5148\u8dd1\u7740\uff0c\u5185\u5b58\u53bb\u6162\u6162\u5199\u5165\u3002
Merging Write Buffer
\u540c\u6837\u662f\u4f7f\u7528 write buffer \u7684\u60c5\u51b5\u3002merging write buffer \u5c31\u662f\u5c06\u5728\u591a\u884c\u53ef\u4ee5\u4e00\u6b21\u5199\u56de\u7684\u5185\u5bb9\u5408\u5e76\u5230\u4e00\u884c\uff0c\u4ee5\u53ef\u4ee5\u4e00\u6b21\u5199\u56de\u3002write buffer \u7684\u5185\u5bb9\u662f\u6309 byte \u7f16\u5740\u7684\uff0c\u4f46\u5185\u5b58\u6570\u636e\u7ebf\u4f4d\u5bbd\u4e00\u822c\u5927\u4e8e byte\uff0c\u6bd4\u5982\u4e00\u6b21\u53ef\u4ee5\u5199\u56de\u4e00\u6574\u4e2a word\uff0c\u90a3\u4e48\u5047\u5982 write buffer \u91cc\u73b0\u5728\u6709\u56db\u884c mem[200], mem[400], mem[208], mem[408]\uff0c\u5199\u56de\u5185\u5b58\u5c31\u9700\u8981\u56db\u6b21\u3002\u4f46\u662f\u5982\u679c\u6211\u4eec\u628a\u5728\u540c\u4e00\u4e2a word \u91cc\u7684 byte \u5408\u5e76\u4e00\u4e0b\uff0c\u53d8\u6210 mem[200] mem[208] \u548c mem[400] mem[408] \u4e24\u884c\uff0c\u4e24\u6b21\u5199\u56de\uff0c\u5c31\u4f1a\u53d8\u5feb\u3002
Victim Caches
\u662f\u4e00\u79cd\u51cf\u5c11 conflict miss \u7684\u65b9\u6cd5\uff0c\u5373\u66ff\u6362\u51fa\u53bb\u7684\u9875\u5148\u653e\u8fdb\u8fd9\u4e2a victim cache \u7ed3\u6784\u3002victim cache \u4e0e cache \u662f\u5168\u76f8\u5173\u7684\uff0c\u6709\u70b9\u50cf\u4e00\u4e2a\u4e8c\u7ea7 cache\uff0c\u662f\u4e00\u4e2a\u6bd4\u4e00\u7ea7 cache \u6162\u7684 cache\u3002\u8fd9\u6837\u5982\u679c\u53d1\u751f conflict miss\uff0c\u4ece\u8fd9\u4e2a victim cache \u91cc\u53d6\u6570\u636e\u6bd4\u4ece\u5185\u5b58\u91cc\u53d6\u66f4\u5feb\u3002
"},{"location":"docs/1-cs/architecture/chap2/#miss-rate","title":"Miss Rate","text":"\u8fd9\u4e00\u680f\u7684\u524d\u4e09\u4e2a\u65b9\u6cd5\u90fd\u4e0d\u662f\u5f88\u806a\u660e\uff0c\u672c\u8d28\u4e0a\u662f\u5728 cache \u7684\u4e09\u79cd\u8bbe\u8ba1\u65b9\u6cd5\u4e2d\u53bb\u6743\u8861\uff0c\u800c\u6211\u4eec\u77e5\u9053 cache \u7684\u4e09\u79cd miss \u8fd8\u662f\u6b64\u6d88\u5f7c\u957f\u7684\uff0c\u54ea\u4e00\u79cd\u8bbe\u8ba1\u65b9\u6cd5\u90fd\u4e0d\u80fd\u5b8c\u7f8e\u89e3\u51b3\u3002\u4e0d\u8fc7\u6574\u4f53\u800c\u8a00\uff0cfrom \u738b\u9053\u8ba1\u7ec4\uff0c\u4f7f\u7528\u5408\u9002\u7684 2^n \u8def\u7ec4\u5173\u8054\u65f6\uff0c\u6700\u597d\u7684\u60c5\u51b5\u80fd\u591f\u51e0\u4e4e\u517c\u5177\u76f4\u63a5\u6620\u5c04\u7684\u6548\u7387\u548c\u5168\u5173\u8054\u7684\u547d\u4e2d\u7387\u3002
Larger Block Size
\u628a cache \u7684\u6bcf\u4e2a\u5757\u8bbe\u8ba1\u5f97\u66f4\u5927\uff0c\u8fd9\u6837\u6bcf\u4e2a\u5757\u5b58\u5f97\u4e1c\u897f\u591a\u4e86\uff0c\u5f53\u7136 miss_rate \u5c31\u4e0b\u964d\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0cmiss_penalty \u4e0a\u5347\u4e86\uff0c\u56e0\u4e3a\u5199\u8d77\u6765\u53d8\u6162\u4e86\u3002
Larger Cache Size
\u628a cache \u7684\u5757\u6570\u589e\u591a\uff0c\u8fd9\u6837\u5b58\u5f97\u4e1c\u897f\u4e5f\u591a\u4e86\uff0cmiss_rate \u5c31\u4e5f\u4e0b\u964d\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0c\u51b7\u542f\u52a8 compulsory miss \u4e0a\u5347\u4e86\uff1b\u5982\u679c\u4e0d\u662f\u76f4\u63a5\u6620\u5c04\uff0c\u67e5\u627e\u65f6\u95f4\u4e5f\u4e0a\u5347\u4e86\u3002
Higher Associativity
\u63d0\u5347\u7ec4\u5173\u8054\u6570\uff0c\u8fd9\u6837\u51cf\u5c11 cache \u91cc\u9762\u7684\u4e1c\u897f\u88ab\u66ff\u6362\u51fa\u53bb\u7684\u6982\u7387\uff0c\u51cf\u5c11 conflict miss\u3002\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0c\u67e5\u627e\u65f6\u95f4\u589e\u52a0\u3002
Way-predicting Cache
\u5728\u7ec4\u5173\u8054\u8bbe\u8ba1\u4e2d\uff0c\u4f7f cache \u5177\u6709\u9884\u6d4b\u9700\u8981\u67e5\u627e\u7684 tag \u7684\u80fd\u529b\u3002\u56e0\u4e3a\u53bb\u67e5\u9700\u8981\u7684\u6570\u636e\u5728\u7ec4\u91cc\u54ea\u4e2a tag \u6bd4\u8f83\u6162\uff0c\u6240\u4ee5\u5148\u731c\u4e00\u4e2a tag \u5728 cache \u91cc\u627e\u7740\uff0c\u7b49 tag \u51c6\u5907\u597d\u540e\u5982\u679c\u731c\u5bf9\u4e86\uff0c\u90a3\u4e48\u8282\u7ea6\u4e86\u65f6\u95f4\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5 hit\u3002
Pseudo-associative Caches
\u65e2\u662f\u76f4\u63a5\u6620\u5c04\u53c8\u662f\u7ec4\u5173\u8054\u6620\u5c04\u7684 cache\u3002\u9996\u5148\u628a cache \u5f53\u4f5c\u4e00\u4e2a\u76f4\u63a5\u6620\u5c04 cache\uff0c\u7b2c\u4e00\u6b21\u67e5\u7684\u65f6\u5019\u5c31\u8fd9\u4e48\u67e5\uff0c\u6700\u5feb\u3002\u4f46\u662f\u8fd9\u79cd cache \u53c8\u540c\u65f6\u662f\u4e00\u4e2a\u7ec4\u5173\u8054\u6620\u5c04\uff0c\u5728 cache \u5757\u4e2d\u653e\u4e00\u4e2a\u989d\u5916\u7684\u6807\u5fd7\u8868\u793a\u4e0e\u4e4b\u5173\u8054\u7684\u5176\u5b83\u5757\uff0c\u5982\u679c miss \u4e86\u518d\u53bb\u67e5\u8fd9\u4e9b\u5757\u3002\u8fd9\u6837\u6709\u4e00\u4e2a\u5c0f\u7684 hit_time \u548c2^n - 1\u4e2a\u5927\u7684 pseudo_hit_time\uff0c\u4f46\u662f\u5e73\u5747\u6765\u8bf4 miss_rate \u6bd4\u76f4\u63a5\u6620\u5c04\u5c0f\uff0chit_time \u6bd4\u7ec4\u5173\u8054\u6620\u5c04\u5c0f\u3002
Compiler Techniques Reduce Cache Misses
\u7528\u8f6f\u4ef6\u65b9\u6cd5\uff0c\u4f18\u5316\u4ee3\u7801\u3002\u8fd9\u91cc\u6709\u56db\u4e2a\u4f8b\u7a0b\uff0c\u5206\u522b\u53eb Merging Arrays, Loop Interchange, Blocking, \u548c Loop Merging\u3002\u7b80\u5355\u7684\u76f4\u63a5\u7528\u6587\u5b57\u63cf\u8ff0\u4e86\u3002
Merging Arrays
\u6bd4\u5982\u6211\u4eec\u9700\u8981\u8bbf\u95ee\u7684\u662fa[100], b[100], \u5728\u540c\u4e00\u4e2a\u5faa\u73af\u91cc\u8fde\u7eed\u8bbf\u95eea[i] b[i]\u5373\u4e0b\u6807\u76f8\u540c\u7684\u9879\uff0ccache\u5982\u679c\u4e00\u6b21\u6027\u653e\u4e0d\u4e0b\u4e24\u4e2a\u6570\u7ec4\uff0c\u5c31\u4f1a\u4e24\u4e2a\u6570\u7ec4\u4ea4\u66ff\u4ece\u5185\u5b58\u91cc\u53d6\u51fa\u6765\u653e\u5230cache\u91cc\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u8bbe\u8ba1\u6210\u4e00\u4e2a\u7ed3\u6784\u4f53\u6570\u7ec4struct ab { a[100], b[100] }\uff0c\u8fd9\u6837 cache \u53ef\u4ee5\u628a a \u548c b \u76f8\u90bb\u5730\u62ff\u8fdb\u6765\u3002\u51cf\u5c11miss\u3002
Loop Interchange
e.g.
/* Before: \u5916\u884c\u5185\u5217\uff0c\u4e00\u884c\u53ef\u4ee5\u4e00\u6b21\u88ab\u653e\u8fdb\u5185\u5b58 */\nfor (k = 0; k < 100; k = k+1)\nfor (j = 0; j < 100; j = j+1)\nfor (i = 0; i < 5000; i = i+1)\nM[i][j] = 2 * M[i][j];\n/* After: \u5916\u5217\u5185\u884c */\nfor (k = 0; k < 100; k = k+1)\nfor (i = 0; i < 5000; i = i+1)\nfor (j = 0; j < 100; j = j+1)\nM[i][j] = 2 * M[i][j];\n
\u4fee\u6539\u540e\u7684cache\u547d\u4e2d\u7387\u53d8\u9ad8\u4e86\uff0c\u56e0\u4e3a\u4ea4\u6362\u540e\u5bf9\u5185\u5b58\u7684\u8bbf\u95ee\u662f\u8fde\u7eed\u7684\u3002\u4e00\u822c\u662f\u884c\u5bf9\u9f50\u7684\uff0c\u6700\u4f4e\u7ef4\u662f\u76f8\u90bb\u7684\u3002
Blocking
\u9002\u5f53\u62c6\u5206\u8fd0\u7b97\uff0c\u4ee5\u914d\u5408cache\u5927\u5c0f\u3002e.g. \u77e9\u9635\u76f8\u4e58\u4f8b\u5b50\u3002
/* Before */\nfor (i = 0; i < N: i += 1)\nfor (j = 0; j < N; j += 1) {\nr = 0; for (k = 0; k < N; k +=1 )\nr = r + y[i][k] * z[k][j]; }\n/* After */\nfor (jj = 0 ; jj < N; jj = jj+B)\nfor (kk = 0; kk < N; kk = kk +B) {\n// ...\u8bb0\u4e0d\u6e05\u4e86\nfor (ii = 0; ii < B; ii ++) {\n// \u603b\u4e4b\u8fd9\u4e2a\u5185\u5c42\u5faa\u73af\u53ea\u5904\u7406\u4e00\u4e2a B * B \u7684 block\uff0c\u5176\u4e2d block \u662f cache \u80fd\u653e\u4e0b\u7684\u5927\u5c0f\n}\n}\n
\u90a3\u4e48\u4f18\u5316\u524d cache \u9700\u8981\u66ff\u6362\u66f4\u591a\u6b21\uff0c\u56e0\u4e3a\u4e0d\u8bba\u662f\u884c\u5faa\u73af\u8fd8\u662f\u5217\u5faa\u73af\uff0c\u8d85\u8fc7 B \u4e4b\u540e cache \u90fd\u8981\u91cd\u65b0\u5199\u4e00\u904d\u3002\u7136\u540e\u4e0b\u6b21\u5199\u5230\u8fd9\u4e2a block \u65f6\u518d\u6362\u8fdb\u6765\u4e00\u6b21\u3002 \u4f18\u5316\u540e\u6bcf\u6b21\u5bf9\u6bcf\u4e00\u4e2a block \u4e00\u6b21\u6027\u5b8c\u6210\u64cd\u4f5c\u3002
Loop Merging
\u6bd4\u5982\u6709\u4e24\u4e2a\u5faa\u73af\u7684\u5faa\u73af\u8d77\u6b62\u6761\u4ef6\u4e00\u6837\uff0c\u90a3\u4e48\u5c31\u4e0d\u8981\u5f00\u4e24\u4e2a\u5faa\u73af\u4e86\uff0c\u5408\u5e76\u5230\u4e00\u4e2a\u5faa\u73af\u91cc\u5b8c\u6210\u3002
"},{"location":"docs/1-cs/architecture/chap2/#parallelism","title":"Parallelism","text":"Non-blocking Caches
cache miss\u65f6, \u7b49\u5f85\u5185\u5b58\u5199\u56de\u65f6\u7ee7\u7eed\u505a\u522b\u7684\u6ca1\u6709\u51b2\u7a81\u7684\u4e8b\u60c5\uff0c\u4e0d\u5fc5\u8981\u8ba9\u6240\u6709\u7684\u8d44\u6e90\u90fd\u7b49\u5f85\u5185\u5b58\u3002\u53ef\u4ee5\u8ba9\u522b\u7684\u5757\u5148\u5b8c\u6210\u522b\u7684\u6307\u4ee4\u7684\u9700\u6c42\u3002\u6bd4\u5982\u5728\u5904\u7406write miss\u7684\u65f6\u5019\uff0c\u5141\u8bb8\u5904\u7406read hit\u3002
\u4e3b\u8981\u7528\u4e8eout of order\uff08\u4e71\u5e8f\uff09\u7684\u5904\u7406\u5668\u4e0a\u3002
ppt \u7ed9\u7684\u5b9a\u4e49\u662f\uff1aallows cache to continues to supply hits while processing read misses (hit under miss, hit under multiple miss)
Hardware Prefetching of Instr/Data
\u53ef\u4ee5\u7531\u786c\u4ef6\u63a7\u5236\u6570\u636e\u9884\u53d6\uff0c\u4e00\u79cd\u7c7b\u4f3c branch-prediction \u7684\u505a\u6cd5\u3002\u9884\u6d4b\u5e76\u63d0\u524d\u53d6\u51fa\u53ef\u80fd\u9700\u8981\u7528\u5230\u7684\u6570\u636e\u653e\u5230cache\u91cc\u3002
\u4f7f\u7528prefetching\u7684\u524d\u63d0\u662f\u6307\u4ee4\u662f\u5e76\u884c\u7684\uff0ccache \u4e5f\u662f non-blocking \u7684\u3002
Compiler Controlled Prefetching
\u4e0a\u9762\u4e00\u6761\u9884\u53d6\u65b9\u6cd5\uff0c\u4e5f\u53ef\u4ee5\u7531\u7a0b\u5e8f\u5458\u548c\u7f16\u8bd1\u5668\u624b\u52a8\u6307\u5b9a\u54ea\u4e9b\u5185\u5bb9\u5e94\u8be5\u88ab\u653e\u5230cache\u3002
"},{"location":"docs/1-cs/architecture/chap2/#hit-time","title":"Hit Time","text":"Small & Simple Caches
\u6bd4\u5982\u5c31\u9488\u5bf9 cache \u672c\u8eab\uff0c\u51cf\u5c0f cache \u7684\u590d\u6742\u5ea6\u4ee5\u51cf\u5c0f\u7ec4\u5408\u903b\u8f91\u7684\u5ef6\u8fdf\u3002\u5f53\u7136\u7531\u4e8e\u6211\u4eec\u4e4b\u524d\u8ba8\u8bba\u8fc7\u7684 cache \u4e09\u4e2a\u6307\u6807\u7684\u76f8\u4e92\u5236\u7ea6\uff0c\u662f\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5176\u5b83\u4e24\u4e2a\u6307\u6807\u53d8\u4e0d\u597d\u7684\u3002
Avoiding Address Translation
\u8fd9\u91cc\u9700\u8981\u5206\u522b\u56de\u5fc6\u4e00\u4e0b cache \u6807\u8bb0\u4f4d\u7684\u7ed3\u6784\u548c OS \u91cc\u7684\u9875\u8868\u9879\u3002\u4e00\u822c\u672c\u8bfe\u7a0b\u4e2d\u4f7f\u7528\u7684 cache \u8bbe\u8ba1\u89c4\u5219\u90fd\u662f \"physically tagged, virtually indexed\"(PTVI)\uff0c\u610f\u601d\u662f\uff0c\u7528\u4e8e\u67e5\u627e cache block \u7684 tag \u6574\u4e2a\u5168\u90fd\u5728 page offset \u91cc\uff0c\u8fd9\u5757 offset \u5b57\u6bb5\u5bf9\u4e8e\u865a\u62df\u5730\u5740\u548c\u7269\u7406\u5730\u5740\u6765\u8bf4\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff0c\u53ea\u6709 page number \u9700\u8981\u9001\u8fdb tlb \u53bb\u5bfb\u627e\u7269\u7406\u5e27\u53f7\u3002\u5982\u56fe\u3002
\u5982\u679c\u4e4b\u524d\u7684\u505a\u6cd5\u662f cache \u7b49\u5230\u7269\u7406\u5e27\u53f7\u627e\u51fa\u6765\u3001\u5730\u5740\u7ffb\u8bd1\u5b8c\u518d\u53bb\u67e5\u627e\uff0c\u5c31\u592a\u6162\u4e86\u3002\u65e2\u7136 tag \u4e0d\u7528\u7b49\u5230\u5730\u5740\u7ffb\u8bd1\u5c31\u80fd\u62ff\u5230\uff0c\u53ef\u4ee5\u4f7f\u5730\u5740\u7ffb\u8bd1\u548c cache \u67e5\u627e\u540c\u65f6\u8fdb\u884c\u3002
Pipelined Cache Access
\u56e0\u4e3a cache management unit \u7684\u64cd\u4f5c\u5206\u4e3a\u597d\u591a\u6b65\uff0c\u53ef\u4ee5\u628a\u6bcf\u6b65\u53bb\u50cf\u6d41\u6c34\u7ebf\u4e00\u6837\u5e76\u884c\u3002\u7f3a\u70b9\u662f\u4f1a\u589e\u52a0\u7cfb\u7edf\u5f00\u9500\uff0c\u5bfc\u81f4 hit_time \u589e\u52a0\uff0c\u4f46\u662f\u597d\u5904\u662f\u524d\u9762\u7684\u6307\u4ee4 miss \u65f6\uff0c\u4e0b\u4e00\u6761\u6307\u4ee4\u53ef\u4ee5\u5e76\u884c\u3002
Multi-banked Cache
\u5c06\u591a\u8def\u7ec4\u5173\u8054\u7684\u6bcf\u4e00\u8def\u7684\u67e5\u627e\u5e76\u884c\u3002
ppt \u7ed9\u7684\u5b9a\u4e49\u662f\uff1acache is divided into independent banks that can support simultateous accesses like interleaved memory banks.
Trace Cache
\u6838\u5fc3\u903b\u8f91\u662f\u7f13\u5b58\u903b\u8f91\u4e0a\u7684\u6307\u4ee4\u6d41\uff0c\u800c\u4e0d\u662f\u7f13\u5b58\u7269\u7406\u5730\u5740\u7684\u6307\u4ee4\u6d41\uff0c\u4ece\u800c\u52a0\u5feb\u6307\u4ee4\u7684\u9884\u53d6\u3002\u6bd4\u5982\u5206\u652f\u6307\u4ee4\u4e2d\u4e0d\u53bb\u9884\u6d4b\u91cc cache \u4e0d\u4f1a\u547d\u4e2d\u7684\u5206\u652f\uff0c\u8fd9\u6837\u8282\u7701\u4e86 cache \u7a7a\u95f4\uff0c\u4e5f\u8ba9\u76f8\u90bb\u7684\u6307\u4ee4\u5728 cache \u4e2d\u4e5f\u76f8\u90bb\u3002\u6211\u7684\u7406\u89e3\u5b83\u7684\u610f\u601d\u662f\u628a prediction \u7684\u529f\u80fd\u9001\u7ed9\u4e86 cache\uff0c\u5982\u679c\u5206\u652f\u9884\u6d4b\u9884\u6d4b\u5230\u4e86\u67d0\u4e2a\u8df3\u8f6c\u6307\u4ee4\u4f1a\u53d1\u751f\uff0c\u90a3\u4e48 cache \u5c31\u53bb\u9884\u53d6\u53d1\u751f\u7684\u5206\u652f\u540e\u9762\u7684\u6570\u636e\u3002
"},{"location":"docs/1-cs/architecture/chap3/","title":"chap3: Instruction-level Parallelism (ILP)","text":":material-circle-edit-outline: \u7ea6 1058 \u4e2a\u5b57 :fontawesome-solid-code: 9 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap3/#_1","title":"\u76ee\u5f55","text":"Note
\u662f\u5199\u5f97\u7b80\u5355\u70b9\u4e86\u54c8\u3002\u5199\u4e0d\u52a8\u4e86\u3002\u8981\u4e0d\u5927\u5bb6\u770b\u8ba1\u7ec4\u738b\u9053\u597d\u4e86\u3002
\u4e09\u79cd\u7ade\u4e89
\u6570\u636e\u7ade\u4e89 Data Hazard \u5206\u4e3a\uff08\u6ce8\u610f\u4e0b\u9762\u547d\u540d\u65b9\u6cd5\u90fd\u662f\u6309\u201c\u672c\u5e94\u53d1\u751f\u7684\u987a\u5e8f\u201d\uff0c\u6bd4\u5982 RAW \u5c31\u662f\u6307\uff0c\u6b63\u5e38\u7684\u8fd0\u884c\u987a\u5e8f\u5c31\u662f\u5148\u5199\u540e\u8bfb\u3002\uff09
\u7ed3\u6784\u7ade\u4e89 Structural Hazard \u662f\u6307\u5982\u679c\u4e24\u4e2a\u6307\u4ee4\u9700\u8981\u540c\u65f6\u7528\u540c\u4e00\u4e2a Function Unit\uff0c\u6bd4\u5982\u540c\u65f6\u7528\u4e00\u4e2a\u9700\u8981\u4e24\u65f6\u949f\u5468\u671f\u624d\u80fd\u7b97\u5b8c\u7684 ALU\uff0c\u7ed3\u679c\u8be5 Function Unit \u53ea\u6709\u4e00\u4e2a\uff0c\u90a3\u4e48\u540e\u6765\u7684\u6307\u4ee4\u5c31\u5f97\u7b49\u5148\u6765\u7684\u6307\u4ee4\u7b97\u5b8c\u624d\u80fd\u53bb\u7b97\u3002
\u63a7\u5236\u7ade\u4e89 Control Hazard \u662f\u6307\u5982\u679c\u9047\u5230\u8df3\u8f6c\u6307\u4ee4\uff0c\u7ed3\u679c\u7528\u4e8e\u5224\u65ad\u8df3\u8f6c\u6761\u4ef6\u7684\u5bc4\u5b58\u5668\u503c\u8fd8\u6ca1\u597d\uff0c\u5c31\u9700\u8981\u7b49\u5bc4\u5b58\u5668\u51c6\u5907\u597d\u624d\u80fd\u77e5\u9053\u8df3\u4e0d\u8df3\uff0c\u90a3\u5c31\u9700\u8981\u505c\u4e0b\u7b49\u3002
\u6d41\u6c34\u7ebf\u7c7b\u578b
\u5355\u5468\u671f\u6d41\u6c34\u7ebf \u4ee5\u8017\u65f6\u6700\u957f\u7684\u4e00\u4e2a\u9636\u6bb5\u7684\u7528\u65f6\u4e3a\u673a\u5668\u5468\u671f\u3002 \u6240\u6709\u6307\u4ee4\u8dd1\u5b8c\u7528\u65f6\u7684\u8ba1\u7b97\uff1a(\u6307\u4ee4\u6570 + \u9636\u6bb5\u6570 - 1) * \u673a\u5668\u5468\u671f\u3002\u7406\u89e3\u8d77\u6765\u5c31\u662f\u53ea\u6709\u7b2c\u4e00\u6761\u6307\u4ee4\u7684\u524d n-1 \u4e2a\u5468\u671f\u6ca1\u6709\u6307\u4ee4\u5b8c\u6210\uff0c\u4e4b\u540e\u6bcf\u4e2a\u5468\u671f\u90fd\u5b8c\u6210\u4e00\u6761\u6307\u4ee4\u3002
\u591a\u5468\u671f\u6d41\u6c34\u7ebf \u4f1a\u8003\u586b\u8868\u9898\u3002\u5c31\u662f\u90a3\u79cd\u4e58\u6cd5\u7b49 6 \u4e2a\u5468\u671f\u9664\u6cd5\u7b49 24 \u4e2a\u7684\u3002lab \u91cc\u4f1a\u590d\u4e60\u5230\u3002
\u8fd8\u6709\u4e0b\u56fe\u8fd9\u51e0\u79cd
\u770b\u7684\u65f6\u5019\u6ce8\u610f\u603b\u7ed3\u4e00\u4e0b\u6bcf\u4e00\u79cd\u7684 CPI \u662f\u5927\u4e8e\u7b49\u4e8e\u8fd8\u662f\u5c0f\u4e8e 1\u3002\u6211\u603b\u7ed3\u4e0d\u51fa\u6765\u4e86\u3002
"},{"location":"docs/1-cs/architecture/chap3/#ilp_1","title":"ILP \u5728\u4f53\u7cfb\u91cc\u5b66\u7684\u4e09\u79cd\u7b97\u6cd5","text":"Note
\u672c\u6765\u8fd9\u5757\u8be5\u5199\u7684\u4f46\u662f\u6211\u5199\u4e0d\u52a8\u4e86
\u76f4\u63a5\u53bb bing \u641c\u7d22 (1)Scoreboard, (2)Tomasulo, (3)Tomasulo w speculation, \u53bb\u627e\u4e00\u4e2a\u5357\u5927\u540c\u5b66\u5199\u7684\u77e5\u4e4e\u5e16\u5b50\uff0c\u6211\u662f\u770b\u8fd9\u5957\u5e16\u5b50\u770b\u61c2\u7684\u3002\u8fd8\u6709 lab \u91cc\u8fd9\u5757\u7684\u5b9e\u9a8c\u4e5f\u80fd\u5e2e\u52a9\u7406\u89e3\u3002
\u8bf7\u518d\u7ed3\u5408\u8fd9\u5f20\u56fe\u8bb0\u5fc6\u4e00\u4e0b\uff1a
\u8fd8\u6709\u4e00\u4e2a\u4e0a\u8ff0\u8d44\u6599\u4f3c\u4e4e\u6ca1\u8bb2\u5230\u7684\u70b9\uff0c\u5173\u4e8e ISSUE \u65f6\u673a\uff0c\u6211\u8bb0\u5f97\u662f - Scoreboard: \u9700\u8981\u7684 Function Unit \u4e3a\u7a7a\uff0c\u4e14\u9700\u8981\u5199\u7684 Reg State \u6ca1\u6709\u522b\u7684\u6307\u4ee4\u8fd8\u51c6\u5907\u5199\uff08\u907f\u514d WAW\uff09\u65f6\u3002 - Tomasulo: Reservation Station \u6709\u7a7a\u65f6\u3002 - Tomasulo w ROB (\u5373 w speculation): Reservation Station \u548c ROB \u90fd\u7a7a\u65f6\u3002
Warning
\u4f46\u662f\u4e0a\u8ff0 Tomasulo w ROB \u4f3c\u4e4e\u8ddf\u6211\u8003\u7684\u4e00\u4e2a\u671f\u672b\u9898\u4e0d\u517c\u5bb9\uff0c\u4e0d\u77e5\u9053\uff0c\u7b49\u540e\u4eba\u6765\u4e3a\u6211\u6307\u51fa
"},{"location":"docs/1-cs/architecture/chap3/#branch-prediction","title":"Branch prediction","text":"\u56de\u5fc6 control hazard\uff0c\u6d41\u6c34\u7ebf CPU \u9047\u5230\u8df3\u8f6c\u8bed\u53e5\u5982\u679c\u5224\u65ad\u6761\u4ef6\u8fd8\u6ca1\u5c31\u7eea\uff0c\u5c31\u9700\u8981\u7b49\u64cd\u4f5c\u6570\u624d\u80fd\u7ee7\u7eed\u5f80\u4e0b\u8d70\u3002\u6211\u4eec\u60f3\u8ba9 CPU \u968f\u4fbf\u5148\u731c\u4e00\u4e2a\u5f80\u4e0b\u8d70\u7740\uff0c\u5982\u679c\u7b49\u64cd\u4f5c\u6570\u51c6\u5907\u597d\u53d1\u73b0\u731c\u9519\u4e86\uff0c\u5927\u4e0d\u4e86\u518d\u6390\u6389\uff0c\u731c\u5bf9\u4e86\u90a3\u5c31\u8282\u7ea6\u65f6\u95f4\u4e86\u3002
\u731c\u7684\u6839\u636e\u6709\u4ec0\u4e48\u5462\uff0c\u786e\u5b9e\u6709\u6839\u636e\uff0c\u7edf\u8ba1\u8868\u660e\u5927\u90e8\u5206\u7a0b\u5e8f\u91cc\u53d1\u751f\u8df3\u8f6c\uff08branch taken\uff09\u548c\u4e0d\u53d1\u751f\u8df3\u8f6c\uff08branch not taken\uff09\u7684\u6570\u76ee\u662f\u4e25\u91cd\u4e0d\u6210\u6bd4\u4f8b\u7684\uff0c\u7ecf\u5e38\u5176\u4e2d\u4e00\u4e2a\u53ef\u80fd\u80fd\u5360\u5230 90% \u591a\u7684\u60c5\u51b5\u3002\u90a3\u4e48\uff0c\u5047\u8bbe\u5982\u679c\u77e5\u9053\u4e4b\u524d\u5f88\u591a\u8df3\u8f6c\u8bed\u53e5\u90fd\u8df3\u4e86\uff0c\u63a5\u4e0b\u6765\u53d1\u751f\u7684\u8df3\u8f6c\u8bed\u53e5\u4e5f\u5927\u6982\u7387\u4f1a\u8df3\u3002
\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u8bbe\u8ba1\u4e00\u4e2a\u72b6\u6001\u673a\uff0c\u6709\u56db\u79cd\u7f16\u7801 00(\u5f88\u53ef\u80fd\u8df3) 01(\u5e94\u8be5\u8df3\u5427) 10(\u5e94\u8be5\u4e0d\u8df3\u5427) 11(\u5f88\u53ef\u80fd\u4e0d\u8df3)\uff0c\u5982\u679c\u72b6\u6001\u673a\u5728 00 \u548c 01 \u72b6\u6001\u5c31\u9884\u6d4b\u4e0b\u4e00\u6b21\u4e5f\u8df3\u8f6c\uff0c\u5982\u679c\u72b6\u6001\u673a\u5728 10 \u548c 11 \u5c31\u9884\u6d4b\u4e0b\u4e00\u6b21\u4e0d\u8df3\u8f6c\u3002
\u800c\u72b6\u6001\u8f6c\u79fb\u662f\u8fd9\u6837\u53d1\u751f\u7684\uff1a
Note
\u6211\u77e5\u9053 mkdocs \u5e94\u8be5\u6e32\u4e0d\u4e86 mermaid\uff0c\u4f46\u662f\u6211\u61d2\uff0c\u8bf7\u5927\u5bb6\u8111\u6e32\u4e00\u4e0b\u3002\u3002\u6216\u8005\u770b\u81ea\u5df1\u8001\u5e08 ppt\u3002\u3002\u662f\u4e00\u4e2a\u6709\u56db\u4e2a\u72b6\u6001\u7684\u7ea2\u7ea2\u84dd\u84dd\u7684\u72b6\u6001\u673a
graph LR\n00 --(\u672c\u6b21\u8df3\u4e86)--> 00\n00 --(\u672c\u6b21\u6ca1\u8df3)--> 01\n01 --(\u672c\u6b21\u8df3\u4e86)--> 00\n01 --(\u672c\u6b21\u6ca1\u8df3)--> 10\n10 --(\u672c\u6b21\u8df3\u4e86)--> 01\n10 --(\u672c\u6b21\u6ca1\u8df3)--> 11\n11 --(\u672c\u6b21\u8df3\u4e86)--> 10\n11 --(\u672c\u6b21\u6ca1\u8df3)--> 11\n
\u8ba1\u7b97\u9898\u4f1a\u8003\u4f7f\u7528\u8fd9\u6837\u7684 branch prediction\uff0c\u9884\u6d4b\u5931\u8bef\u7684\u6982\u7387\u662f\u591a\u5c11\u3002
"},{"location":"docs/1-cs/architecture/chap5/","title":"chap5: Thread-level Parallelism","text":":material-circle-edit-outline: \u7ea6 381 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/architecture/chap5/#_1","title":"\u76ee\u5f55","text":"\u4e0d\u77e5\u9053\u600e\u4e48\u63cf\u8ff0\u7684\u4e24\u4e2a\u672f\u8bed
Note
\u8ba1\u7ec4\u738b\u9053\u6709\u4e00\u7ae0\u4e13\u95e8\u8bb2\u3002\u5176\u5b83\u8bf7\u901a\u8fc7\u738b\u9053\u5b66\u4e60\uff0c\u8fd8\u6709\u59dc\u8001\u5e08 ppt \u4e5f\u6709\u4e00\u4e2a\u5c0f\u603b\u7ed3\u7684\u8868\u683c\u3002
\u6982\u5ff5 \u5168\u540d \u7279\u70b9 \u4f18\u70b9 UMA uniform memory access \u6bcf\u4e2a\u8282\u70b9\u5230 memory \u7684\u8bbf\u95ee\u65f6\u95f4\u4e00\u81f4 NUMA non-uniform memory access \u6bcf\u4e2a\u8282\u70b9\u5230 memory \u7684\u8bbf\u95ee\u65f6\u95f4\u4e0d\u4e00\u81f4\uff0c\u5230\u81ea\u5df1\u7684\u5feb\uff0c\u5230\u522b\u4eba\u7684\u6162 \u6269\u5c55\u5230\u66f4\u5927\u89c4\u6a21\u4e0a\u7684\u53ef\u6269\u5c55\u6027\u5f3acache \u4e00\u81f4\u6027\u7684\u672f\u8bed
\u5982\u679c CPU \u6709\u591a\u4e2a\u6838\uff0c\u6216\u8005\u5982\u679c CPU \u662f\u5206\u5e03\u5f0f\u7684\uff0c\u5b83\u4eec\u5171\u7528\u4e00\u4e2a cache\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u4f7f cache \u5bf9\u6240\u6709\u6838/\u8282\u70b9\u7684\u8bfb\u5199\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u6bd4\u5982\u4e00\u4e2a\u6838/\u8282\u70b9\u5199\u7684\u4e1c\u897f\u5bf9\u5176\u5b83\u6838/\u8282\u70b9\u53ef\u89c1\uff0c\u5176\u5b83\u6838/\u8282\u70b9\u770b\u89c1\u7684\u90fd\u662f\u6700\u65b0\u7684\u3002
\u672f\u8bed \u4e00\u53e5\u8bdd\u5b9a\u4e49\uff08\u5728 ppt \u4e0a\u53d1\u73b0\u7684\uff0c\u4f46\u662f\u4e2a\u4eba\u611f\u89c9\u4e0d\u592a\u51c6\u786e\uff09 \u5173\u6ce8\u7684\u65b9\u9762\u662f\uff08\u8fd9\u680f from \u8bfe\u672c\u66f4\u51c6\u786e\uff0c\u4f46\u4e0d\u662f\u4e00\u53e5\u8bdd\u5b9a\u4e49\uff09 coherence Memory accesses executed by each processor were kept in order. reads and writes to the same location consistency Memory accesses among different processors were interleaved. reads and writes wrt other memory locations"},{"location":"docs/1-cs/architecture/chap5/#cache_1","title":"\u8fbe\u6210 cache \u4e00\u81f4\u6027\u4e24\u4e2a\u534f\u8bae","text":"Note
\u806a\u660e\u7684\u8bfb\u8005\u5df2\u7ecf\u53d1\u73b0\u6211\u5df2\u7ecf\u4e0d\u60f3\u5199\u4e86
Snooping\u534f\u8bae
Note
\u8bf7\u901a\u8fc7\u81ea\u5df1\u73ed\u8001\u5e08 ppt \u5b66\u4e60\uff1aMOESI \u72b6\u6001\u673a + \u4f8b\u9898\u8868\u683c \u4e24\u4e2a\u56fe
Directory\u534f\u8bae
Note
\u8bf7\u901a\u8fc7\u81ea\u5df1\u73ed\u8001\u5e08 ppt \u5b66\u4e60: \u4f8b\u9898\u8868\u683c \u4e00\u4e2a\u56fe
"},{"location":"docs/1-cs/compiler/","title":"Compiler","text":":material-circle-edit-outline: \u7ea6 56 \u4e2a\u5b57
\u662f ZJU \u7f16\u8bd1\u539f\u7406\u7b14\u8bb0\u3002\u4f5c\u4e3a xyx \u4e8b\u65e0\u5de8\u7ec6\u7248\u672c\u7684\u7b14\u8bb0\uff08\u53ef\u5728\u672c\u7ad9\u9996\u9875\u627e\u5230\uff09\u7684\u8865\u5145\uff0c\u6211\u505a\u4e86\u4e00\u4e9b\u6211\u505a\u9898\u65f6\u9700\u901f\u67e5\u7684\u8d44\u6599\u7684\u6574\u7406\u3002
\u8fdb\u5ea6\uff1a
:material-circle-edit-outline: \u7ea6 788 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
\u672c\u9875\u5b8c\u6210\u4e86\u5173\u4e8e LL(1), LR(0), SLR (aka. SLR(1)), LR(1), LALR(1) \u6587\u6cd5\u7684\u4e00\u4e9b\u5e38\u7528\u533a\u522b\u7684\u6574\u7406\u3002\u7531\u4e8e\u4f5c\u8005\u4e5f\u5b66\u5f97\u4e0d\u597d\uff0c\u5982\u679c\u6709\u9519\uff0c\u8bf7\u5411\u6211\u6307\u51fa\uff08\u53ef\u60dc\u8bc4\u8bba\u533a\u6211\u8fd8\u6ca1\u7814\u7a76\u597d\u600e\u6837\u914d\uff0c\u4e00\u5b9a\u5c3d\u5feb\u914d\u4e0a\uff0c\u53ef\u4ee5\u5148\u5176\u5b83\u9014\u5f84\u8054\u7cfb\u6211\uff09\u3002
\u672c\u9875\u9762\u5199\u4f5c\u65f6\u7684\u7279\u70b9\u662f\u5c3d\u91cf\u7528\u81ea\u7136\u8bed\u8a00\u6765\u63cf\u8ff0\u7279\u70b9\uff0c\u800c\u4e0d\u662f latex \u6570\u5b66\u516c\u5f0f\u548c\u56fe\u50cf\u3002\u539f\u56e0\u662f\u6211\u5728\u5176\u5b83\u8d44\u6599\u641c\u5230\u7684\u8bb2\u89e3\u90fd\u4e8b\u65e0\u5de8\u7ec6\u7528\u5927\u91cf\u516c\u5f0f\u548c\u56fe\u50cf\uff0c\u4f7f\u7406\u89e3\u53d8\u5f97\u5bb9\u6613\uff0c\u4f46\u4e0d\u9002\u5408\u901f\u67e5\u548c\u8bb0\u5fc6\u3002\u76f4\u767d\u4e00\u70b9\u8bf4\u5c31\u662f\u7b14\u8005\u4e0d\u60f3\u770b\u5230\u5b83\u4eec\uff0c\u4e00\u770b\u5c31\u5934\u75bc\u3002\u56e0\u6b64\u4e5f\u9020\u6210\u4e86\u672c\u6587\u6863\u7684\u4e00\u4e2a\u7f3a\u70b9\uff1a\u4e0d\u662f\u4e3a\u521d\u5b66\u8005\u8bbe\u8ba1\u7684\u3002\u521d\u5b66\u8005\u63a8\u8350\u9605\u8bfb xyx \u7684\u7b14\u8bb0\u3002\u505a\u9898\u65f6\u901f\u67e5\u8bb0\u5fc6\u53ef\u4ee5\u770b\u672c\u6587\u6863\u3002
\u600e\u6837\u5224\u65ad\u6587\u6cd5\u662f...\u4e0d\u662f...
\u6587\u6cd5 \u5224\u65ad\u662f \u5224\u65ad\u4e0d\u662f LL(1) (\u4e0d\u542b\u5de6\u9012\u5f52 && \u5bf9\u4e8e\u6587\u6cd5\u4e2d\u6bcf\u4e00\u4e2a non-terminal\uff0c\u5b83\u7684\u4ea7\u751f\u5f0f\u7684 SELECT set\uff08\u5373\u5f00\u5934\u7684 terminal \u4e0e\u5f00\u5934\u7684 non-terminal \u7684 FIRST\uff09\u4e24\u4e24\u4e0d\u4ea4\uff0c\u4e14\u4e0d\u80fd\u540c\u65f6\u63a8\u51fa\u7a7a\u4e32) || \u4ea7\u751f\u5f0f lhs \u4e24\u4e24\u4e0d\u76f8\u540c \u542b\u5de6\u9012\u5f52 || \u9047\u5230\u4e0b\u4e00\u4e2a\u8981\u626b\u63cf\u7684 terminal \u8f93\u5165\u65f6\uff0c\u6709\u8d85\u8fc7\u4e00\u79cd derive \u65b9\u6cd5 LR(0) \u6784\u9020\u51fa LR(0) items DFA\uff0c\u5982\u679c\u4e0d\u5b58\u5728 shift-reduce & reduce-reduce conflicts LR(0) items DFA \u5b58\u5728 shift-reduce | reduce-reduce conflicts SLR (aka. SLR(1)) \u6784\u9020\u51fa LR(0) items DFA\uff0c\u9996\u5148\u5176\u4e0d\u5b58\u5728 reduce-reduce \u51b2\u7a81\uff0c\u4e14\u5b58\u5728 shift-reduce \u51b2\u7a81\uff08\u5426\u5219\u5c31\u4e3a LR(0) \u8bed\u6cd5\u4e86\uff09\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u6709 shift-reduce \u51b2\u7a81\u7684\u5730\u65b9\uff0c\u72b6\u6001\u91cc\u9762\u6709\u53ef shift \u89c4\u5219\u4e5f\u6709\u53ef reduce \u89c4\u5219\uff0c\u5982\u679c reduce \u540e\u5f97\u5230\u7684 non-terminal \u7684 FOLLOW set \u4e0e\u53ef shift \u89c4\u5219\u65b0\u7eb3\u5165\u7684 terminal \u90fd\u6ca1\u6709\u4ea4 shift-reduce conflict \u4e2d\u5982\u679c reduce \u540e\u5f97\u5230\u7684 non-terminal \u7684 FOLLOW set \u4e0e\u53ef shift \u89c4\u5219\u65b0\u7eb3\u5165\u7684 terminal \u6709\u4ea4 LR(1) \u6784\u9020\u51fa LR(1) items DFA\uff0c\u5982\u679c\u4e0d\u5b58\u5728 shift-reduce & reduce-reduce conflicts LR(1) items DFA\uff0c\u5982\u679c\u5b58\u5728 shift-reduce | reduce-reduce conflicts LALR(1) \u6784\u9020\u51fa LR(1) items DFA\uff0c\u5982\u679c\u5408\u5e76\u540c\u5fc3\u96c6\u540e\u6ca1\u6709\u4ea7\u751f reduce-reduce conflicts\uff08\u4e00\u5b9a\u4e0d\u4f1a\u4ea7\u751f shift-reduce conflicts\uff0c\u540c\u5fc3\u96c6\u4e0d\u957f\u90a3\u6837\uff09 LR(1) items DFA \u5982\u679c\u5408\u5e76\u540c\u5fc3\u96c6\u540e\u4ea7\u751f\u4e86 reduce-reduce conflicts\u5927\u5bb6\u7684 items DFA \u600e\u4e48\u753b...
\u6587\u6cd5 items DFA LL(1) \u5b83\u6ca1\u6709\u2026 LR(0) \u5148\u753b NFA\uff1a\u6240\u6709 shift \u7684\u60c5\u51b5\u9760\u8bfb\u53d6 non-terminal/terminal \u8f6c\u6362\uff0c\u6240\u6709 reduce \u7684\u60c5\u51b5\u7a7a\u8f6c\u79fb\u3002\u7136\u540e\u753b DFA\uff1a\u628a\u7a7a\u8f6c\u79fb\u5408\u5e76\u3002 SLR (aka. SLR(1)) \u540c\u753b LR(0)\u3002\u53ea\u662f\u591a\u5224\u65ad\u4e00\u4e0b shift-reduce conflict \u7684 FOLLOW \u548c terminal \u91cd\u5408\u60c5\u51b5\uff0c\u4f46\u8fd9\u4e2a\u53ea\u4f53\u73b0\u5728 parse table\uff0c\u4e0d\u5c5e\u4e8e DFA \u5173\u5fc3\u7684\u4e8b\u3002 LR(1) \u5176\u5b83\u6b65\u9aa4\u540c\u753b LR(0)\uff0c\u53ea\u662f\u591a\u4e86\u5728\u6240\u6709 items \u540e\u9762\u7528\u9017\u53f7\u9694\u5f00\u4e00\u4e2a lookahead symbol\u3002lookahead \u7684\u9009\u62e9\u5f88\u50cf\u9009\u62e9\u4e86\u5bf9\u5e94\u4ea7\u751f\u5f0f\uff08\u4e0d\u8bba\u662f lhs/rhs\uff09\u7684 FOLLOW set\uff0c\u5373\u5bf9\u5e94\u4ea7\u751f\u5f0f\u4e4b\u540e\u63a5\u7684 terminal \u662f\u4ec0\u4e48\u3002 LALR(1) \u540c\u753b LR(1)\u3002\u53ea\u662f\u9700\u8981\u5408\u5e76\u6240\u6709\u540c\u5fc3\u96c6\uff0c\u540c\u5fc3\u96c6\u662f\u6307\u4ea7\u751f\u5f0f\u76f8\u540c\u4f46\u662f\u53ea\u6709 lookahead symbol \u4e0d\u540c\u7684\u90a3\u4e9b\u72b6\u6001\u3002\u5927\u5bb6\u7684 parse table \u600e\u4e48\u753b...
\u6587\u6cd5 parse table LL(1) non-terminals, nullable, FIRST, FOLLOW LR(0) states, shift&reduce, goto SLR (aka. SLR(1)) states, shift&reduce, goto LR(1) states, shift&reduce, goto LALR(1) states, shift&reduce, goto"},{"location":"docs/1-cs/database/","title":"DBMS","text":":material-circle-edit-outline: \u7ea6 360 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/database/#whats-this","title":"what's this","text":"\u8fd9\u91cc\u662f\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u7406\u8bba\u8bfe\u3002
content table:
\u4e00\u4e9b\u4e0e\u8003\u8bd5\u6709\u5173\u7684\u504f\u95e8\u4e1c\u897f\u3002
\u4e00\u4e2a\u671f\u672b\u8003\u70b9\uff1a\u6570\u636e\u5e93\u5b66\u79d1\u7684\u56db\u4e2a\u56fe\u7075\u5956
\u4eba\u7269 \u5e74\u4efd \u8d21\u732e Charles William Bachman 1973 \u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf DBMS \u7684\u5f00\u53d1\u3002\u4f7f\u7528\u5de5\u7a0b\u65b9\u6cd5\u6765\u8bbe\u8ba1\u548c\u5b9e\u73b0\u6570\u636e\u5e93\u7ba1\u7406\u3002 Edgar Frank \"Ted\" Codd 1981 \u5173\u7cfb\u6570\u636e\u5e93\u7406\u8bba\uff0c\u63d0\u51fa\u4e86\u5173\u7cfb\u6a21\u578b\u7684\u6982\u5ff5\uff0c\u8bbe\u8ba1\u4e86\u5173\u7cfb\u6570\u636e\u5e93\u7684\u6570\u5b66\u57fa\u7840\uff0c\u5e76\u53d1\u660e\u4e86SQL\u3002 Raj Reddy 1994 \u5206\u5e03\u5f0f\u6570\u636e\u5e93\u7cfb\u7edf\u3002\u63d0\u51fa\u4e86\u4e00\u79cd\u540d\u4e3aDAI\uff08distributed artificial intelligence\uff09\u7684\u5206\u5e03\u5f0f\u8ba1\u7b97\u6a21\u578b\u3002\u4f7f\u6570\u636e\u53ef\u4ee5\u5728\u591a\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u5171\u4eab\u548c\u5206\u5e03 Mike Ralph Stonebraker 2014 \u9762\u5411\u5bf9\u8c61\u6570\u636e\u5e93\u7cfb\u7edf\u3002\u63d0\u51fa\u4e86\u4e00\u79cd\u540d\u4e3a O-ODBS (object-oriented database system) \u7684\u65b0\u578b\u6570\u636e\u5e93\u7cfb\u7edf\u67b6\u6784\uff0c\u5c06\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u548c\u6570\u636e\u5e93\u7cfb\u7edf\u76f8\u7ed3\u5408\u3002\u4f7f\u6570\u636e\u5e93\u7cfb\u7edf\u53ef\u4ee5\u66f4\u597d\u652f\u6301\u590d\u6742\u5e94\u7528\u548c\u66f4\u5927\u89c4\u6a21\u6570\u636e\u3002"},{"location":"docs/1-cs/database/#_1","title":"\u53c2\u8003\u8d44\u6599","text":"\u5b8c\u6574\u8d44\u6599
\u4e13\u9898\u5e16\u5b50
:material-circle-edit-outline: \u7ea6 2 \u4e2a\u5b57
"},{"location":"docs/1-cs/database/SQL/","title":"SQL Grammar","text":":material-circle-edit-outline: \u7ea6 172 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/1-cs/database/SQL/#_1","title":"\u5173\u7cfb\u4ee3\u6570","text":"5 \u79cd\u57fa\u672c\u64cd\u4f5c
\u6269\u5c55\u64cd\u4f5c
select
select distinct
where
and / or
order by
insert to
update delete
JOIN \u8bed\u53e5
\u8fde\u63a5\uff1a\u7528\u4e8e\u628a\u591a\u4e2a\u8868\u7684\u884c\u7ed3\u5408\u8d77\u6765\u3002
SQL \u4e2d\u51e0\u79cd join \u7684\u7c7b\u578b
:material-circle-edit-outline: \u7ea6 3119 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
\u8fd9\u7ae0\u5173\u6ce8\u5982\u4f55\u5728\u78c1\u76d8 disk \u4e0a\u5b9e\u73b0\u4e00\u4e2a database\u3002
"},{"location":"docs/1-cs/database/design/#storage-structure","title":"Storage Structure \u5b58\u50a8\u7ed3\u6784","text":"\u9996\u5148\u9700\u8981\u4ecb\u7ecd storage hierarchy\u3002\u4e00\u4e2a\u4ece\u9876\uff08\u5bb9\u91cf\u6700\u5c0f\u6700\u5feb\u7684\uff09\u5411\u4e0b\uff08\u5bb9\u91cf\u6700\u5927\u6700\u6162\u7684\uff09\u7684\u56fe\u793a\u5982\u4e0b\uff0c
/\\ Primary storage \u4e3b\u5b58\u50a8\u5668: CPU register \u5bc4\u5b58\u5668, cache \u7f13\u5b58, main memory \u4e3b\u5b58\n /--\\ Secondary storage \u4e8c\u7ea7\u5b58\u50a8\u5668: flash memory \u95ea\u5b58, magnetic disk \u78c1\u76d8\n /----\\ Teriary storage \u4e09\u7ea7\u5b58\u50a8\u5668: optical disk \u5149\u76d8, magnetic tape \u78c1\u5e26\n --------\n
\u5176\u4e2d\u6700\u9876\u5c42 primary storage \u662f volatile\uff08\u6613\u5931\u7684\uff09\uff0c\u610f\u601d\u662f\u5982\u679c\u8ba1\u7b97\u673a\u65ad\u7535\u91cd\u542f\uff0c\u5c31\u4f1a\u4e22\u5931\uff1b\u4e0b\u9762\u4e24\u5c42\u90fd\u662f non-volatile\uff08\u4e0d\u6613\u5931\u7684\uff09\uff0c\u610f\u601d\u662f\u5373\u4f7f\u8ba1\u7b97\u673a\u65ad\u7535\uff0c\u4e5f\u4e0d\u4f1a\u4e22\u5931\u3002 \u4e0b\u9762\u4f9d\u6b21\u7b80\u5355\u4ecb\u7ecd\u6bcf\u4e2a\u5b58\u50a8\u5668\uff1a
Cache \u7f13\u5b58
\u7f13\u5b58\u662f\u901f\u5ea6\u6700\u5feb\u7684\u5b58\u50a8\u5668\uff0c\u4f46\u9020\u4ef7\u548c\u7ef4\u62a4\u6210\u672c\u6700\u9ad8\uff0c\u6240\u4ee5\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u3002\u867d\u7136\u6570\u636e\u5e93\u65e0\u9700\u7ef4\u62a4 cache\uff0c\u4f46\u6709\u7684\u6570\u636e\u5e93\u5728\u8bbe\u8ba1\u67e5\u8be2\u7684\u65f6\u5019\u4f1a\u5173\u6ce8 cache \u6548\u7387\u3002
Main memory \u4e3b\u5b58
\u4e3b\u5b58\u91cc\u7684\u6570\u636e\u53ef\u4ee5\u76f4\u63a5\u88ab CPU \u6267\u884c\u8ba1\u7b97\u64cd\u4f5c\uff0c\u8fd9\u91cc\u7684\u8ba1\u7b97\u64cd\u4f5c\u5c31\u662f\u6307 machine instruction \u673a\u5668\u6307\u4ee4\u3002\u4e3b\u5b58\u4e5f\u76f8\u5bf9\u5c0f\uff0c\u867d\u7136\u73b0\u5728\u6709\u7684\u5546\u4e1a\u6570\u636e\u5e93\u53ef\u4ee5\u88ab\u6574\u4e2a\u585e\u8fdb\u4e3b\u5b58\u3002\u4e3b\u5b58\u662f volatile \u4e5f\u5c31\u662f\u65ad\u7535\u4e22\u5931\u7684\uff0c\u7cfb\u7edf\u574f\u6389\u4e5f\u4f1a\u4e22\u5931\u3002
Flash memory \u95ea\u5b58 \u95ea\u5b58\u53ca\u4ee5\u4e0b\u7684\u5b58\u50a8\u5668\u5c31\u90fd\u662f\u65ad\u7535\u4e0d\u4e22\u5931\u7684\u4e86\u3002\u95ea\u5b58\u7684\u7ef4\u62a4\u6210\u672c\u6bd4\u4e3b\u5b58\u4f4e\uff0c\u6bd4\u78c1\u76d8\u9ad8\u3002
\u95ea\u5b58\u53ef\u4ee5\u7528\u4e8e\u5728\u201cUSB flash drive\u201d\uff08U \u76d8\uff09\u4e2d\u4fdd\u5b58\u6570\u636e\uff1b\u8fd8\u6709 Solid-state drive \u56fa\u6001\u786c\u76d8\uff08SSD\uff09\u4e5f\u4f7f\u7528\u4e86\u95ea\u5b58\uff0c\u4f46\u662f\u63d0\u4f9b\u4e86\u78c1\u76d8\u4e00\u6837\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u4ee3\u66ff\u78c1\u76d8\u7684\u529f\u80fd\u3002
Magnetic disk \u78c1\u76d8
\u4e5f\u53eb hard disk drive \u786c\u76d8\u3002\u78c1\u76d8\u662f\u4e3b\u8981\u7684\u957f\u671f online \u5b58\u50a8\u7684\u4ecb\u8d28\uff0c\u4f46\u662f CPU \u5982\u679c\u60f3\u8981\u64cd\u4f5c\u78c1\u76d8\u4e0a\u7684\u6570\u636e\uff0c\u5c31\u5148\u8981\u628a\u6570\u636e\u79fb\u5230\u4e3b\u5b58\u91cc\uff0c\u5904\u7406\u5b8c\u518d\u79fb\u51fa\u6765\u3002\u78c1\u76d8\u7684\u5b58\u50a8\u80fd\u529b\u5728\u9010\u5e74\u4e0a\u5347\u3002
Optical disk \u5149\u76d8
\u5e38\u89c1\u7684 disk video disk\uff08DVD\uff09\u5c31\u662f\u4e00\u79cd\u5149\u76d8\u3002\u5149\u76d8\u4e0a\u7684\u6570\u636e\u88ab\u7528\u6fc0\u5149\u8bfb\u5199\u3002\u5b83\u662f\u4e00\u79cd write-once, read-many (WORM) \u4ecb\u8d28\uff0c\u5373\u53ea\u80fd\u5199\u4e00\u6b21\uff0c\u4f46\u662f\u80fd\u8bfb\u5f88\u591a\u6b21\u3002
Magnetic tape \u78c1\u76d8
\u78c1\u76d8\u4e00\u822c\u662f\u7528\u6765\u5907\u4efd\u548c\u5b58\u6863\u4e0d\u5e38\u7528\u7684\u6570\u636e\u7684\uff0c\u8fd9\u7c7b\u6570\u636e\u5c31\u4e0d\u5e38\u4f7f\u7528\uff0c\u4e00\u822c\u9700\u8981\u88ab\u5b89\u5168\u5730\u957f\u671f\u4fdd\u5b58\u3002\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5fc5\u987b\u88ab\u987a\u5e8f\u8bfb\u53d6\uff0c\u5373\u8bfb\u5199\u5934\u5728\u78c1\u76d8\u4e0a\u79fb\u52a8\uff0c\u8bfb\u54ea\u91cc\u79fb\u5230\u54ea\u91cc\uff0c\u6240\u4ee5\u5b83\u53eb sequential-access storage\uff0c\u8fd9\u6837\u8bfb\u53d6\u662f\u975e\u5e38\u6162\u7684\u3002\u76f4\u63a5\u8bfb\u53d6\u7684 direct-access storage\uff0c\u6bd4\u5982\u78c1\u76d8\u548c SSD storage\uff0c\u8bfb\u53d6\u5c31\u76f8\u5bf9\u5feb\u4e00\u4e9b\uff0c\u56e0\u4e3a\u53ef\u4ee5\u76f4\u63a5\u8bfb\u53d6\u76d8\u4e0a\u7684\u4efb\u4f55\u5730\u65b9\u3002
\u4e00\u4e2a\u78c1\u76d8\u6709\u4e0a\u5341\u4e07\u4e2a track\uff08\u78c1\u9053\uff09\uff0c\u4e00\u4e2a\u78c1\u9053\u53c8\u6709\u4e0a\u5343\u4e2a sector\uff08\u6247\u533a\uff0c\u662f\u8ba1\u7b97\u673a\u548c\u78c1\u76d8\u4ea4\u6362\u6570\u636e\u7684\u6700\u5c0f\u5355\u4f4d\uff09\u3002\u78c1\u76d8\u4e0a\u5bfb\u9053\u7684\u5de5\u5177\u662f arm assemly \u8bfb\u5199\u5934\uff0c\u8bfb\u5199\u5934\u8fdb\u8fdb\u9000\u9000\u6765\u5bfb\u627e\u6570\u636e\u5728\u54ea\u4e2a\u78c1\u9053\u4e0a\uff0c\u7b49\u5bf9\u5e94\u6247\u533a\u65cb\u8f6c\u5230\u8bfb\u5199\u5934\uff0c\u624d\u5f00\u59cb\u4f20\u8f93\u6570\u636e\u3002
\u540c\u6837\u7684\u78c1\u9053\u7ec4\u6210\u4e00\u4e2a\u67f1\u9762\uff0c\u5bf9\u4e8e\u5927\u6587\u4ef6\uff0c\u6700\u597d\u50a8\u5b58\u5728\u540c\u4e00\u4e2a\u67f1\u9762\u4e0a\uff0c\u8fd9\u6837\u53ef\u4ee5\u5e76\u884c\u8bfb\u5199\u3002
\u6d4b\u91cf\u78c1\u76d8\u7684\u6027\u80fd\u9700\u8981\u4e00\u4e9b\u91cf\u5316\u6307\u6807\uff0c\u901a\u5e38\u6211\u4eec\u8003\u8651\u6570\u636e\u6570\u636e\u8bbf\u95ee\u7684\u7528\u65f6\u548c\u3002
Access time\uff08\u8bbf\u95ee\u65f6\u95f4\uff09
Data-transfer Rate\uff08\u6570\u636e\u4f20\u8f93\u7387\uff09
!!! (\u8fd9\u5757\u5728 db \u548c os \u91cc\u90fd\u4e0d\u8003\uff0c\u4f46\u662f\u90fd\u4f1a\u7ecf\u5e38\u63d0\u5230\uff0c\u5f88\u795e\u79d8\uff0c\u6240\u4ee5\u987a\u4fbf\u505a\u4e00\u4e0b\u7b14\u8bb0)
RAID \u5168\u79f0\u662f redundant arrays of independent disk \u72ec\u7acb\u78c1\u76d8\u5197\u4f59\u9635\u5217\u3002\u5b83\u7684\u6765\u5386\u662f\u56e0\u4e3a\uff0c\u8fc7\u53bb\u7684\u7cfb\u7edf\u8bbe\u8ba1\u8005\u4eec\u8ba4\u4e3a\u4f7f\u7528\u591a\u4e2a\u5c0f\u578b\u3001\u5ec9\u4ef7\u78c1\u76d8\u7ec4\u6210\u7684\u5b58\u50a8\u7cfb\u7edf\u662f\u4e00\u4e2a\u66f4\u7ecf\u6d4e\u9ad8\u6548\u7684\u9009\u9879\uff0c\u6240\u4ee5\u539f\u6765 RAID \u4e2d\u7684 I \u662f inexpensive \u7684\u610f\u601d\u3002\u4f46\u73b0\u5728\u6240\u6709\u78c1\u76d8\u5728\u7269\u7406\u5c3a\u5bf8\u4e0a\u90fd\u5f88\u5c0f\uff0c\u5bb9\u91cf\u66f4\u5927\u7684\u78c1\u76d8\u5b9e\u9645\u4e0a\u5177\u6709\u66f4\u4f4e\u7684\u6bcf\u5146\u5b57\u8282\u6210\u672c\u3002\u5f00\u53d1\u8005\u4f7f\u7528 RAID \u7cfb\u7edf\u73b0\u5728\u4e3b\u8981\u56e0\u5176\u66f4\u9ad8\u7684\u53ef\u9760\u6027\u548c\u6027\u80fd\uff0c\u548c\u7ba1\u7406\u64cd\u4f5c\u7b80\u4fbf\u3002
!!! TODO
\u901a\u8fc7\u5e76\u884c\u6765\u52a0\u901f
\u6570\u636e\u5e93\u662f\u5b58\u50a8\u5728\u4e00\u7cfb\u5217\u7684\u6587\u4ef6\u4e2d\u7684\uff0c\u6587\u4ef6\u5185\u90e8\uff0c\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u6709\u4e00\u7cfb\u5217\u7684 records \u8bb0\u5f55\uff0c\u6bcf\u4e2a record \u542b\u6709\u4e00\u7cfb\u5217\u7684 fields \u57df\u3002
\u5728\u8bbe\u8ba1\u65f6\uff0c\u4e00\u822c\u6709\u4e00\u4e9b\u5047\u8bbe\uff1a\uff081\uff09\u5047\u8bbe\u8bb0\u5f55\u7684\u957f\u5ea6\u662f\u56fa\u5b9a\u7684\uff0c\uff082\uff09\u5047\u8bbe\u6bcf\u4e2a\u6587\u4ef6\u91cc\u53ea\u6709\u4e00\u79cd\u8bb0\u5f55\uff0c\uff083\uff09\u5047\u8bbe\u4e0d\u540c\u7684\u6587\u4ef6\u88ab\u7528\u4e8e\u4e0d\u540c\u7684\u5173\u7cfb\u3002
"},{"location":"docs/1-cs/database/design/#_2","title":"\u8bb0\u5f55\u7684\u7c7b\u578b","text":"\u8bb0\u5f55\u5206\u4e3a
Fixed-length records \u5b9a\u957f\u8bb0\u5f55
\u8bb0\u5f55 i \u4ece\u5b57\u8282 n * (i-1) \u5904\u5f00\u59cb\uff0c
Variable-length records \u53d8\u957f\u8bb0\u5f55
\u4e00\u4e2a\u65b0\u7684\u8bb0\u5f55\u8981\u63d2\u5165\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u6709\u51e0\u79cd\u7b97\u6cd5\u6765\u51b3\u5b9a\u63d2\u5165\u5230\u6587\u4ef6\u7684\u54ea\u4e2a\u4f4d\u7f6e\uff1a
\u6bcf\u4e2a\u6587\u4ef6\u88ab\u5212\u5206\u4e3a\u56fa\u5b9a\u957f\u5ea6\u7684 blocks\u3002block \u662f\u6570\u636e\u5b58\u53d6\u548c\u7a7a\u95f4\u5206\u914d\u7684\u57fa\u672c\u5355\u4f4d\u3002
\u4e00\u4e2a block \u5305\u542b\u591a\u6761\u8bb0\u5f55\u3002\u5728\u4f20\u7edf\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u8bb0\u5f55\u7684\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7 block\uff0c\u6bcf\u6761\u8bb0\u5f55\u4e00\u5b9a\u90fd\u662f\u5b8c\u6574\u7684\u3002\u8bb0\u5f55\u4e4b\u95f4\u7528\u94fe\u8868\u6765\u8fde\u63a5\u3002
\u8bb0\u5f55\u5206\u4e3a\u5b9a\u957f\u8bb0\u5f55\u548c\u53d8\u957f\u8bb0\u5f55\u4e24\u79cd\u3002
Fixed-length records \u5b9a\u957f\u8bb0\u5f55
Storage record i starting from byte n*(i-1) where n is the size of each record. Record access is simple but records may cross blocks.
Modification of fixed-length records: do not allow records to cross block boundaries.
Deletion of record i: alternatives
\u53ef\u4ee5\u4e0d move records\uff0cbut link all free records on a free list. \u8981\u5220\u9664\u7684\u6761\u76ee\u6253\u4e0a\u6807\u8bb0\uff0c\u5f62\u6210\u4e00\u4e2a\u7a7a\u8bb0\u5f55\u7684\u94fe\u8868\u3002\u672a\u6765\u8981\u63d2\u5165\u65f6\u4e5f\u5e94\u9009\u62e9\u7a7a\u8bb0\u5f55\uff0c\u53ea\u8981\u901a\u8fc7\u6307\u9488\u5c31\u53ef\u4ee5\u627e\u5230\uff0c\u7136\u540e\u66f4\u65b0\u8bb0\u5f55\u5373\u53ef\u3002
Varaible-length records \u53d8\u957f\u8bb0\u5f55 variable-length records arise in database systems in several ways:
variable length attributes represented by fixed size (offset, length), with actual data storad after all fixed length atrributes.
null values represented by null-value bitmap ()
\u4e0d\u5b9a\u957f\u7684\u4fdd\u5b58\u5728\u540e\u9762\uff0c\u5b9a\u957f\u7684\uff08offset length\uff09\u4fdd\u5b58\u5728\u524d\u9762\u3002
slotted page structure \u5206\u69fd\u9875
\u5178\u578b\u7684\u53d8\u957f\u8bb0\u5f55\u6709\u5982\u4e0b\u7279\u70b9\uff1a
\u5b58\u50a8\u7f13\u51b2\u533a\u7684\u7ba1\u7406
"},{"location":"docs/1-cs/database/design/#index","title":"Index \u7d22\u5f15","text":"\u6570\u636e\u5e93\u4e2d\u5f15\u5165\u7d22\u5f15\u6982\u5ff5\uff0c\u662f\u4e3a\u4e86\u52a0\u5feb\u67e5\u627e\u901f\u5ea6\u3002
\u5728\u5f15\u5165\u7d22\u5f15\u7684\u65f6\u5019\uff0c\u9700\u8981\u5173\u6ce8\u7684\u56e0\u7d20\u90fd\u6709\u5982\u4e0b\u51e0\u79cd
Access type \u8bbf\u95ee\u7c7b\u578b
Access time \u8bbf\u95ee\u65f6\u95f4
Insertion time \u63d2\u5165\u65f6\u95f4
Deletion time \u5220\u9664\u65f6\u95f4
Space overhead \u7a7a\u95f4\u5f00\u9500
\u4e00\u822c\u6765\u8bf4\uff0c\u952e\u7684\u6392\u5217\u65b9\u5f0f\u5206\u4e3a ordered index \u987a\u5e8f\u7d22\u5f15\u548c hased index \u4e24\u79cd\u3002
\u800c\u7d22\u5f15\u6307\u5411\u6570\u636e\u7684\u65b9\u5f0f\u53c8\u5206\u4e3a\uff1a
Dense index \u5bc6\u96c6\u7d22\u5f15 \u5bc6\u96c6\u7d22\u5f15\u4e0b\uff0c\u6bcf\u4e00\u6761\u6570\u636e\u8bb0\u5f55\u90fd\u6709\u5bf9\u5e94\u7684\u7d22\u5f15\u3002
Sparse inedx \u7a00\u758f\u7d22\u5f15 \u6b64\u65f6\u4e0d\u662f\u6bcf\u4e00\u6761\u8bb0\u5f55\u90fd\u6709\u5bf9\u5e94\u7684\u7d22\u5f15\u3002\u7d22\u5f15\u53ea\u6307\u5411\u5bf9\u5e94\u7684\u4e00\u90e8\u5206\u8bb0\u5f55\uff0c\u5176\u4f59\u8bb0\u5f55\u901a\u8fc7\u94fe\u8868\u4e00\u6837\u7684\u6307\u9488\u8fde\u63a5\u8d77\u6765\u3002\u6b64\u65f6\u9700\u8981\u7684\u7a7a\u95f4\u548c\u63d2\u5165\u5220\u9664\u65b0\u7d22\u5f15\u7684\u5f00\u9500\u8f83\u5c0f\uff0c\u4f46\u662f\u6bd4\u5bc6\u96c6\u7684\u7d22\u5f15\u6162\u3002
Secondary index \u4e8c\u7ea7\u7d22\u5f15 \u7d22\u5f15\u901a\u8fc7\u4e00\u4e2a\u5927\u7684 bucket \u6765\u5bfb\u627e\u6240\u6307\u5411\u7684\u5730\u65b9\u3002
Multilevel index \u591a\u7ea7\u7d22\u5f15 \u5206\u4e3a outer index \u548c inner index\u3002
Clustering Index A clustering index is an index whose search key also defines the sequentially ordered, a clustering index is an index whose search key also defines the sequenrial order of the file. Clustering indices are also called primary indices.
\u4ecb\u7ecd\u5e38\u7528\u7684 B+ \u6811\u6570\u636e\u7ed3\u6784\u3002\u4e0e fds \u4e2d\u5b9a\u4e49\u76f8\u540c\uff0c\u4f46\u662f\u518d\u4ecb\u7ecd\u4e00\u6b21\u3002
B+ \u6811\u662f\u4e00\u79cd\u5e73\u8861\u7684\uff08\u6bcf\u5c42\u90fd\u662f\u6ee1\u7684\uff09\u591a\u5206\u6811\uff08\u4e0d\u6b62\u4e24\u4e2a\u8282\u70b9\uff09\u3002\u4e00\u4e2a m \u9636\u7684 B+ \u6811\u6ee1\u8db3\u5982\u4e0b\u6761\u4ef6\uff1a
\u5728\u5b9e\u73b0\u4e2d\uff0cB+ \u6811\u7684\u4e00\u4e2a\u8282\u70b9\u7684\u5927\u5c0f\u548c\u4e00\u4e2a\u78c1\u76d8\u533a\u5757\u4e00\u6837\u5927\uff08\u901a\u5e38\u662f 4 KB\uff09\uff0c\u800c\u7d22\u5f15\u7684\u89c4\u6a21\u4e00\u822c\u5728 100 \u5de6\u53f3\u3002
B+ Tree Visualization \u662f\u4e00\u4e2a B+ \u6811\u53ef\u89c6\u5316\u7684\u5de5\u5177\u3002
\u4ecb\u7ecd\u67e5\u8be2\u3001\u63d2\u5165\u548c\u5220\u9664\u64cd\u4f5c\u3002
\u5f53 B+ \u6811\u4e2d\u7684\u8282\u70b9 TODO \u5177\u4f53\u7684\u6761\u4ef6\u662f\u4ec0\u4e48\uff0c\u6211\u4eec\u8fd9\u91cc\u8bb0\u4f5c\u7834\u574f\u4e86 B+ \u6811\u3001\u5143\u7d20\u8fc7\u591a\u6216\u5143\u7d20\u8fc7\u5c11\uff0c\u5c31\u9700\u8981\u8003\u8651\u66f4\u65b0\u7d22\u5f15\u3002
\u63d2\u5165\uff1a
\u5220\u9664\uff1a
\u5206\u522b\u5206\u6790\u51e0\u79cd\u6570\u636e\u64cd\u4f5c\u4e0b\uff0cB+ \u6811\u7684\u6027\u80fd\uff1a
\u67e5\u627e search
\u67e5\u627e\u7b97\u6cd5\u5c31\u662f\u4ece\u6839\u8282\u70b9\u5f00\u59cb\u5411\u4e0b\u6bd4\u8f83\uff0c\u6839\u636e\u4e0e\u6bcf\u4e2a\u7236\u8282\u70b9\u7684\u5927\u5c0f\u5173\u7cfb\u4e00\u8def\u6bd4\u8f83\u627e\u5230\u8981\u627e\u7684\u53f6\u5b50\u7ed3\u70b9\u3002\u5982\u679c N \u4e3a\u53f6\u5b50\u7684\u603b\u6570\uff0c\u90a3\u4e48\u67e5\u8be2\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0d\u4f1a\u8d85\u8fc7 \\(log_n/2(K)+1\\)\u3002
\u63d2\u5165 insert
\u63d2\u5165\u7b97\u6cd5\u6d89\u53ca\uff1a\u5148\u627e\u5230\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\u76f4\u63a5\u63d2\u5165\uff0c\u5982\u679c\u5f53\u524d\u7684\u8282\u70b9\u6570\u91cf\u8d85\u8fc7\u4e86\u9636\u6570 M \u5219\u62c6\u6210\u4e24\u4e2a\u90e8\u5206\uff0c\u5e76\u5411\u4e0a\u66f4\u65b0\u7d22\u5f15\u3002\u6240\u4ee5\u65f6\u95f4\u590d\u6742\u5ea6\u662f...
\u5220\u9664 delete
\u5220\u9664\u7b97\u6cd5\u8bbe\u8ba1\uff1a\u76f4\u63a5\u628a\u8981\u5220\u9664\u7684\u8282\u70b9\u5220\u9664\uff0c\u7136\u540e\u628a\u6ca1\u6709\u7d22\u5f15 key \u4e86\u7684\u975e\u53f6\u8282\u70b9\u5220\u9664\uff0c\u4ece\u65c1\u8fb9\u627e\u4e00\u4e2a\u53f6\u8282\u70b9\u5408\u5e76\u51fa\u65b0\u7684\u975e\u53f6\u8282\u70b9\u3002\u6240\u4ee5\u65f6\u95f4\u590d\u6742\u5ea6\u662f...
B+ \u6811\u7684\u76f8\u5173\u8ba1\u7b97
\u9ad8\u5ea6\u7684\u4f30\u8ba1\uff1a\u53ef\u4ee5\u5206\u6790\u9ad8\u5ea6\u7684\u4e0a\u4e0b\u754c
size \u5927\u5c0f\u7684\u4f30\u8ba1\uff1a\u4e5f\u662f\u5206\u6790\u9ad8\u5ea6\u7684\u4e0a\u4e0b\u754c
:material-circle-edit-outline: \u7ea6 1976 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f
\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981\u5173\u7cfb\u6a21\u5f0f\uff1f
\u5728\u8bbe\u8ba1\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u6211\u4eec\u753b\u5b8c E-R \u56fe\uff0c\u8981\u628a\u56fe\u8f6c\u5316\u6210\u8868\u7684\u5f62\u5f0f\u5316\u5b9a\u4e49\uff08\u6bd4\u5982 Student(sid, course, department)
\u8fd9\u79cd\u683c\u5f0f\uff09\u3002\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u5bf9\u4e00\u4e9b\u5c5e\u6027\u8fdb\u884c\u8fdb\u4e00\u6b65\u7ea6\u675f\uff0c\u6bd4\u5982\u8981\u5173\u6ce8\u8fd9\u4e9b\u95ee\u9898\uff1a\uff081\uff09\u5728\u4e24\u4e2a\u8868\u91cc\u7684\u952e\u8c01\u51b3\u5b9a\u8c01\uff1f\u8981\u4fdd\u8bc1\u53ea\u6709 candidate key \u7684\u5c5e\u6027\u624d\u80fd\u51b3\u5b9a\u5176\u5b83\u5c5e\u6027\u3002\uff082\uff09\u6709\u4e9b\u8868\u8be5\u5408\u5728\u4e00\u8d77\uff0c\u8fd8\u662f\u62c6\u6210\u591a\u4e2a\u8868\uff1f\u5982\u679c\u8868\u5408\u5f97\u592a\u591a\uff0c\u6709\u4e9b\u4fe1\u606f\u53ef\u80fd\u51fa\u73b0\u592a\u591a\u6b21\uff0c\u4ea7\u751f\u4fe1\u606f\u5197\u4f59\u3001\u63d2\u5165\u5f02\u5e38\u3001\u66f4\u65b0\u56f0\u96be\u3002\uff083\uff09\u6709\u4e9b\u5c5e\u6027\u867d\u7136\u4e0d\u662f\u4e3b\u952e\uff0c\u4f46\u53c8\u51b3\u5b9a\u5176\u5b83\u5173\u7cfb\u7684\u503c\uff0c\u8fd9\u79cd\u60c5\u51b5\u53eb\u505a\u6709\u51fd\u6570\u4f9d\u8d56\u3002
\u6240\u4ee5\u6211\u4eec\u5f15\u5165\u5173\u7cfb\u4ee3\u6570\uff0c\u6765\u6307\u5bfc\u6211\u4eec\u4ece E-R \u56fe\u5230\u5efa\u7acb\u5f62\u5f0f\u5316\u5b9a\u4e49\u7684\u8fd9\u4e00\u6b65\u9aa4\u3002\u5176\u5b9e\u4e3b\u8981\u7275\u626f\u5230\u7684\u6b65\u9aa4\u5c31\u662f\u5173\u7cfb\u5206\u89e3\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5148\u4ecb\u7ecd\u5206\u89e3\uff0c\u7136\u540e\u4ecb\u7ecd\u5176\u4f9d\u8d56\u7684\u7406\u8bba\u51fd\u6570\u4f9d\u8d56\u7684\u5b9a\u4e49\uff1b\u7136\u540e\u4ecb\u7ecd 6 \u79cd\u6307\u5bfc\u5173\u7cfb\u6a21\u5f0f\u7684\u8303\u5f0f\uff0c\u8fd9\u4e9b\u6bcf\u79cd\u8303\u5f0f\u5c42\u5c42\u9012\u8fdb\uff0c\u662f\u4e00\u4e9b\u5bf9\u6570\u636e\u5e93\u5173\u7cfb\u8d8a\u6765\u8d8a\u4e25\u683c\u7684\u7ea6\u675f\u3002
"},{"location":"docs/1-cs/database/normalforms/#_2","title":"\u5206\u89e3","text":"\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u662f\u4e0d\u597d\u7684\uff0c\u6211\u4eec\u5e0c\u671b\u628a\u5b83\u5206\u89e3\u6210\u597d\u7684\u5173\u7cfb\u3002
\u4ecb\u7ecd\u4e00\u4e0b decomposition \u5206\u89e3\u5206\u4e3a\u4e24\u7c7b
lossy decomposition \u6709\u635f\u5206\u89e3 \u5982\u679c\u4e0d\u80fd\u7528\u5206\u89e3\u540e\u7684\u51e0\u4e2a\u5173\u7cfb\u91cd\u5efa\u539f\u672c\u7684\u5173\u7cfb\uff0c\u5c31\u79f0\u5206\u89e3\u4e3a\u6709\u635f\u5206\u89e3\u3002
lossless decomposition \u65e0\u635f\u5206\u89e3 \u4e00\u4e2a\u5173\u7cfb\u662f\u65e0\u635f\u5206\u89e3\uff0c\u5b9a\u4e49\u662f
(1) \\(\\Pi_{R_1}(r) \\Join \\Pi_{R_2}(r) = r\\)\uff0c\u5f53 R1 \u548c R2 \u662f\u5173\u7cfb R \u7684\u5206\u89e3\uff0cr(R) \u6307 R \u4e0a\u5728\u5206\u89e3\u65f6\u53ef\u80fd\u635f\u5931\u7684\u4e00\u4e2a\u5173\u7cfb\u65f6\u3002
\u6216\u8005
(2) \u5173\u7cfb R \u5206\u89e3\u540e\u4ea7\u751f\u5173\u7cfb\u96c6 (R1, R2) \u4e14 R = R1 \\(\\cup\\) R2\u3002
\u4e00\u4e2a\u66f4\u76f4\u89c2\u7684\u5224\u65ad\u65b9\u6cd5\u662f\uff0c\u5982\u679c\u6ee1\u8db3 (1) R1 \\(\\cap\\) R2 -> R1 \u4e14 (2) R1 \\(\\cap\\) R2 -> R2\uff0c\u5219\u79f0\u4e3a\u4e00\u4e2a\u65e0\u635f\u8fde\u63a5\u3002\u5176\u4e2d\u7bad\u5934\u7684\u610f\u601d\u662f\u51b3\u5b9a\u3002\u5982\u679c\u8fde\u63a5\u540e\u8fd8\u80fd\u51b3\u5b9a\u539f\u6765\u7684\u4e24\u4e2a\u5173\u7cfb\uff0c\u90a3\u4e48\u5f53\u7136\u662f\u65e0\u635f\u94fe\u63a5\u3002
\u8fd9\u4e2a\u5206\u89e3\u7684\u7406\u8bba\uff0c\u662f\u57fa\u4e8e (1) functional dependencies \u51fd\u6570\u4f9d\u8d56 (2) multivalued dependencies \u591a\u503c\u4f9d\u8d56 \u4e24\u4e2a\u7406\u8bba\u7684\u3002
\u6839\u636e\u5206\u89e3\u7406\u8bba\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f97\u5230\u518d\u4e0b\u4e00\u6b65\u8981\u4ecb\u7ecd\u7684\u516d\u4e2a\u8303\u5f0f\u3002
"},{"location":"docs/1-cs/database/normalforms/#_3","title":"\u51fd\u6570\u4f9d\u8d56","text":"\u6982\u5ff5\u533a\u522b
\u51fd\u6570\u4f9d\u8d56\uff1a
\u90e8\u5206\u51fd\u6570\u4f9d\u8d56\uff1a\u8bbe X, Y \u662f\u5173\u7cfb R \u7684\u4e24\u4e2a\u5c5e\u6027\u96c6\u5408\uff0c\u5b58\u5728 X->Y, \u82e5 X' \u662f X \u7684\u771f\u5b50\u96c6\uff0c\u5b58\u5728 X\u2018->Y\uff0c\u5219\u79f0 Y \u90e8\u5206\u4f9d\u8d56\u4e8e\u51fd\u6570 X\u3002
\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\uff1a\u8bbe X, Y, Z \u662f\u5173\u7cfb R \u4e2d\u4e92\u4e0d\u76f8\u540c\u7684\u5c5e\u6027\u96c6\u5408\uff0c
\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\uff1a
\u6211\u770b\u4e0d\u61c2\u3002\u3002\u3002\u3002\u3002\u3002
\u51fd\u6570\u4f9d\u8d56\u662f\u6765\u81ea\u4e8e\u5e94\u7528\u5c42\u9762\u7684\u89c4\u5b9a\uff08Functional dependencies are constraints on the set of legal relations\uff09\uff0c\u5148\u6709\u51fd\u6570\u4f9d\u8d56\uff0c\u518d\u6709\u6570\u636e\u5e93\u4e2d\u7684\u503c\u3002\u51fd\u6570\u4f9d\u8d56\u8981\u6c42\u4e24\u4e2a\u503c
\u901a\u8fc7
\u51fd\u6570\u4f9d\u8d56\u53ef\u4ee5\u88ab\u8bc1\u4f2a\uff08\u5bf9\u4e8e\u5355\u4e2a\uff09\uff0c\u4e0d\u80fd\u88ab\u8bc1\u5b9e\uff08\u5bf9\u4e8e\u6240\u6709\uff09\u3002
!!! \u672c\u8282\u4ee5\u4e0b latex \u9e1f\u8bed\u5168\u90fd\u4e0d\u8003
\u5f62\u5f0f\u5316\u7684\u5b9a\u4e49\u91cc\u51fd\u6570\u4f9d\u8d56\u662f\u6307\uff0c\u5728\u4e00\u4e2a\u5173\u7cfb R \u4e2d\uff0c\u5982\u679c\u5c5e\u6027\uff08\u7ec4\uff09Y \u7684\u503c\u662f\u7531\u5c5e\u6027\uff08\u7ec4\uff09X \u7684\u503c\u51b3\u5b9a\u7684\uff0c\u5c31\u79f0 Y \u5bf9 X \u6709\u51fd\u6570\u4f9d\u8d56\u3002\u8003\u8651\u5230\u672c\u8eab\u51fd\u6570\u7684\u5b9a\u4e49\u662f X \u4e2d\u7684\u5143\u7d20\u5728 Y \u4e2d\u6709\u552f\u4e00\u786e\u5b9a\u7684\u503c\uff0c\u90a3\u4e48\u8fd9\u91cc\u7684\u4f9d\u8d56\u5c31\u662f\u6307\uff0c\u4e24\u4e2a\u5143\u7d20\u5982\u679c\u5728 X \u4e2d\u7684\u503c\u4e00\u6837\uff0c\u90a3\u4e48\u5728 Y \u4e2d\u7684\u503c\u4e5f\u4e00\u6837\u3002
\u5f62\u5f0f\u5316\u5b9a\u4e49\uff1a\u8bbe \\(R(U)\\) \u662f\u5c5e\u6027\u96c6\u5408 \\(U={A_1, A_2, ..., A_n}\\) \u4e0a\u7684\u4e00\u4e2a\u5173\u7cfb\u6a21\u5f0f\uff0cX, Y \u662f U \u4e0a\u7684\u4e24\u4e2a\u5b50\u96c6\uff0c\u82e5\u5bf9 \\(R(U)\\) \u7684\u4efb\u4e00\u4e2a\u53ef\u80fd\u7684\u5173\u7cfb \\(r\\)\uff0c\\(r\\) \u4e2d\u4e0d\u5b58\u5728\u4e24\u4e2a\u5728 X \u4e2d\u5c5e\u6027\u503c\u76f8\u7b49\uff0c\u5728 Y \u4e2d\u5c5e\u6027\u503c\u4e0d\u7b49\u7684\u5143\u7ec4\u3002\u5373\u79f0\u4e3a\u201cX \u51fd\u6570\u51b3\u5b9a Y\u201d\u6216\u201cY \u51fd\u6570\u4f9d\u8d56 X\u201d\uff0c\u8ba1\u4f5c X -> Y\u3002
Armstrong \u516c\u7406\u7cfb\u7edf\u662f\u63cf\u8ff0\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u51fd\u6570\u4f9d\u8d56\u5173\u7cfb\u7684\u4e00\u7cfb\u5217 references\uff08\u63a8\u7406\u89c4\u5219\uff09\uff0c\u5728 1974 \u5e74\u7531 William W. Armstrong \u8bbe\u8ba1\u3002
Armstrong \u516c\u7406\u7cfb\u7edf\u6709\u4e09\u5927\u516c\u7406\uff08\u81ea\u53cd\u5f8b\uff0c\u589e\u5e7f\u5f8b\uff0c\u4f20\u9012\u5f8b\uff09\uff0c\u548c\u4e00\u4e9b\u5f15\u7406\u3002
\u516c\u7406
!!! \u5bf9\u4e0d\u8d77\uff0c\u6211\u662f\u61d2\u72d7\uff0c\u6211\u4e0d\u60f3\u6572 latex \u5199\u5f62\u5f0f\u5316\u5b9a\u4e49\u4e86\uff0c\u7528\u4eba\u8bdd\u7ed9\u5927\u5bb6\u8bb2\u5427\u3002
\u8bbe F \u4e3a R(U) \u7684\u4e00\u7ec4\u51fd\u6570\u4f9d\u8d56\uff0c\u8bb0\u4e3a R(U, F)\u3002
\u81ea\u53cd\u5f8b
\u5982\u679c\u4e00\u4e2a\u5c5e\u6027\u96c6\u662f\u53e6\u4e00\u4e2a\u5c5e\u6027\u96c6\u7684\u5b50\u96c6\uff0c\u90a3\u4e48\u8bf4\u540e\u8005\u51b3\u5b9a\u524d\u8005\u3002\u53ef\u4ee5\u53eb\u505a\uff0c\u5c5e\u6027\u96c6 X \u51b3\u5b9a\u5b83\u7684\u5c5e\u6027\u5b50\u96c6\u3002
\u589e\u5e7f\u5f8b
\u5982\u679c X -> Y \u5728 F \u8fd9\u4e2a\u51fd\u6570\u4f9d\u8d56\u96c6\u5408\u4e2d\uff0c\u53e6\u4e00\u5c5e\u6027\uff08\u7ec4\uff09Z \u662f\u5c5e\u6027\u96c6 U \u4e2d\u7684\u5143\u7d20\uff0c\u90a3\u4e48\u4ece F \u4e2d\u53ef\u4ee5\u63a8\u5bfc\u5f97\u51fa XZ \u51fd\u6570\u51b3\u5b9a YZ\u3002\u6709\u70b9\u50cf\u5728\u8bf4\u672c\u6765 X \u51b3\u5b9a Y\uff0c\u540e\u968f\u4fbf\u53d6\u4e00\u4e2a\u5c5e\u6027\u96c6 Z\uff0c\u5728\u4e24\u4fa7\u5206\u522b\u8fde\u63a5 X \u548c Y\uff0c\u7ed3\u679c XZ \u8fd8\u662f\u51b3\u5b9a YZ\u3002
\u4f20\u9012\u5f8b
\u82e5 X -> Y\uff0cY -> X\uff0c\u5219 X -> Z\u3002
\u5f15\u7406
!!! \u5b66\u4e0d\u52a8\u4e86\u5149\u62a5\u4e2a\u83dc\u540d\u5427
\u6b63\u5219\u8986\u76d6
"},{"location":"docs/1-cs/database/normalforms/#normal-form-6","title":"Normal Form \u8303\u5f0f\uff1a6 \u4e2a\u8303\u5f0f","text":"\u63a5\u4e0b\u6765\u6211\u4eec\u4ecb\u7ecd\u6570\u636e\u5e93\u8bbe\u8ba1\u7684\u516d\u5927\u8303\u5f0f\u3002\u5982\u524d\u6587\u6240\u8ff0\uff0c\u516d\u4e2a\u8303\u5f0f\u662f\u5bf9\u6570\u636e\u5e93\u5173\u7cfb\u5c5e\u6027\u5c42\u5c42\u9012\u8fdb\u3001\u8d8a\u6765\u8d8a\u4e25\u683c\u7684\u7ea6\u675f\u3002
\u7cbe\u7b80\u7248\u5982\u4e0b\uff08\u7528\u4e8e\u8003\u524d\u7a81\u51fb\uff09\uff1a
\u540d\u79f0 \u4ecb\u7ecd \u8303\u4f8b \u8303\u56f4 \u7b2c\u4e00\u8303\u5f0f 1NF \u5927\uff0c\u9010\u4e2a\u5305\u542b\u4e0b\u65b9\u7684 \u7b2c\u4e8c\u8303\u5f0f 2NF \u7b2c\u4e00\u8303\u5f0f 3NF Buckus-Codd NF \u7b2c\u4e94\u8303\u5f0f 5NF \u7b2c\u516d\u8303\u5f0f 6NF \u5c0f\uff0c\u9010\u4e2a\u88ab\u4e0a\u65b9\u7684\u5305\u542b\u63a5\u4e0b\u6765\u662f\u8be6\u7ec6\u4ecb\u7ecd\u3002
First Normal Form \u7b2c\u4e00\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u6ca1\u6709\u91cd\u590d\u7684\u5217\u3002
\u7b2c\u4e00\u8303\u5f0f\u7684\u542b\u4e49\uff1aatomicity \u539f\u5b50\u6027\u3002\u5373\u4e0d\u80fd\u518d\u7ee7\u7eed\u62c6\u5206\uff0c\u5c5e\u6027\u4e0d\u80fd\u518d\u5411\u4e0b\u62c6\u5206\u3002\u5f53\u4e00\u4e2a\u5173\u7cfb\u6a21\u5f0f R \u7684\u6240\u6709\u5c5e\u6027\u90fd\u662f atomic \u7684\uff0c\u8fd9\u4e2a\u5173\u7cfb\u6a21\u578b\u5c31\u662f\u7b2c\u4e00\u8303\u5f0f\u3002
\u6bd4\u5982\uff0cstring \u5e94\u5f53\u88ab\u5f53\u4f5c\u4e0d\u53ef\u5206\u5272\u7684\u3002\u6bd4\u5982 ZJU \u7684\u5b66\u53f7\u7b2c\u4e00\u4f4d\u770b\u672c\u79d1\u751f\u7814\u7a76\u751f\uff0c\u540e\u9762\u4e24\u4f4d\u770b\u5e74\u7ea7\uff0c\u4f46\u8fd9\u4e24\u4e2a\u4fe1\u606f\u5982\u679c\u9700\u8981\u662f\u5e94\u5f53\u88ab\u663e\u793a\u5730\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u800c\u4e0d\u662f\u9700\u8981\u7684\u65f6\u5019\u53bb\u5b66\u53f7\u4e2d\u5206\u6790\u67e5\u627e\u7684\u3002\u5982\u679c\u8fd9\u6837\u505a\uff0c\u76f8\u5f53\u4e8e\u628a\u89e3\u6790\u5b57\u7b26\u4e32\u7684\u5de5\u4f5c\u7ed9\u4e86\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u5b57\u7b26\u4e32\u67e5\u627e\u662f\u4e00\u4e2a\u6bd4\u6570\u636e\u5e93\u67e5\u8be2\u6162\u7684\u6b65\u9aa4\uff0c\u8fd9\u6837\u7ed3\u679c\u5f88\u4e0d\u597d\u3002
\u7b2c\u4e00\u8303\u5f0f\u6ca1\u6709\u6d88\u9664\u5197\u4f59\uff0c\u5b83\u6d88\u9664\u7684\u662f\u5217\u91cc\u91cd\u590d\u7684\u4fe1\u606f\u3002\u5b83\u628a\u8868\u683c\u91cc\u5197\u4f59\u7684\u5217\u62c6\u5206\u6210\u4e86\u591a\u4e2a\u884c\u3002
Second Normal Form \u7b2c\u4e8c\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u5b9e\u4f53\u7684\u5c5e\u6027\u5b8c\u5168\u4f9d\u8d56\u4e8e\u4e3b\u5173\u952e\u5b57\u3002
\u7b2c\u4e8c\u8303\u5f0f\u662f\u57fa\u4e8e fully functional dependency \u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u7684\u3002\u610f\u601d\u662f\uff0c\u7b2c\u4e8c\u8303\u5f0f\u7528\u4e8e\u90a3\u4e9b\u6709\u590d\u5408\u952e\u503c\u7684\u5173\u7cfb\uff0c\u6bd4\u5982\u5f53\u4e00\u4e2a\u5173\u7cfb\u7684\u4e3b\u952e\u662f\u591a\u4e2a\u5217\u7684\u590d\u5408\u65f6\u3002
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u672c\u6765\u5c31\u6ca1\u6709\u590d\u5408\u7684\u5c5e\u6027\uff0c\u90a3\u672c\u6765\u5c31\u662f 2NF \u7684\u3002
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u6709\u590d\u5408\u7684\u5c5e\u6027\uff0c\u6bd4\u5982 AB -> C\uff0c\u90a3\u4e48 2NF \u4f1a\u628a AB \u62c6\u5f00\u3002
TODO\uff1a\u600e\u4e48\u62c6\u5462
Third Normal Form \u7b2c\u4e09\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u4e0d\u4f9d\u8d56\u4e8e\u5176\u5b83\u975e\u5c5e\u6027\u3002
A relation is in the third normal form, if there is no transitive dependency for non-prime attributes as well as it is in the second normal form.
\u5982\u679c\u4e00\u4e2a\u5173\u7cfb\u5728\u7b2c\u4e09\u8303\u5f0f\u91cc\uff0c\u5b83\u5e94\u5f53\u5bf9\u4e8e\u975e\u4e3b\u952e\u5c5e\u6027\u6ca1\u6709\u4f20\u9012\u4f9d\u8d56\uff0c\u5e76\u4e14\u5728\u7b2c\u4e8c\u8303\u5f0f\u91cc\u3002
Boyce-Cudd Normal Form BCNF\u8303\u5f0f
\u7b80\u800c\u8a00\u4e4b\uff1a\u6bcf\u4e2a\u4f9d\u8d56\u5173\u7cfb\u4e2d\uff0c\u88ab\u4f9d\u8d56\u7684\u90fd\u662f\u4e3b\u952e
A relation is in BCNF if it is already 3NF, and if for any functional dependency say P->Q, P should be a super key.
\u6bd4\u8f83 3NF \u548c BCNF \u7684\u533a\u522b\uff1a
3NF BCNF \u4e0d\u5e94\u6709 \u5f31 \u5f3a \u51cf\u5c11\u4e86\u5197\u4f59 \u4fdd\u7559\u4e86\u6240\u6709\u51fd\u6570\u4f9d\u8d56 \u53ef\u80fd\u6709\u7684\u51fd\u6570\u4f9d\u8d56\u6ca1\u6709\u88ab\u4fdd\u5b58Fifth Normal Form \u7b2c\u4e94\u8303\u5f0f
Sixth Normal Form \u7b2c\u516d\u8303\u5f0f
\u505a\u9898\u7684\u65f6\u5019\u4f3c\u4e4e\u53ea\u4f1a\u8ba9\u5199\uff1a\u7b26\u5408 1NF \u7684\uff0c3NF \u7684\uff0cBCNF \u7684\u4e09\u79cd\u5206\u89e3\u3002
"},{"location":"docs/1-cs/database/normalforms/#_4","title":"\u51fd\u6570\u4f9d\u8d56","text":""},{"location":"docs/1-cs/database/normalforms/#_5","title":"\u95ed\u5305","text":""},{"location":"docs/1-cs/database/normalforms/#_6","title":"\u6700\u5c0f\u8986\u76d6","text":""},{"location":"docs/1-cs/database/normalforms/#references","title":"References","text":":material-circle-edit-outline: \u7ea6 1202 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
\u67e5\u8be2\u5904\u7406\u7684\u57fa\u672c\u6b65\u9aa4\u662f\uff1a\uff081\uff09Parsing and translation \u89e3\u6790\u548c\u7ffb\u8bd1 \uff082\uff09Optimization \u4f18\u5316 \uff083\uff09Evaluation \u8bc4\u4f30\u3002
\u6211\u4eec\u6700\u5173\u6ce8\u7684\u5176\u5b9e\u662f\u4f18\u5316\u6b65\u9aa4\u3002\u4f18\u5316\u4e00\u6b65\u662f\u57fa\u4e8e\u4ee5\u4e0b\u5047\u8bbe\uff1a\u4e00\u79cd SQL \u67e5\u8be2\u53ef\u80fd\u5bf9\u5e94\u4e86\u591a\u79cd\u7b49\u4ef7\u7684\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u4f30\u8ba1\u6bcf\u79cd\u4f18\u5316\u65b9\u6cd5\u7684 cost \u6765\u8bc4\u4f30\u65b9\u6cd5\u7684\u597d\u574f\u3002\u67e5\u8be2\u4f18\u5316\u4f1a\u9009\u62e9\u6700\u8282\u7ea6\u7684\u65b9\u5f0f\u8fdb\u884c\u67e5\u8be2\u3002
\u90a3\u4e48\u95ee\u9898\u5c31\u89c4\u7ea6\u6210\u4e86\u4ece\u6240\u6709\u7b49\u4ef7\u7684\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u4e2d\uff0c\u9009\u62e9 cost \u6700\u5c0f\u7684\u4e00\u4e2a\u3002\u90a3\u4e48\u95ee\u9898\u5c31\u53d8\u6210\u4e86\u5982\u4f55\u8ba1\u7b97 cost\uff01
Cost is generally measured as total elapsed time for answering query. Many factors contribute to the time cost: disk access + CPU + network communication
. \u4f46\u662f\u524d\u9762\u8ba8\u8bba\u8fc7\uff0c\u4e00\u4e2a\u67e5\u8be2\u88ab\u6267\u884c\u7684\u65f6\u5019\u9700\u8981\u88ab\u52a0\u8f7d\u5230\u78c1\u76d8\u4e0a\uff0c\u800c\u78c1\u76d8\u8bfb\u5199\u975e\u5e38\u6162\uff1bCPU \u65f6\u95f4\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\uff1b\u53ea\u8981\u4e0d\u662f\u7f51\u7edc\u5e94\u7528\u5c31\u4e0d\u7528\u7ba1\u7f51\u7edc\u4f20\u8f93\u5f00\u9500\u3002\u6240\u4ee5\u76ee\u524d\u6211\u4eec\u5173\u6ce8\u7684 cost \u6700\u5927\u7684\u6765\u6e90\u5c31\u662f\u78c1\u76d8\u8bbf\u95ee\u65f6\u95f4\uff0c\u5176\u4e2d\u5305\u542b seek, block read, block write \u7684\u7528\u65f6\u3002\u56e0\u6b64\u5b9a\u4e49\u4ee5\u4e0b cost \u8ba1\u7b97\u65b9\u6cd5\uff1a
\u5728 B \u4e2a block \u4e2d\u67e5\u8be2 S \u6b21\u7684\u65f6\u95f4 = B * \u8f6c\u79fb\u5230\u4e00\u4e2a block \u7684\u65f6\u95f4 + S * \u4e00\u6b21\u67e5\u8be2\u7684\u65f6\u95f4\u3002
\u800c\u67e5\u8be2\u4e2d\uff0c\u8bfb\u5199\u8017\u65f6\u66f4\u591a\uff0c\u5176\u4e2d\u5199\u6bd4\u8bfb\u66f4\u8017\u65f6\u3002\u6240\u4ee5\u6211\u4eec\u5e0c\u671b\u67e5\u627e\u548c\u67e5\u8be2\u7684\u65f6\u95f4\u90fd\u66f4\u5c11\u3002
\uff08TODO\uff1a\u8fd9\u91cc\u8ba1\u7b97\u7684\u65f6\u5019\u8981\u57fa\u4e8e\u4e24\u4e2a\u5047\u8bbe\uff0ccost \u4f9d\u8d56\u4e8e\u4e3b\u5b58\u4e2d\u7f13\u51b2\u533a\u7684\u5927\u5c0f\uff0c\u66f4\u591a\u7684\u5185\u5b58\u53ef\u4ee5\u51cf\u5c11 disk access\uff1b\u53e6\u5916\u901a\u5e38\u8003\u8651\u6700\u574f\u7684\u60c5\u51b5\uff0c\u5373\u4e3b\u5b58\u53ea\u63d0\u4f9b\u6700\u5c11\u7684\u5185\u5b58\u6765\u5b8c\u6210\u67e5\u8be2\u5de5\u4f5c\uff09
\u63a5\u4e0b\u6765\u6765\u4f30\u8ba1\u5173\u7cfb\u4ee3\u6570\u5404\u4e2a\u64cd\u4f5c\u7684 cost
Select \u9009\u62e9\u7684 cost \u8ba1\u7b97
\u6709\u4e09\u79cd select \u7684\u7b97\u6cd5
\u7ebf\u6027\u641c\u7d22
\u53bb\u4f9d\u6b21\u67e5\u8be2\u6bcf\u4e2a block \u5224\u65ad\u662f\u5426\u6ee1\u8db3\u67e5\u8be2\u6761\u4ef6\u3002
\u7d22\u5f15\u641c\u7d22
Primary index, equality on key \u641c\u7d22\u4e00\u6761\u8bb0\u5f55
Primary index, equality on non-key \u9700\u8981\u641c\u7d22\u591a\u6761\u8bb0\u5f55
Secondary index \u4e8c\u7ea7\u7d22\u5f15
Sort \u6392\u5e8f\u7684 cost \u4f30\u8ba1
sort \u64cd\u4f5c\u4e00\u822c\u4f7f\u7528\u5916\u90e8\u5f52\u5e76\u6392\u5e8f\u3002\u5bf9\u4e8e\u4e00\u4e2a\u5927\u5c0f\u4e3a M \u7684\u5185\u5b58\uff0cb_r \u8868\u793a block \u7684\u6570\u91cf\u3002sort \u5206\u4e3a\u4ee5\u4e0b\u4e24\u4e2a\u6b65\u9aa4\uff1a(1) create sorted runs\uff0c\u6570\u636e\u4ece\u78c1\u76d8\u8bfb\u5165\u5185\u5b58\u4e2d\uff0c\u56e0\u4e3a\u5185\u5b58\u5927\u5c0f\u662f M\uff0c\u6bcf\u6b21\u80fd\u5904\u7406 M \u4e2a\u6570\u636e\u9879 (2) merge the runs\u3002
\u9700\u8981\u7684 merge pass \u7684\u603b\u6570 \\(\\lceil log_{M-1}(b_r/M) \\rceil\\)\u3002
\u521b\u5efa\u548c\u6bcf\u6b21 run \u7684\u8fc7\u7a0b\u4e2d disk access \u7684\u6570\u91cf 2br\u3002
\u5916\u90e8\u6392\u5e8f\u4e2d\u603b\u7684 disk access \u6b21\u6570 \\((2\\lceil log_{M-1}(b_r/M) \\rceil+1)b_r\\)
Join \u8fde\u63a5\u7684 cost \u4f30\u8ba1
\u4ee5\u4e0b\u6709\u51e0\u79cd\u5b9e\u73b0 join \u7684\u7b97\u6cd5 (1) nested-loop join (2) block nested-loop join (3) indexed nested-loop join (4) merge-join (5) hash-join\u3002
nested-loop join For each tuple in the outer relation, scan the entire inner relation to find all matching tuples.
\u8ba1\u7b97 theta-join \u8868\u8fbe\u5f0f\uff1a
for each tuple tr in sr do begin\n for each tuple ts in s do begin\n test pair (tr, ts) to see if they satisfy the join condition\n
r is called the outer relation and s the inner relation of the join.
block nested-loop join
Similar to the nested-loop join, but processes the relations in block rather than tuple by tuple to reduce the number of I/O operations.
for each block br of r do begin\n for each block bs of s do begin\n for each tuple tr in br do begin\n for each tuple ts in bs do begin\n check if (tr, ts) satisfy the join condition\n if they do, add tr\u00b7ts to the result\n end\n end\n end\nend\n
\u6700\u574f\u7684\u60c5\u51b5\uff1a block transfer b_r * b_s + b_r
\u57fa\u7840\u60c5\u51b5\uff1a
index nested-loop join
merge-join Requires both relations to be sorted on the join key. Merges the sorted relations by iterating through them in parallel.
hash join
Uses a hash table to partition the tuples of one relation based on the join key, then probes the hash table with the tuples of the other relation.
\u5bf9\u6bd4\uff1a
Nested-loop Join: Simple but inefficient for large datasets due to \ud835\udc42 ( \u2223 \ud835\udc45 \u2223 \u00d7 \u2223 \ud835\udc46 \u2223 ) O(\u2223R\u2223\u00d7\u2223S\u2223) complexity. Block Nested-loop Join: Optimized version of nested-loop join that processes blocks to reduce I/O operations. Merge Join: Efficient for sorted relations, with complexity dominated by the sort operations. Hash Join: Very efficient for large datasets, especially when one relation can fit into memory, with \ud835\udc42 ( \u2223 \ud835\udc45 \u2223 + \u2223 \ud835\udc46 \u2223 ) O(\u2223R\u2223+\u2223S\u2223) complexity assuming good hashing.
Duplicated Deletion \u91cd\u590d\u6d88\u9664
\u6392\u5e8f\u548c\u6295\u5f71\u53ef\u4ee5\u6d88\u9664\u91cd\u590d
\u8003\u5f97\u4e0d\u591a\u3002
Aggregation \u805a\u5408
\u4e5f\u53ef\u4ee5\u7528\u6392\u5e8f\u6216\u6295\u5f71\u6765\u505a\u3002
"},{"location":"docs/1-cs/database/query/#query-optimization","title":"Query Optimization \u67e5\u8be2\u4f18\u5316","text":"\u5bf9\u7ed9\u5b9a\u67e5\u8be2\uff0c\u4f18\u5316\u7684\u65b9\u6cd5\u6709\uff1a
Equivalent expressions \u7b49\u4ef7\u8868\u8fbe\u5f0f
\u8fd9\u79cd\u5c5e\u4e8e\u903b\u8f91\u4f18\u5316\uff0c\u8bbe\u8ba1\u5173\u7cfb\u4ee3\u6570\u8868\u8fbe\u5f0f\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u505a\u6570\u5b66\u9898\u65f6\u8ba1\u7b97 a*b + c*b\uff0c\u4f18\u5316\u6210 (a+c) * b\uff0c\u5c31\u50cf\u4e00\u79cd\u903b\u8f91\u4f18\u5316\u3002
\u5b83\u4e5f\u53eb Cost based optimization.
\u5728\u6570\u636e\u5e93\u4e2d\u539f\u5219\u4e00\u822c\u662f\u5f80\u5f80\u5148\u53bb\u505a\u9009\u62e9\u548c\u6295\u5f71\uff08\u5df2\u7ecf\u5bf9\u521d\u59cb\u8868\u505a\u8fc7\u4e00\u6b21\u9009\u62e9\uff0c\u51cf\u5c11\u4e86\u5f88\u591a\u8bb0\u5f55\uff09\uff0c\u518d\u8fde\u63a5\u3002
Different algorithms for each operation \u76f8\u540c\u7b97\u5b50\u7684\u4e0d\u540c\u8868\u8fbe\u5f0f
\u8fd9\u79cd\u5c5e\u4e8e\u7269\u7406\u5c42\u9762\u7684\u4f18\u5316\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u505a\u6570\u5b66\u9898\u65f6\u4e0d\u518d\u7528\u7b14\u7b97\uff0c\u800c\u662f\u7528\u8ba1\u7b97\u5668\u7b97\uff0c\u5c31\u50cf\u662f\u4e00\u79cd\u7269\u7406\u5c42\u9762\u7684\u4f18\u5316\u3002
\u5b83\u4e5f\u53eb Transformation based optimization.
!!! TODO \u4e0b\u9762\u7684\u51e0\u4e2a\u4e13\u9898\u7a76\u7adf\u662f\u4ec0\u4e48\u903b\u8f91\u6392\u7684
"},{"location":"docs/1-cs/database/query/#equivalent-expressions","title":"Equivalent expressions","text":""},{"location":"docs/1-cs/database/query/#statistics-for-cost-estimation","title":"Statistics for Cost Estimation","text":""},{"location":"docs/1-cs/database/transaction/","title":"Transaction \u4e8b\u52a1","text":":material-circle-edit-outline: \u7ea6 1318 \u4e2a\u5b57 :fontawesome-solid-code: 7 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/1-cs/database/transaction/#_1","title":"\u7b80\u4ecb","text":"\u4e8b\u52a1\u662f\u7a0b\u5e8f\u6267\u884c\u7684\u57fa\u672c\u5355\u4f4d\uff0c\u4f1a\u5f15\u8d77\u4e00\u4e9b\u6570\u636e\u9879\u7684\u66f4\u65b0\u3002\u6211\u4eec\u5b9a\u4e49\u4e8b\u52a1\u6709\u4ee5\u4e0b\u56db\u4e2a\u57fa\u672c\u5c5e\u6027\uff1a
Atomicity \u539f\u5b50\u6027 \u4e8b\u52a1\u662f non-or-all \u7684\uff0c\u5373\u6240\u6709\u6b65\u9aa4\u8981\u4e48\u5168\u90e8\u6267\u884c\u540e commit\uff0c\u8981\u4e48\u5c31 rollback \u56de\u6eda\u5230\u6ca1\u505a\u7684\u72b6\u6001\u3002
Durability \u6301\u4e45\u6027 \u4e8b\u52a1\u5b8c\u6210\u540e\u66f4\u65b0\u6570\u636e\uff0c\u5373\u4f7f\u8f6f\u786c\u4ef6\u51fa\u4e86\u95ee\u9898\uff0c\u66f4\u65b0\u7684\u6570\u636e\u4e5f\u5fc5\u987b\u5b58\u5728\u3002
Consistency \u4e00\u81f4\u6027 \u5b9a\u4e49\u8bf4\uff1a\u4e8b\u52a1\u5fc5\u987b\u4f7f\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u3002\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff0c\u5982\u679c\u6709\u4e00\u4e2a\u4fdd\u5b58\u5b58\u6b3e\u7684\u6570\u636e\u5e93\uff0c\u4e00\u5f00\u59cb\u5b58\u53d6\u8bb0\u5f55\u52a0\u8d77\u6765\u7ed3\u679c\u662f\u7b49\u4e8e\u603b\u6570\u7684\uff0c\u90a3\u4e48\u4e8b\u52a1\u6267\u884c\u5b8c\uff0c\u8fd8\u8981\u4fdd\u6301\u6240\u6709\u8bb0\u5f55\u5728\u8fd9\u4e2a\u52a0\u8d77\u6765\u7b49\u4e8e\u603b\u6570\u7684\u72b6\u6001\u3002
Isolation \u72ec\u7acb\u6027 \u5f53\u591a\u4e2a\u7528\u6237\u5e76\u53d1\u8bbf\u95ee\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u6570\u636e\u5e93\u4e3a\u6bcf\u4e2a\u7528\u6237\u5f00\u542f\u7684\u4e8b\u52a1\uff0c\u4e0d\u80fd\u88ab\u5176\u5b83\u4e8b\u52a1\u7684\u64cd\u4f5c\u6240\u5e72\u6270\u3002
\u4e3a\u4e86\u4fdd\u8bc1\u4e8b\u52a1\u7684\u8fd9\u4e9b\u5c5e\u6027\uff0c\u4e00\u822c\u4e3b\u8981\u9700\u8981\u8003\u8651\u4e24\u4e2a\u95ee\u9898\uff1a
\u4e8e\u662f\uff0c\u6211\u4eec\u8003\u8651\u628a\u4e00\u4e2a\u4e8b\u52a1\u5206\u4e3a\u591a\u4e2a\u72b6\u6001\u6765\u5b8c\u6210\u3002\u4e00\u4e2a\u4e8b\u52a1\u6709\u4e94\u79cd\u72b6\u6001\uff1a
\u4e00\u4e2a\u8f6c\u5316\u7684\u72b6\u6001\u56fe\u5982\u4e0b
graph LR\n\nA[[active]] --> P[[Partially commited]]\nP --(single step)--> C[[commited]]\nA --> F[[failed]]\nP --> F\nF --(single step)--> B[[aborted]]\n
\u6211\u4eec\u4e3b\u8981\u9700\u8981\u4fdd\u8bc1 partially commited \u5230 commited\uff0c\u548c failed \u5230 abort\uff0c\u8fd9\u4e24\u6b65\u90fd\u662f\u539f\u5b50\u6027\u7684\u3002
"},{"location":"docs/1-cs/database/transaction/#_2","title":"\u8c03\u5ea6","text":"\u8fd9\u6837\u5c31\u6d89\u53ca\u5230\u8c03\u5ea6\u6982\u5ff5\u3002Schedules \u8c03\u5ea6\u662f\u4e00\u7cfb\u5217\u7528\u4e8e\u6307\u5b9a\u5e76\u53d1\u4e8b\u52a1\u6267\u884c\u987a\u5e8f\u7684\u6307\u4ee4\u3002\u5b83\u9700\u8981\uff081\uff09\u5305\u542b\u4e8b\u52a1\u4e2d\u7684\u6240\u6709\u6307\u4ee4\uff0c\uff082\uff09\u4fdd\u8bc1\u5355\u4e2a\u4e8b\u52a1\u4e2d\u7684\u6307\u4ee4\u7684\u76f8\u5bf9\u987a\u5e8f\u3002
\u5982\u679c\u4e8b\u52a1\u662f\u826f\u6784\u7684\u4e14\u662f\u4e24\u9636\u6bb5\u7684\uff0c\u90a3\u4e48\u4efb\u4f55\u4e00\u4e2a\u5408\u6cd5\u7684\u8c03\u5ea6\u90fd\u662f\u9694\u79bb\u7684 \u5177\u4f53\u7684\u6570\u5b66\u63a8\u5230\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u7167<<\u4e8b\u52a1\u5904\u7406:\u6982\u5ff5\u4e0e\u6280\u672f>>\u8fd9\u672c\u4e66\u76847.5.8.2\u8282\u6b64\u4e66\u4e43\u662f\u5173\u4e8e\u6570\u636e\u5e93\u4e8b\u52a1\u7684\u5723\u7ecf\uff0c\u65e0\u9700\u89e3\u91ca(\u4e2d\u6587\u7ffb\u8bd1\u867d\u7136\u6666\u6da9\uff0c\u4e5f\u80fd\u575a\u6301\u8bfb\u4e0b\u53bb,\u5f3a\u70c8\u63a8\u8350
"},{"location":"docs/1-cs/database/transaction/#_3","title":"\u4e32\u884c","text":"\u5982\u679c\u4e00\u4e2a\u8c03\u5ea6\u4e0e\u4e00\u4e2a\u4e32\u884c\u8c03\u5ea6\uff08serial\uff09\u7b49\u4ef7\uff0c\u90a3\u4e48\u79f0\u8fd9\u4e2a\u8c03\u5ea6\u662f serializable \u53ef\u4e32\u884c\u5316\u7684\u3002
\u53ef\u4e32\u884c\u5316\u5efa\u7acb\u5728\u4e00\u4e2a\u5047\u8bbe\u4e0a\uff1a\u4e8b\u52a1\u4e0d\u4f1a\u7834\u574f\u6570\u636e\u5e93\u7684\u4e00\u81f4\u6027\uff0c\u53ea\u8003\u8651\u6709\u8bfb\u5199\u4e24\u79cd\u64cd\u4f5c\u3002
\u6211\u4eec\u8bf4\u4e00\u4e2a\u8c03\u5ea6\u662f conflict serializable \u51b2\u7a81\u53ef\u4e32\u884c\u5316\u7684\uff0c\u5f53\uff1a
"},{"location":"docs/1-cs/database/transaction/#-","title":"-","text":""},{"location":"docs/1-cs/database/transaction/#_4","title":"\u5e76\u53d1\u5904\u7406","text":"\u540c\u65f6\u6267\u884c\u591a\u4e2a\u4e8b\u52a1\uff0c\u53ef\u4ee5\u63d0\u9ad8\u8fd0\u884c\u7684\u6548\u7387\uff0c\u51cf\u5c11\u5e73\u5747\u6267\u884c\u65f6\u95f4\u3002
\u5e76\u53d1\u63a7\u5236\u7684\u5904\u7406\u673a\u5236\u662f\uff0c\u8ba9\u5e76\u53d1\u7684\u4e8b\u52a1\u72ec\u7acb\u8fdb\u884c\uff0c\u63a7\u5236\u5e76\u53d1\u7684\u4e8b\u52a1\u4e4b\u95f4\u7684\u4ea4\u6d41\u3002
"},{"location":"docs/1-cs/database/transaction/#_5","title":"\u6545\u969c\u6062\u590d","text":"\u6545\u969c\u7684\u79cd\u7c7b\u6709\uff1a
database application \u903b\u8f91\u9519\u8bef\uff1a\u6bd4\u5982\u4e0d\u6ee1\u8db3\u6570\u636e\u5e93\u7ea6\u675f\u6761\u4ef6\uff08\u4e3b\u952e\uff09\uff0c\u7cfb\u7edf\u9519\u8bef\u6b7b\u9501\u3002
DBMS
Database
checkpoint
Recovery algorithms are techniques to ensure database consistency and transaction atomicity and durability despite failures. \u6545\u969c\u6062\u590d\u7b97\u6cd5\u5c31\u662f\u4fdd\u969c\u6570\u636e\u5e93 ACD\uff08\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6ca1\u6709 I\uff09\u7279\u6027\u7684\u65b9\u6cd5\u3002
\u6545\u969c\u6062\u590d\u7b97\u6cd5\u6709\u4e24\u4e2a\u90e8\u5206\uff1a
\u6545\u969c\u6062\u590d\u7b97\u6cd5\u5177\u6709 Idempotent(\u5e42\u7b49\u6027): An recovery algorithm is said to be idempotent if executing it several times gives the same result as executing it once. \u610f\u601d\u662f\u7b97\u6cd5\u6062\u590d\u591a\u6b21\u7684\u6548\u679c\u662f\u4e00\u6837\u7684\uff0c\u56e0\u4e3a\u6062\u590d\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4e5f\u53d1\u751f crash\u3002
Log-based Recovery \u57fa\u4e8e\u65e5\u5fd7\u7684\u6062\u590d\u6cd5
log records \u65e5\u5fd7\u8bb0\u5f55\uff1a
\u65e5\u5fd7\u8bb0\u5f55\u662f\u8bb0\u5f55\u5728 stable storage\uff08\u7a33\u5b9a\u5b58\u50a8\u5668\uff09\u4e0a\u7684\uff0c\u4e00\u7cfb\u5217\u8bb0\u5f55\u6570\u636e\u5e93\u600e\u6837\u88ab\u6210\u529f\u4fee\u6539\u7684\u4fe1\u606f\u3002log \u7531\u4e00\u4e32 log records \u7ec4\u6210\u3002\u5b83\u6709\u4ee5\u4e0b\u51e0\u79cd\u683c\u5f0f
checkpoint \u4e4b\u95f4\u7684\u95f4\u9694\u5e94\u5f53\u901a\u8fc7\u65e5\u5fd7\u91cf\u6765\u786e\u5b9a\u3002
\u4e24\u79cd\u7b56\u7565 - Redo:
In the redo phase, the system replays updates of all transactions by scaning the log forward from the last checkpoint. The log records that are replayed include log records for transactions that were rolled back befored system crash, and those that had not committed when the system crash occurred. \n\u5728 redo \u9636\u6bb5\u91cc\uff0c\u7cfb\u7edf\u6839\u636e\u91cd\u65b0\u626b\u63cf\u4e0a\u4e00\u6b21 checkpoint \u4e4b\u540e\u7684\u6240\u6709\u8bb0\u5f55\uff0c\u91cd\u65b0\u6267\u884c\u4e0a\u4e00\u6b21 checkpoint \u4e4b\u540e\u7684\u6240\u6709 transaction\u3002\u8fd9\u91cc\u7684 log \u8bb0\u5f55\u5305\u62ec\u5728 crash \u4e4b\u524d\u6b63\u5728\u56de\u6eda\u7684\u90a3\u4e9b\u8bb0\u5f55\uff0c\u4e5f\u5305\u62ec crash \u65f6\u8fd8\u6ca1\u6709\u63d0\u4ea4\u7684\u90a3\u4e9b\u8bb0\u5f55\u3002Redo \u9636\u6bb5\u4e5f\u4f1a\u5224\u65ad\u6240\u6709 transaction \u662f\u5426\u5b8c\u6210\u4e86\uff0c\u662f\u5426\u9700\u8981 roll back\u3002\u6ca1\u5b8c\u6210\u7684 transaction \u4f1a\u88ab\u6807\u8bb0\u4e3a\u6216\u8005 \\<Ti abort\\> \u6216\u8005 \\<Ti commit\\> \u7684\u6807\u8bb0\u3002\u5177\u4f53\u6765\u8bf4\u6267\u884c\u7684\u6b65\u9aa4\u6709\u4e0b\u9762\u51e0\u6761\uff1a\n\n-\n
:material-circle-edit-outline: \u7ea6 14 \u4e2a\u5b57
"},{"location":"docs/1-cs/database/xml/#_1","title":"\u5b9a\u4e49\u548c\u57fa\u672c\u7ed3\u6784","text":""},{"location":"docs/1-cs/database/xml/#document-schema","title":"Document Schema","text":""},{"location":"docs/1-cs/database/xml/#_2","title":"\u67e5\u8be2","text":""},{"location":"docs/1-cs/oop/course/","title":"Courses \u542c\u8bfe","text":":material-circle-edit-outline: \u7ea6 1567 \u4e2a\u5b57 :fontawesome-solid-code: 91 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f
"},{"location":"docs/1-cs/oop/course/#cs106bcs106l","title":"\u5173\u4e8eCS106B\u548cCS106L","text":"CS106B\u504f\u7b80\u5355\uff0c\u76f8\u5f53\u4e8eZJU\u7684\u6570\u636e\u7ed3\u6784+C++\u7684STL\u7528\u6cd5\u4e00\u5757\u8bb2\uff0c\u53e6\u5916\u518d\u8bb2\u4e00\u4e9bFDS\u7684\u7b97\u6cd5\u3002 CS106L\u662f\u4e13\u95e8\u8bb2C++\u8fdb\u9636\u7279\u6027\u7684\u3002
\u56e0\u4e3a\u5728\u542cCS106B\u4e4b\u524d\u5b66\u8fc7FDS\uff0cCS106B\u82b1\u4e00\u5929\u901f\u901a\u4e86\u4e00\u4e0b\uff0c\u91cd\u590d\u5185\u5bb9\u6709\u70b9\u591a\uff0c\u622a\u4e0b\u4e86\u4e00\u5e45\u56fe\u3002
CS106L\u63d0\u4f9b\u7684C++\u5b66\u4e60\u8def\u7ebf\u56fe
"},{"location":"docs/1-cs/oop/course/#zju","title":"ZJU\u8bfe\u7a0b","text":""},{"location":"docs/1-cs/oop/course/#_1","title":"\u8bfe\u7a0b\u53c2\u8003\u8d44\u6599","text":"CPP Reference Standard C++ CppCon
"},{"location":"docs/1-cs/oop/course/#_2","title":"\u4e0a\u8bfe\u5fc3\u5f97","text":"\u6211\u8ddf\u7684\u662fcx\u8001\u5e08\u7684\u73ed\uff0c\u5e94\u8be5\u662f\u6559\u5f97\u6700\u597d\u7684\u4e00\u6863orz \u4f46\u662f\u4e0a\u8bfe\u5185\u5bb9\u4ecd\u4e0d\u80fd\u8986\u76d6\u4f5c\u4e1a\u548c\u671f\u672b\u7684\u5185\u5bb9\uff0c\u89c9\u5f97\u542c\u8bfe\u5185\u5bb9\u53ea\u80fd\u8d77\u5230\u4e00\u4e2a\u9aa8\u67b6\u4f5c\u7528\uff0c\u8bfe\u540e\u9700\u8981\u82b1\u4e0a\u8bfe2\u81f33\u500d\u7684\u65f6\u95f4\u81ea\u5b66\u81ea\u5df1\u6574\u7406\u7b14\u8bb0\uff0c\u591a\u8bfb\u591a\u5199\u4ee3\u7801\uff0c\u4e0d\u7136\u671f\u672b\u4f1a\u9047\u5230\u6ca1\u89c1\u8fc7\u7684\u7279\u6027\uff0c\u4f1a\u6709\u70b9\u60e8orz\uff08\u50cf\u6211\u4e00\u6837\uff09
"},{"location":"docs/1-cs/oop/course/#_3","title":"\u9762\u5411\u5bf9\u8c61\u56db\u5927\u7279\u6027","text":"class Name\n{\n public:\n public_data;\n public_functions;\n protected:\n protected_data;\n protected_functions;\n private:\n private_data;\n private_functions;\n}\n
\u8fd4\u56de\u7c7b\u578b \u7c7b\u540d::\u6210\u5458\u51fd\u6570\u540d\uff08\u53c2\u6570\u8868\uff09 { // \u51fd\u6570\u4f53 }
"},{"location":"docs/1-cs/oop/course/#_9","title":"\u5185\u8054\u51fd\u6570\u548c\u5916\u8054\u51fd\u6570","text":"\u53ef\u4ee5\u628a\u76f8\u540c\u6570\u636e\u7ed3\u6784\u548c\u76f8\u540c\u64cd\u4f5c\u96c6\u7684\u5bf9\u8c61\u770b\u4f5c\u5c5e\u4e8e\u540c\u4e00\u7c7b\u3002\u5bf9\u8c61\u662f\u7c7b\u7684\u5b9e\u4f8b\u3002
"},{"location":"docs/1-cs/oop/course/#_11","title":"\u5bf9\u8c61\u7684\u5b9a\u4e49","text":"\u5bf9\u8c61\u540d.\u6570\u636e\u6210\u5458\u540d\uff08\u662f \u5bf9\u8c61\u540d.\u7c7b\u540d::\u6210\u5458\u540d \u7684\u7f29\u5199\uff09 \u5bf9\u8c61\u540d.\u6210\u5458\u51fd\u6570\u540d\uff08\u53c2\u6570\u8868\uff09
class Sample\n{\npublic:\nint k;\nint geti(){return i;}\nint getj(){return j;}\nint getk(){return k;}\nprivate:\nint i;\nprotected:\nint j;\n};\nint main()\n{\nSample a;\na.i; // \u975e\u6cd5\na.j: // \u975e\u6cd5\na.k; // \u5408\u6cd5\n}\n
"},{"location":"docs/1-cs/oop/course/#_13","title":"\u7c7b\u7684\u4f5c\u7528\u57df","text":"\u7c7b\u7684\u6784\u9020\u51fd\u6570\u662f\u7c7b\u7684\u4e00\u4e2a\u7279\u6b8a\u6210\u5458\u51fd\u6570\uff0c\u6ca1\u6709\u8fd4\u56de\u7c7b\u578b\uff08\u4e0d\u662fvoid\uff09\uff0c\u53ef\u4ee5\u6709\u53c2\u6570\uff0c\u51fd\u6570\u540d\u548c\u7c7b\u540d\u4e00\u6837\u3002\u5f53\u521b\u5efa\u7c7b\u7684\u4e00\u4e2a\u65b0\u5bf9\u8c61\u65f6\uff0c\u81ea\u52a8\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5b8c\u6210\u521d\u59cb\u5316\u5de5\u4f5c\u3002
"},{"location":"docs/1-cs/oop/course/#namespace","title":"Namespace","text":""},{"location":"docs/1-cs/oop/course/#namespace_1","title":"\u4ec0\u4e48\u662fnamespace\uff1f","text":"\u662f\u5355\u4e00\u7684\u5168\u5c40\u540d\u5b57\u7a7a\u95f4\u3002\u9632\u6b62\u5728\u4e00\u4e2a\u7a7a\u95f4\u4e2d\u76f8\u540c\u7684\u540d\u5b57\u5f15\u8d77\u51b2\u7a81\u3002 \u4f8b\u5b50\uff1a
namespace myown1\n{\nstring user_name = \"myown1\";\n}\nnamespace myown2\n{\nstring user_name = \"myown2\";\n}\nint main()\n{\n// using namespace myown1; \ncout << \"\\\\n\" << \"Hello, \"\n<< myown1::user_name\n<< \"...and goodbye!\\\\n\"\ncout << \"\\\\n\" << \"Hello, \"\n<< myown2::user_name\n<< \"...and goodbye!\\\\n\"\nreturn 0;\n}\n
\u5173\u952e\u8bcdusing\u5c06\u4e00\u4e2a\u540d\u5b57\u7a7a\u95f4\u53d8\u4e3a\u53ef\u89c1\uff0c\u4e0d\u4f1a\u8986\u76d6\u5f53\u524d\u7684namespace\u3002
"},{"location":"docs/1-cs/oop/course/#_15","title":"\u7ee7\u627f\u4e0e\u6d3e\u751f\u7c7b","text":"\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u4e2d\u9664\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e4b\u5916\u7684\u6240\u6709\u6210\u5458\u3002\u6d3e\u751f\u7c7b\u7684\u6210\u5458\u5305\u62ec\uff1a - \u7ee7\u627f\u57fa\u7c7b\u7684\u6210\u5458 - \u6d3e\u751f\u7c7b\u5b9a\u4e49\u65f6\u58f0\u660e\u7684\u6210\u5458
\u4ece\u5df2\u6709\u7c7b\u6d3e\u751f\u51fa\u65b0\u7c7b\u65f6\uff0c\u53ef\u4ee5\u5728\u6d3e\u751f\u7c7b\u5185\u5b8c\u6210\u4ee5\u4e0b\u51e0\u79cd\u529f\u80fd\uff1a - \u589e\u52a0\u65b0\u7684\u6570\u636e\u6210\u5458 - \u589e\u52a0\u65b0\u7684\u6210\u5458\u51fd\u6570 - \u91cd\u65b0\u5b9a\u4e49\u57fa\u7c7b\u4e2d\u5df2\u6709\u7684\u6210\u5458\u51fd\u6570 - \u53ef\u4ee5\u6539\u53d8\u73b0\u6709\u6210\u5458\u7684\u5c5e\u6027
\u58f0\u660e\u4e00\u4e2a\u6d3e\u751f\u7c7b\u7684\u4e00\u822c\u683c\u5f0f
class \u6d3e\u751f\u7c7b\u540d:\u7ee7\u627f\u65b9\u5f0f \u57fa\u7c7b\u540d\n{\n// \u6d3e\u751f\u7c7b\u65b0\u589e\u7684\u6570\u636e\u6210\u5458\u548c\u6210\u5458\u51fd\u6570\n};\n
\u4e09\u79cd\u7ee7\u627f\u65b9\u5f0f
class employee: public person\n{};\n// default\nclass employee: private person\n{};\nclass employee: protected person\n{};\n
\u57fa\u7c7b\u6210\u5458\u5728\u6d3e\u751f\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027
\u5728\u57fa\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027 \u7ee7\u627f\u65b9\u5f0f \u5728\u6d3e\u751f\u7c7b\u4e2d\u7684\u8bbf\u95ee\u5c5e\u6027 \u89e3\u91ca private public inaccessible \u57fa\u7c7b\u4e2dprivate\u7684\u5bf9\u8c61\u5728\u7c7b\u5916\u5f53\u7136\u4e0d\u53ef\u8bbf\u95ee private private inaccessible private protected inaccessible public public public \u57fa\u7c7b\u4e0d\u7ba1 public private private public protected protected protected public protected \u6743\u9650\u4f1a\u88ab\u7ee7\u627f\u65b9\u5f0f\u7f29\u5c0f\u800c\u4e0d\u4f1a\u653e\u5927 protected private private protected protected protected\u6d3e\u751f\u7c7b\u5bf9\u57fa\u7c7b\u7684\u8bbf\u95ee\u89c4\u5219 - \u5185\u90e8\u8bbf\u95ee\uff1a\u7531\u6d3e\u751f\u7c7b\u4e2d\u65b0\u589e\u6210\u5458\u5bf9\u57fa\u7c7b\u7ee7\u627f\u6765\u7684\u6210\u5458\u7684\u8bbf\u95ee\u3002 - \u5bf9\u8c61\u8bbf\u95ee\uff1a\u5728\u6d3e\u751f\u7c7b\u5916\u90e8\uff0c\u901a\u8fc7\u6d3e\u751f\u7c7b\u7684\u5bf9\u8c61\u5bf9\u4ece\u57fa\u7c7b\u7ee7\u627f\u6765\u7684\u6210\u5458\u7684\u8bbf\u95ee\u3002
\u57fa\u7c7b\u6210\u5458 private\u6210\u5458 public\u6210\u5458 protected\u6210\u5458 \u5185\u90e8\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u53ef\u8bbf\u95ee \u53ef\u8bbf\u95ee \u5bf9\u8c61\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee \u4e0d\u53ef\u8bbf\u95ee\u79c1\u6709\u7ee7\u627f\u4e3e\u4f8b
class Point\n{\npublic:\nvoid InitP(float x = 0, float y = 0)\n{\nthis->X = x;\nthis->Y = y;\n}\nvoid Move(float offX, float offY)\n{\nX += offX;\nY += offY;\n}\nfloat GetX() const{return X;}\nfloat GetY() const{return Y;}\nprivate:\nfloat X, Y;\n};\nclass Rectangle: private Point // \u6d3e\u751f\u7c7b\u58f0\u660e\n{\npublic: //\u65b0\u589e\u5916\u90e8\u63a5\u53e3\nvoid InitR(float x, float y, float w, float h)\n{\nInitR(x, y);\nW = w;\nH = h;\n} // \nvoid Move(float xOff, float yOff)\n{\nPoint::\n}\n}\n
"},{"location":"docs/1-cs/oop/final_review/","title":"ZJU \u671f\u672b\u590d\u4e60","text":":material-circle-edit-outline: \u7ea6 1500 \u4e2a\u5b57 :fontawesome-solid-code: 36 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f
\u9762\u5411\u671f\u672b\u9898\u7684\u76f8\u4f3c\u77e5\u8bc6\u70b9\u805a\u7c7b
"},{"location":"docs/1-cs/oop/final_review/#_1","title":"\u6784\u9020\u987a\u5e8f","text":"\uff081\uff09main\u51fd\u6570\u4ee5\u5916\u7684\u5bf9\u8c61\uff0c\u5168\u5c40\u7c7b\u5b9a\u4e49\u540e\u76f4\u63a5\u5b9a\u4e49\u7684\u7c7b\u5bf9\u8c61 \uff082\uff09main\u51fd\u6570\u5185\u7684\u5bf9\u8c61 \uff083\uff09\u7236\u7c7b\u6784\u9020 \uff084\uff09\u5b50\u7c7b\u7c7b\u6210\u5458 \uff085\uff09\u5b50\u7c7b\u6784\u9020 \u6790\u6784\u987a\u5e8f\u76f8\u53cd
"},{"location":"docs/1-cs/oop/final_review/#_2","title":"\u4ec0\u4e48\u65f6\u5019\u751f\u6210\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\uff1f","text":"\u5982\u679c\u5df2\u7ecf\u6709\u6784\u9020\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u4e0d\u4f1a\u751f\u6210\u9ed8\u8ba4\u6784\u9020\u51fd\u6570 \u6ca1\u6709\u7684\u65f6\u5019\u4e5f\u4e0d\u4e00\u5b9a\u4f1a\u751f\u6210 \u9700\u8981\u7528\u624d\u751f\u6210
"},{"location":"docs/1-cs/oop/final_review/#_3","title":"\u91cd\u8f7d\u89c4\u5219","text":"\u4e0d\u80fd\u91cd\u8f7d\u7684\u6709\uff1a - \u4f5c\u7528\u57df\u64cd\u4f5c\u7b26:: - \u6761\u4ef6\u64cd\u4f5c\u7b26?:\uff08\u5e94\u8be5\u662f\u95ee\u53f7\u8868\u8fbe\u5f0f\uff1f\uff09 - \u70b9\u64cd\u4f5c\u7b26\u3001\u7c7b\u6210\u5458\u6307\u9488 - \u9884\u5904\u7406\u7b26\u53f7#
\u53ea\u80fd\u91cd\u8f7d\u4e3a\u53cb\u5143\u4e0d\u80fd\u6210\u5458\u51fd\u6570\uff1a - <<\u548c>> \u539f\u56e0\u662f\u6210\u5458\u51fd\u6570\u91cd\u8f7d\uff0c\u53ea\u80fd\u5e26\u4e00\u4e2a\u53c2\u6570\uff0clhs\u5fc5\u987b\u662f\u6210\u5458\u81ea\u8eab
\u4f46\u662f\u6d41\u64cd\u4f5c\u7b26\u5de6\u8fb9\u662fcin\u6216cout\uff0c\u91cd\u8f7d\u4e3a\u53cb\u5143\u51fd\u6570\u65f6\uff0c\u53ef\u4ee5\u6bd4\u6210\u5458\u51fd\u6570\u591a\u8bf4\u660e\u4e00\u4e2a\u5f62\u53c2\u505alhs
\u91cd\u8f7d\u548c\u91cd\u5199\u90fd\u662f\u591a\u6001\uff1a \u91cd\u8f7d\uff1a\u8fd0\u884c\u65f6\u591a\u6001 \u91cd\u5199\uff1a\u7f16\u8bd1\u65f6\u591a\u6001
static\u548cvirtual\u53ea\u80fd\u6709\u4e00\u4e2a
\u6790\u6784\u51fd\u6570\u4e0d\u80fd\u5e26\u53c2\u6570
"},{"location":"docs/1-cs/oop/final_review/#_4","title":"\u5b50\u7c7b\u548c\u7236\u7c7b\u6307\u9488","text":"\u4ec0\u4e48\u65f6\u5019\u5fc5\u987b\u7528\u5e38\u5f15\u7528\uff08const &\uff09\uff1a\u5f15\u7528\u578b\u53c2\u6570\u5e94\u5f53\u5728\u80fd\u5b9a\u4e49\u4e3aconst\u7684\u60c5\u51b5\u4e0b\u5c3d\u91cf\u5b9a\u4e49\u4e3aconst\u3002
\u4f7f\u7528\u5f15\u7528\u7684\u4e3b\u8981\u539f\u56e0\uff1a \u7a0b\u5e8f\u80fd\u591f\u4fee\u6539\u8c03\u7528\u51fd\u6570\u4e2d\u7684\u6570\u636e\u5bf9\u8c61 \u901a\u8fc7\u4f20\u9012\u5f15\u7528\u800c\u4e0d\u662f\u6574\u4e2a\u6570\u636e\u5bf9\u8c61\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u901f\u5ea6
\u53ea\u4f7f\u7528\u4f20\u9012\u8fc7\u6765\u7684\u503c\u800c\u4e0d\u4fee\u6539 \u9700\u8981\u4fee\u6539\u4f20\u9012\u8fc7\u6765\u7684\u503c \u5185\u7f6e\u6570\u636e\u7c7b\u578b\uff08\u5c0f\u578b\u7ed3\u6784\uff09 \u6309\u503c\u4f20\u9012 \u6307\u9488\u4f20\u9012 \u6570\u7ec4 \u6307\u9488\u4f20\u9012 \u6307\u9488\u4f20\u9012 \u8f83\u5927\u7684\u7ed3\u6784\uff09 \u6307\u9488\u6216\u5f15\u7528 \u6307\u9488\u6216\u5f15\u7528 \u7c7b/\u5bf9\u8c61 \u5f15\u7528\u4f20\u9012 \u5f15\u7528\u4f20\u9012\u5f15\u7528\u548c\u6307\u9488\u7684\u533a\u522b\uff1a \u53ef\u4ee5\u628a\u5f15\u7528\u7406\u89e3\u6210\u4e00\u4e2a\u5e38\u91cf\u6307\u9488\uff0c\u56e0\u6b64\u5f15\u7528\u58f0\u660e\u65f6\u5c31\u5fc5\u987b\u521d\u59cb\u5316\uff0c\u4e00\u7ecf\u58f0\u660e\u4e0d\u80fd\u518d\u548c\u5176\u5b83\u5bf9\u8c61\u7ed1\u5b9a\u3002
Copy constructor must pass its first argument by reference
"},{"location":"docs/1-cs/oop/final_review/#_6","title":"\u7c7b\u5185\u9759\u6001\u6210\u5458\u7684\u521d\u59cb\u5316","text":"const static\u53ef\u4ee5\u5728\u7c7b\u5185\u76f4\u63a5\u521d\u59cb\u5316\uff0c\u975econst static\u6210\u5458\u9700\u8981\u5728\u7c7b\u5916\u521d\u59cb\u5316\u3002
\u53ef\u4ee5\u8c03\u7528\u9ed8\u8ba4\u521d\u59cb\u5316A::n\uff0c\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\u3002\u6b64\u65f6\u8c03\u7528\u9ed8\u8ba4\u6784\u9020\u4e0d\u80fd\u7528n()\uff0c\u5426\u5219\u8ba4\u4e3a\u662f\u4e2a\u51fd\u6570\u3002\u6216\u8005\u5e26\u521d\u59cb\u503c\u521d\u59cb\u5316A::n(9)
static\u548cconst - \u6ca1\u6709static\u5c31\u662fconst\u7684\u8bf4\u6cd5
const\u7684\u51e0\u79cd\u5f62\u5f0f
const int& fun(int& a); // \u4fee\u9970\u8fd4\u56de\u503c \nint& fun(const int& a); // \u4fee\u9970\u5f62\u53c2 \nint& fun(int& a) const {} // const\u6210\u5458\u51fd\u6570\n
const\u8fd4\u56de\u503c\uff1a\u662f\u4fee\u9970\u8fd4\u56de\u503c\u5f15\u7528\u7c7b\u578b\u7684\u65f6\u5019\uff0c\u4e3a\u4e86\u907f\u514d\u8fd4\u56de\u503c\u88ab\u4fee\u6539\u7684\u60c5\u51b5
\u8fd4\u56de\u503c\u662f\u5f15\u7528\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u5f15\u7528\u5fc5\u7136\u4e0d\u662f\u4e34\u65f6\u5bf9\u8c61\u7684\u5f15\u7528\uff0c\u4e00\u5b9a\u662f\u6210\u5458\u53d8\u91cf\u6216\u8005\u51fd\u6570\u53c2\u6570\u3002\uff08\u53ea\u8981\u53c2\u6570\u4e0d\u9700\u8981\u4fee\u6539\u4e00\u5b9a\u52a0\u4e0aconst\uff09
const\u53c2\u6570\u5fc5\u987b\u4f20\u7b7e\u540d\u540e\u5e26const\u7684\u51fd\u6570\uff1a\u8981\u628athis\u6307\u9488\u53d8\u6210const
\u600e\u6837\u6784\u6210\u91cd\u8f7d - \u4e0d\u91cd\u8f7d\u7684
const int& fun(int& a); // \u53c2\u6570\u5217\u8868\u6ca1\u6709\u53d8 \nint& fun(const int a); // \u56e0\u4e3a\u662f\u503c\u4f20\u9012\uff0c\u4e0d\u662fconst\u7684\u4e5f\u80fdtype conversion\n
int& fun(const int& a); // \u56e0\u4e3a\u662f\u53d8\u91cf\u4f20\u9012\uff0c\u8981\u6c42\u68c0\u67e5\u53c2\u6570\u7684const\uff0c\u662f\u53c2\u6570\u5217\u8868\u53d8\u4e86 \nint& fun(int& a) const {} // \u56e0\u4e3a\u9690\u542b\u53c2\u6570this\u7684const\u4e0e\u5426\u4e0d\u4e00\u6837\uff0c\u4e5f\u662f\u53c2\u6570\u5217\u8868\u53d8\u4e86\n
\u200b\u4ee3\u66ff\u5b8f\u7684\u4e00\u79cd\u64cd\u4f5c\uff0c\u5728\u7f16\u8bd1\u9636\u6bb5\u628a\u6240\u6709\u51fd\u6570\u540d\u66ff\u6362\u6210inline function\u7684\u5b9e\u73b0 \u6bd4\u51fd\u6570\u7684\u4f18\u70b9\uff1a\u4e0d\u7528\u9891\u7e41\u8fdb\u6808\u51fa\u6808 \u6bd4\u5b8f\u7684\u4f18\u70b9\uff1a\u6709\u7c7b\u578b\u68c0\u67e5\uff0c\u80fd\u5199\u591a\u884c\uff0c\u80fd\u64cd\u4f5c\u7c7b\u7684\u79c1\u6709\u6210\u5458 inline\u5173\u952e\u5b57\u53ea\u6709\u51fa\u73b0\u5728\u51fd\u6570\u7684\u5b9a\u4e49\u800c\u4e0d\u662f\u58f0\u660e\u524d\u65f6\u624d\u6709\u7528\u3002 \u9759\u6001\u7ed1\u5b9a\u00a0Static\u00a0Binding \u3002\u80fd\u591f\u660e\u786e\u8fd0\u884c\u7684\u662f\u54ea\u4e2a\u7c7b\u7684\u65b9\u6cd5\u65f6\u4f1a\u53d1\u751f\u9759\u6001\u7ed1\u5b9a \u3002\u53d1\u751f\u5728\u7f16\u8bd1\u65f6\u523b\uff0c\u6240\u4ee5\u53c8\u53eb\u65e9\u7ed1\u5b9a \u52a8\u6001\u7ed1\u5b9aDynamic\u00a0Binding \u3002\u51fa\u73b0\u591a\u6001\uff0c\u7f16\u8bd1\u5668\u4e0d\u80fd\u660e\u786e\u5230\u5e95\u4f7f\u7528\u54ea\u4e2a\u7c7b\u7684\u65b9\u6cd5\u65f6\u53d1\u751f\u52a8\u6001\u7ed1\u5b9a \u3002\u53d1\u751f\u5728\u8fd0\u884c\u65f6\u523b\uff0c\u6240\u4ee5\u53c8\u53eb\u665a\u7ed1\u5b9a \u3002\u53ea\u6709\u5b58\u5728\u00a0virtual\u00a0\u65e6\u901a\u8fc7\u6307\u9488\u8bbf\u95ee\u65f6\uff0c\u624d\u4f1a\u53d1\u751f\u52a8\u6001\u7ed1\u5b9a
static binding \u7f16\u8bd1\u65f6
class Animal { public: void eat() { cout << \"Animal eats\" << endl; } }; class Dog : public Animal { public: void eat() { cout << \"Dog eats\" << endl; } };\n
dynamic binding \u8fd0\u884c\u65f6
class Animal { public: virtual void eat() { cout << \"Animal eats\" << endl; } }; class Dog : public Animal { public: void eat() { cout << \"Dog eats\" << endl; } };\n
\u200b \u5728\u4e0b\u9762\u7684\u60c5\u51b5\u4e0b\uff0c\u6784\u9020\u51fd\u6570\u4f1a\u88ab\u8c03\u7528\uff1a - \u5bf9\u4e8e\u5168\u5c40\u5bf9\u8c61\uff0c\u5728main()\u4e24\u6570\u8fd0\u884c\u4e4b\u524d\uff0c\u6216\u8005\u5728\u540c\u4e00\u4e2a\u7f16\u8bd1\u5355\u5143\u5185\u5b9a\u4e49\u7684\u4efb\u4e00\u51fd\u6570\u6216\u5bf9\u8c61 \u88ab\u4f7f\u7528\u4e4b\u524d\u3002\u5728\u540c\u4e00\u4e2a\u7f16\u8bd1\u5355\u5143\u5185\uff0c\u5b83\u4eec\u7684\u6784\u9020\u4e24\u6570\u6309\u7167\u58f0\u660e\u7684\u987a\u5e8f\u521d\u59cb\u5316\u3002 - \u5bf9\u4e8e static\u00a0local\u00a0variables\uff0c\u00a0\u5728\u7b2c\u4e00\u6b21\u8fd0\u884c\u5230\u5b83\u7684\u58f0\u660e\u7684\u65f6\u5019. - \u5bf9\u4e8e automatic\u00a0storage\u00a0duration\u00a0\u7684\u5bf9\u8c61\uff0c\u5728\u5176\u58f0\u660e\u88ab\u8fd0\u884c\u65f6\u3002 - \u5bf9\u4e8e dynamic\u00a0storage\u00a0duration\u00a0\u7684\u5bf9\u8c61\uff0c\u5728\u5176\u7528\u00a0new\u00a0\u8868\u8fbe\u5f0f\u521b\u5efa\u65f6\u3002
"},{"location":"docs/1-cs/oop/final_review/#_7","title":"\u667a\u80fd\u6307\u9488","text":"std::unique_ptr<T> //\u72ec\u5360\u8d44\u6e90\u6240\u6709\u6743\u7684\u6307\u9488\u3002 \nstd::shared_ptr<T> //\u5171\u4eab\u8d44\u6e90\u6240\u6709\u6743\u7684\u6307\u9488\u3002 \nstd::weak_ptr<T> //\u5171\u4eab\u8d44\u6e90\u7684\u89c2\u5bdf\u8005\uff0c\u9700\u8981\u548cstd::shared_ptr \u4e00\u8d77\u4f7f\u7528\uff0c\u4e0d\u5f71\u54cd\u8d44\u6e90\u7684\u751f\u547d\u5468\u671f\u3002\n
\u4f7f\u7528\u88f8\u6307\u9488 \u6240\u4ee5\u9ed8\u8ba4\u53c2\u6570\u662f\u548c\u865a\u8868\u65e0\u5173\u4e0e\u5f53\u524d\u7c7b\u578b\u6709\u5173\u5417 \u662f\u7684 \u9ed8\u8ba4\u53c2\u6570\u4e0d\u8fdb\u865a\u8868 \u2192 upcasting\u7684\u65f6\u5019
"},{"location":"docs/1-cs/oop/final_review/#upcasting","title":"upcasting","text":":material-circle-edit-outline: \u7ea6 1186 \u4e2a\u5b57 :fontawesome-solid-code: 361 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f
\u9700\u6c42\uff1a\u8ba9\u6211\u4eec\u7684\u4ee3\u7801\u72ec\u7acb\u4e8e\u5177\u4f53\u7684\u7c7b\u578b\u5de5\u4f5c\u3002
\u6211\u4eec\u5199\u51fa\u4e00\u4e2a\u9002\u7528\u4e8e\u6240\u6709\u7c7b\u578b\u7684\u6570\u636e\u7ed3\u6784\u7684\u7c7b\u6216\u7b97\u6cd5\uff08\u51fd\u6570\uff09\uff0c\u5728\u771f\u6b63\u9700\u8981\u4f7f\u7528\u65f6\u751f\u6210\u4e00\u4e2a\u9002\u7528\u4e8e\u6240\u9700\u7c7b\u578b\u7684\u5b9e\u4f8b\u3002\u8fd9\u79cd\u7f16\u7a0b\u8303\u5f0f\u79f0\u4e3a\u8303\u578b\u7f16\u7a0b\u3002
\u6a21\u677f\u7c7b\u7684\u5199\u6cd5
template<typename T>\nclass Container{\nT *data;\nunsigned size, capa;\npiblic:\nContainer(unsigned capa = 512): data(new T[capa]){}\n~Container() {delete[] data;}\nT& operator[](unsigned index) {return data[index];}\n}\n
\u8fd9\u91cctemplate T\u8868\u660e\u5b83\u63a5\u53d7\u4e00\u4e2a\u7c7b\u578b\u4f5c\u4e3a\u53c2\u6570\uff0c\u540d\u5b57\u662fT\u3002\u5728\u6a21\u677f\u7684\u5b9a\u4e49\u5185\u90e8\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5230\u8fd9\u4e2a\u7c7b\u578b\u53d8\u91cfT\u3002
\u7279\u5316\uff1a\u6839\u636e\u6a21\u677f\u751f\u6210\u5b9e\u9645\u7684\u7c7b\u7684\u8fc7\u7a0b
Container<int> ci;\nContainer<double> cd;\n
\u6a21\u677f\u51fd\u6570\u8981\u600e\u4e48\u5199
template<typename T>\nT abs(T x) {return x>0?x:-x;}\n
\u6a21\u677f\u8fd0\u7b97\u7b26\u91cd\u8f7d\u600e\u4e48\u5199
template<typename T>\nclass Container {\nT* data;\nunsigned size = 0, capa;\npublic: Container(unsigned capa = 512) : data(new T[capa]), capa(capa){}\n~Container(){delete[] data;}\nT& operator[](unsigned index) {return data[index];}\nconst T& operator[](unsigned idnex) const {return data[index];}\nunsigned getSize() const {return size;}\nunsigned getCapa() const {return capa;}\nContainer &add(T val){\ndata[size++] = val;\nreturn *this;\n}\n};\ntemplate<typename T>\nostream & operator<<(ostream& os, const Container<T>&c){\nfor (unsigned i = 0; i < c.getSize(); i++){\nos << c[i] << ' ';\nreturn os;\n}\n}\n
"},{"location":"docs/1-cs/oop/templates/#reference","title":"Reference","text":"7 \u6a21\u677f (I) - \u57fa\u672c\u77e5\u8bc6\u4e0e STL \u4f7f\u7528 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4
"},{"location":"docs/1-cs/oop/templates/#template","title":"\u53ef\u53d8\u53c2\u6570\u6a21\u677f templateC++11\u7684\u65b0\u7279\u6027 \u5bf9\u53c2\u6570\u9ad8\u5ea6\u6cdb\u5316\uff0c\u53ef\u4ee5\u8868\u793a0\u5230\u4efb\u610f\u4e2a\u4efb\u610f\u7c7b\u578b\u7684\u53c2\u6570\u3002
\u8bed\u6cd5
template <class ...T> // \u58f0\u660e\u4e00\u4e2a\u53c2\u6570\u5305\uff0c\u8fd9\u4e2a\u53c2\u6570\u5305\u4e2d\u5305\u542b0\u5230\u4efb\u610f\u4e00\u4e2a\u53c2\u6570\u6a21\u677f\nvoid f(T... args); // \u5728\u6a21\u677f\u5b9a\u4e49\u7684\u53f3\u8fb9\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570\u5305\u5c55\u5f00\u6210\u4e00\u4e2a\u4e00\u4e2a\u72ec\u7acb\u53c2\u6570\n
\u6700\u5927\u7684\u96be\u70b9\uff1a\u5982\u4f55\u5c55\u5f00\u53ef\u53d8\u6a21\u677f\u53c2\u6570
\u6253\u5370\u53c2\u6570\u4e2a\u6570\uff1a
template<class ...T>\nvoid f(T... args)\n{\n cout << sizeof...(args) << endl;\n}\n\nf();\nf(1, 2);\nf(1, 2.5, \"\");\n
\u9012\u5f52\u65b9\u5f0f\u5c55\u5f00\u53c2\u6570\u5305
#include <iostream>\nusing namespace std;\n\n// \u9012\u5f52\u7ec8\u6b62\u51fd\u6570\nvoid print(){\n cout << \"empty\" << endl;\n}\n\n// \u5c55\u5f00\u51fd\u6570\ntemplate<class T, class ...Args>\nvoid print(T head, Args... rest){\n cout << \"parameter\" << head << endl;\n print(rest...);\n}\n\nint main(){\n print(1, 2, 3, 4);\n return 0;\n}\n
\u4e0a\u8ff0\u4f8b\u5b50\u4f1a\u8f93\u51fa\u6bcf\u4e00\u4e2a\u53c2\u6570\uff0c\u76f4\u5230\u7a7a\u65f6\u8f93\u51faempty\u3002\u5c55\u5f00\u53c2\u6570\u5305\u7684\u51fd\u6570\u6709\u4e24\u4e2a\uff0c\u4e00\u4e2a\u662f\u9012\u5f52\u51fd\u6570\uff0c\u53e6\u4e00\u4e2a\u662f\u9012\u5f52\u7ec8\u6b62\u51fd\u6570\uff0c\u53c2\u6570\u5305Args\u2026\u5728\u5c55\u5f00\u7684\u8fc7\u7a0b\u4e2d\u9012\u5f52\u8c03\u7528\u81ea\u5df1\uff0c\u6bcf\u8c03\u7528\u4e00\u6b21\uff0c\u53c2\u6570\u5305\u4e2d\u7684\u53c2\u6570\u5c31\u5c11\u4e00\u4e2a\uff0c\u76f4\u5230\u6240\u6709\u53c2\u6570\u90fd\u5c55\u5f00\u4e3a\u6b62\u3002\u5f53\u6ca1\u6709\u53c2\u6570\u65f6\uff0c\u5219\u8c03\u7528\u975e\u6a21\u677f\u51fd\u6570print()\u7ec8\u6b62\u9012\u5f52\u8fc7\u7a0b\u3002
\u7ec8\u6b62\u51fd\u6570\u4e5f\u53ef\u4ee5\u5199\u6210
template<class T>\nvoid print(T t){\n cout << t << endl;\n}\n
\u53ef\u53d8\u6a21\u677f\u53c2\u6570\u6c42\u548c
template<typename T>\nT sum(T t){\n return t;\n}\ntemplate<typename T, typename ... Types>\nT sum(T first, Types ...rest){\n return first + sum<T> (rest...);\n}\n\nsum(1, 2, 3, 4);\n
\u9012\u5f52\u51fd\u6570\u5c55\u5f00\u53c2\u6570\u5305\u662f\u4e00\u79cd\u6807\u51c6\u505a\u6cd5\uff0c\u4e5f\u6bd4\u8f83\u597d\u7406\u89e3\uff0c\u4f46\u662f\u7f3a\u70b9\u65f6\u5fc5\u987b\u8981\u4e00\u4e2a\u91cd\u8f7d\u7684\uff08\u540c\u540d\uff09\u9012\u5f52\u7ec8\u6b62\u51fd\u6570\u6765\u7ec8\u6b62\u9012\u5f52\u3002
\u6216\u8005\u4e0d\u9012\u5f52\u65b9\u5f0f\uff0c\u8fd9\u79cd\u65b9\u5f0f\u9700\u8981\u501f\u52a9\u9017\u53f7\u8868\u8fbe\u5f0f\u548c\u521d\u59cb\u5316\u5217\u8868\u3002\u524d\u9762\u7684print\u53ef\u4ee5\u8fd9\u4e48\u5199
template<class T>\nvoid printarg(T t){\n cout << t << endl;\n}\n\ntemplate <class ...Args>\nvoid expand(Args... args){\n int arr[] = {(printarg(args), 0)...};\n}\n\nexpand(1, 2, 3, 4);\n
arr\u8fd9\u4e2a\u6570\u7ec4\u7684\u76ee\u7684\u5355\u7eaf\u662f\u5c55\u5f00\u53c2\u6570\u5305
\u5982\u679c\u5c06\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\uff0c\u5c31\u53ef\u4ee5\u652f\u6301lambda\u8868\u8fbe\u5f0f
template<class F, class... Args> void expand(const F& f, Args&&...args){\ninitializer_list<int>{(f(std::forward< Args>(args)), 0)};\n}\nexpand([](int i){cout << i << endl;}, 1,2,3);\n
\u53ef\u4ee5\u5e26\u4efb\u610f\u4e2a\u6570\u4e0d\u540c\u7684\u53c2\u6570\uff0c\u6bd4\u5982std::tuple
template<class... Types>\nclass tuple;\n
\u6a21\u677f\u504f\u7279\u5316\u548c\u9012\u5f52\u65b9\u5f0f\u5c55\u5f00\u53c2\u6570\u5305
\u53ef\u53d8\u53c2\u6570\u6a21\u677f\u7c7b\u7684\u5c55\u5f00\u4e00\u822c\u9700\u8981\u5b9a\u4e49\u4e24\u5230\u4e09\u4e2a\u7c7b\uff0c\u5305\u62ec\u7c7b\u58f0\u660e\u548c\u504f\u7279\u5316\u7684\u6a21\u677f\u7c7b
// \u524d\u5411\u58f0\u660e\ntemplate<typename... Args>\nstruct Sum;\n\n// \u57fa\u672c\u5b9a\u4e49\ntemplate<typename First, typename... Rest>\nstruct Sum<First, Rest...>{\n enum { value = Sum<First>::value + Sum<Rest...>::value };\n}\n\n// \u9012\u5f52\u7ec8\u6b62\ntemplate<typename Last>\nstruct Sum<Last>{\n enum { value = sizeof(Last) };\n}\n
","text":""},{"location":"docs/1-cs/oop/templates/#stl","title":"\u6807\u51c6\u6a21\u677f\u5e93 STL STL\u516d\u5927\u90e8\u4ef6\uff1a\u5bb9\u5668\uff08containers\uff09\uff0c\u5206\u914d\u5668\uff08allocators\uff09\uff0c\u7b97\u6cd5\uff08algorithm\uff09\uff0c\u8fed\u4ee3\u5668\uff08iterator\uff09\uff0c\u9002\u914d\u5668\uff08adapters\uff09\uff0c\u4eff\u51fd\u6570\uff08functors\uff09
","text":""},{"location":"docs/1-cs/oop/templates/#_1","title":"\u5e38\u7528\u7684\u5bb9\u5668","text":"vector, deque, list, set/multiset, map/multimap \u7b49
"},{"location":"docs/1-cs/oop/templates/#1-vector","title":"1. Vector","text":"Vector\u662f\u4e00\u79cd\u53d8\u957f\u6570\u7ec4\u3002
#include<vector>\nusing namespace std;\nvector<int> name;\nvector<double> name;\nvector<char> name;\nvector<struct node> name;\n// \u8fd9\u4e24\u4e2a\u4e3b\u8981\u6709\u901f\u5ea6\u4e0a\u7684\u533a\u522b\uff0carray\u975e\u5e38\u6162\uff0cvector\u5feb\u4e00\u4e9b\nvector< vector<int> > name; // > >\u4e4b\u95f4\u8981\u52a0\u7a7a\u683c\uff0c\u65b0\u6807\u51c6\u4e0d\u7528\u52a0\u4e86\nvector<int> array[SIZE]; // \u8fd9\u4e2a\u4e0d\u662f\u5f88\u5e38\u7528\uff0c\u56e0\u4e3a\u5bb9\u6613\u51fa\u9519\uff0c\u4e14\u6570\u7ec4\u4e0d\u77e5\u9053\u81ea\u5df1\u7684\u957f\u5ea6\uff0c\u8fd8\u6709std::array\n
\u8bbf\u95ee\u65b9\u5f0f
// 1. \u901a\u8fc7\u4e0b\u6807\n#include<iostream>\n#include<vector>\nusing namespace std;\nint main()\n{\nvector<int> vi;\nvi.push_back(1);\ncout<<vi[0]<<endl;\nreturn 0;\n}\n// 2. \u901a\u8fc7\u8fed\u4ee3\u5668\nvector<int>::iterator\nvector<double>::iterator\n// \u4f8b\n#include<iostream>\n#include<vector>\nint main()\n{\nvector<int> v;\nfor(int i = 0; i < 5; i++)\n{\nv.push_back(i); }\nvector<int>::iterator it=v.begin();\nfor(int i = 0; i < v.size(); i++)\n{\ncout << it[i] << \" \";\n// \u4e5f\u53ef\u4ee5\u5199\u6210 cout << * (it + i) << \" \";\n}\nreturn 0;\n}\n// \u6216\u8005\u4f18\u96c5\u7684\u5199\u6cd5\n// \u56e0\u4e3a\u8fed\u4ee3\u5668\u4e0d\u652f\u6301 it < v.end()\u7684\u5199\u6cd5\uff0c\u53ea\u80fd\u5199!=\nfor (vector<int>::iterator it=v.begin(); it!=v.end();it++)\n{\ncout << *it << \" \";\n}\n
\u5e38\u7528\u51fd\u6570 push_back(item) // \u5728vector\u540e\u9762\u6dfb\u52a0\u4e00\u4e2a\u5143\u7d20\npop_back(item) // \u5728vector\u540e\u9762\u5220\u9664\u4e00\u4e2a\u5143\u7d20\nsize(vector) // \u8fd4\u56de\u5143\u7d20\u4e2a\u6570\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(1)\nclear(vector) // \u6e05\u9664\u6240\u6709\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(N)\ninsert(position, x) // \u5728position\u7684\u5730\u65b9\u63d2\u5165\u4e00\u4e2ax\n// \u4f8b\nv.insert(v.begin()+2, -1); // \u76f8\u5f53\u4e8e\u5728v[2]\u5904\u63d2\u5165\u4e00\u4e2a-1\nerase(position);\nerase(positionBegin, positionEnd); // \u5de6\u95ed\u53f3\u5f00\n
"},{"location":"docs/1-cs/oop/templates/#2-set","title":"2. set","text":"\u96c6\u5408\u662f\u4e0d\u5141\u8bb8\u5143\u7d20\u91cd\u590d\u7684\u65e0\u5e8f\u5bb9\u5668
#include<set>\nusing namespace std;\nset<int> name;\nset<double> name;\nset<char> name;\nset<struct node> name;\nset<set<int> > name;\n
\u56e0\u4e3a\u65e0\u5e8f\uff0cset\u53ea\u80fd\u901a\u8fc7iterator\u8bbf\u95ee\uff0c\u9664\u4e86vector\u548cstring\u4e4b\u5916\u7684\u5bb9\u5668\u90fd\u4e0d\u80fd\u901a\u8fc7\u4e0b\u6807\u8bbf\u95ee set<int>::iterator it;\nset<char>::iterator it;\n
\u5e38\u7528\u51fd\u6570 st.insert(X);\nst.find(X); // \u8fd4\u56deset\u4e2dvalue\u6240\u5bf9\u5e94\u7684\u8fed\u4ee3\u5668\uff0c\u4e5f\u5c31\u662fvalue\u7684\u6307\u9488\n// \u4f8b\nset<int>::iterator it = st.find(2);\ncout << *it << endl;\n// \u53ef\u4ee5\u76f4\u63a5\u5199\u6210\ncout << *(st.find(2)) << endl;\nst.erase(it); // \u5220\u9664\u67d0\u4e2a\u5730\u5740\u7684\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(1)\nst.erase(X); // \u5220\u9664\u67d0\u4e2a\u5143\u7d20\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(N)\nst.erase(itBegin, itEnd);\nst.size();\n
"},{"location":"docs/1-cs/oop/templates/#3-deque","title":"3. deque","text":"deque\u662f\u7531\u4e00\u6bb5\u5b9a\u91cf\u8fde\u7eed\u7a7a\u95f4\u6784\u6210\uff0c\u4e00\u65e6\u8981\u5728deque\u7684\u524d\u7aef\u548c\u5c3e\u7aef\u589e\u52a0\u7a7a\u95f4\uff0c\u4fbf\u914d\u7f6e\u4e00\u6bb5\u8fde\u7eed\u7a7a\u95f4\uff0c\u4e32\u5728\u6574\u4e2adeque\u7684\u5934\u90e8\u548c\u5c3e\u90e8.
"},{"location":"docs/1-cs/oop/templates/#4-list","title":"4. list","text":""},{"location":"docs/1-cs/oop/templates/#5-mapunordered_map","title":"5. map/unordered_map","text":""},{"location":"docs/1-cs/oop/templates/#6-string","title":"6. string","text":"// init\n#include<string>\nstring str;\nstring str = \"Hello\";\ncin >> str;\ncout << str;\n// assignment\nchar cstr1[20];\nchar cstr2[20] = \"jaguar\";\nstring str1;\nstring str2 = \"panther\";\ncstr1 = cstr2; // illegal\nstr1 = str2; // legal\n// concatenation\nstring str3;\nstr3 = str1 + str2;\nstr1 += str2;\nstr1 += \"a string literal\";\n// constructors (Ctors)\nstring (const char *cp, int len);\nstring (const string& s2, int pos);\nstring (const string& s2, int pos, int len);\n// sub-string\nsubstr (int pos, int len);\n// modification\nassign (...);\ninsert (...);\ninsert (int pos, const string& s);\nerase (...);\nappend (...);\nreplace (...);\nreplace (int pos, int len, const string& s);\n...\n// search\nfind (const string& s);\n// File I/O\n#include <ifstream> // read from file\n#include <ofstream> // write to file\n// write into file\nofstream File1(\"...\");\nFile1 << \"Hello world\" << std::enl;\n// read from file\nifstream File2(\"...\");\nstd::string str;\nFile2 >> str;\n
"},{"location":"docs/1-cs/oop/templates/#_2","title":"\u7b97\u6cd5","text":"\u7b97\u6cd5\u90e8\u5206\u4e3b\u8981\u7531<algorithm> <numeric> <functional>
\u7ec4\u6210 <algorithm>
\u662f\u6700\u5927\u7684\u4e00\u4e2a <numeric>
\u4f53\u79ef\u5f88\u5c0f\uff0c\u53ea\u5305\u62ec\u51e0\u4e2a\u5728\u5e8f\u5217\u4e0a\u8fdb\u884c\u7b80\u5355\u6570\u5b66\u8fd0\u7b97\u7684\u6a21\u677f\u51fd\u6570 <functional>
\u5b9a\u4e49\u4e86\u4e00\u4e9b\u6a21\u677f\u7c7b\uff0c\u7528\u4ee5\u58f0\u660e\u51fd\u6570\u5bf9\u8c61
\u7528\u8fed\u4ee3\u5668\u53ef\u4ee5\u8bfb\u53d6\u5b83\u6307\u5411\u7684\u5143\u7d20\u3002\u8fed\u4ee3\u5668\u540d\u5c31\u8868\u793a\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5143\u7d20\uff0c\u901a\u8fc7\u975e\u5e38\u91cf\u8fed\u4ee3\u5668\u8fd8\u80fd\u4fee\u6539\u5176\u6307\u5411\u7684\u5143\u7d20\u3002
#include<iostream> #include<vector> using namespace std; int main() { vector<int> v; for (int n = 0; n < 5; ++n) v.push_back(n); vector<int>::iterator i; for (i = v.begin(); i != v.end(); i++) { cout << *i << \" \"; // *i \u662f i \u6307\u5411\u7684\u5143\u7d20 *i *= 2; \n} }\n
"},{"location":"docs/1-cs/oop/templates/#stl_1","title":"\u7c7b\u5e93\u548cSTL STL\u662f\u8303\u578b\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4e00\u4e2a\u8303\u4f8b\uff0c\u542b\uff1a\u5bb9\u5668\uff08container\uff09\u3001\u8fed\u4ee3\u5668\uff08iterator\uff09\u3001\u7b97\u6cd5\uff08algorithm\uff09\u3001\u51fd\u6570\u5bf9\u8c61\uff08function object\uff09\u3002\u7c7b\u5e93\u662f\u7c7b\u7684\u96c6\u5408\uff0c\u662f\u4e00\u79cd\u9884\u5b9a\u4e49\u7684\u9762\u5411\u5bf9\u8c61\u7684\u7a0b\u5e8f\u5e93\u3002
","text":""},{"location":"docs/1-cs/oop/templates/#c","title":"C++\u7684\u6807\u51c6\u5e93","text":"using namespace std;
\u5bb9\u5668\uff08container\uff09\u7c7b\u662f\u7528\u6765\u5bb9\u7eb3\u3001\u5305\u542b\u4e00\u7ec4\u5143\u7d20\u6216\u5143\u7d20\u96c6\u5408\u7684\u5bf9\u8c61\u7684\u3002STL\u4e2d\u5b9a\u4e49\u4e86\u591a\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u5bb9\u5668\uff0c\u4f8b\u5982
\u5b9a\u4e49
vector<int> iv;\nvector<int> cv(5);\nvector<int> cv(5, 'x');\nvector<int> iv2(iv);\n
\u4f7f\u7528
#include<iostream>\n#include<vector>\nusing namespace std;\nint main()\n{\nvector<char> v; // create zero-len vector\nint i;\n// put values into a vector\nfor (i = 0; i < 10; i++)\nv.push_back('A' + i);\n// can access vector contents using subsripting\nfor (i = 0; i < 10; i++)\ncout << v[i] << \" \";\ncout << endl;\n// access via iterator\nvector<char>::iterator p = v.begin();\nwhile(p != v.end())\n{\ncout << *p << \" \";\np++;\n}\nreturn 0;\n}\n
"},{"location":"docs/1-cs/oop/templates/#list","title":"\u7ebf\u6027\u8868 list","text":"\u5b9a\u4e49\u4e86\u53cc\u5411\u7684\u7ebf\u6027\u8868\uff0c\u53c8\u53ef\u79f0\u4e3a\u53cc\u5411\u94fe\u8868\u3002list\u7c7b\u53ea\u652f\u6301\u987a\u5e8f\u8bbf\u95ee\u3002
// sort a list\n#include<iostream>\n#include<list>\n#include<cstdlib>\nusing namespace std;\nint main()\n{\nint i;\nlist<char> lst;\n// create a list of random characters\nfor (i = 0; i < 10; i++)\nlist.push_back('A' + (rand()%26));\n}\n
"},{"location":"docs/1-cs/oop/templates/#set","title":"\u96c6\u5408 set","text":"#include<set>\n#include<iostream>\n#include<string>\nint main()\n{\nstd::set<std::string> source;\nstd::string input;\nfor(int i=0;i<6;i++)\n{\nstd::cin>>input;\nsource.insert(input);\n}\nstd::set<std::string>::iterator at = source.begin();\nwhile(at != source.end())\nstd::cour << * at++ << std::endl;\n}\n
"},{"location":"docs/1-cs/oop/templates/#multiset","title":"multiset","text":""},{"location":"docs/1-cs/oop/templates/#map","title":"\u6620\u5c04 map","text":""},{"location":"docs/1-cs/oop/templates/#queue","title":"\u961f\u5217 queue","text":""},{"location":"docs/1-cs/oop/templates/#stdstack","title":"std::stack","text":""},{"location":"docs/1-cs/oop/templates/#stdpair","title":"std::pair","text":""},{"location":"docs/1-cs/oop/templates/#string","title":"\u5b57\u7b26\u4e32string","text":""},{"location":"docs/1-cs/oop/templates/#_3","title":"\u7b97\u6cd5\u5e93 ` #include<algorithm>\n#include<iostream>\n#include<string>\n#include<vector>\nusing namespace std;\nvoid load(vector<string>&);\nvoid print(vector<string>);\nconst int SIZE = 8;\nint main()\n{\nvector<string> v(SIZE);\nload(v);\nsort(v.begin(), v.end()); // \u6307\u5b9a\u6392\u5e8f\u7684\u8d77\u6b62\u4f4d\u7f6e\nprint(v);\nreturn 0;\n}\n// \u4f1a\u6309\u7167\u5b57\u6bcd\u5e8f\u6392\u5e8f\n
"},{"location":"docs/1-cs/oop/templates/#_4","title":"\u8fed\u4ee3\u5668 \u662f\u4e00\u79cd\u7c7b\u4f3c\u6307\u9488\u7684\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fed\u4ee3\u5668\u6765\u8bbf\u95ee\u5bb9\u5668\u4e2d\u7684\u5143\u7d20\u3002
#include<list>\n#include<iostream>\nint main()\n{\nusing namespace std;\nlist<int> c1;\nlist<int>::iterator c1_Iter;\nlist<int>::reverse_iterator c1_rIter;\nc1_rIter = c1.rbegin(); // the last element\n}\n
"},{"location":"docs/1-cs/oop/templates/#_5","title":"\u53c2\u8003\u8d44\u6599 https://zhuanlan.zhihu.com/p/344558356 LJJ PPT
","text":""},{"location":"docs/1-cs/os/","title":"\u7d22\u5f15","text":":material-circle-edit-outline: \u7ea6 384 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u6211\u89c9\u5f97 x+i for i in [x, y, g] \u4e09\u4f4d\u7684\u7b14\u8bb0\u5bf9\u4e8e\u8fd9\u95e8\u8bfe\u7406\u8bba\u90e8\u5206\u7684\u4ecb\u7ecd\u5df2\u7ecf\u975e\u5e38\u5145\u5206\u4e86\u3002\u5927\u5bb6\u53ef\u4ee5\u5728\u6211 root \u7d22\u5f15\u9875\u6307\u5411\u7684 xy \u7b14\u8bb0\u627e\u5230\u6211\u8fd9\u91cc\u63d0\u5230\u7684\u4e09\u4efd\u7b14\u8bb0\u3002
\u6211\u4ecd\u8981\u5199\u8fd9\u95e8\u8bfe\u7684\u5b9e\u9a8c\u90e8\u5206\u7684\u539f\u56e0\u662f\uff0c\u81ea\u5df1\u89c9\u5f97\u5b9e\u9a8c\u624b\u518c\u5199\u5f97\u4ecd\u6709\u4e00\u4e9b\u5bfc\u81f4\u4e0d\u592a\u597d\u7406\u89e3\u7684\u7f3a\u9677\uff0c\u6bd4\u5982\u7406\u8bba\u548c\u64cd\u4f5c\u5206\u6210\u4e0a\u4e0b\u4e24\u5927\u5757\u6765\u5199\uff0c\u5bfc\u81f4\u67e5\u8d77\u6765\u7684\u65f6\u5019\u50cf\u5728\u5403\u4e00\u76d8\u94a2\u4e1d\u7403\u7092\u610f\u5927\u5229\u9762\uff0c\u6bd4\u5982\u6709\u65f6\u5728\u8bf4\u64cd\u4f5c\u65f6\u4e0d\u5206\u5df2\u7ecf\u5b9e\u73b0\u597d\u7684/\u6211\u8981\u505a\u7684/linux\u4f1a\u505a\u4f46\u662f\u6211\u4eec\u4e0d\u5173\u5fc3\u7684\u3002
\u6211\u7684\u9884\u671f\u662f\u628a\u8fd9\u4efd\u7b14\u8bb0\u5199\u6210\u4e00\u5757\u4e00\u5757\u7684\u4e1c\u897f\uff0c\u6bcf\u4e00\u5757\u662f\u4e00\u4e2a\u7406\u8bba+\u64cd\u4f5c+\u4e00\u4e2a\u80fd\u8dd1\u8d77\u6765\u7684\u6700\u5c0f\u5355\u5143\u3002\u73b0\u5b9e\u662f\u6211\u7684\u65f6\u95f4\u771f\u7684\u592a\u4e0d\u8db3\u4e86\uff0c\u611f\u89c9\u53ea\u6765\u5f97\u53ca\u53bb\u8865\u5145\u4e00\u4e9b\u5b9e\u9a8c\u624b\u518c\u91cc\u6ca1\u6709\u5199\u7684\u80cc\u666f\u6216\u8005\u662f\u6211\u81ea\u5df1\u64cd\u4f5c\u65f6\u7684\u4e00\u4e9b\u5fc3\u5f97\u6216\u603b\u7ed3\uff0c\u53ea\u80fd\u5f53\u5b9e\u9a8c\u624b\u518c\u7684\u8865\u5145\u6765\u770b\u3002\u7136\u540e\u672c\u6765\u8fd9\u91cc\u5e94\u5f53\u6709\u4e00\u53e5\u5e0c\u671b\u4ee5\u540e\u6709\u65f6\u95f4\u80fd\u5199\u5b8c\uff0c\u4f46\u662f\u6211\u4e5f\u4e0d\u60f3\u8fd9\u6837\u627f\u8bfa\u4e86\uff0c\u6211\u66f4\u613f\u610f\u8bf4\u4e00\u4e9b\u73b0\u5b9e\u7684\u6bd4\u5982\u6211\u4e0d\u4f1a\u518d\u66f4\u65b0\u8fd9\u4efd\u7b14\u8bb0\u4e86\uff0c\u4f46\u662f\u5e0c\u671b\u8bfb\u8005\u505a\u5b9e\u9a8c\u7684\u65f6\u5019\u53ef\u4ee5\u5e26\u7740\u4e0a\u8ff0\u63d0\u5230\u7684\u601d\u8def\u53bb\u6574\u7406\u81ea\u5df1\u7684\u601d\u7ef4\u548c\u5b9e\u9a8c\u62a5\u544a\u3002
\u63a5\u4e0b\u6765\u8bf7\u70b9\u8fdb\u53e6\u4e00\u4e2a lab \u9875\u9762\u7ee7\u7eed\u9605\u8bfb\u3002
"},{"location":"docs/1-cs/os/lab/","title":"OS lab","text":":material-circle-edit-outline: \u7ea6 8965 \u4e2a\u5b57 :fontawesome-solid-code: 91 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 31 \u5206\u949f
\u76ee\u5f55\uff1a\u8fd9\u91cc\u4f1a\u5148\u8bb2\u4e00\u4e0b\u7528\u5230\u7684\u80cc\u666f\u77e5\u8bc6\u548c mac \u4e0b\u7684\u73af\u5883\u914d\u7f6e\u6280\u5de7\uff08\u56e0\u4e3a\u624b\u518c\u8bb2 mac \u4e0d\u591a\uff09\uff0c\u7136\u540e\u6328\u4e2a\u5b9e\u9a8c\u6211\u60f3\u8fdb\u884c\u4e00\u4e9b\u7efc\u8ff0\uff0c\u4e0d\u77e5\u9053\u7cbe\u529b\u80fd\u652f\u6491\u5199\u591a\u5c11\uff0c\u6700\u540e\u8865\u5145\u4e24\u4e2a\u6211\u5b9e\u9a8c\u4e2d\u603b\u9047\u5230\u7684\u4f46\u624b\u518c\u6ca1\u6d89\u53ca\u7684\u95ee\u9898\u3002\u81ea\u77e5\u5b66\u5f97\u4e0d\u597d\uff0c\u4e0d\u786e\u5b9a\u7684\u5730\u65b9\u6211\u4f1a\u6807\u51fa\u6765\u3002
"},{"location":"docs/1-cs/os/lab/#overview","title":"overview","text":"Warning
\u7ed3\u6784\u56fe TODO
\u4e00\u4e2a\u6700\u540e\u505a\u51fa\u6765\u7684 lab \u7ed3\u6784\u56fe:
"},{"location":"docs/1-cs/os/lab/#_1","title":"\u80cc\u666f\u77e5\u8bc6","text":"\u5148\u4ecb\u7ecd\u4e00\u4e0b\u6574\u4e2a\u5b9e\u9a8c\u548c\u5b9e\u9a8c\u73af\u5883\u7684\u5927\u80cc\u666f\u3002
"},{"location":"docs/1-cs/os/lab/#os","title":"\u8ba1\u7b97\u673a\u4e0a\u7535\u5230OS\u8fd0\u884c\u7684\u8fc7\u7a0b","text":"\u5d4c\u5165\u5f0f\u7cfb\u7edf\uff08\u76f8\u6bd4\u8ba1\u7b97\u673a\u7cfb\u7edf\u6bd4\u8f83\u7b80\u5355\uff0c\u53ea\u80fd\u5728\u7279\u5b9a\u786c\u4ef6\u4e0a\u8fd0\u884c\uff09\u7684\u542f\u52a8\u8fc7\u7a0b\u6bd4\u8f83\u7b80\u5355\uff0c\u7528\u5b83\u6765\u505a\u4f8b\u5b50\u8bb2\u89e3\uff0c\u8fc7\u7a0b\u662f\uff1a
Hardware RISC-V M Mode RISC-V S Mode \n+------------+ +--------------+ +----------+\n| Power On | ----> | Bootloader | ----> | Kernel |\n+------------+ +--------------+ +----------+\n
"},{"location":"docs/1-cs/os/lab/#sbiopensbi","title":"sbi\u548copensbi","text":"\u4ecb\u7ecd\u5b9e\u9a8c\u73af\u5883\u7528\u7684\u7b2c\u4e00\u4e2a\u5de5\u5177\uff1asbi (supervisor binary interface)\u662f s-mode \u7684 kernel \u548c m-mode \u6267\u884c\u73af\u5883\u4e4b\u95f4\u7684\u63a5\u53e3\u89c4\u8303
opensbi\u662f\u4e00\u4e2ariscv sbi\u89c4\u8303\u7684\u5f00\u6e90\u5b9e\u73b0\uff0c\u603b\u4e4b\u610f\u601d\u662fopensbi\u662f\u4e00\u4e9b\u5bf9m-mode\u4e0b\u786c\u4ef6\u7684\u7edf\u4e00\u5b9a\u4e49\uff0c\u5728s-mode\u4e0b\u7684\u5185\u6838\u53ef\u4ee5\u6309\u7167\u8fd9\u4e9b\u89c4\u8303\u5bf9\u4e0d\u540c\u786c\u4ef6\u64cd\u4f5c\u3002
\u6211\u4eecopensbi\u53ef\u4ee5\u4f5c\u4e3abootloader\u5b8c\u6210\u673a\u5668\u542f\u52a8\u65f6m-mode\u4e0b\u7684\u786c\u4ef6\u521d\u59cb\u5316\u548c\u5bc4\u5b58\u5668\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u5229\u7528opensbi\u5b8c\u6210\u5b57\u7b26\u6253\u5370\u4e4b\u7c7b\u7684\u64cd\u4f5c\u3002
qemu\u4f1a\u628aopensbi\u8d77\u59cb\u5730\u5740\u52a0\u8f7d\u52300x80000000\u5904.
opensbi\u521d\u59cb\u5316\u540e\u4f1a\u8df3\u8f6c\u52300x80200000\u5904\uff0c\u5373kernel\u7684\u8d77\u59cb\u5730\u5740\u3002\u6240\u4ee5\u8981\u7f16\u8bd1\u7684\u4ee3\u7801\u57280x80200000\u5904\u3002
"},{"location":"docs/1-cs/os/lab/#_2","title":"\u7279\u6743\u6a21\u5f0f","text":"riscv\u6709\u4e09\u79cd\u7279\u6743\u6a21\u5f0f\uff1aUser, Supervisor, & Machine\u3002\u6574\u4e2a\u5b9e\u9a8c\u4e2d\u6211\u4eec\u4e00\u5f00\u59cb\u90fd\u8981\u5728 s-mode \u64cd\u4f5c\uff0c\u4e4b\u540e\u6162\u6162\u5b9e\u73b0 u-mode\u3002
Level Encoding Name Abbreviation \u4ecb\u7ecd 0 00 User/Application U \u5bf9\u786c\u4ef6\u6a21\u5f0f\u7684\u62bd\u8c61\uff0c\u6709\u6700\u9ad8\u7ea7\u522b\u7684\u6743\u9650 1 01 Supervisor S \u5bf9\u5e94\u4e0e\u5185\u6838\u6001Kernel\u3002\u5f53\u7528\u6237\u9700\u8981\u5185\u6838\u8d44\u6e90\u65f6\uff0c\u5411\u5185\u6838\u7533\u8bf7\uff0c\u5e76\u5207\u6362\u5230\u5185\u6838\u6001\u8fdb\u884c\u5904\u7406 2 10 Reserved 3 11 Machine M \u7528\u6237\u6001\uff0c\u6700\u4f4e\u7ea7\u522b\u6743\u9650\u4e00\u822c\u6bcf\u79cd\u6a21\u5f0f\u53ef\u4ee5\u8fd0\u884c\u7684\u7a0b\u5e8f\u6709
supported modes intended usage M simple embedded systems M, U secure embedded systems M, S, U systems running unix-like operating systems"},{"location":"docs/1-cs/os/lab/#_3","title":"\u73af\u5883\u914d\u7f6e","text":""},{"location":"docs/1-cs/os/lab/#docker","title":"Docker","text":"\u5728\u5b98\u7f51\u5b89\u88c5Docker\u3002\u4e4b\u540e\u9700\u8981\u6253\u5f00Docker app\uff0c\u767b\u9646\u540e\u624d\u80fd\u5728terminal\u4e2d\u4f7f\u7528docker\u547d\u4ee4\u3002
$ sudo hdiutil attach Docker.dmg\n$ sudo /Volumes/Docker/Docker.app/Contents/MacOS/install\n$ sudo hdiutil detach /Volumes/Docker\n
\u521b\u5efa\u5bb9\u5668
docker pull ubuntu:22.04\ndocker run -it --name my_linux ubuntu:22.04 bash\n
\u51fa\u73b0root@xxxxxxx:?# \u5373\u521b\u5efa\u6210\u529f\uff0c\u5176\u4e2dxxxxxxx\u4e00\u4e32\u662f\u5f53\u524d\u5bb9\u5668\u7684id\uff0c\u9700\u8981\u8bb0\u5f55\u4e0b\u6765\uff0c\u4e0b\u6b21\u53ef\u4ee5\u901a\u8fc7\u8be5id\u8fdb\u5165\u76f8\u540c\u5bb9\u5668\u3002
\u5b89\u88c5\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u5305\uff0cqemu\uff0cgdb\uff0c\u8fd9\u51e0\u6b65\u9700\u8981\u5f00\u7740\u547d\u4ee4\u884c\u4ee3\u7406\uff0c\u622a\u56fe\u7565\u3002
"},{"location":"docs/1-cs/os/lab/#docker_1","title":"\u806a\u660e\u5730\u4f7f\u7528docker","text":"\u8fd8\u662f\u6700\u597d\u914d\u7f6e\u4e00\u4e0b vscode \u91cc\u7684\u56fe\u5f62\u754c\u9762\u3002\u6b65\u9aa4\uff1a
ps a
\u548c kill qemu
\u7b49\u547d\u4ee4\u3002\u3002\u5f53\u7136\u53ef\u80fd\u4e5f\u53ea\u6709\u7b28\u86cb\u6211\u6309\u7167\u540e\u4e24\u79cd\u7528\u4e86\u597d\u4e45\u3002Warning
TODO \u8fd9\u5757\u5e94\u8be5\u518d\u6269\u5199\u4e00\u4e0b\u7684
bash [shell file].sh
\u6765\u8fd0\u884c\u3002riscv-gnu-toolchain
\u3002\u9700\u8981\u8c03\u8bd5\u65f6\uff0c\u56e0\u4e3a\u9876\u5c42 makefile \u5e2e\u6211\u4eec\u5199\u597d\u4e86\u8c03\u8bd5\u547d\u4ee4\uff0c\u6211\u4eec\u7b2c\u4e00\u4e2a terminal \u53ea\u9700\u8981\u8f93\u5165 make debug
\u3002 \u7136\u540e\u65b0\u5f00\u4e00\u4e2a terminal \u8f93\u5165 gdb-multiarch path/to/vmlinux
\u5176\u4e2d vmlinux \u662f\u7f16\u8bd1\u597d\u7684\u6587\u4ef6\u3002
gdb \u4f7f\u7528\u7684\u65b9\u6cd5/\u7a8d\u95e8
\u8c03\u8bd5\u7684\u65f6\u5019\u9700\u8981\u770b\u4ec0\u4e48\u5462\uff1f
\u8fd9\u662f\u6211\u521a\u4e0a\u624b\u8c03\u8bd5\u7684\u65f6\u5019\u611f\u5230\u56f0\u6270\u7684\u4e00\u4e2a\u95ee\u9898\u3002
\u540e\u6765\u6211\u9010\u6e10\u60f3\u6e05\u695a\u7684\u662f\uff0c\u9996\u5148\u6211\u8ba4\u4e3a\u5982\u679c\u4e0d\u77e5\u9053\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u8fd0\u884c\u7684\u6d41\u7a0b\uff08\u6bd4\u5982\u5148\u54ea\u4e2a\u51fd\u6570\u518d\u54ea\u4e2a\u51fd\u6570\uff09\uff0c\u662f\u4e0d\u9002\u5408\u5f00\u59cb\u8c03\u8bd5\u7684\uff0c\u5e94\u5f53\u56de\u53bb\u518d\u601d\u8003\u4e00\u904d lab \u7684\u7406\u8bba\uff0c\u8d77\u7801\u77e5\u9053\u81ea\u5df1\u7a0b\u5e8f\u7684\u5404\u79cd\u9884\u671f\u7ed3\u679c\u3002\u66b4\u8bba\u4e00\u70b9\u8bf4\u5176\u5b9e\u6211\u89c9\u5f97\u8c03\u8bd5\u65f6\u957f\u5927\u4e8e\u5f00\u53d1\u65f6\u957f\u90fd\u662f\u4e0d\u592a\u597d\u7684\uff0c\u66b4\u9732\u51fa\u80af\u5b9a\u54ea\u91cc\u7406\u8bba\u6ca1\u5543\u900f\u5c31\u5f00\u59cb\u52a8\u7b14\u4e86\u3002
\u7136\u540e\u53ef\u4ee5\u7531\u5927\u5230\u5c0f\uff0c\u6bd4\u5982\u5148\u628a\u51e0\u4e2a\u65ad\u70b9\u6253\u5728\u731c\u6d4b\u53ef\u80fd\u51fa\u9519\u4e86\u7684\u51e0\u4e2a\u51fd\u6570\u4e0a\uff0c\u786e\u5b9a\u5177\u4f53\u5728\u54ea\u4e2a\u51fd\u6570\u51fa\u9519\u540e\u518d\u9010 c \u8bed\u8a00\u884c\u8fd0\u884c\uff0c\u786e\u5b9a\u662f\u54ea\u4e2a c \u8bed\u8a00\u884c\u51fa\u9519\u540e\u518d\u9010\u6c47\u7f16\u884c\u8fd0\u884c\uff0c\u5faa\u5e8f\u6e10\u8fdb\u627e\u5230\u5177\u4f53\u51fa\u9519\u7684\u6307\u4ee4\u3002\u5728\u9644\u8fd1\u6253\u5370\u6253\u5370\u51e0\u4e2a\u5bc4\u5b58\u5668\u7684\u503c\uff08\u53ef\u4ee5\u770b\u7684\u5bc4\u5b58\u5668\u6211\u4f1a\u5728\u4e0b\u4e00\u8282\u4ecb\u7ecd\uff09\uff0c\u7136\u540e\u5728\u6b64\u57fa\u7840\u4e0a\u601d\u8003\u9519\u8bef\u539f\u56e0\u3002
"},{"location":"docs/1-cs/os/lab/#gdb","title":"\u806a\u660e\u5730\u4f7f\u7528 gdb","text":"gdb \u81ea\u5e26\u7684\u547d\u4ee4\u884c ui \u7f3a\u70b9\u4e3b\u8981\u5728\u4e8e\u4e0d\u80fd\u968f\u65f6\u663e\u793a\u5bc4\u5b58\u5668\u548c\u53d8\u91cf\u7684\u503c\uff0c\u8c03\u8bd5\u4f1a\u4e0d\u8212\u670d\u3002\u6709\u4e00\u4e9b\u66f4\u597d\u7684 ui \u5de5\u5177\u3002
\u6211\u6ca1\u6709\u914d\u6240\u4ee5\u4e0d\u80fd\u63d0\u4f9b\u5f88\u597d\u7684\u6211\u7684\u63a8\u8350\uff0c\u8d34\u4e00\u4e9b\u522b\u4eba\u7684\u5e16\u5b50\u3002\u9664\u4e86\u4e0b\u9762\u5e16\u5b50\u91cc\u63d0\u5230\u7684\u51e0\u4e2a\uff0c\u8431\u8431\u8fd8\u63d0\u5230\u4e00\u4e2a gdbpeda
\u3002
\u63a8\u8350\u51e0\u4e2a\u597d\u7528\u7684GDB\u56fe\u5f62\u5316\u529f\u80fd\u589e\u5f3a\u63d2\u4ef6
"},{"location":"docs/1-cs/os/lab/#lab0","title":"lab0","text":"\u6ca1\u96be\u5ea6\u4e0d\u7528\u8bb2
"},{"location":"docs/1-cs/os/lab/#lab1","title":"lab1","text":""},{"location":"docs/1-cs/os/lab/#c-risc-v","title":"C & RISC-V \u5185\u8054\u6c47\u7f16","text":"Note
\u8fd9\u5757\u6765\u81ea\u4e8e\u5bf9 lab1 \u6587\u6863\u7684\u6574\u7406\u3002\u5e0c\u671b\u6709\u6574\u7406\u5f97\u6bd4\u539f\u6587\u6863\u53ef\u8bfb\u4e00\u4e9b\u3002
__asm__ volatile (\n\"instruction1\\n\"\n\"instruction2\\n\"\n......\n......\n\"instruction3\\n\"\n: [out1] \"=r\" (v1),[out2] \"=r\" (v2)\n: [in1] \"r\" (v1), [in2] \"r\" (v2)\n: \"memory\"\n);\n
\u5176\u4e2d\uff0c\u4e09\u4e2a\u00a0:
\u00a0\u5c06\u6c47\u7f16\u90e8\u5206\u5206\u6210\u4e86\u56db\u90e8\u5206\u3002\u8fd9\u56db\u90e8\u5206\u4e2d\u540e\u4e09\u90e8\u5206\u4e0d\u662f\u5fc5\u987b\u7684\uff1a
\u8fd9\u6bb5\u6682\u65f6\u7528\u4e0d\u7740\u6211\u4e0d\u5199\u4e86\uff0c\u8d34\u4e00\u6bb5lab1\u4e2d\u7684\u539f\u6587\u7ed9\u7684\u793a\u4f8b\u3002e.g. 1
unsigned long long s_example(unsigned long long type,unsigned long long arg0) {\nunsigned long long ret_val;\n__asm__ volatile (\n\"mv x10, %[type]\\n\"\n\"mv x11, %[arg0]\\n\"\n\"mv %[ret_val], x12\"\n: [ret_val] \"=r\" (ret_val)\n: [type] \"r\" (type), [arg0] \"r\" (arg0)\n: \"memory\"\n);\nreturn ret_val;\n}\n
e.g. 1. \u4e2d\u6307\u4ee4\u90e8\u5206\uff0c%[type]\u3001%[arg0]\u4ee5\u53ca%[ret_val]\u4ee3\u8868\u7740\u7279\u5b9a\u7684\u5bc4\u5b58\u5668\u6216\u662f\u5185\u5b58\u3002\u8f93\u5165\u8f93\u51fa\u90e8\u5206\u4e2d\uff0c[type] \"r\" (type)
\u4ee3\u8868\u7740\u5c06\u00a0()
\u00a0\u4e2d\u7684\u53d8\u91cf\u00a0type
\u00a0\u653e\u5165\u5bc4\u5b58\u5668\u4e2d\uff08\"r\"
\u00a0\u6307\u653e\u5165\u5bc4\u5b58\u5668\uff0c\u5982\u679c\u662f\u00a0\"m\"
\u00a0\u5219\u4e3a\u653e\u5165\u5185\u5b58\uff09\uff0c\u5e76\u4e14\u7ed1\u5b9a\u5230\u00a0[]
\u00a0\u4e2d\u547d\u540d\u7684\u7b26\u53f7\u4e2d\u53bb\u3002[ret_val] \"=r\" (ret_val)
\u00a0\u4ee3\u8868\u7740\u5c06\u6c47\u7f16\u6307\u4ee4\u4e2d\u00a0%[ret_val]
\u00a0\u7684\u503c\u66f4\u65b0\u5230\u53d8\u91cf\u00a0ret_val
\u4e2d\u3002
e.g. 2
#define write_csr(reg, val) ({\n__asm__ volatile (\"csrw \" #reg \", %0\" :: \"r\"(val)); })\n
e.g. 2. \u5b9a\u4e49\u4e86\u4e00\u4e2a\u5b8f\uff0c\u5176\u4e2d\u00a0%0
\u00a0\u4ee3\u8868\u7740\u8f93\u51fa\u8f93\u5165\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u7b26\u53f7\uff0c\u5373\u00a0val
\u3002 #reg
\u00a0\u662fc\u8bed\u8a00\u7684\u4e00\u4e2a\u7279\u6b8a\u5b8f\u5b9a\u4e49\u8bed\u6cd5\uff0c\u76f8\u5f53\u4e8e\u5c06reg\u8fdb\u884c\u5b8f\u66ff\u6362\u5e76\u7528\u53cc\u5f15\u53f7\u5305\u88f9\u8d77\u6765\u3002\u4f8b\u5982\u00a0write_csr(sstatus,val)
\u00a0\u7ecf\u5b8f\u5c55\u5f00\u4f1a\u5f97\u5230\uff1a
({\n__asm__ volatile (\"csrw \" \"sstatus\" \", %0\" :: \"r\"(val)); })\n
\u6b64\u5916\uff0c\u8fd9\u4e2a\u793a\u4f8b\u4e2d\u7684\u00a0({...})
\u00a0\u8fd8\u6d89\u53ca\u4e86\u4e00\u4e2a GNU \u5bf9 C \u7684\u6269\u5c55\uff0c\u53ef\u4ee5\u53c2\u8003\u00a0Statements and Declarations in Expressions\u3002\u590d\u5408\u8bed\u53e5\u4e2d\u7684\u6700\u540e\u4e00\u9879\u5e94\u8be5\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u540e\u8ddf\u4e00\u4e2a\u5206\u53f7\u00a0;
\u3002\u8be5\u5b50\u8868\u8fbe\u5f0f\u7684\u503c\u7528\u4f5c\u6574\u4e2a\u8bed\u53e5\u7684\u503c\uff0c\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u7c7b\u4f3c\u201c\u8fd4\u56de\u503c\u201d\u7684\u6548\u679c\u3002
Note
\u8fd9\u5757\u6765\u81ea\u4e8e\u5bf9 lab1 \u6587\u6863\u7684\u6574\u7406\u3002\u5e0c\u671b\u6709\u6574\u7406\u5f97\u6bd4\u539f\u6587\u6863\u53ef\u8bfb\u4e00\u4e9b\u3002
`vmlinux.lds`` \u662f GNU ld\uff0c\u4e00\u79cd\u94fe\u63a5\u5668\uff0c\u5c06 .o \u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u8fde\u63a5\u8d77\u6765\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002ld\u4f7f\u7528\u94fe\u63a5\u811a\u672clinker script\u63a7\u5236\u3002\u8fd9\u4e2a\u6587\u4ef6\u91cc\u6709\u5199\uff1a
OUTPUT_ARCH( \"riscv\" )
ENTRY( _start )
\u5e76\u4e14head.S\u91cc\u9700\u8981\u7f16\u5199\u5bf9\u5e94\u7684_start\u51fd\u6570BASE_ADDR = 0x80200000;
\u6211\u4eec\u9605\u8bfb\u4e00\u4e0b\u8fd9\u4e2a\u94fe\u63a5\u5668\u6587\u4ef6\uff0c\u5bf9\u4e4b\u540e\u7684\u5b9e\u9a8c\u5e2e\u52a9\u633a\u5927\u3002
\u9996\u5148\u53ef\u4ee5\u7c97\u7565\u89c2\u5bdf\u5230\uff0ckernel \u7a7a\u95f4\u91cc\u662f\u5206\u6bb5(secition)\u7684\uff0c\u4e3b\u8981\u7684section\u6709\uff1a
\u6bb5\u540d \u4e3b\u8981\u4f5c\u7528 .text \u901a\u5e38\u5b58\u653e\u7a0b\u5e8f\u6267\u884c\u4ee3\u7801 .rodata \u901a\u5e38\u5b58\u653e\u5e38\u91cf\u7b49\u53ea\u8bfb\u6570\u636e .data \u901a\u5e38\u5b58\u653e\u5df2\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf \u9759\u6001\u53d8\u91cf .bss \u901a\u5e38\u5b58\u653e\u672a\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf \u9759\u6001\u53d8\u91cf\u518d\u7ec6\u81f4\u4e00\u70b9\u53bb\u89c2\u5bdf\u91cc\u9762\u7684\u7b26\u53f7\u3002
.
\u5728\u94fe\u63a5\u811a\u672c\u4ee3\u8868\u5f53\u524d\u5730\u5740\uff0c\u5b83\u6709\u8d4b\u503c\u3001\u88ab\u8d4b\u503c\u3001\u81ea\u589e\u7b49\u64cd\u4f5c\u3002*
\u6709\u4e24\u79cd\u7528\u6cd5\uff0c\u5176\u4e00\u662f *()
\u5728\u5927\u62ec\u53f7\u4e2d\u8868\u793a\u5c06\u6240\u6709\u6587\u4ef6\u4e2d\u7b26\u5408\u62ec\u53f7\u5185\u8981\u6c42\u7684\u6bb5\u653e\u7f6e\u5728\u5f53\u524d\u4f4d\u7f6e *(.data .data.*)
\uff0c\u5176\u4e8c\u662f\u4f5c\u4e3a\u901a\u914d\u7b26\u3002_s
\u00a0\u4e0e\u00a0_e
\u5f00\u5934\u7684\u7b26\u53f7\u90fd\u662f\u672c\u5b9e\u9a8c\u52a9\u6559\u8001\u5e08\u81ea\u5df1\u5b9a\u4e49\u7684\u3002\u7f16\u8bd1\u51fa\u7684\u6587\u4ef6\u91cc\uff1a
nm vmlinux
\u00a0\u547d\u4ee4\u5373\u53ef\u6253\u5370 vmlinux \u7684\u7b26\u53f7\u8868\u3002\u64cd\u4f5c\u7cfb\u7edf\u5728\u542f\u52a8\u540e\u7531\u4e8b\u4ef6(event)\u9a71\u52a8\uff0c\u6211\u4eec\u5c06\u5f15\u5165\u4e00\u79cd\u4e8b\u4ef6trap\uff0ctrap\u7ed9\u4e86os\u4e0e\u8f6f\u786c\u4ef6\u4ea4\u4e92\u7684\u80fd\u529b\u3002\u5728boot\u9636\u6bb5opensbi\u5b9e\u73b0\u4e86M\u6001\u7684trap\u5904\u7406\u3002\u6211\u4eec\u5b9e\u73b0\u7684\u662fs\u6001\u7684trap\u5904\u7406\u3002
\u5e76\u4e14\u6211\u4eec\u660e\u786e\u4e00\u4e0b Interrupt, Exception \u548c Trap \u7684\u533a\u522b (from riscv unprivileged spec)\uff1a
\u5b9e\u9a8c\u624b\u518c\u5219\u7ed9\u4e86\u4e0b\u8868\uff0c\u867d\u7136\u91cc\u9762\u6ca1\u6709\u8bb2\u5230 trap\uff0c\u4f46\u662f\u8fd9\u4e2a\u5bf9\u4e8e interrupt \u548c exception \u7684\u89e3\u91ca\u66f4\u6e05\u695a\u3002
Interrupt Exception hardware generated software generated Asynchronous external requests (generated by e.g. keyboard or printer) synchronous internal requests for services based upon abnormal events (generated by e.g. illegal instructions, illegal address, overflow, etc.) normal events abnormal events\u7406\u89e3\u4e86\u4e0a\u8ff0\u4e24\u4e2a\u6982\u5ff5\u540e\u53ef\u4ee5\u628a trap \u5f53\u4f5c\u4e00\u79cd\u7edf\u79f0\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3a trap = interrupt + exception\u3002\u6211\u4eec\u540e\u7eed\u5b9e\u73b0\u7684 trap_handler()
\u65e2\u8981\u5904\u7406\u4e2d\u65ad\u4e5f\u8981\u5904\u7406\u5f02\u5e38\u3002
\u8981\u5b9e\u73b0\u7684\u4e2d\u65ad\u7684\u6d41\u7a0b\u5982\u4e0b\uff0c\u53ef\u4ee5\u53c2\u7167\u8fd9\u4e2a\u5b8c\u6210 do_timer()
switch_to()
schedule()
\u7b49\u51fd\u6570\uff1a
\u56de\u5fc6\u5185\u5b58\u7ed3\u6784\uff08\u5982\u679c\u4f60\u660e\u786e\u77e5\u9053\u5bc4\u5b58\u5668\u662f\u4ec0\u4e48\u5c31\u4e0d\u7528\u56de\u5fc6\u4e86\uff09\uff0c\u53ef\u89c1\u5bc4\u5b58\u5668\u5e76\u4e0d\u5728\u8fd0\u884c\u5185\u5b58\u91cc\uff1a
\u5c0f/\u5feb <---------------> \u5927/\u6162\n[\u5bc4\u5b58\u5668] - [cache] - [\u5185\u5b58] - [\u5916\u5b58]\n
riscv\u670932\u4e2a\u901a\u7528\u5bc4\u5b58\u5668 + \u5f88\u591a\u63a7\u5236\u72b6\u6001\u5bc4\u5b58\u5668 (control and status registers (CSRs))\u3002riscv \u7ed9\u6bcf\u4e2a\u5bc4\u5b58\u5668\u6709\u4e2a\u5143\u4fe1\u606f\uff0c\u8fd9\u4e2a\u5143\u4fe1\u606f\u5171\u7528 12-bit \u6765\u5b58\u50a8\u5373 csr[11:0]\uff0c\u6240\u4ee5\u4e00\u5171\u652f\u6301 4096 \u4e2a\u5bc4\u5b58\u5668\u3002\u5177\u4f53\u800c\u8a00\uff0ccsr[11:0] \u8fd9\u4e2a\u6570\u636e\u7ed3\u6784\u6bcf\u4e2a\u4f4d\u7684\u610f\u4e49\u5206\u914d\u5982\u4e0b\uff1a
\u4f4d\u6570 11:10 9:8 7:4 \u957f\u5ea6 2 2 4 \u4f5c\u7528 11=read-only\uff0cother=read/write\uff1f \u80fd\u8bbf\u95ee\u8be5csr\u7684\u6700\u4f4e\u7684\u6743\u9650\u6a21\u5f0f \u6211\u731c\u662f\u4fdd\u7559\u7ed9\u6bcf\u4e2acsr\u7279\u5b9a\u7684\u9996\u5148\uff0c\u901a\u7528\u5bc4\u5b58\u5668\u6709\u5982\u4e0b\u8fd9\u4e9b\uff1a
\u5728\u7f16\u5199\u6c47\u7f16\u4ee3\u7801\u7684\u65f6\u5019\u4e00\u822c\u4f7f\u7528\u5bc4\u5b58\u5668\u7684abi\u7684\u540d\u5b57\u800c\u4e0d\u662f\u5bc4\u5b58\u5668\u7684\u7f16\u53f7
\u800c\u4e0b\u9762\u8981\u5355\u72ec\u8bb2\u4e00\u4e0b csr\u3002
sstatus (supervisor status register)
The sstatus register is an SXLEN(\u4ee3\u886832\u621664)-bit read/write register formatted as follows. \u6211\u4eec\u7528\u7684\u662f64\u4f4d\u3002
\u4e5f\u5c31\u662f\u8bf4\u8fd9\u4e2a\u5bc4\u5b58\u5668\u628a\u5f88\u591a\u4e8b\u4ef6\u7684\u72b6\u6001\u90fd\u75280\u62161\u8868\u793a\uff0c\u62fc\u5230\u4e86\u540c\u4e00\u4e2a\u5bc4\u5b58\u5668\u91cc\u3002
\u4f4d\u6570 \u540d\u79f0 \u7f6e1\u8868\u793a \u7f6e0\u8868\u793a 1 SIE \u54cd\u5e94\u6240\u6709\u7684S\u6001trap \u7981\u7528\u6240\u6709S\u6001trap 5 SPIE \u5728trap\u53d1\u751f\u524d\u7684SIE=1 \u5728trap\u53d1\u751f\u524d\u7684SIE=0 8 SPP \u5f53\u4e2d\u65ad\u53d1\u751f\u5b8c\u7684\u65f6\u5019\uff0c\u8fd4\u56de\u5230S-mode \u5f53\u4e2d\u65ad\u53d1\u751f\u5b8c\u7684\u65f6\u5019\uff0c\u8fd4\u56de\u5230U-mode\u624b\u518c\u91cc\u8fd8\u4ecb\u7ecd\u7684\u4f4d\u6709
sie (supervisor interrupt enable register)
\u5982\u679c\u5f00\u542f\u4e86sstatus[SIE]\uff0c\u5c31\u4f1a\u6839\u636esie\u4e2d\u7684\u6bd4\u7279\u4f4d\uff0c\u51b3\u5b9a\u662f\u5426\u5904\u7406interrupt
Bits sip.SEIP and sie.SEIE are the interrupt-pending and interrupt-enable bits for supervisor- level external interrupts. If implemented, SEIP is read-only in sip, and is set and cleared by the execution environment, typically through a platform-specific interrupt controller. Bits sip.STIP and sie.STIE are the interrupt-pending and interrupt-enable bits for supervisor- level timer interrupts. If implemented, STIP is read-only in sip, and is set and cleared by the execution environment. Bits sip.SSIP and sie.SSIE are the interrupt-pending and interrupt-enable bits for supervisor- level software interrupts. If implemented, SSIP is writable in sip and may also be set to 1 by a platform-specific interrupt controller.
stvec (supervisor trap vector base address register)
\u4e2d\u65ad\u5411\u91cf\u8868\u57fa\u5740.
WARL\u662f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u7684\u5730\u5740
MODE\u662f
Value mode \u63cf\u8ff0 0 Direct \u6a21\u5f0f \u9002\u7528\u4e8e\u7cfb\u7edf\u4e2d\u53ea\u6709\u4e00\u4e2a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f, \u5176\u6307\u5411\u4e2d\u65ad\u5904\u7406\u5165\u53e3\u51fd\u6570 \uff08 \u672c\u5b9e\u9a8c\u4e2d\u6211\u4eec\u6240\u7528\u7684\u6a21\u5f0f \uff09 1 Vectored\u6a21\u5f0f \u6307\u5411\u4e2d\u65ad\u5411\u91cf\u8868\uff0c \u9002\u7528\u4e8e\u7cfb\u7edf\u4e2d\u6709\u591a\u4e2a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f \u22652 \u4fdd\u7559sscratch (supervisor scratch register)
Typically, sscratch is used to hold a pointer to the hart-local supervisor context while the hart is executing user mode. At the beginning of a trap handler, sscratch is swapped with a user register to provide an initial working register.
\u5728\u672c\u6b21\u5b9e\u9a8c\u4e2d\uff0c\u6211\u4eec\u62ffsscratch\u8bb0\u5f55s-mode\u7684stack pointer\uff0c\u5728trap\u53d1\u751f\u7684\u65f6\u5019\u4e0eu-mode stack pointer\u4ea4\u6362\uff08\u597d\u50cf\u662f\u6765\u7740\u5fd8\u4e86TODO\u4e00\u4f1a\u6838\u5b9e\uff09
sepc (supervisor exception program counter)
\u4f1a\u8bb0\u5f55 trap \u5904\u7406\u8fc7\u540e\u7684\u8fd4\u56de\u5730\u5740\u3002
scause (supervisor cause register)
\u4f1a\u8bb0\u5f55 trap \u53d1\u751f\u7684\u539f\u56e0\uff0c\u8fd8\u4f1a\u8bb0\u5f55\u8be5 trap \u662f\u00a0Interrupt
\u00a0\u8fd8\u662f\u00a0Exception
\u3002\u539f\u56e0\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a
stval (supervisor trap value register)
The stval register can optionally also be used to return the faulting instruction bits on an illegal instruction exception (sepc points to the faulting instruction in memory). If stval is written with a nonzero value when an illegal-instruction exception occurs, then stval will contain the shortest of:
\u0088 the actual faulting instruction \u0088 the first ILEN bits of the faulting instruction \u0088 the first SXLEN bits of the faulting instruction
The value loaded into stval on an illegal-instruction exception is right-justified and all unused upper bits are cleared to zero.
satp (supervisor address translation and protection register)
\u8bb0\u5f55\u6700\u9ad8\u7ea7\u9875\u8868\u7684\u7269\u7406\u5730\u5740\u3002MODE\u4f4d=8\u65f6\uff0c\u4f7f\u7528Sv39\u6a21\u5f0f\u865a\u62df\u5730\u5740\uff08\u672c\u5b9e\u9a8c\uff09
\u4ee5\u4e0b\u662f\u65f6\u949f\u4e2d\u65ad\u76f8\u5173\u7684\u5bc4\u5b58\u5668\uff1a
mtime
\u8ba1\u65f6\u5668\uff0c\u4ee5\u6052\u5b9a\u9891\u7387\u81ea\u589e\uff08\u6211\u8bb0\u5f97\u5728\u672c\u5b9e\u9a8c\u91cc\u662f\u591a\u5c11\u5206\u4e4b\u4e00\u79d2\uff09
mtimecmp\uff08machine timer register\uff09
\u4e0b\u4e00\u6b21\u65f6\u949f\u4e2d\u65ad\u7684\u4e2d\u65ad\u70b9
mcounteren\uff08counter enable register\uff09
\uff08\u672c\u5b9e\u9a8c\u4e2d\u4e0d\u7528\u7ba1\uff0c\u4f46\u662f\u8bf4\u660e\u4e00\u4e0b\uff1a\uff09mtime\u672c\u6765\u662fm\u6001\u7684\u5bc4\u5b58\u5668\uff0c\u5728s\u6001\u4e0d\u80fd\u8bfb\u5199\uff0c\u4f46\u662fopensbi\u5df2\u7ecf\u8bbe\u7f6e\u8fc7\u53ef\u4ee5\u8bfb\u5199m\u6001
"},{"location":"docs/1-cs/os/lab/#_6","title":"\u5bc4\u5b58\u5668\u64cd\u4f5c","text":"\u64cd\u4f5ccsr\u5bc4\u5b58\u5668\u7684riscv\u6307\u4ee4\u96c6 TODO\u5f85\u6574\u7406
func scr rs1 rd\u5316\u7528\u4e00\u4e2a\u6682\u65f6\u4e0d\u60f3\u53bb\u627e\u6765\u6e90\u7684 CSDN \u5e16\u5b50\u7684\u603b\u7ed3\uff1a
\u672c\u5b9e\u9a8c\u5efa\u7acb\u7684\u7ebf\u7a0b\u90fd\u662f\u5185\u6838\u6001\u7ebf\u7a0b\u3002\u4e00\u4e2a\u4f9d\u636e\u5c31\u662f\u67d0\u4e2a\u7ebf\u7a0b trap \u540e\u4e0d\u4f1a\u963b\u585e\u5176\u5b83\u7ebf\u7a0b\u3002
\u7ebf\u7a0b\u7684 task_struct \u53ef\u4ee5\u7406\u89e3\u4e3a\u7406\u8bba\u8bfe\u4e0a\u8bb2\u7684 PCB (\u662f\u4e0d\u662f\u8be5\u53eb TCB\uff1f)\u3002\u91cc\u9762\u7684\u4e1c\u897f\u4f1a\u968f\u7740\u9010\u4e2a lab \u6dfb\u52a0\u8fdb\u53bb\uff0c\u6700\u7ec8\u4f1a\u6709\u4ee5\u4e0b\u4e1c\u897f\uff1a
Warning
TODO \u4ee5\u4e0b\u5185\u5bb9\u9700\u8981\u518d\u68c0\u67e5\uff0c\u5ffd\u7136\u5206\u4e0d\u6e05\u6bcf\u4e2a\u7ebf\u7a0b\u603b\u5171\u662f\u5f00\u4e86\u4e00\u4e2a\u8fd8\u662f\u4e24\u4e2a\u5185\u5b58\u7a7a\u95f4
\u7ebf\u7a0b\u5185\u5b58\u7a7a\u95f4\u7ed3\u6784\u5982\u4e0b\u3002
\u5185\u6838\u865a\u62df\u5b58\u50a8\u5668 \u7528\u6237\u4e0d\u53ef\u89c1\u7684\u5b58\u50a8\u5668 0xc000 0000 \u7528\u6237\u6808 \u2190 sp 0x4000 0000 \u5171\u4eab\u5e93\u7684\u5b58\u50a8\u5668\u6620\u5c04\u533a\u57df \u8fd0\u884c\u65f6\u5806\uff08\u7531malloc\u521b\u5efa\uff09 \u2190 brk \u8bfb\u5199\u6bb5 .data .bss \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d \u53ea\u8bfb\u6bb5 .init .text .rodata \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d 0x0804 8000 \u672a\u7528\u7684 \u4ece\u53ef\u6267\u884c\u6587\u4ef6\u52a0\u8f7d"},{"location":"docs/1-cs/os/lab/#lab3","title":"lab3","text":"\u5230\u672c\u5b9e\u9a8c\u7ed3\u675f\u65f6\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u5c06\u8981\u5b9e\u73b0\u8fd9\u6837\u4e00\u4e2a\u4ece\u542f\u52a8\u5230\u5f00\u542f\u6620\u5c04\u7684\u8fc7\u7a0b\uff08\u4e5f\u5bf9\u5e94 head.S
\u5f00\u5934\u7684\u4e00\u5806\u51fd\u6570\u8c03\u7528\u6d41\u7a0b\uff09\uff1a
lab2\u4e2d\u6211\u4eec\u505a\u7684\u90fd\u662f\u5185\u6838\u7ebf\u7a0b\uff0c\u53ef\u4ee5\u5171\u4eab\u8fd0\u884c\u7a7a\u95f4\uff0c\u5373\u8fd0\u884c\u4e0d\u540c\u7ebf\u7a0b\u5bf9\u5185\u8bad\u7684\u4fee\u6539\u662f\u76f8\u4e92\u53ef\u89c1\u7684\u3002\u5982\u679c\u9700\u8981\u7ebf\u7a0b\u76f8\u4e92\u9694\u79bb\u5c31\u9700\u8981\u5f15\u5165\u865a\u62df\u5185\u5b58\uff0c\u65b9\u4fbf\u591a\u7ebf\u7a0b\u9ad8\u6548\u5171\u4eab\u5185\u5b58\u3002\u5982\u679c\u5f88\u865a\u5730\u53bb\u8bb2\u865a\u62df\u5185\u5b58\u7684\u4f5c\u7528\uff1a
\u6211\u4eec\u8981\u5b9e\u73b0\u7684\u865a\u62df\u5185\u5b58\u5e03\u5c40\uff0c\u9996\u5148\u7528\u4e00\u4e2a\u622a\u56fe\u6765\u7406\u89e3\uff1a
\u4f4e\u5730\u5740<- ->\u9ad8\u5730\u5740\n\nstart_address end_address\n 0x0 0x3fffffffff\n \u2502 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2518 \u250c\u2500\u2500\u2500\u2500\u2500\u2518\n\u2193 256G \u2193 \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 User Space \u2502 ... \u2502 Kernel Space \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2191 256G \u2191\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \n \u2502 \u2502\n 0xffffffc000000000 0xffffffffffffffff\n start_address end_address\n
\u7136\u540e\u5fc5\u987b\u8981\u641e\u660e\u767d\uff1a\u865a\u62df\u5185\u5b58\u4ece\u6765\u6ca1\u6709\u88ab\u771f\u6b63\u5f00\u8f9f\u8fc7\uff0c\u88ab\u771f\u6b63\u5f00\u8f9f\u7684\u53ea\u6709\u7269\u7406\u5185\u5b58\u3002\u6211\u4eec\u5728\u7a0b\u5e8f\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5f00\u7684\u53d8\u91cf\u548c alloc \u7684 page\uff0c\u90fd\u662f\u5f00\u5728 kernel \u7684\u6808\u6216\u8005\u5806\u4e0a\uff08.data\u548c.bss\u6bb5\uff09\uff0c\u56e0\u4e3a\u67e5\u5730\u5740\u65f6\u53ef\u4ee5\u67e5\u5230\u5b83\u4eec\u7684\u7269\u7406\u5730\u5740\u3002\u800c\u5404\u79cd csr \u5728 cpu \u91cc\uff0c\u4e0d\u4f1a\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002\u800c\u672c\u6b21\u5b9e\u9a8c\u6240\u8bb2\u7684\u201c\u5f00\u542f\u865a\u62df\u5185\u5b58\u201d\uff0c\u672c\u8d28\u4e0a\u53ea\u662f\u8bbe\u8ba1\u4e00\u4e2a\u865a\u62df\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u8f6c\u6362\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u653e\u5728\u9875\u8868\u91cc\u3002
"},{"location":"docs/1-cs/os/lab/#sv39","title":"Sv39 \u7684\u9875\u8868\u9879","text":"\u7406\u89e3\u4e00\u4e0b\u9875\u8868\u9879\uff08pte\uff09\u3002\u5b83\u7684\u4f4e\u4f4d\uff1a
create_mapping()
\u51fd\u6570\u904d\u5386\u6574\u4e2a\u6620\u5c04\u5927\u5c0f\uff0c\u4f9d\u6b21\u6309\u4e8c\u7ea7\u9875\u8868\uff08\u5373\u6839\u9875\u8868\u7684\u4e0b\u4e00\u7ea7\uff09\u2192\u4e09\u7ea7\u9875\u8868\u2192\u7269\u7406\u9875\uff0c\u68c0\u67e5\u9875\u8868\u9879\u7684V bit\u770b\u9875\u8868\u9879\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u5219\u7528kalloc() \u5206\u914d\u4e00\u9875\u4f5c\u4e3a\u9875\u8868\u76ee\u5f55\uff1b\u5b58\u5728\u5219\u5728\u9875\u8868\u9879\u4e2d\u8bb0\u5f55\u9875\u8868\u7684\u7269\u7406\u5730\u5740\u3002
pte : [ PPN2: 53-28 ][ PPN1: 27-19 ][ PPN0: 18-10 ][ perm: 9-0 ]
vm_addr: [ VPN2: 38-30 ][ VPN1: 29-21 ][ VPN0:20-12 ][ offset: 11-0 ]
\u56e0\u4e3a\u67e5\u8be2\u4e09\u7ea7\u9875\u8868\u7684\u6d41\u7a0b\u4e3a\uff1a
\u6240\u4ee5\u53cd\u63a8\u8bbe\u7f6e\u7684\u6d41\u7a0b\u4e3a\uff1a
\u9876\u5c42\u9875\u8868
now_tbl = pgtbl;
now_vpn = VPN2(va);
now_pte = *(now_tbl + now_vpn);
\u6b21\u7ea7\u9875\u8868\u76f8\u540c
\u5728 2023 \u5e74\u7248\u7684\u5b9e\u9a8c\u4e2d\uff0cvmlinux.lds
\u4e2d\u8bbe\u7f6e\u4e86\u5c06\u7f16\u8bd1\u51fa\u7684\u7b26\u53f7\u8868\u90fd\u7528\u865a\u62df\u5730\u5740\u6765\u8868\u793a\uff0c\u65b9\u4fbf\u8c03\u8bd5\u3002\u4e5f\u5373\u7a0b\u5e8f\u8fd0\u884c\u5230\u6b64\u5904\u8bfb\u5230\u7684\u9875\u8868\u9879\u5730\u5740\u662f\u865a\u62df\u5730\u5740\u3002\u663e\u7136\uff0c\u5728 setup_vm()
\u4e4b\u524d\uff0c\u865a\u62df\u5185\u5b58\u8fd8\u6ca1\u6709\u88ab\u5f00\u542f\uff0c\u6240\u4ee5\u8981\u51cf\u6389\u4e00\u4e2a\u504f\u79fb\u91cf\u4f7f\u5176\u80fd\u8bfb\u5230\u9875\u8868\u9879\u7684\u7269\u7406\u5730\u5740\u3002\u5728 relocate:
\u5904\u7406\u504f\u79fb\u4e4b\u540e\u5c31\u4e0d\u7528\u7ba1\u4e86\u3002
\u6211\u4eec\u56de\u5fc6 lab3 \u91cc\u865a\u62df\u5730\u5740\u53ea\u7528\u4e86\u9ad8\u4f4d\uff0c\u4f4e\u4f4d\u6ca1\u6709\u7528\uff0c\u5728\u672c\u5b9e\u9a8c\u6211\u4eec\u8981\u5c06\u4f4e\u4f4d 0x0-0x4000000
\u5206\u7ed9\u7528\u6237\u8fdb\u7a0b\u3002\u800c\u7528\u6237\u8fdb\u7a0b\u7684\u4ee3\u7801\u5b9e\u9645\u5728\u7269\u7406\u5730\u5740\u4e0a\u5206\u914d\u51fa\u6765\u7684\u67d0\u4e2a\u5730\u65b9\u3002\u603b\u4e4b\uff0c\u8981\u5b9e\u73b0\u4ee5\u4e0b\u7684\u5185\u5b58\u5e03\u5c40\uff1a
PHY_START new allocated memory allocated space end PHY_END\n \u2502 \u2502 \u2502 \u2502\n \u25bc \u25bc \u25bc \u25bc\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n PA \u2502 \u2502 \u2502 uapp (copied from _sramdisk) \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25b2 \u25b2\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u2502 (map) \u2502\n \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502\n \u2502 \u2502\n \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n VA \u2502 UAPP \u2502 \u2502u mode stack\u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25b2 \u25b2\n \u2502 \u2502\n\n USER_START USER_END\n
"},{"location":"docs/1-cs/os/lab/#riscv_1","title":"riscv\u5904\u7406\u5668\u652f\u6301\u7684\u6a21\u5f0f","text":"lab3\u521b\u5efa\u7684\u90fd\u662f\u5185\u6838\u7ebf\u7a0b \u516c\u7528\u4e86\u5730\u5740\u7a7a\u95f4\uff08\u9875\u8868swapper_pg_dir\uff09\u3002\u8981\u5f15\u5165\u7528\u6237\u6001\u8fdb\u7a0b\u9700\u8981\u505a\uff1a
\u5177\u4f53\u5728\u6211\u4eec\u7684\u5b9e\u9a8c\u64cd\u4f5c\u4e2d\uff0c\u5b9e\u73b0\u7528\u6237\u6001\u548c\u5185\u6838\u6001\u5207\u6362\u7684\u65b9\u6cd5\u662f\uff1asstatus[SUM] \u548c PTE[U]
\u5bc4\u5b58\u5668 sstatus[SUM]
\u9875\u8868\u9879 PTE[U]
Warning
\u60f3\u5199\u4e00\u4e0b\u5728\u6c47\u7f16\u4ee3\u7801\u91cc\u7684\u64cd\u4f5c\uff0c\u5fd8\u5e72\u51c0\u4e86\uff0c\u6574\u4f53\u601d\u8def\u662f\u8fd9\u6837\u7684\uff0c\u4f46\u4e00\u4e9b\u7ec6\u8282\u5f85\u6838\u5b9e
\u5e76\u4e14\u5728\u6c47\u7f16\u4ee3\u7801\u91cc\u9700\u8981\u5b9e\u73b0\u4e00\u7cfb\u5217 csr \u8bfb\u5199\u64cd\u4f5c\uff1a
__switch_to
: \u9700\u8981\u52a0\u5165\u4fdd\u5b58/\u6062\u590d\u00a0sepc
sstatus
sscratch
\u00a0\u4ee5\u53ca\u5207\u6362\u9875\u8868\u7684\u903b\u8f91\u3002\u5728\u5207\u6362\u4e86\u9875\u8868\u4e4b\u540e\uff0c\u9700\u8981\u901a\u8fc7\u00a0fence.i
\u00a0\u548c\u00a0vma.fence
\u00a0\u6765\u5237\u65b0 TLB \u548c ICache\u3002_traps
\u548c trap_handler()
: \u56e0\u4e3a\u6211\u4eec\u7684\u7ebf\u7a0b\u662f\u5728trap\u91cc\u5207\u6362\u7684\uff0c\u8fd8\u8981\u6539trap\u7684\u903b\u8f91\u3002\u7ebf\u7a0b\u5728u-mode\u91cc\u8fd0\u884c\uff0c\u5230trap\u8981\u5207\u6210s-mode\uff0c\u4e2d\u65ad\u5b8c\u518d\u5207\u56de\u6765\u3002\u4e14\u5982\u679c\u662f\u5185\u6838\u7ebf\u7a0b\uff08\u6ca1\u6709u-mode stack\uff09\u89e6\u53d1\u4e86\u5f02\u5e38\u5c31\u4e0d\u9700\u8981\u8fdb\u884c\u5207\u6362\uff0c\u6240\u4ee5\u5185\u6838\u7ebf\u7a0b\u7684sp\u6c38\u8fdc\u6307\u5411s-mode stack\uff0csscratch\uff08sp\uff1f\uff09\u4e3a0\u3002TODO\uff1a\u6709\u4e00\u4e2a\u975e\u5e38\u4f18\u96c5\u7684\u76f4\u63a5\u5b9e\u73b0\u4e24\u4e2a csr \u4ea4\u6362\u7684\u547d\u4ee4\u3002\u627e\u4e0d\u5230\u4e86\u3002\u4f1a\u8865\u7684\u3002__dummy
: \u6211\u4eec\u56de\u5fc6\u4e4b\u524d lab2 \u5b9e\u73b0\u7684\u662f\uff0c\u76f4\u63a5\u5c06 __dummy
\u51fd\u6570\u7684\u5199\u5728\u7ebf\u7a0b\u7684 sepc\uff08\u4e2d\u65ad\u8fd4\u56de\u5730\u5740\uff09\u91cc\uff0c\u53c8\u5728 __dummy
\u91cc\u5199\u8fd4\u56de\u5730\u5740\u662f dummy()
\u51fd\u6570\u3002\u6240\u4ee5\u5982\u679c\u6211\u4eec\u8fd9\u91cc\u60f3\u8ba9\u8fdb\u7a0b\u5207\u6362\u5230\u7528\u6237\u8fdb\u7a0b\u540e\u8fdb\u5165\u7528\u6237\u7a0b\u5e8f\uff0c\u4fee\u6539 __dummy
\u8fd0\u884c\u5b8c\u6240\u8fd4\u56de\u7684\u5730\u5740\u4e3a user app \u7684\u7b2c\u4e00\u6761\u6307\u4ee4\u5730\u5740\u5c31\u53ef\u4ee5\u4e86\u3002\u4e00\u79cd\u7269\u7406\u5185\u5b58\u7ba1\u7406\u7b97\u6cd5\uff0c\u7a7a\u95f2\u7a7a\u95f4\u9996\u5148\u88ab\u770b\u6210 2^N \u4e2a\u7269\u7406\u9875\u7684\u5927\u7a7a\u95f4\uff0c\u5f53\u4e00\u4e2a\u5927\u5c0f\u4e3a m \u7684\u9875\u8bf7\u6c42\u5185\u5b58\u5206\u914d\u65f6\uff0c\u4e0d\u505c\u628a\u7a7a\u95f4 /2 \u5212\u5206\uff0c\u6700\u540e\u627e\u5230\u6700\u63a5\u8fd1m\u76842\u7684\u6b21\u65b9\u7684\u4e00\u4e2a\u7a7a\u95f4\u5927\u5c0f\u5206\u7ed9 m\u3002\u5f53\u5757\u91ca\u653e\u65f6\uff0c\u5206\u914d\u5668\u5c31\u4f1a\u627e\u5230\u5176\u5b83\u7a7a\u95f2\u7684\u4f19\u4f34\u5757\u53bb\u5408\u5e76\u3002\u5b83\u7684\u5b9e\u73b0\u5728\u8fd9\u4e2a\u6587\u7ae0\u91cc\u8bb2\u5f97\u66f4\u597d Lab 6\uff1aRISC-V \u52a8\u6001\u5185\u5b58\u5206\u914d\u4e0e\u7f3a\u9875\u5f02\u5e38\u5904\u7406 - \u77e5\u4e4e (zhihu.com)\u3002
"},{"location":"docs/1-cs/os/lab/#elf","title":"elf \u6587\u4ef6","text":"\u4e00\u4e2a elf \u6587\u4ef6\u50cf\u4e00\u4e2a\u5c01\u88c5\u590d\u6742\u7248\u7684\u4e8c\u8fdb\u5236\u7528\u6237\u7a0b\u5e8f\u3002\u7528\u62bd\u8c61\u7684\u753b\u56fe\u7ed9\u5b83\u7684\u7ed3\u6784\u505a\u4e00\u4e2a\u6bd4\u55bb\uff08\u5bf9\u4e0d\u8d77\u592a\u62bd\u8c61\u4e86\uff09\uff1a
Elf_Ehdr ehdr->e_phoff\n\u2b07\ufe0f \u2b07\ufe0f\n[ [type: ???][type: LOAD][type: ???] ]\n
\u5c31\u662f elf \u6587\u4ef6\u91cc\u6563\u843d\u7740\u51e0\u4e2a\u5c0f\u6bb5\uff0c\u5176\u4e2d\u4e00\u4e2a\u7c7b\u578b\u4e3a LOAD \u7684\u6bb5\u662f\u9700\u8981\u590d\u5236\u5230\u7ebf\u7a0b\u4ee3\u7801\u6bb5\u7684\uff0c\u4f46\u4e0d\u4e00\u5b9a\u590d\u5236\u5230\u7ebf\u7a0b\u5934\u7684\u8d77\u59cb\u5730\u5740 0x0
\uff0cp_vaddr
\u4f1a\u544a\u8bc9\u4f60\u8fd9\u6bb5\u4ee3\u7801\u5e0c\u671b\u88ab\u590d\u5236\u5230\u54ea\u91cc\u53bb\u3002e_entry \u4e5f\u8d34\u5fc3\u544a\u8bc9\u4f60\u7b2c\u4e00\u6761\u4ee3\u7801\u6307\u4ee4\u7684\u8d77\u59cb\u5730\u5740\u5728\u54ea\u3002\u603b\u4e4b\uff0c\u4f60\u9700\u8981\u5148\u901a\u8fc7\u4e00\u4e9b\u504f\u79fb\u91cf\u5728 Elf64_Ehdr \u8fd9\u4e2a\u6307\u9488\u91cc\u627e\u5230\u7b2c\u4e00\u4e2a segment\uff0c\u7136\u540e\u4ee5\u4e00\u4e2a Elf63_phdr \u7684\u5927\u5c0f\u4e3a\u5355\u4f4d\uff0c\u6328\u4e2a\u53bb\u5bfb\u627e\u4e00\u4e2a\u7c7b\u578b\u4e3a LOAD \u7684 segment\u3002\u7b49\u627e\u5230\u4e86\u5c31\u53ef\u4ee5\u62f7\u8d1d\u4e86\u3002
\u5982\u679c\u4f60\u6309\u7167\u4e00\u5806\u6307\u9488\u7684\u5199\u6cd5\u88ab\u641e\u5f97\u6655\u5934\u8f6c\u5411\uff0c\u751a\u81f3\u53ea\u662f\u5148\u7528 readelf -h
\u67e5\u770b\u4e00\u4e0b elf \u6587\u4ef6\u91cc\u5404\u4e2a\u4e1c\u897f\u7684\u5730\u5740\uff08\u67e5\u770b\u540e\u53ef\u4ee5\u53d1\u73b0\u4e0e\u5b9e\u9a8c\u6307\u5bfc\u4e2d\u7ed9\u7684\u4f8b\u5b50\u5c31\u662f\u540c\u4e00\u4e2a\u6587\u4ef6\uff09\uff0c\u7136\u540e\u76f4\u63a5\u628a\u6574\u4e2a uapp \u7a0b\u5e8f\u5168\u90e8\u62f7\u5230\u8fdb\u7a0b\u91cc\u6765\uff0c\u76f4\u63a5\u628a __dummy
\u8fd4\u56de\u5730\u5740\u6307\u5230\u4f60\u5728\u6587\u4ef6\u91cc\u8bfb\u51fa\u6765\u7684\u90a3\u4e2a\u4ee3\u7801\u8d77\u59cb\u5730\u5740\uff0c\u751a\u81f3\u90fd\u80fd\u8dd1\u3002\u5728\u8dd1\u8d77\u6765\u4e4b\u540e\uff0c\u6839\u636e\u4f60\u7684\u7406\u89e3\u4e00\u70b9\u4e00\u70b9\u628a\u8bbe\u7f6e\u6307\u9488\u7684\u4ee3\u7801\u6309\u7167\u542b\u4e49\u66ff\u6362\u4e0a\uff0c\u6211\u611f\u89c9\u8fd9\u6837\u53cd\u7740\u505a\u4e5f\u884c\u3002
Warning
\u4e0b\u9762\u51e0\u4e2a\u5b9e\u9a8c\u6211\u5199\u5f97\u6709\u70b9\u7b80\u7565\uff0c\u5c0f\u90e8\u5206\u56e0\u4e3a\u6211\u4e0d\u8bb0\u5f97\u4e86\uff0c\u5927\u90e8\u5206\u56e0\u4e3a\u6211\u81ea\u6211\u611f\u89c9\u6ca1\u6709\u5403\u900f\u8fd9\u4e2a\u5b9e\u9a8c\uff0c\u4e0d\u73ed\u95e8\u5f04\u65a7\u4e86\u3002\u4f46\u662f\u8fd9\u4e2a\u5730\u65b9\u53d1\u81ea\u5185\u5fc3\u5730\u60f3\u7559\u4e2a TODO \u5e0c\u671b\u80fd\u6709\u673a\u4f1a\u8865\u5b8c\u3002
\u672c\u5b9e\u9a8c\u4e0e lab4 \u5185\u5b58\u5206\u914d\u7684\u533a\u522b\u662f\uff0c\u4e3a\u4e86\u9632\u6b62\u7269\u7406\u5185\u5b58\u4e0d\u8db3\uff0c\u5728 task \u521d\u59cb\u5316\u8bf7\u6c42\u7a7a\u95f4\u65f6\uff0c\u5148\u4e0d\u5206\u914d\u7269\u7406\u5185\u5b58\uff0c\u800c\u662f\u7528 do_mmap()
\u5148\u628a task \u7684\u8bf7\u6c42\u7684\u6240\u6709\u53c2\u6570\u8bb0\u5f55\u4e0b\u6765\uff0c\u7b49 task \u771f\u6b63\u53bb\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u5fc5\u7136\u4f1a\u89e6\u53d1 page fault\uff0c\u7136\u540e\u5728 page fault handler \u91cc\u6839\u636e\u8bb0\u5f55\u7684\u53c2\u6570\uff0c\u518d\u5206\u914d\u7269\u7406\u5185\u5b58\u3002
\u5b9e\u9a8c\u4e3b\u8981\u76ee\u6807\u662f\u5b9e\u73b0\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u903b\u8f91\uff0c\u5373\u5728\u7528\u6237\u7a0b\u5e8f\u8c03\u7528fork()\u51fd\u6570\uff0c\u4ea7\u751f220\u53f7\u7cfb\u7edf\u8c03\u7528\u7684\u65f6\u5019\uff0c\u5728sys_clone()\u8fd9\u4e2a\u51fd\u6570\u91cc\u521b\u5efa\u5b50\u8fdb\u7a0b\uff0c\u5e76\u4f7f\u5176\u52a0\u5165\u88ab\u8c03\u7528\u7684task\u961f\u5217\u3002
"},{"location":"docs/1-cs/os/lab/#lab7","title":"lab7","text":"Warning
lab7 \u6211\u53ea\u5b8c\u6210\u4e86\u5360 60% \u7684\u7b2c\u4e00\u90e8\u5206\uff0c\u4f46\u5176\u5b9e\u5de5\u4f5c\u91cf\u6bd4\u8f83\u5927\u7684\u8fd8\u5728\u7b2c\u4e8c\u90e8\u5206\u3002\u6211\u8fd9\u91cc\u53ea\u80fd\u603b\u7ed3\u7b2c\u4e00\u90e8\u5206\u4e86\u3002
\u672c\u5b9e\u9a8c\u6bcf\u4e2atask\u90fd\u6709\u4e00\u4e2a\u7ed3\u6784\u4f53\u53bb\u7ef4\u62a4\u5df2\u7ecf\u6253\u5f00\u7684\u6587\u4ef6\u8868\u3002\u672c\u5b9e\u9a8c\u9996\u5148\u4fee\u6539task struct\uff0c\u5728\u6bcf\u4e2atask struct\u4e2d\u6dfb\u52a0\u4e86\u4e00\u4e2a\u9875(struct file* \u578b)\u53bb\u7ef4\u62a4\u8fd9\u4e2a\u6587\u4ef6\u8868\u3002
\u6bcf\u4e2a\u6587\u4ef6\u8868\u6709\u4e00\u4e9b\u51fd\u6570\u6307\u9488\uff0c\u5206\u522b\u6307\u5411\u5bf9\u6587\u4ef6\u7684\u8bfb\u5199\u64cd\u4f5c\u51fd\u6570\u3002\u9996\u5148\u9700\u8981\u5b9e\u73b0\u8fd9\u4e9b\u51fd\u6570\uff0c\u5982 stdout_write()
\u548c stdin_read()
\u7b49\u3002
\u5f53\u7528\u6237\u7a0b\u5e8f\u4ea7\u751f\u6587\u4ef6\u8bfb\u5199\u7684 system call \u65f6\uff0ctrap_handler()
\u4e2d\u9700\u8981\u5b9e\u73b0\u5bf9\u8fd9\u4e9b system call \u7684\u5904\u7406\u51fd\u6570\u3002\u5177\u4f53\u64cd\u4f5c\u5c31\u662f\u6355\u83b7\uff0c\u7136\u540e\u4ec0\u4e48\u4e5f\u4e0d\u505a\uff0c\u76f4\u63a5\u628a\u53c2\u6570\u4ea4\u7ed9\u4e0a\u8ff0\u5b9e\u73b0\u7684\u6587\u4ef6\u8bfb\u5199\u51fd\u6570\u6765\u64cd\u4f5c\u3002
Q1: \u8fd0\u884c\u53d1\u73b0\u7a0b\u5e8f\u5728\u51e0\u4e2a\u521d\u59cb\u5316\u51fd\u6570\u4e4b\u95f4\u6765\u56de\u8df3\u8dc3\uff0c\u6bd4\u5982\u5df2\u7ecf\u5230\u4e86 set_up_vm_final()
\uff0c\u53c8\u8df3\u56de set_up_vm()
\uff0c\u518d\u5f80\u4e0b\u8fd0\u884c\u5c31\u5728\u8fd9\u51e0\u4e2a\u51fd\u6570\u4e4b\u95f4\u5faa\u73af\u3002\u8fdb\u5165 gdb \u8c03\u8bd5\uff0c\u5219\u53d1\u73b0\u53d1\u751f\u8df3\u8f6c\u7684\u5730\u65b9\u5e76\u6ca1\u6709\u4efb\u4f55 branch \u6216\u8005 call \u8bed\u53e5\u6307\u5411\u8df3\u5f80\u7684\u5730\u5740\uff0c\u4f46\u662f\u80fd\u89c2\u5bdf\u5230\u51fa\u73b0\u8df3\u8f6c\u7684\u5730\u65b9\uff0c\u5f80\u5f80\u662f\u8fdb\u4e86 memset() \u6216\u8005 memcopy() \u51fd\u6570\u3002
A1: \u6574\u4e2a\u5b9e\u9a8c\u8fc7\u7a0b\u4e2d\u6211\u9047\u5230\u4e86\u4e09\u56db\u6b21\uff0c\u4e00\u5f00\u59cb\u89c9\u5f97\u662f\u4ee5\u5947\u602a\u7684\u65b9\u5f0f\u89e3\u51b3\u4e86\uff08\u6bd4\u5982\uff0c\u7a81\u7136\u53d1\u73b0\u81ea\u5df1\u5728\u521d\u59cb\u5316\u8fdb\u7a0b\uff0c\u5f15\u5165\u5916\u90e8\u9875\u8868\u65f6\u7528\u5230\u7684\u4ee3\u7801\u662f extern unsigned long *swapper_pg_dir;
\uff0c\u800c\u4e0d\u662f extern unsigned long swapper_pg_dir[512] __attribute__((__aligned__(0x1000)));
\uff0c\u5373\uff0c\u7f3a\u5c11\u4e86\u4e00\u4e2a\u5730\u5740\u5bf9\u9f50\u3002\u540c\u5b66\u6307\u51fa\u5982\u679c\u6ca1\u6709\u5bf9\u9f50\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u9875\u8868\u8fb9\u7f18\u7684\u4e00\u4e9b\u6570\u636e\u7684\u4e22\u5931\u635f\u574f\u3002\uff09\uff0c\u540e\u6765\u6162\u6162\u53d1\u73b0\u89c4\u5f8b\u662f\uff1a\u53d1\u751f\u8fd9\u6837\u8df3\u8f6c\u7684\u6307\u4ee4\uff0c\u90fd\u5728\u5c1d\u8bd5\u5f80 0x80000000
\u8fd9\u4e2a\u7269\u7406\u5730\u5740\u4ee5\u4e0b\u7684\u7269\u7406\u5730\u5740\u5199\u4e1c\u897f\u3002\u6211\u4eec\u6ce8\u610f\u5230 qemu \u63d0\u4f9b\u7ed9\u6211\u4eec\u7684\u7269\u7406\u5730\u5740\u90fd\u662f 0x80000000
\u4ee5\u4e0a\u7684\u5730\u5740\uff0c\u867d\u7136\u6ca1\u6709\u8003\u8bc1\uff0c\u4f46\u662f\u5408\u7406\u731c\u6d4b\u5176\u4e0b\u7684\u5730\u5740\u662f qemu \u81ea\u5df1\u7684\u4ee3\u7801\u533a\uff0c\u652f\u6301 qemu \u81ea\u5df1\u7684\u8fd0\u884c\u903b\u8f91\u3002\u5982\u679c\u4e0d\u5c0f\u5fc3\u5199\u5230\u4e86\u8fd9\u4e2a\u5730\u65b9\uff0c\u5f53\u7136\u53ef\u80fd\u53d1\u751f\u4e0d\u80fd\u89e3\u91ca\u7684 qemu \u884c\u4e3a\u3002
\u6240\u4ee5\u5982\u679c\u9047\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u884c\u7684\u4e00\u6b65\u4e00\u6b65\u68c0\u67e5\u65b9\u6cd5\u662f\uff1a
create_mapping()
\u505a\u9875\u8868\u6709\u6ca1\u6709\u505a\u5bf9\u3002\u4e00\u4e2a\u6f02\u4eae\u7684\u68c0\u67e5\u65b9\u6cd5\u662f printk(\"[function name]: map from %#llx-%#llx to %#llx-%#llx\", pa, pa+size, va, va+size);
\uff0c\u5e2e\u52a9\u68c0\u67e5\u4ece\u54ea\u4e2a\u5730\u5740 copy \u5230\u54ea\u4e2a\u5730\u5740\u4e86\u3002memset()
memcpy()
\u7b49\u51fd\u6570\u6709\u6ca1\u6709\u7528\u5bf9\u3002\u4e00\u6837\u662f\u7528\u4e0a\u9762\u7c7b\u4f3c\u7684 prink \u53bb\u6253\u5370\u8d77\u59cb\u5730\u5740\u3002\u603b\u4e4b\uff0c\u6839\u672c\u76ee\u6807\u662f\u53bb\u770b\u4e00\u4e0b\u6709\u6ca1\u6709\u5f80\u7269\u7406\u5730\u5740 0x80000000
\u4ee5\u4e0b\u7684\u5730\u65b9\u5199\u4e1c\u897f\u3002
Q2: \u8fd0\u884c\u7a0b\u5e8f\u5230\u4e00\u534a\u5361\u4f4f\uff0c\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa\u4e86\uff0c\u8c03\u8bd5\u53d1\u73b0\u6700\u540e\u662f\u5728 __dummy
\u7684 sret
\u540e\u5361\u4f4f\u4e86\u3002
A2: \u53ef\u4ee5\u5148\u5b9e\u73b0\u4e00\u4e2a\u6f02\u4eae\u70b9\u7684 trap_handler()
\u5e2e\u52a9\u8c03\u8bd5\u3002\u8fd9\u70b9\u5728 lab7 \u7684\u6307\u5bfc\u91cc\u624d\u6709\u63d0\u793a\u5230\uff0c\u4e0d\u8fc7\u6211\u89c9\u5f97\u5e94\u8be5\u65e9\u70b9\u5b9e\u73b0\u8d77\u6765\u3002\u6bd4\u5982\uff1a
void trap_handler(uint64 scause, uint64 sepc, struct pt_regs* regs) { // a0, a1, a2\nuint64 stval = csr_read(stval);\n// printk(\"[S] Trap @sepc = %#llx, @scause = %#llx, @stval = %#llx\\n\", sepc, scause, stval);\nint done = 0;\n/* Interrupt */\nif ((scause >> 63) && (scause & 0x7FFFFFFFFFFFFFFF) == 5) {\nclock_set_next_event();\nprintk(\"[S] Supervisor Timer Intterupt\\n\");\ndo_timer();\n} /* Exception */\nelse {\n/* instrution addr misaligned */\nif (scause == 0) {}\n/* Instruction access fault */\nelse if (scause == 1) {}\n/* Illegal instruction */\nelse if (scause == 2) {}\n/* breakpoint */\nelse if (scause == 3) {}\n/* load addr misaligned */\nelse if (scause == 4) {}\n/* load access fault */\nelse if (scause == 5) {}\n/* store/amo addr misaligned */\nelse if (scause == 6) {}\n/* store/amo access fault */\nelse if (scause == 7) {}\n/* ecall U-mode */\nelse if (scause == 8) {\nif (sys_call_num == SYS_WRITE) {\n// ...\n} else if (sys_call_num == SYS_GETPID) {\n// ...\n} else if (sys_call_num == SYS_CLONE) {\n// ...\n}\nregs->sepc += 4; // pc + 4\n} /* ecall S-mode */\nelse if (scause == 9) {}\n/* Instruction page fault */\n/* Load page fault */\n/* Store/amo page fault */\nelse if (scause == 12 || scause == 13 || scause == 15) {\ndone = do_page_fault(scause, regs);\n} else {\nprintk(\"[S] Unhandled exception with scause = %d, sepc = %lx\\n\", scause, sepc);\nwhile (1);\n}\n}\n// if (!done) while(1);\n}\n
\u603b\u4e4b\uff0c\u5efa\u8bae\u5bf9 trap_handler()
\u505a\u7684\u6539\u8fdb\u6709\u4e24\u4ef6 while(1)
\u8bed\u53e5\uff0c\u8fd9\u662f\u56e0\u4e3a\u5982\u679c\u4f60\u7684\u7a0b\u5e8f\u5361\u4f4f\u7684\u539f\u56e0\u662f\u5faa\u73af\u53d1\u751f trap\uff0c\u4e00\u4e2a trap \u8fd8\u6ca1\u7ed3\u675f\u5c31\u8fdb\u5165\u4e86\u53e6\u4e00\u4e2a\uff0c\u90a3\u53ef\u80fd\u4f1a\u5faa\u73af\u8f93\u51fa\u4f60\u6253\u5370\u7684\u4fe1\u606f\u770b\u4e0d\u6e05\u3002\u8fd9\u4e2a\u8bed\u53e5\u53ef\u4ee5\u5e2e\u4f60\u505c\u4f4f\u8ba9\u4f60\u770b\u6e05\u6253\u5370\u7684\u4fe1\u606f\u3002\uff08\u600e\u4e48\u6211\u8bb2\u5f97\u542c\u8d77\u6765\u597d\u5f31\u667a\uff09\u5982\u679c\u786e\u5b9e\u662f\u5faa\u73af trap \u5bfc\u81f4\u7684\u7a0b\u5e8f\u5361\u4f4f\uff0c\u90a3\u4e48\u6309\u6253\u5370\u7684\u4fe1\u606f\u53bb\u601d\u8003\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\u679c\u8fd8\u662f\u4ec0\u4e48\u8f93\u51fa\u90fd\u6ca1\u6709\uff08\u6211\u8bb0\u5f97\u4e5f\u6709\u8fd9\u79cd\u60c5\u51b5\uff09\uff0c\u6211\u4e0d\u8bb0\u5f97\u662f\u4ec0\u4e48\u539f\u56e0\u4e86\uff0c\u4f46\u662f\u8d77\u7801\u5e2e\u4f60\u6392\u9664\u4e86\u53d1\u751f\u4e86 trap \u7684\u53ef\u80fd\u6027\uff0c\u4f60\u53ef\u4ee5\u5728\u6b64\u57fa\u7840\u4e0a\u7ee7\u7eed\u601d\u8003\u662f\u4e3a\u4ec0\u4e48\u3002
"},{"location":"docs/2-ling/","title":"Linguistic Notes","text":":material-circle-edit-outline: \u7ea6 62 \u4e2a\u5b57
This section mainly consists of the notes of the linguistics courses from Zhejiang University.
"},{"location":"docs/2-ling/#contents","title":"Contents","text":"It is commonly considered that the subject linguistics consists of 6 main branches.
Besides, we also talk about other topics,
French
Cross-lingual comparison
:material-circle-edit-outline: \u7ea6 40 \u4e2a\u5b57
\u4e3b\u8981\u53ef\u80fd\u5199\u4e00\u4e9b\u8bed\u6cd5\uff0c\u8bcd\u6cd5\u548c\u53e5\u6cd5\u7b49\u3002
\u5355\u8bcd\u8bb0\u5fc6\u548c\u4e60\u60ef\u7528\u8bed\u4e0d\u5728\u672c\u5e16\u7684\u8bb0\u5f55\u8303\u56f4\u4e4b\u5185\u3002
"},{"location":"docs/2-ling/acqusition/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1161 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/2-ling/acqusition/french-tense/#overview","title":"Overview\uff1a\u8bed\u6001\u548c\u65f6\u6001","text":"\u52a8\u8bcd\u7684\u53d8\u4f4d\u6709\u4e24\u79cd\u5c5e\u6027\uff1a\u8bed\u6001\u548c\u65f6\u6001\u3002\u8bed\u6001\u5bf9\u5e94\u4e00\u4e2a\u52a8\u4f5c\u7684\u7edd\u5bf9\u8fdb\u884c\u7a0b\u5ea6\u5c5e\u6027\uff0c\u800c\u65f6\u6001\u5bf9\u5e94\u52a8\u4f5c\u7684\u76f8\u5bf9\u53d1\u751f\u65f6\u95f4\u3002
\u6211\u627e\u5230\u4e86\u4e00\u4e2a\u5173\u4e8e\u8bed\u6001\u6bd4\u8f83\u597d\u7684\u793a\u610f\u56fe\uff0c\u6a2a\u5411\u8868\u793a\u52a8\u8bcd\u7684\u5b8c\u6210\u7a0b\u5ea6\uff0c\u7eb5\u5411\u8868\u793a\u52a8\u8bcd\u672c\u8eab\u7684\u6301\u7eed\u65f6\u957f\uff0c\u4e8e\u662f\u4e0a\u3001\u4e0b\u3001\u5de6\u3001\u53f3\u53ef\u4ee5\u5927\u81f4\u5bf9\u5e94\u77ac\u6001\u52a8\u8bcd\u3001\u6301\u7eed\u52a8\u8bcd\u3001\u5c06\u8981\u53bb\u505a\u3001\u5df2\u7ecf\u5b8c\u6210\u3002
\u77ac\u6001\n /\\\n / \\\n /\u975e\u5e38\u6001\\\n -------\n\u4e0d\u5b9a\u6001 / \\ \u5b8c\u6210\u6001\n ------------\n \u5e38\u6001\n
\u800c\u65f6\u6001\u8868\u793a\u52a8\u4f5c\u53d1\u751f\u7684\u65f6\u95f4\u987a\u5e8f\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u4e09\u89d2\u5957\u5165\u8fc7\u53bb\u3001\u73b0\u5728\u3001\u5c06\u6765\u8fd9\u4e09\u4e2a\u76f8\u5bf9\u65f6\u95f4\uff0c\u7ec4\u5408\u5f97\u5230\u5bf9\u5e94\u65f6\u6001\u4e0b\u7684\u591a\u4e2a\u8bed\u6001\u3002 \u6cd5\u8bed\u7684 3 \u79cd\u65f6\u6001\u6709\uff1a
\u540c\u65f6\u8fd8\u6709 6 \u79cd\u8bed\u6001\uff1a
\u4e8e\u662f\u53ef\u4ee5\u7ec4\u5408\u4ea7\u751f\u591a\u4e2a\u65f6\u6001\u4e0b\u7684\u591a\u4e2a\u8bed\u6001\uff0c\u5b83\u4eec\u4e00\u822c\u5408\u79f0\u53eb\u65f6\u6001\uff0c\u6709\u70b9\u6b67\u4e49\uff0c\u4e0d\u8fc7\u5c31\u8fd9\u6837\u53eb\u597d\u4e86\u3002\u4e0b\u9762\u4e00\u4e00\u4ecb\u7ecd\u3002
"},{"location":"docs/2-ling/acqusition/french-tense/#_1","title":"\u5177\u4f53\u65f6\u6001\u4ecb\u7ecd","text":"\u9996\u5148\u63d0\u4f9b\u4e00\u4e2a overview\u3002
Fig 1. \u4ec5\u4e0e\u5ba2\u89c2\u73b0\u5b9e\u6709\u5173\u7684\u51e0\u4e2a\u65f6\u6001\u7684\u65f6\u95f4\u8f74
\u76f4\u9648\u5f0f (l'indicatif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u76f4\u9648\u5f0f\u73b0\u5728\u65f6l'indicatif pr\u00e9sent \u53d1\u751f\u5728\u73b0\u5728\u7684\u52a8\u4f5c\u6216\u5b58\u5728\u7684\u72b6\u6001\u3002 \u52a8\u8bcd\u8bcd\u6839 - \u8bcd\u5c3e + \u4e0d\u540c\u4eba\u79f0\u4e3b\u8bed\u5bf9\u5e94\u7684\u8bcd\u5c3e j'aime,tu aimes,il/elle/on aime,nous aimons,vous aimez,ils/elle aiment je choisis,tu choisis,il/elle/on choisit,nous choisissons,vous choisissez,ils/elles choisissent je dors,tu dors,il/elle/on dort,nous dormons,vous dormez,ils/elles dorment \u76f4\u9648\u5f0f\u590d\u5408\u8fc7\u53bb\u65f6le pass\u00e9 compos\u00e9 \u8868\u793a\u4ece\u73b0\u5728\u89d2\u5ea6\u770b\u5df2\u7ecf\u53d1\u751f\u7684\u52a8\u4f5c\u3002\u8868\u8fbe\u7684\u662f\u201c\u67d0\u4e8b\u5df2\u7ecf\u5b8c\u6210\u201d\u7684\u6982\u5ff5\u3002 \u00eatre \u7684\u76f4\u9648\u5f0f\u73b0\u5728\u65f6 + \u52a8\u8bcd\u8fc7\u53bb\u5206\u8bcd\uff08\u5c11\u90e8\u5206\u8868\u793a\u8d8b\u5411\u6027\u3001\u4f4d\u7f6e\u6216\u72b6\u6001\u53d8\u5316\u7684\u4e0d\u53ca\u7269\u52a8\u8bcd\u3001\u6240\u6709\u4ee3\u8bcd\u5f0f\u52a8\u8bcd\uff0csee Fig 2\uff09 \u6216avoir \u7684\u76f4\u9648\u5f0f\u73b0\u5728\u65f6 + \u52a8\u8bcd\u8fc7\u53bb\u5206\u8bcd\uff08\u5176\u5b83\uff09 .. .. .. \u76f4\u9648\u5f0f\u672a\u5b8c\u6210\u8fc7\u53bb\u65f6l'imparfait \u8868\u793a\u8fc7\u53bb\u53d1\u751f\u7684\u52a8\u4f5c\uff0c\u53ea\u662f\u4e8b\u60c5\u7684\u5b8c\u6210\u72b6\u6001\u662f\u4e0d\u660e\u786e\u7684\uff0c \u76f4\u9648\u5f0f\u6108\u8fc7\u53bb\u65f6le plus-que parfait \u76f4\u9648\u5f0f\u7b80\u5355\u8fc7\u53bb\u65f6le pass\u00e9 simple \u76f4\u9648\u5f0f\u5148\u8fc7\u53bb\u65f6le pass\u00e9 ant\u00e9rieur \u76f4\u9648\u5f0f\u6700\u8fd1\u8fc7\u53bb\u65f6le pass\u00e9 proche \u76f4\u9648\u5f0f\u7b80\u5355\u5c06\u6765\u65f6le furture simple \u76f4\u9648\u5f0f\u5148\u5c06\u6765\u65f6le future ant\u00e9rieur \u76f4\u9648\u5f0f\u6700\u8fd1\u5c06\u6765\u65f6le future proche \u76f4\u9648\u5f0f\u8fc7\u53bb\u5c06\u6765\u65f6le futur dans le pass\u00e9Fig 2. le pass\u00e9 compos\u00e9 \u4e2d\u4f7f\u7528 \u00eatre \u52a9\u52a8\u8bcd\u7684\u52a8\u8bcd
\u547d\u4ee4\u5f0f (l'imp\u00e9ratif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u6761\u4ef6\u5f0f (le conditionnel)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u865a\u62df\u5f0f (le subjonctif)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent\u5206\u8bcd\u5f0f (le participe)\u4e0b\u7684\u65f6\u6001
\u65f6\u6001 \u5b9a\u4e49 \u5927\u81f4\u6784\u6210\u89c4\u5219 \u4e00\u7c7b\u52a8\u8bcd\u6784\u6210 \u6784\u6210 \u7b2c\u4e09\u7ec4\u6784\u6210 \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent \u547d\u4ee4\u5f0f\u73b0\u5728\u65f6l'imp\u00e9ratif pr\u00e9sent"},{"location":"docs/2-ling/acqusition/french-tense/#references","title":"References","text":":material-circle-edit-outline: \u7ea6 2 \u4e2a\u5b57
"},{"location":"docs/2-ling/morphology/#outline","title":"outline","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/","title":"TODO","text":":material-circle-edit-outline: \u7ea6 327 \u4e2a\u5b57 :fontawesome-solid-code: 2 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
Aug. 25th. 2023
This talk aims both to provide an introduction to the subject Philosophy of Language (a similar subject with semantics and pragmatics, according to its definition; PoL hereafter), and give a summary on the recent ongoing discussion on the linguistics concepts in NLP (e.g. \"meaning\", \"understanding\", \"reasoning\", \"grounding\").
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#a-preview-of-this-talk","title":"A Preview of This Talk","text":"1st 40min: History of philosophy of language 2nd 40min: Recent papers and discussions on PoL topics in NLP 3rd 10min: Discussion on take-away
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#the-location-of-pol-on-the-academic-coordinate","title":"The Location of PoL on the Academic Coordinate","text":"Before we start this talk, we will first provide a brief definition of the term Philosophy of Language in our talk here. The PoL concerns mainly the two following questions, (i) The relationship between the natural language and the world, (ii) The relationship between the human languages and their meaning. Chen (2003) believes that the PoL and the linguistics are two different subjects. He suggests that the linguistics is the study of language rules and patterns and the application of them, while the PoL pays more attention on the more abstract and essential features of the human language (e.g. its relation to the cognition). The author of this talk believes, according to the definition of PoL, it is a subject that closely involves the semantics and pragmatics branches in linguistics. However the PoL and linguistics overlap or not, it is commonly believed that the subject PoL was born in the 1920s, when the linguistic turn was put on stage in the European philosophy.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#history-of-pol","title":"History of PoL","text":"Now we will dive into the history of PoL. This section is parted \"person by person\". It is noticed that \"person-by-person\" is a common structure of most of the philosophy history, as most of the philosophy progresses are propelled by giants instead of the common people.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#gottfried-wilhelm-leibniz","title":"Gottfried Wilhelm Leibniz","text":"The main contribution of Leibniz is
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#ferdinand-de-saussure","title":"Ferdinand de Saussure","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#friedrich-ludwig-gottlob-frege","title":"Friedrich Ludwig Gottlob Frege","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#bertrand-russell","title":"Bertrand Russell","text":"Bertrand Russell is a pure logician.
"},{"location":"docs/2-ling/philosophy/pol_en_todo/#ludwig-wittgenstein","title":"Ludwig Wittgenstein","text":""},{"location":"docs/2-ling/philosophy/pol_en_todo/#noam-chomsky","title":"Noam Chomsky","text":""},{"location":"docs/2-ling/philosophy/pol_zh/","title":"Philosophy of Language \u8bed\u8a00\u54f2\u5b66","text":":material-circle-edit-outline: \u7ea6 3102 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
Nov. 9th. 2022
"},{"location":"docs/2-ling/philosophy/pol_zh/#talk","title":"\u8fd9\u6b21talk\u4f1a\u8bb2\u4ec0\u4e48","text":"\u2705\u00a0\u4ecb\u7ecd\u8bed\u8a00\u54f2\u5b66\u7684\u601d\u6f6e\u6d41\u53d8\u5386\u7a0b\uff0c\u4ecb\u7ecd\u8bed\u8a00\u4e0a\u7684\u5b9e\u9a8c\u601d\u60f3\u5b9e\u9a8c\uff0c\u8ba8\u8bba\u4e00\u4e9b\u8bed\u8a00\u5b66\u3001\u8ba4\u77e5\u3001\u903b\u8f91\u548c\u54f2\u5b66\u7684\u5173\u8054
"},{"location":"docs/2-ling/philosophy/pol_zh/#pol","title":"PoL","text":"\u8bed\u8a00\u54f2\u5b66\u7684\u57fa\u672c\u95ee\u9898\uff1a 1. \u8bed\u8a00\u548c\u4e16\u754c\u7684\u5173\u7cfb 2. \u8bed\u8a00\u6216\u8bed\u8bcd\u7684\u610f\u4e49\u95ee\u9898
\u8bed\u8a00\u54f2\u5b66\u548c\u8bed\u8a00\u5b66 \u8bed\u8a00\u5b66\u548c\u8bed\u8a00\u54f2\u5b66\u7684\u8054\u7cfb\u7d27\u5bc6\uff0c\u4f46\u662f\u662f\u4e24\u95e8\u5b66\u79d1\u3002
20\u4e16\u7eaa\u54f2\u5b66\u4e0a\u53d1\u751f\u4e86\u8bed\u8a00\u8f6c\u5411\uff0c\u8fd9\u4e5f\u662f\u73b0\u4ee3\u8bed\u8a00\u5b66\u5f62\u6210\u7684\u65f6\u5019\u3002
\u8bed\u8a00\u5b66\u662f\u5bf9\u8bed\u8a00\u89c4\u5f8b\u548c\u8fd9\u4e9b\u89c4\u5f8b\u7684\u5e94\u7528\u7684\u7814\u7a76\uff0c\u8bed\u8a00\u54f2\u5b66\u66f4\u5173\u5fc3\u8bed\u8a00\u66f4\u672c\u8d28\u66f4\u62bd\u8c61\u7684\u610f\u4e49\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#history-of-pol","title":"History of PoL","text":"\u83b1\u5e03\u5c3c\u8328\uff1a\u63d0\u51fa\u903b\u8f91\u8bed\u8a00\uff0c\u7b80\u5386\u4eba\u5de5\u8bed\u8a00\u7684\u52aa\u529b
\u5f3a\u8c03\u81ea\u7136\u8bed\u8a00\u4f9d\u8d56\u4e8e\u77e5\u8bc6\uff0c\u56e0\u6b64\u5206\u6709\u77e5\u89c9\u7684\u6a21\u7cca\u3001\u6b67\u4e49\u7b49\u79cd\u79cd\u7f3a\u9677\u3002\u81ea\u7136\u8bed\u8a00\u4e0d\u662f\u63cf\u8ff0\u5ba2\u89c2\u4e8b\u7269\u7684\u6700\u4f73\u5de5\u5177\uff0c\u4e3a\u4e86\u63a2\u7a76\u771f\u7406\uff0c\u5fc5\u987b\u5efa\u7acb\u4e00\u4e2a\u7531\u666e\u904d\u7b26\u53f7\u7ec4\u6210\u7684\u66f4\u4e3a\u6e05\u695a\u7684\u7b26\u53f7\u4f53\u7cfb\u3002\u8fd9\u79cd\u52aa\u529b\u5728\u6570\u5b66\u65b9\u9762\u662f\u5353\u6709\u6210\u6548\u7684\uff0c\u6bd4\u5982\u5fae\u79ef\u5206\u7b26\u53f7\u3002
\u7d22\u7eea\u5c14\uff1a \u7d22\u7eea\u5c14\u6700\u5927\u7684\u5f71\u54cd\u662f\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u3002\u6211\u4eec\u4e00\u822c\u8ba4\u4e3a\u7d22\u7eea\u5c14\u662f\u4e00\u4f4d\u8bed\u8a00\u5b66\u5bb6\uff0c\u4f46\u662f\u4ed6\u5728\u8fd9\u672c\u4e66\u4e2d\u63d0\u51fa\u7684\u201c\u80fd\u6307\u201d\u4e0e\u201c\u6240\u6307\u201d\u7406\u8bba\uff0c\u662f\u54f2\u5b66\u91cc\u7684\u7b26\u53f7\u5b66\u7684\u5f00\u7aef\u3002
\u8bed\u8a00\u662f\u7528\u58f0\u97f3\u8868\u8fbe\u601d\u60f3\u7684\u7b26\u53f7\u7cfb\u7edf\uff0c\u7b26\u53f7\u662f\u7528\u4ee5\u8868\u793a\u8005\u548c\u88ab\u8868\u793a\u8005\u7684\u7ed3\u5408\u3002
\u6211\u4eec\u4f1a\u8bf4\uff0c\u58f0\u97f3\u672c\u8eab\u4e0d\u80fd\u65bd\u6307\uff0c\u53ea\u6709\u5904\u5728\u67d0\u79cd\u7279\u5b9a\u5173\u7cfb\u4e2d\uff08\u8bed\u8a00\u5b9a\u4e49\u4e86\u58f0\u97f3\u548c\u5b9e\u4f53\u4e4b\u95f4\u7684\u5173\u7cfb\uff09\uff0c\u58f0\u97f3\u624d\u6709\u4e86\u610f\u4e49\u3002
\u4efb\u610f\u6027\u539f\u5219\u662f\uff0c\u5982\u6b64\u8fd9\u822c\u7684\u65bd\u6307\u548c\u5982\u6b64\u8fd9\u822c\u7684\u6240\u6307\u7ed3\u5408\u800c\u6210\u7684\u4e00\u4e2a\u7b26\u53f7\uff0c\u662f\u4efb\u610f\u7684\u3002eg. \u989c\u8272\u4e0e\u989c\u8272\u8bcd\u7684\u8054\u7ed3\u662f\u4efb\u610f\u7684\uff0c\u989c\u8272\u7684\u754c\u9650\u4e0e\u989c\u8272\u8bcd\u7684\u8054\u7ed3\u4e5f\u662f\u4efb\u610f\u7684\u3002
\"\u7eff\"\u4e0d\u4ec5\u548c\u7eff\u989c\u8272\u76f8\u8fde\uff0c\u800c\u4e14\u548c\u201c\u84dd\u201d\u201c\u9752\u201d\u7b49\u8bed\u8bcd\u76f8\u8fde\u3002\n\u5982\u679c\u6ca1\u6709\u201c\u84dd\u201d\u201c\u9752\u201d\uff0c\u6211\u4eec\u5c31\u4e0d\u80fd\u77e5\u9053\u201c\u7eff\u201d\u6240\u754c\u5b9a\u7684\u989c\u8272\u8303\u56f4\u3002\n\n\u201c\u4e03\u8272\u5f69\u8679\u201d\n\u65e5\u8bed\u4e0d\u533a\u5206\u201c\u84dd\u201d\u548c\u201c\u7eff\u201d\uff0c\u53ea\u6709\u4e00\u4e2a\u5355\u8bcd\u201c\u9752\u201d\uff08aoi\uff09\uff0c\u65e5\u8bed\u6bcd\u8bed\u8005\u5728\u9274\u522b\u84dd\u8272\u548c\u7eff\u8272\u65f6\u53cd\u5e94\u65f6\u9ad8\u4e8e\u82f1\u8bed\u6bcd\u8bed\u8005\u3002\n\u4e00\u79cd\u5317\u6b27\u8bed\u8a00\u6709\u4e03\u79cd\u84dd\u8272\u7684\u540d\u79f0\u3002\n
\u6211\u4eec\u4e60\u60ef\u628a\u8bed\u8bcd\u548c\u60c5\u5883\u7684\u8054\u7cfb\u79f0\u4f5c\u7eb5\u5750\u6807\u6216\u8bed\u5883\u5750\u6807\uff0c\u628a\u8bed\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u79f0\u4f5c\u6a2a\u5750\u6807\u548c\u903b\u8f91\u5750\u6807\u3002
eg. \u5b8c\u5f62\u586b\u7a7a\u9898
eg. \u6570\u636e\u5e93\u5173\u7cfb\u6a21\u578b\u7684\u5c5e\u6027\u3001\u5143\u7ec4
\u975e\u5e38\u6709\u8da3\uff0c\u7d22\u7eea\u5c14\u5199\u8fd9\u672c\u8bed\u8a00\u5b66\u6559\u6750\u65f6\uff0c\u4e16\u754c\u4e0a\u5e76\u6ca1\u6709\u7b26\u53f7\u5b66\u8fd9\u4e2a\u5b66\u79d1\u3002\u5728\u4ed6\u63d0\u51fa\u201c\u80fd\u6307\u201d\u201d\u6240\u6307\u201c\u8fd9\u4e2a\u6982\u5ff5\u540e\uff0c\u7b26\u53f7\u5b66\u5728\u4ed6\u201d\u80fd\u6307\u201c\u5728\u201d\u6240\u6307\u201c\u7684\u94fe\u6761\u4e0a\u6ed1\u52a8\u8fd9\u4e00\u8bba\u65ad\u7684\u57fa\u7840\u4e0a\u8bde\u751f\uff0c\u5e76\u81f3\u4eca\u6210\u4e3a\u6cd5\u56fd\u54f2\u5b66\u7684\u4e00\u4e2a\u91cd\u8981\u95ee\u9898\u3002
\u5f17\u96f7\u683c\uff1a
\u5f17\u96f7\u683c\u662f\u516c\u8ba4\u7684\u5206\u6790\u54f2\u5b66\u3001\u8bed\u8a00\u54f2\u5b66\u548c\u73b0\u4ee3\u6570\u7406\u903b\u8f91\u7684\u5f00\u521b\u8005\u3002
\u300a\u6982\u5ff5\u6587\u5b57\uff1a\u4e00\u79cd\u6a21\u4eff\u7b97\u672f\u8bed\u8a00\u6784\u9020\u7684\u7eaf\u601d\u7ef4\u7684\u5f62\u5f0f\u8bed\u8a00\u300b\u4e3b\u8981\u5de5\u4f5c\u662f\uff0c\u8bbe\u8ba1\u4e86\u4e00\u5957\u4eba\u5de5\u7b26\u53f7\u7cfb\u7edf\uff0c\u6392\u9664\u4e86\u81ea\u7136\u8bed\u8a00\u4e2d\u4fee\u8f9e\u4e4b\u7c7b\u7684\u4e1c\u897f\uff0c\u4e13\u6ce8\u4e8e\u6982\u5ff5\u672c\u8eab\u548c\u6982\u5ff5\u4e4b\u95f4\u7684\u8054\u7cfb\uff0c\u56e0\u6b64\uff0c\u5b83\u5c06\u6392\u9664\u81ea\u7136\u8bed\u8a00\u7684\u6a21\u7cca\u6027\u548c\u4e0d\u786e\u5b9a\u6027\u3002\u7528\u8fd9\u5957\u7b26\u53f7\u7cfb\u7edf\u6765\u91cd\u65b0\u8868\u8ff0\u7b97\u672f\u7684\u57fa\u672c\u6982\u5ff5\u548c\u63a8\u7406\u89c4\u5219\uff0c\u660e\u786e\u6240\u6709\u63a8\u7406\u7684\u524d\u63d0\uff0c\u4fdd\u8bc1\u4e00\u4e2a\u8bc1\u660e\u4e2d\u5404\u4e2a\u547d\u9898\u95f4\u7684\u6240\u6709\u63a8\u7406\u89c4\u5219\uff0c\u4f7f\u63a8\u7406\u4e0d\u518d\u57fa\u4e8e\u76f4\u89c9\uff0c\u4e5f\u6ca1\u6709\u8df3\u8dc3\u548c\u8131\u8282\u3002
\u5bf9\u8bed\u8a00\u54f2\u5b66\u5f71\u54cd\u6700\u6df1\u7684\u662f\u4ed6\u5728\u300a\u7b97\u672f\u57fa\u7840\u300b\u4e2d\u63d0\u51fa\u7684\u4e09\u6761\u8457\u540d\u539f\u5219\uff1a
\u4e24\u4e2a\u601d\u7ef4\u5b9e\u9a8c\uff1a
\u6307\u79f0\u76f8\u540c\u800c\u610f\u4e49\u4e0d\u540c\u7684\u8bcd
\u201c\u542f\u660e\u661f\u201d\u548c\u201c\u957f\u5e9a\u661f\u201d\u662f\u540c\u4e00\u9897\u884c\u661f\u2014\u2014\u2014\u2014\u91d1\u661f\u3002\n\u4f46\u662f\u4e24\u4e2a\u540d\u8bcd\u7684\u610f\u4e49\u4e0d\u540c\uff0c\u5927\u591a\u6570\u65f6\u5019\u4e0d\u80fd\u66ff\u6362\u3002\n\u201c\u4ed6\u5929\u8fd8\u6ca1\u4eae\u5c31\u8d77\u8eab\uff0c\u8fce\u7740\u542f\u660e\u661f\u5411\u4e1c\u8d70\u53bb\u3002\u201d\n
\u51fd\u5f0f\u7406\u8bba
\uff08 \uff09\u662f\u4e2d\u56fd\u7684\u9996\u90fd\n\uff08 \uff09= \"\u4f26\u6566\"\u3001\"\u5317\u4eac\"\n\u53ea\u6709\u586b\u5165\u5317\u4eac\u7684\u65f6\u5019\u624d\u662f\u771f\u547d\u9898\n
\u7f57\u7d20\uff1a\u903b\u8f91
\u6df1\u5165\u4e13\u540d\u548c\u901a\u540d\u3001\u6096\u8bba\u3001\u6392\u4e2d\u5f8b\u3002
\u7ef4\u7279\u6839\u65af\u5766\uff1a
\u524d\u671f\u601d\u60f3\u300a\u903b\u8f91\u54f2\u5b66\u8bba\u300b
\u201c\u4e16\u754c\u662f\u4e8b\u5b9e\u7684\u7efc\u5408\u201d\uff1a\u201c\u53f8\u9a6c\u5149\u662f\u5510\u671d\u4eba\u201d\u7b26\u5408\u903b\u8f91\uff0c\u4f46\u4e0d\u7b26\u5408\u4e8b\u5b9e\u3002
\u56fe\u50cf\u8bba
\u8bed\u8a00\u662f\u547d\u9898\u7684\u603b\u548c\u800c\u4e0d\u662f\u540d\u79f0\u7684\u603b\u548c\u3002
\u4eba\u5728\u4ea4\u6d41\u601d\u60f3/\u547d\u9898\u65f6\uff0c\u4ea4\u6d41\u7684\u662f\u8111\u4e2d\u7684\u56fe\u50cf\u3002
\u4ed6\u7684\u524d\u671f\u601d\u60f3\u542f\u53d1\u4e86\u7ef4\u4e5f\u7eb3\u5b66\u6d3e\uff1a\u4eba\u5de5\u8bed\u8a00\uff0c\u903b\u8f91\u8bed\u8a00
\u5341\u4e5d\u4e16\u7eaa\u672b\u4ee5\u6765\u4eba\u5de5\u8bed\u8a00\u7684\u5c1d\u8bd5\uff1a\u201c\u4e16\u754c\u8bed\uff08Esperanto\uff09\u201d\uff0c\u4e18\u5409\u5c14\u63a8\u5d07\u7684\u57fa\u672c\u82f1\u8bed\uff0c\u81ea\u7136\u8bed\u8a00\u4e2d\u5bf9\u201c\u5973\u4eba\u201d\u201c\u5973\u6027\u201d\u201c\u5973\u58eb\u201d\u201c\u5987\u5973\u201d\u8fd9\u6837\u7684\u6307\u79f0\u7684\u89c4\u8303\u5c1d\u8bd5\u3002
\u540e\u671f\u601d\u60f3\u300a\u54f2\u5b66\u7814\u7a76\u300b
\u8bed\u8a00\u6e38\u620f\uff08Sprachspiel\uff09
\u8bed\u8a00\u7684\u529f\u80fd\u7684\u672c\u8d28\uff1a\u4e00\u65b9\u558a\u51fa\u8bed\u8bcd\uff0c\u53e6\u4e00\u65b9\u4f9d\u7167\u8fd9\u4e9b\u8bed\u8bcd\u6765\u884c\u52a8\u3002
\u8001\u5e08\u6307\u7740\u77f3\u5934\u8bf4\u201c\u77f3\u5934\u201d\uff0c\u5b66\u751f\u8ddf\u7740\u8bf4\u201c\u77f3\u5934\u201d\u3002\n
\u4e22\u624b\u7ee2\u65f6\u5531\u7740\u201c\u8f7b\u8f7b\u5730\u653e\u5728\u5c0f\u670b\u53cb\u7684\u8eab\u540e\u201d\uff0c\u628a\u624b\u7ee2\u653e\u5728\u5c0f\u670b\u53cb\u7684\u8eab\u540e\n
\u4e0e\u524d\u671f\u56fe\u50cf\u7406\u8bba\u7684\u5bf9\u6bd4\uff1a\u5728\u56fe\u50cf\u7406\u8bba\u4e2d\uff0c\u8bed\u8a00\u4ece\u6839\u672c\u4e0a\u662f\u4e00\u79cd\u53cd\u6620\uff1b\u5728\u8bed\u8a00\u6e38\u620f\u8bf4\u4e2d\uff0c\u8bed\u8a00\u9996\u5148\u662f\u4e00\u79cd\u6d3b\u52a8\u3002
\u610f\u4e49\u6765\u6e90\u4e8e\u4f7f\u7528\u3002
\u6211\u4eec\u5173\u5fc3\u201c\u9524\u5b50\u201d\u662f\u4ec0\u4e48\u65f6\uff0c\n\u5173\u5fc3\u7684\u662f\u201c\u4f7f\u7528\u4e00\u628a\u9524\u5b50\u201d\uff0c\n\u800c\u4e0d\u662f\u201c\u9524\u5b50\u610f\u5473\u7740\u2026\u2026\u201d\n\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u6b63\u662f\u4ece\u201c\u4f7f\u7528\u4e00\u628a\u9524\u5b50\u201d\u6765\u5b9a\u4e49\u9524\u5b50\n
\u5982\u4f55\u533a\u5206\u201c\u4f7f\u7528\u201d\u201c\u6709\u7528\u201d\u201c\u5229\u7528\u201d\uff1f\n\u5728\u4e00\u4e9b\u60c5\u5883\u4e2d\u80fd\u7528\uff0c\u5728\u4e00\u4e9b\u60c5\u5883\u4e2d\u4e0d\u80fd\u7528\u3002\n
\u8bed\u8a00\u6e38\u620f\u7684\u7c7b\u522b
\u5bb6\u65cf\u76f8\u4f3c\u7406\u8bba\uff08Familien\u00e4hnlichkeiten\uff09
\u201c\u4e00\u4e2a\u5bb6\u65cf\u7684\u6709\u4e9b\u6210\u5458\u6709\u4e00\u6837\u7684\u9f3b\u5b50\uff0c\u53e6\u4e00\u4e9b\u6709\u4e00\u6837\u7684\u7709\u6bdb\uff0c\u8fd8\u6709\u4e00\u4e9b\u6709\u4e00\u6837\u7684\u6b65\u6001\uff1b\u8fd9\u4e9b\u76f8\u4f3c\u4e4b\u5904\u4ea4\u53c9\u91cd\u53e0\u3002\u201c
\u5185\u6db5\uff1a\u4e00\u4e2a\u6982\u5ff5\u7684\u5b9a\u4e49
\u5916\u5ef6\uff1a\u4e00\u4e2a\u6982\u5ff5\u5305\u542b\u7684\u4e0b\u5c5e\u6982\u5ff5\u7684\u8303\u56f4
\u901a\u540d\u7684\u4e0b\u5c5e\u8bcd\uff0c\u5404\u79cd\u4e13\u540d\u4e4b\u95f4\u5e76\u6ca1\u6709\u4e25\u683c\u7684\u754c\u9650\uff0c\u4e00\u4e2a\u76f8\u4f3c\u53e6\u4e00\u4e2a\uff0c\u5206\u4eab\u4e0d\u540c\u7684\u5171\u540c\u7279\u5f81\u3002
\u751f\u6d3b\u5f62\u5f0f\uff08Lebens Form\uff09\uff1a\u5e38\u8bc6\u7684\u91cd\u8981\u6027
\u201c\u626b\u5e1a\u5728\u90a3\u91cc\u201d\u5df2\u7ecf\u8db3\u591f\u6e05\u6670\u3002\n\u201c\u626b\u5e1a\u628a\u548c\u626b\u5e1a\u5934\u5728\u90a3\u91cc\u201d\uff0c\u867d\u7136\u5206\u6790\u5f97\u66f4\u6e05\u695a\uff0c\u4f46\u5728\u4ea4\u9645\u4e2d\u8ba9\u4eba\u8d39\u89e3\u3002\n
\u4eff\u4f5b\u6211\u4eec\u53ea\u8981\u66f4\u591a\u8bf4\u4e00\u70b9\uff0c\u591a\u5206\u6790\u4e00\u70b9\uff0c\u4e8b\u60c5\u5c31\u4f1a\u66f4\u6e05\u695a\uff0c\u4eff\u4f5b\u6ca1\u6709\u4e00\u53e5\u8bdd\u672c\u8eab\u5c31\u662f\u8db3\u591f\u6e05\u695a\u7684\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#conclusion-of-agreements","title":"Conclusion of Agreements","text":"\u963f\u4f69\u5c14\u603b\u7ed3\u897f\u65b9\u54f2\u5b66\u7684\u53d1\u5c55\uff1a
\u53e4\u4ee3\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u672c\u4f53\u8bba\uff0c\u4ece\u8fd1\u4ee3\u5f00\u59cb\uff0c\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u8ba4\u8bc6\u8bba\uff0c\u523020\u4e16\u7eaa\uff0c\u54f2\u5b66\u6ce8\u91cd\u7684\u662f\u8bed\u8a00\u3002
\u672c\u4f53\u8bba\u7684\u95ee\u9898\uff1a\u4ec0\u4e48\u4e1c\u897f\u5b58\u5728\uff0c\u4ec0\u4e48\u662f\u5b9e\u5728\u7684\u57fa\u672c\u5b58\u5728\u5f62\u5f0f\u3002
\u8ba4\u8bc6\u8bba\u7684\u95ee\u9898\uff1a\u54ea\u4e9b\u4e1c\u897f\u662f\u6211\u4eec\u80fd\u8ba4\u8bc6\u7684\uff0c\u6211\u4eec\u662f\u600e\u6837\u8ba4\u8bc6\u8fd9\u4e9b\u4e1c\u897f\u7684\u3002
\u8bed\u8a00\u7684\u95ee\u9898\uff1a\u6211\u4eec\u5728\u4f55\u79cd\u610f\u4e49\u4e0a\u80fd\u591f\u8ba4\u8bc6\u5b58\u5728\u2014\u2014\u800c\u610f\u4e49\u7684\u9996\u8981\u8f7d\u4f53\u662f\u8bed\u8a00\u3002\u2192 Linguistic Turn
PoL\u7684\u5176\u5b83topic\uff1a 1. \u6307\u79f0\u4e0e\u5b9e\u4f53\uff0c\u8bed\u8a00\u4e0e\u610f\u4e49\u7684\u5173\u7cfb 2. \u901a\u540d\u4e0e\u4e13\u540d\uff0c\u8bcd\u4e49\u7684\u8303\u56f4 3. \u771f\u7406\u7406\u8bba 4. \u300a\u6211\u4eec\u8d56\u4ee5\u751f\u5b58\u7684\u9690\u55bb\u300b\uff1a\u9690\u55bb\u65e0\u5904\u4e0d\u5728\uff0c\u4e0d\u4ec5\u5b9a\u4e49\u4e2d\u7684\u201cxx\u662fxx\u201d\u662f\u9690\u55bb\uff0c\u6709\u65f6\u5355\u4e2a\u8bcd\u5c31\u662f\u4e00\u4e2a\u9690\u55bb\u3002
\u52a8\u8bcd\u662f\u9690\u55bb
\u65f6\u95f4\u5728\u6d41\u901d\u3002\n
\u4ecb\u8bcd\u662f\u9690\u55bb
I\u2019m feeling up today.\nHe is down.\n\u9ad8\u5174\u4e3a\u4e0a\uff0c\u60b2\u4f24\u4e3a\u4e0b\u3002\nWake up.\nHe fell asleep.\n\u6709\u610f\u8bc6\u4e3a\u4e0a\uff0c\u65e0\u610f\u8bc6\u4e3a\u4e0b\u3002\nHe fell ill.\nShe dropped dead.\n\u5065\u5eb7\u548c\u751f\u547d\u4e3a\u4e0a\uff0c\u75be\u75c5\u548c\u6b7b\u4ea1\u4e3a\u4e0b\u3002\nI have controlled over her.\nHe fell from power.\n\u63a7\u5236\u6216\u5f3a\u8feb\u4e3a\u4e0a\uff0c\u88ab\u63a7\u5236\u6216\u88ab\u5f3a\u8feb\u4e3a\u4e0b\u3002\nMy income rose last year.\nThe number of errors is low.\n\u66f4\u591a\u4e3a\u4e0a\uff0c\u66f4\u5c11\u4e3a\u4e0b\u3002\n
\u4e54\u59c6\u65af\u57fa\uff1a
\u7ed3\u6784\u4e3b\u4e49\u8bed\u8a00\u5b66\u5230\u8f6c\u6362\u751f\u6210\u8bed\u6cd5\u3002
\u8bed\u8a00\u5b66\u7684\u5de5\u4f5c\u4e0d\u5e94\u5f53\u662f\u641c\u96c6\u8bed\u8a00\u7d20\u6750\u52a0\u4ee5\u5f52\u7eb3\uff0c\u800c\u662f\u8981\u89e3\u91ca\u8bed\u8a00\u7684\u521b\u9020\u6027\u3002
CNF
S -> AB\nA -> AA | a\nB -> b | e\n
\u8f6c\u6362\u751f\u6210\u8bed\u6cd5\u89c4\u5219 \\(\\Sigma = \\{NP, Vp, T, N, Npsing, NPpl, Aux, V, C, M, En, S, Past, Af\\}\\)
S -> NP + VP\nVP -> Verb + NP\nNP -> Det + N\nVerb -> Aux + V\nDet -> the, a...\nN -> man, ball...\nAux -> will, can...\nV -> hit, see...\n
\u4f20\u7edf\uff08\u6210\u5206\uff09\u8bed\u6cd5\u89c4\u5219
1. \u4e3b + \u8c13\n2. \u4e3b + \u8c13 + \u5bbe\n3. \u4e3b + \u7cfb + \u8868\n4. \u4e3b + \u8c13 + \u5bbe + \u53cc\u5bbe\n5. \u4e3b + \u8c13 + \u5bbe + \u5bbe\u8865\n6. \u4e3b + \u8c13 + \u5e76\u5217\u5bbe\n\n...\n
\u300a\u53e5\u6cd5\u7ed3\u6784\u300b\uff081957\uff09\u6838\u5fc3\u53e5\u548c\u8f6c\u6362\u6982\u5ff5\u3002
\u751f\u6210\u6b65\u9aa4 1. \u751f\u6210\u6838\u5fc3\u53e5\u3002
S -> X1 | X2 | ... Xn\n
\u8f6c\u6362\u7ed3\u6784\uff08\u66ff\u6362\u3001\u7701\u7565\u3001\u6dfb\u52a0\u3001\u6362\u4f4d\uff09\u3002
X1 -> Y1Z1 | ...\n...\n
\u6dfb\u52a0\u5f62\u6001\u97f3\u4f4d\u89c4\u5219\u3002
Z1 -> W1\n...\nZn -> Wn\n
\u8f6c\u6362\uff1a\u6574\u4e2a\u8f6c\u6362\u751f\u6210\u8fc7\u7a0b\u53ef\u4ee5\u5206\u4e3a\u4e09\u4e2a\u6b65\u9aa4
\u6df1\u5c42\u7ed3\u6784\u548c\u8868\u5c42\u7ed3\u6784
\u4e54\u59c6\u65af\u57fa\u8bed\u6cd5\u4f53\u7cfb\u4e2d\uff0c\u6307\u53e5\u5b50\u751f\u6210\u8fc7\u7a0b\u4e2d\u7279\u5b9a\u9636\u6bb5\u6240\u91c7\u7528\u7684\u4e00\u79cd\u7279\u6b8a\u64cd\u4f5c\u624b\u6bb5\u6216\u89c4\u5219\u3002\u6df1\u5c42\u7ed3\u6784\u662f\u5b83\u7684\u8f93\u5165\uff0c\u8868\u5c42\u7ed3\u6784\u662f\u5b83\u7684\u8f93\u51fa\u3002
\u6709\u7684\u53e5\u5b50\u8868\u5c42\u7ed3\u6784\u4e0d\u540c\uff0c\u6df1\u5c42\u7ed3\u6784\u76f8\u4f3c\u3002\u901a\u8fc7\u8f6c\u6362\u64cd\u4f5c\u53ef\u4ee5\u76f8\u4e92\u8f6c\u5316\u3002
\u6709\u7684\u53e5\u5b50\u6df1\u5c42\u7ed3\u6784\u4e0d\u540c\uff0c\u8868\u5c42\u7ed3\u6784\u76f8\u4f3c\u3002\u901a\u8fc7\u8f6c\u6362\u64cd\u4f5c\u4e0d\u80fd\u76f8\u4e92\u8f6c\u5316\u3002
\u4e3a\u4ec0\u4e48\u4eca\u5929\u6211\u4eec\u8981\u8c08\u8bed\u8a00\u54f2\u5b66\uff1f
\u9648\u5609\u6620\u8001\u5e08\uff1a\u79d1\u5b66\u662f\u4e00\u4e2a\u4e25\u5bc6\u7684\u6574\u6d01\u7684\u4f53\u7cfb\uff0c\u539f\u56e0\u662f\u5b83\u628a\u6240\u6709\u6df7\u6c8c\u7684\u65e0\u6cd5\u89e3\u51b3\u7684\u95ee\u9898\u629b\u5728\u4e86\u8fd9\u4e2a\u4f53\u7cfb\u4e4b\u5916\u3002[\u300a\u8d70\u51fa\u552f\u4e00\u771f\u7406\u89c2\u300b\uff0c2020]
\u6240\u4ee5\u54f2\u5b66\u7684\u95ee\u9898\u662f\u7814\u7a76\u88ab\u79d1\u5b66\u6254\u51fa\u53bb\u7684\u6df7\u6c8c\u3002
\u8bed\u8a00\u54f2\u5b66\u5c31\u50cf\u201c\u5165\u4fb5\u7684\u5b9e\u5728\u754c\u201d\uff0c\u201c\u8fb9\u754c\u7684\u6d4b\u8bd5\u70b9\u201d\u3002
"},{"location":"docs/2-ling/philosophy/pol_zh/#recommended-reading","title":"Recommended Reading","text":"\u300a\u8bed\u8a00\u54f2\u5b66\u300b\u9648\u5609\u6620
\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u7d22\u7eea\u5c14
\u300a\u903b\u8f91\u54f2\u5b66\u8bba\u300b\u7ef4\u7279\u6839\u65af\u5766
\u300a\u54f2\u5b66\u7814\u7a76\u300b\u7ef4\u7279\u6839\u65af\u5766
\u300a\u6211\u4eec\u8d56\u4ee5\u751f\u5b58\u7684\u9690\u55bb\u300b\u4e54\u6cbb\u00b7\u83b1\u8003\u592b
\u300a\u5fc3\u667a\u3001\u8bed\u8a00\u548c\u673a\u5668\u300b\u5f90\u82f1\u747e
"},{"location":"docs/2-ling/philosophy/pol_zh/#_1","title":"\u8ba8\u8bba","text":"\u662f\u5426\u6240\u6709\u6ca1\u6709\u7528\u8bed\u8a00\u8868\u8fbe\u7684\u77e5\u8bc6\uff0c\u90fd\u53ef\u4ee5\u88ab\u7528\u8bed\u8a00\u8868\u8fbe\uff1f\uff08not NP or NP-hard\uff09
\u53ea\u5b66\u4e60\u8bed\u8a00\u662f\u5426\u80fd\u6a21\u62df\u4eba\u7684\u667a\u80fd\u6c34\u5e73\uff1f
\u6a21\u578b\u662f\u5426\u9700\u8981\u5e94\u5bf9\u6240\u6709\u7684\u5f02\u5e38\u60c5\u51b5/\u673a\u5668\u8bed\u8a00\u7684\u76ee\u6807\u672c\u8eab\u8981\u4e0e\u4eba\u7c7b\u8bed\u8a00\u6709\u6240\u533a\u522b
"},{"location":"docs/2-ling/philosophy/saussure/","title":"Reading Notes of Cours de linguistique g\u00e9n\u00e9rale, Ferdinand de Saussure","text":":material-circle-edit-outline: \u7ea6 685 \u4e2a\u5b57 :fontawesome-solid-code: 5 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
\u300a\u666e\u901a\u8bed\u8a00\u5b66\u300b\u7d22\u7eea\u5c14 \u8bfb\u4e66\u7b14\u8bb0
\u7b2c\u96f6\u7f16\uff1a\u7eea\u8bba
\u7b2c\u4e09\u7ae0\uff1a\u8bed\u8a00\u5b66\u7684\u5bf9\u8c61
\u8bed\u97f3\u4e0e\u8bed\u4e49\u7684\u8054\u7cfb
_______________________\n | |\n | \u2228\nc <-> i i <-> i \n \u542c\u97f3 \u53d1\u97f3\n \u2227 |\n |_______________________|\n
c\uff1a\u6982\u5ff5 i\uff1a\u97f3\u54cd\u5f62\u8c61
\u8bed\u8a00\u7814\u7a76\u7684\u5bf9\u8c61
parole
\u8a00\u8bed\uff1a\u4e2a\u4eba\u7684\u3001\u6df7\u6742\u7684\u3001\u5f02\u8d28\u7684lingua
\u8bed\u8a00\uff1a\u793e\u4f1a\u7684\u3001\u660e\u786e\u7684\u3001\u540c\u8d28\u7684\u7b2c\u516d\u7ae0\uff1a\u6587\u5b57\u8868\u73b0\u8bed\u8a00
\u8bed\u97f3\u7684\u53d1\u5c55\u662f\u5386\u53f2\u6027\u7684\u3002
\u7b2c\u4e03\u7ae0\uff1a\u97f3\u4f4d\u5b66 phonetics
\u7b2c\u4e00\u7f16\uff1a\u4e00\u822c\u539f\u5219
\u7b2c\u4e00\u7ae0\uff1a\u8bed\u8a00\u7b26\u53f7\u7684\u6027\u8d28
\u7b26\u53f7\u7684\u7ed3\u6784\uff1a\n ________________ \u4e0a\n | \u6982\u5ff5 -> \u6240\u6307 |\n -----------------\n | \u97f3\u54cd\u5f62\u8c61 -> \u80fd\u6307 | \n |________________| \u4e0b\n
\u80fd\u6307\u7684\u5c5e\u6027
\u7b26\u53f7\u5728\u65f6\u95f4\u4e0a\u7684\u8fde\u7eed\u6027\u548c\u65f6\u95f4\u4e0a\u7684\u53d8\u5316\u76f8\u8fde\uff0c\u7b26\u53f7\u7684\u4efb\u610f\u6027\u4f7f\u5176\u65e0\u6cd5\u62b5\u5fa1\u4f7f\u80fd\u6307\u5728\u6240\u6307\u4e0a\u6ed1\u52a8\u7684\u56e0\u7d20\u3002
\u4e00\u5207\u79d1\u5b66
C\n |\n |\nA ------------- B \u540c\u65f6\u8f74\u7ebf\n |\n |\n D\n \u8fde\u7eed\u8f74\u7ebf\n
\u8bed\u8a00\u5b66
C\n |\n |\nA ------------- B \u9759\u6001\u8bed\u8a00\u5b66\uff08\u5171\u65f6\uff09\n |\n |\n D\n \u6f14\u5316\u8bed\u8a00\u5b66\uff08\u5386\u65f6\uff09\n
\u5185\u5728\u4e8c\u91cd\u6027\u4f8b\u8bc1
-> \u5171\u65f6\n \u00b7<--------->\u00b7 \u7532\u65f6\u671f\n | | |\n \u2228 \u2228 \u2228\n \u5386\u65f6 \u00b7<--------->\u00b7 \u4e59\u65f6\u671f\n
\u53ef\u4ee5\u6bd4\u4f5c\u4e0b\u68cb\uff1a\u8861\u5b9a\u7684\u89c4\u5219\u548c\u53d8\u52a8\u7684\u5c40\u52bf
\u7b2c\u4e8c\u7f16\uff1a\u5171\u65f6\u8bed\u8a00\u5b66
\u540c\u4e00\u6027\uff1a\u5171\u65f6 - \u97f3\u6bb5 -> \u610f\u4e49
\u666e\u904d\u4ef7\u503c\uff1a
\u8bed\u8a00\u4e4b\u4e2d\u53ea\u6709\u5dee\u522b -\u2014\u2014 \u6ca1\u6709\u79ef\u6781\u8981\u7d20\u7684\u5dee\u522b\u3002\u8bed\u8a00\u662f\u5f62\u5f0f\u800c\u4e0d\u662f\u5b9e\u8d28\u3002
\u7b2c\u4e94\u7ae0
\u7b2c\u516d\u7ae0\uff1a\u8bed\u8a00\u7684\u673a\u6784
\u53e5\u6bb5\u7684\u8fde\u5e26\u5173\u7cfb\uff1a\u6574\u4f53\u7684\u4ef7\u503c\u53d6\u51b3\u4e8e\u5b83\u7684\u90e8\u5206\uff0c\u90e8\u5206\u7684\u4ef7\u503c\u51b3\u5b9a\u4e86\u5b83\u4eec\u5728\u6574\u4f53\u4e2d\u7684\u5730\u4f4d\u3002
----------\n d\u00e9-faire\n ----------\n / \\\n d\u00e9coller faire\n / \\\n d\u00e9lancer refaire\n / \\\n d\u00e9cendre contrefaire\n
\u6b63\u662f\u8fd9\u4e9b\u4e0d\u540c\u7684\u5f62\u5f0f\u6f02\u6d6e\u5728\u5468\u56f4\uff0c\u8fd9\u4e24\u4e2a\u8bcd\u624d\u80fd\u5206\u89e3\u6210\u5355\u4f4d\uff0c\u6216\u6210\u4e3a\u53e5\u6bb5\u3002
\u53ea\u6709\u4e00\u90e8\u5206\u7b26\u53f7\u662f\u7edd\u5bf9\u4efb\u610f\u7684\uff0c\u4efb\u610f\u6027\u4e0d\u80fd\u53d6\u6d88\uff0c\u90fd\u6709\u7a0b\u5ea6\u5dee\u522b\uff0c\u7b26\u53f7\u53ef\u80fd\u662f\u76f8\u5bf9\u5730\u53ef\u4ee5\u8bba\u8bc1\u7684\u3002
\u6574\u4f53 > \u90e8\u5206\u4e4b\u548c\u3002poirexier > poiretier
------\n / \\\n \u8bcd\u6c47 - - \u8bed\u6cd5\n\u4e0d\u80fd\u8bba\u8bc1\u7684\u6781\u7aef \\ / \u53ef\u4ee5\u8bba\u8bc1\u7684\u6781\u7aef\n \u7b26\u53f7 ------- \u7ed3\u6784\n
\u7b2c\u4e03\u7ae0\uff1a\u8bed\u6cd5\u548c\u533a\u5206
\u62bd\u8c61\u5b9e\u4f53\uff0c\u6700\u540e\u5206\u6790\u8d77\u6765\uff0c\u603b\u662f\u4ee5\u5177\u4f53\u5b9e\u73b0\u4e3a\u57fa\u7840\u7684\u3002
\u7b2c\u4e09\u7f16\uff1a\u5386\u65f6\u8bed\u8a00\u5b66
\u7b2c\u4e09\u7ae0\uff1a\u8bed\u97f3\u6f14\u5316\u5728\u8bed\u6cd5\u4e0a\u7684\u540e\u679c
\u7b2c\u56db\u7ae0\uff1a\u7c7b\u6bd4
\u7b2c\u4e94\u7ae0\uff1a\u7c7b\u6bd4 -> \u6f14\u5316
viendre, monru, traisait
\u7b2c\u516d\u7ae0\uff1a\u6d41\u4fd7\u8bcd\u6e90
"},{"location":"docs/2-ling/pragmatics/ca_da/","title":"Research Methods: Conversation Analysis and Discourse Analysis","text":":material-circle-edit-outline: \u7ea6 275 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/ca_da/#discourse-analysis","title":"Discourse Analysis","text":"Some discourse analysis are taught in linguistic departments (Johnstone, 2018)
Foucault (1972, 1980) use 'discourse' to refer to the ways of talking and thinking constitute ideologies (set of interrelated ideas) and serve to circulate power in society, and in the sense involved patterns of belief and habitual actions as well as patterns of language.
Johnstone, Barbara. 2018. Discourse Analysis (3rd ed.). UK: Wiley-Blackwell.
"},{"location":"docs/2-ling/pragmatics/ca_da/#conversational-analysis","title":"Conversational Analysis","text":"Definition
Conversation analysis is the study of interactional activities. The object being studied involves at least two persons.
Unit
conversation > sequence > adjacency pair > turn
types of adjacency pairs
turn-taking feature
One involved in a conversation is supposed to give floor to the other party (parties) at a proper point of time. to keep the balance between the time one spends talking and the time the others spend talking.
pre-sequence
insertion sequence
A: Are you coming tonight?\nB: Can I bring a guest?\nA: Male or female?\nB: What difference does that make?\nA: An issue of balance.\nB: Female.\nA: Sure.\nB: Yeah, I\u2019ll be there.\n
preference organization
first part second part preferred dispreferred assessment agree disagree invitation accept refuse offer accept decline proposal agree disagree request acccept refuse"},{"location":"docs/2-ling/pragmatics/intro/","title":"Introduction and Concepts","text":":material-circle-edit-outline: \u7ea6 1923 \u4e2a\u5b57 :fontawesome-solid-code: 11 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/intro/#what-is-pragmatics","title":"What is Pragmatics","text":"Charles W. Morris (1901-1979) American semiotician and philosopher. supervised by Charles S. Pierce. In his Foundations of the Theory of Signs (1938), Morris proposed that semiotics should have three divisions:
syntax -------------> semantics -------------> pragmatics\n \u2b06\ufe0f\u00a0 \u2b06\ufe0f\u00a0 \n decoding use in context\n
During the course of everyday communication, human beings as social animals convey more than the literal, propositional meaning (i.e. we don\u2019t always mean what we say literally).
There is more to the literal meaning of a sentence when we consider the sentence in relation to the context, i.e., the situation of uttering the sentence.
Sentence that cannot be considered in isolation \u2192 utterance
Pragmatics looks beyond truth-conditional meanings, and explores non-literal, implicit, context-related meanings.
Thus both semantics and pragmatics deal with meaning, yet there is a division of labour: semantics deals with meaning in context.
"},{"location":"docs/2-ling/pragmatics/intro/#levels","title":"Levels","text":"Definition
Deixis and context: Deictic does not have concrete meanings. Deictic words depend on context for meaning.
linguistic context: refers to the language surrounding the expression in question
The boy said he has five girlfriends.\n
Both he and the boy refer to the boy.
He refers to the boy anaphorically, the boy refer to the boy deictically.
Types of deixis
defined in relation to the deictic center (person, time, place, discourse, social)
symbolic: symbolic usages of deictic terms
personal deixis
The deictic cycle. Harman, 1990.
"},{"location":"docs/2-ling/pragmatics/intro/#reference","title":"Reference","text":"Definition: The act of using a word/phrase to pick out something in the world.
Types of referring expressions (\u6307\u793a\u8bed)
Choice of referring expressions: based on the speaker\u2019s assumption about what the listener knows.
Conditions for successful reference: must be collaborative
Differences between semantic and pragmatic presuppositions
for pragmatic presupposition
cancellation of presuppositions
Presuppositions are cancellable or defeasible by changing the words to alter the previous proposition.
F: \u6709\u4e9b\u4eba\u517b\u732b\u4e86\n~F: \u6709\u4e9b\u4eba\u6ca1\u517b\u732b\n
projection problem
presupposition may not survive when simple sentences are projected into complex ones.
Mary didnt manage to find a job.\nMary didnt manage to find a job. In fact, she didnt even try.\n
Mike didnt date Mary again.\nMike didnt date Mary gain, if indeed he ever did.\n
presupposition triggers (\u89e6\u53d1\u8bed): how to determine speakers\u2019 presupposition in the course of verbal communication?
Definite descriptions \u6709\u5b9a\u63cf\u5199: It gives definite descriptions associated with presuppositions of existence. e.g. the/this/that + NP, 3rd person pronoun, possessive + N (my, your, his/her).
Sue's neighbour's daughter got married last week.\n=> Sue has a neighbour.\n=> The neighbour has a daughter.\n
Factive verbs \u5b9e\u60c5\u52a8\u8bcd: sth has happened. e.g. regret, realize, know, be aware that, be sorry that, be glad that, be proud that, be pleased that, be odd, be strange, be disappointed that.
John regretted having started the project.\n=> He started the project.\n
Implicative verbs \u542b\u84c4\u52a8\u8bcd: e.g. manage, forget, happen, avoid\u2026
I forgot to bring the book.\n=> I ought to have brought the book.\n\nWe happened to meet Bob in the cinema.\n=> We didnt expect to meet Bob in the cinema.\n
\u201cChange of state\u201d verbs \u8868\u72b6\u6001\u6539\u53d8\u7684\u52a8\u8bcd: e.g. finish, stop, begin, start, carry on, continue, cease, leave, arrive, enter, come, go, turn, transform..
He stopped / didnt stop smoking cigars\n
Iteratives \u8868\u53cd\u590d\u7684\u8bcd\u8bed: words expressing repetition. e.g. repeat, back, again, too, another time, any more..
The spaceship came back to earth.\n=> The spaceship used to be on earth.\n
Verbs of judging \u5224\u65ad\u6027\u52a8\u8bcd: accuse, charge, criticize \u603b\u611f\u89c9\u8fd9\u4e2a\u8ddf\u524d\u9762\u7684factive verb\u6709\u70b9\u50cf\uff0c\u53ef\u80fd\u662f\u524d\u9762\u90a3\u4e2a\u4e00\u822c\u662f\u52a0that\u8868that\u540e\u9762\u7684\u662fpresuppotion, \u800c\u8fd9\u4e2a\u8868\u793a\u52a8\u8bcd\u672c\u8eab\u7684\u5c5e\u6027(e.g. \u60c5\u611f\u8272\u5f69) \u4f46\u662f\u597d\u50cf\u533a\u522b\u4e5f\u4e0d\u5927
Joe accused Zeo of forgery.\n=> Joe thinks forgery is bad\n
Temporal clauses \u65f6\u95f4\u72b6\u8bed\u4ece\u53e5: before, after, since, ..
After his father died, he stepped into a large fortune.\n=> His father died.\n
Cleft sentence \u5207\u5206\u53e5/\u65ad\u88c2\u53e5: it is.. that/who.. = \u5f3a\u8c03\u53e5\u3002\u8fd9\u4e2a\u597d\u7275\u5f3a\u3002\u3002
What I lost is my passport\n=> I lost something.\n
Non-restrictive attributive clauses
Jack, who visited China last year, is fond of Chinese tea.\n=> Jack has been to China\n
Counterfactual conditionals
If I had not burnt the cake, we would be having it for tea.\n=> I burnt the cake.\n
Questions
Does Frank speak English or French?\n=> Frank speaks one of the two European languages.\n
Implicature
Grice\u2019s theory of conversational implicature, Logic and Conversation.
An outline of a systematic theory of language use, which can account for the way people read between the lines when understanding everyday language.
meaning of a sentence
Grice\u2019s new terms
Grice draws a distinction
- Smith doesn't seem to have a girlfriend these days.\n\n- He has been paying a lot of visits to New York lately.\n\n=> entailment: he visits New York recently\n=> implicature: Smith may be having a girlfriend in New York.\n
features
Grice\u2019s cooperative principle
common purpose/common direction: Conversational partners normally recognize a common purpose or a common direction in their conversation.
common objectives (~= joint project): At any point of a conversation, certain \u201cconversational moves\u201d are judged suitable or unsuitable for accomplishing their common objectives.
How the cooperative principle is applied:
How to follow the maxims:
How to break the maxims:
The cooperative maxims are guidelines instead of rules. They can be creatively infringed/violated.
quantity:
Chandler: Where is the book you are reading?\nMonica: Its in the living room where there is also light and no one will kick you in the shin.\n
quality
Two travelers arrived at the hotel and were shown a rather dirty room.\n\u201cWhat,\u201d said one, \u201cdoes this pigsty (\u732a\u5708) cost?\u201d Promptly the owner replied, \u201cFor one pig, two dollars; for two pigs, three dollars.\u201d\n
relation
(The American ambassador Joseph Chroates was once mistaken for a doorman by a guest at an embassy function).\nGuest: Call me a taxi.\nJC: OK, you\u2019re a taxi.\n
manner
Miss X sang \u201cHome Sweet Home\u201d vs.\nMiss X produced a series of sounds which corresponded closely with the score (\u4e50\u8c31) of \u2018Home Sweet Home\u2019.\n
The Horn scales & scalar implicature
When any form on a scale (most, some, always, often, must, may\u2026) is used or asserted, the negative of all forms higher on the scale is implicated.
types of implicature
graph TD\nimplicatures --> conventional/lexical\nimplicatures --> conversational\nconversational --> generalized\nconversational --> particularized\n
"},{"location":"docs/2-ling/pragmatics/intro/#lexical-pragmatics","title":"Lexical Pragmatics","text":"Criticism of relevance theory
To calculate the processing cost,
Lexical pragmatics
pragmatic enrichment
graph TD\n\npragmatic_enrichment --> pragmatic_narrowing\npragmatic_enrichment --> pragmatic_broadening\npragmatic_broadening --> approximation\npragmatic_broadening --> metaphorical_extension\n
pragmatic narrowing: superordinate \u2192 subordinate
Doctors also *drink*.\n=> drink alcohol\n
pragmatic broadening
:material-circle-edit-outline: \u7ea6 129 \u4e2a\u5b57
\u8fd9\u5757\u5185\u5bb9\u4f3c\u4e4e\u6ca1\u6709\u8bb2\u5f88\u591a\u4e1c\u897f. \u7c98\u4e00\u70b9ppt\u539f\u8bdd
Intercultural Pragmatics
Intercultural Pragmatics has the potential to help establish a \u201charmonious\u201d interaction and relationship between people from different cultures.
IP aims to study how to deal with the differences arising from cross-cultural communication and how they may affect the universality of pragmatic principles (theory of speech acts, co-
operative principle, politeness principle, etc.)
intercultural pragmatics\u2019 two way perspective
sociopragmatics
:material-circle-edit-outline: \u7ea6 810 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/2-ling/pragmatics/theories/#speech-act-theory","title":"Speech Act Theory \u8a00\u8bed\u884c\u4e3a\u7406\u8bba","text":"Speech action definition:
Speech act theory:
locutionary act \u8a00\u5185\u884c\u4e3a: is the saying of it with the literal meaning
It's stuffy here.\n=> There isn't enough fresh air in here\n
illocutionary act \u8a00\u5916\u884c\u4e3a: the speaker\u2019s intention, can be a request
It's stuffy here.\n=> a request of the receiver to open the window.\n
perlocutionary act \u8a00\u540e\u884c\u4e3a: action or state of mind brought about by, or as a consequence of, saying something
It's stuffy here.\n=> the receiver opens the window or refuses\n
A speech act = locutionary act + illocutionary act + perlocutionary act
Illocutionary force \u8bed\u529b: communicative purposes or social functions
Classification of speech act
Funtion-based classification system:
by John Searle, UCB philosopher
Structure-based classification system:
Development of Gricean theory
Definition of politeness theory
Conversationalists work together, each trying to maintain his/her own face and the face of his/her counterpart.
type of face
Acts involved
Leech\u2019s six Politeness Principle: extension of Gricean theory
(Note that the term \u2018neo-Gricean\u2019 is most often used to describe the works of Laurence Horn, Stephen Levinson, etc. not other theories e.g. relevance theory)
"},{"location":"docs/2-ling/pragmatics/theories/#relevance-theory","title":"Relevance Theory","text":"Only preserving the maxim of relation in Gricean theory
Definition of relevance theory
its investigates how aspects of meaning are generated in context and in relation to the speakers intentions.
R(relevance) = E(#contextual effects)/C(cost of efforts in obtaining E)
Relevance is higher when cognitive effects are higher, but it is lower when more processing efforts is required.
Two aspects of relevance principle
cognitive principle of relevance
Human cognition is geared towards the maximization of relevance.
The degree of relevance of a cognitive activity is governed by
it is only worth an addressee\u2019s time and effort to process some information if the ratio of rewards to effort is sufficiently high.
Every act of ostensive communication automatically carries with it the utterer\u2019s belief in its optimal relevance.
Application of RT
disambiguation
(1) She has a mole on her left cheek.\n(2) They managed to place a mole in the rival organization.\n
assignment of reference
A: I\u2019ll make the salad dressing.\nB: The oil is on the top shelf.\nA: I can\u2019t see it.\n
enrichment
A: When you\u2019ve finished the dishes will you post these letters?\nB: I will.\n=> what B really means is \u201cI will post those letters when I\u2019ve finished the dishes.\n
implicature
A: Did Chris get invited to the conference?\nB: His paper was too long.\n=> Chris didn\u2019t get invited to the conference.\n
1 - Definition Clearification
This chapter provides a brief introduction to the terminologies involved in semantics.\n
2 - Logics & Formal Semantics
This chapter first introduces the semiotics in formal semantics (which adopts a similar system with that in the logics). It then discusses about the semantics in two perspectives: the propositional logic and the predicate logic. It also introduces several basic rules in logic inference.\n
3 - Scope Ambiguity
This chapter discusses on the unsolved questions in scope ambiguity.\n
"},{"location":"docs/2-ling/semantics/#grading","title":"Grading","text":"mid-term: 35%
final: 50%
participation: 15%
"},{"location":"docs/2-ling/semantics/#two-tests","title":"Two tests","text":"Two tests will be given during the term, one in the middle and one at the end of the term, covering all the material covered up to that point in the course. The tests will be a combination of various types of questions, including true/false and short essay.
"},{"location":"docs/2-ling/semantics/#final-review-for-fun","title":"Final Review & For Fun","text":":material-circle-edit-outline: \u7ea6 629 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
The following parts are written in preparation for the final review but I upload it as well for you to read for fun.
"},{"location":"docs/2-ling/semantics/#noble-semanticians","title":"Noble Semanticians","text":"Name Field Contribution Live Nation Institution Fun facts Noam Chomsky mainly in syntax generative grammar, transformational grammar, government and binding theory, minimalist program, productivity of language, recursivity of language 1928- USA MIT Most prominent linguist alive Ferdinand de Saussure linguist and semiotician founder of semiotics. concepts: sign, signifier vs. signified, diachronic vs. synchronic, language vs. parole, paradigmatic vs. syntagmatic 1857-1913 Switzerland University of Geneva, Switzerland Charles Sanders Peirce philosopher, mathematician, logician founder of semiotics. concepts: index, icon, symbol. 1839-1914 Milford Pennsylvania JHU Michel Br\u00e9al comparative grammar coined the term \u201csemantics\u201d, diachronic focus 1832-1915 born in Rheinlan (Germany), studied in Paris and Berlin in Paris Leonard Bloomfield structural linguistics structural linguistics, language as a self-regulating system, behaviorism(stimulus-response testing) 1887-1949 Yale University reject introspection Aristotle polymath term logic, initiator of western scientific tradition 384-322 BC Stagira, Greece tutor of Alexander the Great Gottlob Freg philosopher, logician, mathematician predicate logic, sense(sentence\u2019s proposition) vs. reference (its truth value) 1848-1925 German University of Jena extreme right-wing views Peter Geach philosopher, professor of logic donkey sentence (1962) 1916-2013 England Oxford Richard Montegue semanticist Montegue grammar: syntax and semantics go together 1930-1971 student of Alfred Tarski, gay man, killed in his apartment, four influential papers Gareth Evans philosopher philosophy of mind, work on reference, e-type anaphora 1946-1980 England Oxford Irene Heim semanticist definite and indefinite pronouns 1954- German, Munich MIT, phd 1982 advisor: Barbara Partee Hans Kamp philosopher and linguist discourse representation theory (DRT) 1954- Dutch Bertrand Russell philosopher, logician logic, philosophy of mathematician 1872-1970 Wales, Britain Cambridge Henri\u00ebtte de Swart linguist tense and aspect, negation, bare nominals and indefinite noun phrases. She has also investigated the role of semantics in language evolution, and was involved in the development of bidirectional optimality theory. 1961- Dutch director of Netherlands Graduate School of Linguistics and Utrecht Institute of Linguistics"},{"location":"docs/2-ling/semantics/#example-questions","title":"Example questions","text":"What is a donkey pronoun?
A donkey sentence is such that an expected existential is interpreted as universal taking wide scope.\n
What is a discourse pronoun:
outside the scope of existing quantifier\ne.g. No student studies semantics. He is outside.\n
The scope of a quantifier is always bound in the clause it appears.
True\n
What is quantifier raising?
Chmosky and May.\nLF, \n
What are De Morgan\u2019s laws?
~(p or q) <=> (~p) and (~q)\n~(p and q) <=> (~p) or (~q)\n
What are conditional laws
p -> q <=> ~p or q\n
When is the indefinite \u201ca\u201d not an existential quantifier?
1. donkey sentence\n2. generic noun phrase. A woman is difficult to please. \\forall x(Wx -> Dx)\n3. John is a plumber.pj\n
2 readings: Some boy smiled at Jane and some boy kissed Molly.
\\exist x(Bx and Sx,j and Kx,m)\n\\exist x(Bx and Sx,j) and \\forall y(By and Ky,m)\n
2 Types of Recursion
embedding and coordination\n
"},{"location":"docs/2-ling/semantics/ambiguity/","title":"Ambiguity","text":""},{"location":"docs/2-ling/semantics/ambiguity/#scope-ambiguity","title":"Scope Ambiguity","text":""},{"location":"docs/2-ling/semantics/ambiguity/#scope-and-anaphora","title":"Scope and Anaphora","text":"antecedent vs. postcedent
anaphor vs. cataphor
Predicate logic is suited to capture natural language meaning
allow recursion = recursivity
two sources of recursion
some boy kissed every girl.\n\nEvery girl was kissed by some boy.\n
Someone mentioned tehy called everyone.\n\n\\forall x: Px\\forall y(M(x, Cxy))\n
linear order: negative polarity item
graph TD\n DS -.Transformation.-> SS\n SS -.send off.-> PF\n SS -.send off.-> LF\n PF -.acoustic representation.-> SS\n LF -.semantic interpretation.-> SS\n
Transformation:
CALLOUT: annotation, connotation and denotation
annotation
connotation: intension.
A meaning of a word or phrase that is suggested or implied, as opposed to a denotation, or literal meaning. A characteristic of words or phrases, or of the contexts that words and phrases are used in.
The\u00a0connotations\u00a0of the phrase \"you are a dog\" are that you are physically unattractive or morally reprehensible, not that you are a canine.
A technical term in logic used by J. S. Mill and later logicians to refer to the attribute or aggregate of attributes connoted by a term, and contrasted with\u00a0denotation\u00a0.
The two expressions \"the morning star\" and \"the evening star\" have different\u00a0connotations\u00a0but the same denotation (i.e. the planet Venus).
denotation
Quantifier-raising - NC RM - syntactic structure comes before the semantic structure - The movement we make in SS to remove ambiguity in DS is called quantifier-raising. - take the quantifier to the higher position to show the scope
Quantifier-in - Montague grammar - The derivational illustration is called quantifier-in. - each predicate take an argument once a time
Quantifier storage - Cooper storage - semantic ambiguity not represented in syntactic structure - semantic representation in which scope ambiguities are obtained without special syntactic rules
"},{"location":"docs/2-ling/semantics/ambiguity/#quantifier-in","title":"Quantifier-in","text":"interrogative: asking a question
which woman does every man love?\n
which scopes over every.
"},{"location":"docs/2-ling/semantics/ambiguity/#scope-ambiguity_1","title":"Scope ambiguity","text":"e.g. some boy did not laugh.
\\exist x (Boy(x) and ~Laugh(x))\n~\\exist x (Boy(x) and Laugh(x))\n
some boy kissed no girl.
\\exist x (Boy(x) and ~\\exist y (Girl(y) and Kiss(x, y)))\n~\\exist y (Girl(y) and \\exist x (Boy(x) and Kiss(x, y))): there was no girl kissed by a boy\n
every boy kissed no girl.
\\forall x (Boy(x) and ~\\forall y(Girl(y) and Kiss(x, y)))\n
"},{"location":"docs/2-ling/semantics/ambiguity/#deictic","title":"Deictic","text":"No boy said he was hungry.
No boy was present. He was outside instead.: \u201che\u201d is trying to refer to \u201dno boy\u201d but outside the scope.
pronoun \\(\\sub\\) anaphora
"},{"location":"docs/2-ling/semantics/ambiguity/#discourse-anaphora","title":"Discourse Anaphora","text":"e.g.
Every student was present and she was interested.\n
every: scopes over \u201cEvery student was present\u201d
every: an indefinite quantifier. \u201cshe\u201d\u2019s antecedent is not clear
\u201cshe\u201d is hardly bound by the antecedent. \u201cshe\u201d is free * ungrammatical: \u4e0d\u5408\u8bed\u6cd5\u7684, syntactic
"},{"location":"docs/2-ling/semantics/ambiguity/#infelicitous-semantic-fit-the-context","title":"infelicitous: \u4e0d\u5408\u9002\u7684, semantic, fit the context","text":":material-circle-edit-outline: \u7ea6 1349 \u4e2a\u5b57 :fontawesome-solid-code: 15 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f
discourse pronoun: in separate clauses
sentence quantifier:
Some boy said he was hungry.\nNo boy said he was hungry.\n
discourse quantifier:
Some boy was present; he was hungry.\n#No boy was present; he was hungry. // he is free\n
coreference individual constants
Fred thought he was the the best\n
binding individual variables
Every student thinks he/she is the best\n
So we may conclude the following rules for e-type anaphora. BUT this part has NOT been verified with any authority. Do NOT take them as given truths during exams.
e.g. No boy thinks that he has a chance.
~\\exist x(Boy(x) and Think(x, Has-a-chance(x)))\n
A particular boy said he wanted to kiss every girl. He then did it.
\\exist !x(Bx and W(x, K(x, \\forall y(Gy -> K(x, y))))) and K(x, y)\n
"},{"location":"docs/2-ling/semantics/ambiguity/#donkey-anaphora","title":"Donkey anaphora","text":"if a farmer owns a donkey, he beats it.
* \\exist x (Fx and \\exist y (Dy and O(x, y))) -> B(x, y)\n\\forall x \\forall y (Fx and Dy and O(x, y) -> B(x, y))\n
= every farmer who owns a donkey beats it.
\\exist x(Fx and \\exist y (Dy and O(x, y)) -> B(x, y)) // y is free\n
\u2757\u2757\u2757
A donkey sentence is such that an expected existential is interpreted as universal taking wide scope.
donkey pronoun can be: it, him, they (can also be plural forms)
\u201ca\u201d: generic indefinite
A woman is a difficult thing to please.\n
[Every farmer [who owns a donkey] beats it.]
universal wide scope: it scopes more over the relative clause
The problem - Existential with narrow scope - interpreted as universal with wide scope - in conditional clauses - in restriction of every
Conclusion - the machinery of predicate logic is broken - cannot capture meaning of natural language
If a student tries, she passes the exam.
(\\exist x(Sx and Tx)) -> Py ; y is free\n\\exist x((Sx and Tx)) -> Py)\n
interpretation
\\forall x((Sx and Tx) -> px)\n
Solutions for donkey anaphora:
E-type anaphora
initial examples
A student came in. She had a question about the exam.\nshe = the student came in\n\nBill owns some sheep and Max vaccinates them.\nthem = the sheep Bill owns. E-type pronoun, some sheep scopes over the first half\n
If a student likes Copenhagen, she is happy.
she = for every case we examine, the student is \n
every student who reads a semantic paper likes it.
Bill owns a cat. Max takes care of it.\nBill is a cat-owner. #Max takes care of it.\n
DRT (Dynamic binding theory)
Unselective binding example of the subject is \u2018unselectively bound\u2019 by a special \u2018generic operator.
Dogs bark.\nA dog barks.\n
Reference: Unselective Binding
"},{"location":"docs/2-ling/semantics/ambiguity/#chapter-6-in-short-discoursedonkey-anaphora","title":"Chapter 6 in short: Discourse/Donkey Anaphora","text":"(\u52a0\u7c97\u7684\u662fDonkey anaphora\u548cE-type anaphora\u7684\u533a\u522b)
Discourse: basic unit of interpretation
Donkey sentence: is such that an expected existential is interpreted as universal taking wide scope. / sentences that contain a pronoun with clear meaning but whose syntactical role in the sentence poses challenges to grammarians (wikipedia)
e.g.
every farmer who owns a donkey beats *it*.\nit: (corresponding to the) existential (\"a\") but interpreted as universal\n
every police officer who arrested a murder insulted *him*.\nhim\n
every farmer who owns some sheep cleans *them*.\nthem\n
donkey anaphora = donkey pronoun: it, him, they (can also be plural forms)
Analysis of donkey anaphora: Montague grammar
e.g.
\\forall x(Farmer(x) and \\exist y (Donkey(y) and Owns(x,y)) -> Beat(x,y))\n
Anaphoric relations in sentence and discourse - E-type anaphora: pronoun outside the scope of binder, not bound, content of pronoun reconstructed, reconstruction based on context - in separate sentences
```\n A student came in. *She*(the student came in) had a question about the exam.\n ```\n\n- in the same sentence but outside the scope\n ```\n If a student likes Copenhagen, *she*(for every case we examine, the student in question who likes Copenhagen) is happy.\n ```\n\n- problem of compound: antecedent must appear as a noun?\n ```\n Bill owns a cat. Max takes care of it.\n Bill is a cat-owner. # Max takes care of it.\n ```\n
Anaphora resolution - TODO
"},{"location":"docs/2-ling/semantics/definitions/","title":"Definition Clarification","text":":material-circle-edit-outline: \u7ea6 1068 \u4e2a\u5b57 :fontawesome-solid-code: 53 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/2-ling/semantics/definitions/#what-is-semantics","title":"What is semantics?","text":"parenthesis
small dogs and cats: \n- small (dogs and cats)\n- (small dogs) and cats\n\n// example of scope of quantifier\n
logical quantifier
every body did not cry:\n- every not (boy did cry) 'no boy did cry'\n- not every (boy did cry) 'at least one boy did cry'\n
everything but the subject e.g. John likes grammar.
content verb or adjective taking arguments e.g. like (John, grammar).
graph TD\n Language_Ability --> Competence\n Language_Ability --> Performance\n Competence --> Grammar\n Competence --> Lexicon\n Grammar --> Semantics\n Grammar --> Phonology\n Grammar --> Syntax\n Grammar --> Pragmantics\n
"},{"location":"docs/2-ling/semantics/definitions/#semantics-syntax","title":"Semantics & Syntax","text":""},{"location":"docs/2-ling/semantics/definitions/#syntax-needs-semantics","title":"Syntax needs semantics","text":"We can/cannot study syntax without semantics.
Colorless green ideas sleep furiously.\n
Deixis is how objects, events and situations relate to the here and now of the speakers. It shows that utterance meaning cannot be fully determined by sentence meaning.
(Last week) (I) play(ed) tennis with Chris.\n
"},{"location":"docs/2-ling/semantics/definitions/#deictic-vs-anaphoric-use-of-pronouns","title":"Deictic vs. Anaphoric use of pronouns","text":"Deictic: pointing context Anaphoric: linguistic expression context. pronoun resolution: antecedent - pronoun
\ud83d\udcad index - indices (higher register) / indexes \ud83d\udcad Desiderata (high-register way to say Goal, desideratum. sl.)"},{"location":"docs/2-ling/semantics/definitions/#map-of-semantics-taxomony","title":"Map of Semantics / Taxomony","text":"Semantics - lexical semantics - meaning of lexical items - smaller unites - mainly words - morphemes - compositional semantics - meaning of larger units - phrases and sentences - word combination
"},{"location":"docs/2-ling/semantics/definitions/#utterance-sentence-proposition","title":"Utterance / Sentence / Proposition","text":"abiguity: bank, punch, pitcher\nsynonymy: beautiful-lovely, antonymy: male-female\nhyponymy: set -> superset\ntaxonomy: set -> subset\nsymmetric relation: marry. mutually entail each other\nconverse relation: send, sell\nmeronomy:
"},{"location":"docs/2-ling/semantics/definitions/#1-homonymy","title":"1) homonymy","text":"part-whole relationship
subtypes of meronymy
pistachio - almond taxonymy\nlaugh - cry move in - move out\ncry - weep\nRMB - monetary unit\ngrilfriend - wife\nsit - stand\njump - hop\ngood - bad\nbeat - beet\nrise - fall reverse\ncigarette - cigar taxonymy\nkid - goat dragon - monster\n
"},{"location":"docs/2-ling/semantics/definitions/#compositional-semantics","title":"Compositional semantics","text":"Michel Br\u00e9al: coined semantics
Ferdinand de Saussure: semiotician, diachronic vs. synchronic.
Leonard Bloomfield: structural linguistics, Language, behaviorism(stimulus-response testing). reject introspection(theorize about language learning by thinking about on ones own experience)
"},{"location":"docs/2-ling/semantics/definitions/#diachronic-synchronic","title":"Diachronic & Synchronic","text":"Noam Chomsky Syntax
"},{"location":"docs/2-ling/semantics/definitions/#generative-grammar","title":"Generative Grammar","text":"e.g. Flying planes can be dangerous.
graph TD\n are --> planes\n planes --> flying\n are --> dangerous\n
graph TD\n is --> flying\n flying --> planes\n is --> dangerous\n
"},{"location":"docs/2-ling/semantics/definitions/#pronoun-resolution","title":"pronoun resolution","text":"anaphora
John said he would helps.\nNo boy said he would help. no boy: all the boy not, not exist a boy\n
coreference(coreferential): refer to same person
notes: cf. compare, e.g. for example
graph TD\n Inference --> Entailment\n Inference --> Presuppositions\n Inference --> Implicature\n
any conclusion drawn from a set of propositions, from something someone has said and so on.
"},{"location":"docs/2-ling/semantics/definitions/#entailment","title":"Entailment","text":"Three girls were present. -> More than two girls were present.\nThree girls were not present. kills More than two girls were present.\n
Cannot be cancelled
# Three girls were present, but actually two girls come.\n#: semantically wrong\n
"},{"location":"docs/2-ling/semantics/definitions/#presupposition","title":"Presupposition","text":"Jim regrets ignoring the first problem. -> Jim has the first problem.\nJim does not regret ignoring the first problem. -> Jim has the first problem.\n
cannot be cancelled
# Jim regrets ignoring the first problem, but he does not have the first problem.\n
"},{"location":"docs/2-ling/semantics/definitions/#implicature","title":"Implicature","text":"Susan blushes when Jim looks at her, but she does not have a crush on him.\n
"},{"location":"docs/2-ling/semantics/definitions/#compositionality","title":"Compositionality","text":"Proposed by Noam Chomsky, the term compositionality entails three dimension.
The meaning of the whole is a function of the meaning of its parts and the way they are put together.: \u2026 is determined by\u2026
"},{"location":"docs/2-ling/semantics/formal_semantics/","title":"Logics & Formal Semantics","text":":material-circle-edit-outline: \u7ea6 2560 \u4e2a\u5b57 :fontawesome-solid-code: 24 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f
"},{"location":"docs/2-ling/semantics/formal_semantics/#metalanguage","title":"Metalanguage","text":"a. January has 31 days.\nb. *******January******* has 7 letters.\nb*. 'January' has 7 letters.\n
Liar sentence
(31) Sentence (31) is false.\n
solutions: (\u4e0d\u8003)
fuzzy logic
x = NOT(x)\nx = 1 - x\nx = 0.5\n
Alfred Tarski paradox arises only in languages that are \u201csemantically closed\u201d.
Arthur Prior equivalent
This statement is false.\nThis statement is true and this statement is false.\n
Saul Kripke Whether a sentence is paradoxical or not can be depend upon contingent facts.
A majority of what Jones says about me is false.\n
Smith is a big spender.\nSmith is soft on crime.\nEverything Smith says about me is true.\n
If a statement's truth value is ultimately tied up in some evaluable fact about the world, that statement is \"grounded\". If not, that statement is \"ungrounded\". Ungrounded statements do not have a truth value. Liar statements and liar-like statements are ungrounded, and therefore have no truth value.
Jon Barwise and John Etchemendy \u201cdenial\u201d or \u201cnegation\u201d
Dialetheism
Dialetheism is the view that there are true contradictions. Dialetheism raises its own problems. Chief among these is that since dialetheism recognizes the liar paradox, an intrinsic contradiction, as being true, it must discard the long-recognized\u00a0principle of explosion, which asserts that any proposition can be deduced from a contradiction, unless the dialetheist is willing to accept trivialism \u2013 the view that\u00a0all propositions are true. Since trivialism is an intuitively false view, dialetheists nearly always reject the explosion principle. Logics that reject it are called\u00a0paraconsistent.
Non-cognitivism
logic overview
graph TD\n Logic --> Logic_from_antiquity\n Logic --> Predicate_Logic\n Logic_from_antiquity --> Term_Logic\n Logic_from_antiquity --> Propositional_Logic\n
logic from antiquity: older
predicate logic: newer
Aristotle: term logic
Gottlob Frege: predicate logic
"},{"location":"docs/2-ling/semantics/formal_semantics/#history-of-logics","title":"History of Logics","text":"Not applied for - question (?) - exclamation - modal: modal logic
\ud83d\udcad ergo: therefore"},{"location":"docs/2-ling/semantics/formal_semantics/#term-logic","title":"Term logic","text":""},{"location":"docs/2-ling/semantics/formal_semantics/#modus-ponens","title":"Modus Ponens","text":"Means of putting, MP syllogism, affirming the antecedent
P(conditional statement): If it rain, I do not go to school.\nH: It rains.\nC: I do not go to class.\n
Formal fallacy: affirming the consequent. Abductive reasoning.
P: If it rains, I will not go to class.\nH: I do not go to class.\nC: * It rains.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#modus-tollens","title":"Modus Tollens","text":"Means of carrying, MT syllogism, denying the consequent.
P: If it has not been cloudy, it does not rain.\nH: It rains.\nC: It has been cloudy.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#hypothetical-syllogism","title":"Hypothetical syllogism","text":"principle of transitivity
P: If it rains, the soils goes wet. If the soil goes wet, the plants grow.\nH: It rains.\nC: The plants grow.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#disjunctive-syllogism","title":"Disjunctive syllogism","text":"two premises and a conclusion
P: It either rains or its sunny.\nH: It rains.\nC: It is not sunny.\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#three-types-of-reasoning","title":"Three types of reasoning","text":"Deductive reasoning
general to the particular. based on entailment
Inductive reasoning
particular to the general. empiricism
Abductive reasoning
formal fallacy. All dogs bark, Fido barks, Fido is a dog.
Abductive reasoning allows inferring a as an explanation of b. As a result of this inference, abduction allows the precondition a to be abducted from the consequence b.
Properly used, abductive reasoning can be a useful source of\u00a0priors in\u00a0Bayesian statistics.
John is friendly or John is not friendly.\n
p V_e ~p T T F F T T John is friendly and John is not friendly.\n
p and ~p T F F F F T It is not the case that John is not friendly.\n
~ ~ p T F T F T F contingent.
It is not the case that John is hungry or John is not grumpy.\n
~( p or ~q F T T T F T T F F F T T T F F F"},{"location":"docs/2-ling/semantics/formal_semantics/#material-implication","title":"Material implication \u2192","text":"converse: q\u2192p. affirming the consequent
inverse: ~p\u2192~q. denying the antecedent
contrapositive: ~q\u2192~p. modus tollens
given p\u2192q.
Although it was extremely cold, Sally did not stay indoors.
~q->p\np and ~q\n
We get a holiday, or we protest.
~p->q\np or q\n
Jone said that Jane helped him.
p\np and q\n
John\u2019s sister burped
p: John has a sister. presupposition, assume it true\nq: This sister burped.\np\np and q\n
John arrives before Jane left
p before q\n
John did not arrive before Jane left.
~p before q\np ~before q\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#predication-and-quantification","title":"Predication and Quantification","text":"universal quantifier: every, each, all, any, only
existential quantifier: a, some, there is \\(\\exist\\), for all \\(\\forall\\)
predicate, argument
John may like Sally.
predicate: may like\n
John has a crush on Sally.
predicate: has a crush on\n
Frank is the father of Susan.
predicate: is the father of\n
Frank is Susan\u2019s father.
predicate: is...'s father\n
Adjunct: if, probably, means, of course, early
Valent, empty place holder: formal subject
"},{"location":"docs/2-ling/semantics/formal_semantics/#collective-and-distributive-readings","title":"Collective and distributive readings","text":"Jogn and Molly ate a pizza.\np: one pizza, ate one together. distributive\np and q: two pizzas, each ate a pizza. collective\n
Cinthia and Sam have saved 100 dollars.\np: together 100 dollars\np and q: 200 dollars\n
Content verb is a predicate, but functional verbs are not
John obviously spoke with Jane because he had to.
predicate: spoke with\nargument: John, Jane\nadjuncts: obviously, because he had to.\n
If I get a chance, I will probably try to avoid the mistake.
predicate: will try to \nargument: I, avoid the mistake\nadjuncts: If I get a chance, probably\n
John performed Jill\u2019s operation first.
\n
The person who talk loudly is Jim\u2019s father.
predicate: is someone's father\nargument: the person who talk loudly, Jim\nadjunct: \n
the talking loudly person
predicate: talking\nargument: person\nadjunct: loudly\n
predicate: the nodes that are connected in SUD parsing tree
universal dependency (UD)
syntactic-universal dependency (SUD)
graph TD\n Primitive_units_within_propositions --> Predicates\n Primitive_units_within_propositions --> Arguments\n Arguments --> individuals_Terms\n individuals_Terms --> constants\n individuals_Terms --> variables\n
lexical predicates vs. syntactic predicates
individual constants vs. individual variables
e.g. We think John likes Susan.
T(w, Lj,s)\n
Types of predicates:
e.g. Monica hid her bicycle.
x hide y: Hx,y\nMonica: m\nher bicycle: b\nHm,b\n
e.g. Monica did not hide her bicycle.
x hide y: Hx,y\nMonica: m\nher bicycle: b\n~Hm,b\n
e.g. Monica laughed and cried.
Monica: m\nlaugh: L()\ncry: C()\nLm and Cm\n
e.g. Jim sent Monica his dog.
Sj,m,d\n
e.g. William did not help or hinder Mike.
~ (H1w,m or H2w,m) \n
e.g. Jennifer promise to help.
P(j, Hj)\n
e.g. Jennifer did not promise to help.
~P(j,Hj)\n
e.g. Jennifer promise to not laugh.
P(j,~Lj)\n
e.g. Mike claimed he wanted to help.
C(m, W(m/x, Hm/x))\n\nm: Mike\nx: maybe some other\n
e.g. John asked Mandy to stop laughing.
A(j, m, S(m, Lm))\n
e.g. John and Larry called Molly.
Cj,m and Cl,m\nC(j and l, m)\n
e.g. Molly did not call John and Larry.
~C(m, j) and ~C(m, l)\n~C(m, j and l)\n~C(m, j) or ~C(m, l)\n
entailment: (universal instantiation)
every dog barks \u2192 if something is a dog, then it is a dog.
Universal quantification
\\(\\forall\\)x (Dx \u2192 Bx)
D = (d1, d2, d3,\u2026)
\\(\\forall\\)x (Dx \u2192 Bx)= (Bd1 and Bd2 and Bd3, \u2026.)
Existential quantification
\\(\\exist\\)x (Dx and Bx)
D = (d1, d2, d3,\u2026)
\\(\\exist\\)x (Dx and Bx) = (Bd1 or Bd2 or Bd3, \u2026.)
e.g. Every cat barfed.
\\forall x (Cx -> Bx)\n
e.g. The cat barfed.
Bc\n
e.g. Bill fed cat.
\\forall x (Cx -> Fb,x)\n
e.g. Some dog barked at Fred.
\\exist x (Dx and Bx,f)\n
e.g. Fred scolded some dog.
\\exist x (Dx and Sf,x)\n
e.g. Fred and Susan avoid some dog.
\\exist x (Dx and Af,x and As,x)\n\\exits x (Dx and Af,x) and \\exist y (Dy and Af,s)\n
e.g. No dog barks.
\\forall x (Dx -> ~Bx)\n~\\exist x (Dx and Bx)\n
e.g. Bill fed no dog.
~\\exist x (Dx and Fb,x)\n\\forall x (Dx -> ~Fb,x)\n
e.g. No dog barked at Susan or chased Fred.
~\\exist x ((Dx and (Bx,s or Cx,f))\n\\forall x ((Dx -> (~Bx,s and ~Cx,f))\n\\forall x ((Dx -> ~(Bx,s or Cx,f))\n
Scope ambiguity
e.g. Some boy kissed every girl.
\\exist x \\forall y (Bx and (Gy -> Kx,y)) = \\exist x(Bx and \\forall y (Gy -> Kx,y))\n\\forall y \\exist x (Gy -> (Bx and Kx,y)) = \\forall y (Gy -> \\exist x (Bx and Kx,y))\n
Every boy kissed some girl.
\\forall x (Bx -> \\exist (Gy and Kxy)) <=> \\forall x \\exist y (Gy and Kxy)\n
Every students did not laugh.
\\forall x (Sx -> ~Lx) <=> ! \\exist x (Sx and Lx)\n~\\forall x (Sx -> Lx) <=> \\exist (Sx and ~Lx)\n
Not every student laughs.
~\\forall x (Sx -> Lx) <=> \\exist (Sx and ~Lx)\n
graph TD\n laughed --> student\n student --> /every\n /every --> not\n
each studnet did not laugh.
\\forall x (Sx -> ~Lx) \n~\\forall x (Sx -> Lx)\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#polarity-item","title":"Polarity item","text":"any: negative polarity item
John did not pass every exam.
~\\forall x (Ex -> Pj,x) <=> \\exist x (Ex and Pj,x)\n\\forall x (Ex -> ~Pj,x)\n
John did not pass any exam.
\\forall x (Ex -> ~Pj,x)\n
e.g.
Jack saw a rat.
\\exist x (Rx and Sj,x) \n
Jack is a rat.
the quantifier is in the predicate but not the argument. here rat is a constant.
Rj\n
Jack knows no genius.
use not exist to render \u201cno\u201d
~\\exist x (Gx and Kj,x) <=> \\forall x (Gx -> ~Kj,x)\n
Jack is no genius. <=> Jack is not a genius.
~Gj\n
These problems are difficult.
Dp\n
These problems are difficult ones.
Dp\n
All the problems are difficult.
\\forall x (Px -> Dx)\n
These problems are all the problems.
Ap\n
These problems are not all the problems.
~Ap\n
Jack is our plumber.
Pj\n
Our plumer is Jack. (has presupposition)
Pj\n
Everything counts.
whether thing includes animate and inanimate.
\\forall x (Cx)\n\\forall x (Tx -> Cx)\n
Everybody counts.
*\\forall x (Cx)\n\\forall x (Px -> Cx)\n
predicates
some prepositions.
The present under the tree is big. (prepositions that gives location)
argument nouns.
common nouns
content verbs are the core of syntactic predicates
adjectives are most always the core of syntactic predicates.
e.g. Mike\u2019s wife thinks Mikes if lazy.
predicates inside individual constants are presuppositional
A thin man was present.
predicates inside \u2026 .are propositional
e.g. Every barking is harmless
has true or false impact on the truth
\\forall x ((Dx and Bx) -> Hx)\n
this proposition has to show up in the predicate
The barking dog is harmless.
Hd\n
the presupposition does not show in the predicate
John avoids every dog he sees.
\\forall x ((Dx and Sj,x) -> Aj,x)\n
John said every dog barks.
intensional
Sj\nS(j,\\forall x (Dx -> Bx)) \nSj,I ; I for intensional argument predicate\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#adjunct-predicates","title":"Adjunct predicates","text":"Jane probably teased Sam last night
John arrived drunk.
Jim burped twice.
twice: propositional or presuppositional
Susan did not cheat yesterday.
Mary stayed because John stayed.
Mary did not stay because John stayed
Every boy was hungry
\\forall x: Bx(Hx)\n
Some boy was hungry.
\\exist x: Bx(Hx)\n
Every cat barfed.
\\forall x: Cx(Bx)\n
Bill fed every cat.
\\forall x (Cx, Fb,x)\n\\forall x: Cx(Fb,x)\n
Some dog barked at Fred.
\\exist x (Dx, Bx,f)\n\\exist x: Dx(Bx,f)\n
Fred and Susan avoid some dog.
\\exist x(Dx and (Af,x and As,x))\n\\exist x: Dx (Af,x and Af,x)\n
No dog barks.
~\\exist x (Dx and Bx) <=> ~\\exist x: Dx (Bx)\n
"},{"location":"docs/2-ling/semantics/formal_semantics/#formal-predicate-semantics","title":"Formal Predicate Semantics","text":"graph TD\n Semantic_Rules --> Model\n Semantic_Rules --> Valuation_Function\n Model --> Universe_of_Discourse\n Model --> Interpretation_Function\n Universe_of_Discourse --> entities\n
interpretation function I
I(name) \u2192 meaning\n
assignment function g[x/e]
g(type of object) -> meaning\n
valuation function V
V(p) = 1/0\nV(Bs) = 1/0\n
[[\\alpha]]^M the denotation of \\alpha wrt M (same as interpretation function I)
[[name]]^M -> meaning\n
:material-circle-edit-outline: \u7ea6 23 \u4e2a\u5b57
\u4e0d\u597d\u8bf4 \u65bd\u5de5\u4e2d
\u76ee\u5f55
:material-circle-edit-outline: \u7ea6 599 \u4e2a\u5b57 :fontawesome-solid-code: 30 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
"},{"location":"docs/2-ling/syntax/conv_gen/#x-bar-theory","title":"X-bar theory","text":"\u751f\u6210\u53e5\u6cd5\u548c\u6210\u5206\u53e5\u6cd5\u4e4b\u95f4\u7684\u533a\u522b
[The big book of poems with the blue cover] is on the table.\n
\u6210\u5206\u53e5\u6cd5\u505a\u51fa\u6765\uff0csubject\u662f\u4e00\u4e2a\u9ad8\u5ea6\u4e3a1\u7684\u6811
\u53e5\u5b50\u4e4b\u95f4\u7684\u6210\u5206\u901a\u8fc7\u4e24\u4e24\u7ec4\u5408\u8fd8\u80fd\u505a\u51fa\u65b0\u7684\u9ad8\u5ea6
one-replacement
\u7528one-replacement\u63a2\u6d4b\u9650\u5b9a\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u5173\u7cfb\uff08\u52a8\u8bcd\u7528did so/did too\uff09
Mika loved the policeman intensively.\nSusan did so half-heartedly.\n*Susan did so the baker.\n
graph TD\n NP --> D\n D --> the\n NP --> N1\n N1 --> AdjP\n AdjP --> big\n N1 --> N2\n N2 --> N3\n N2 --> PP1\n N3 --> N\n N --> book\n N3 --> PP2\n PP2 --> of_poems\n PP1 --> with_the_blue_cover\n
\u52a0\u5165\u4e86bar level\uff0cbook\u4e0eof poems\u6784\u6210\u4e00\u4e2a\u4e2d\u95f4\u6295\u5c04X-bar\uff0c\u6784\u6210\u4e00\u4e2aconstituent\u3002\u4f7f\u5f97\u6bcf\u4e2a\u53e5\u5b50\u90fd\u80fd\u88ab\u753b\u6210\u4e00\u4e2a\u4e8c\u53c9\u6811\u5f62\u5f0f
\u751f\u6210\u53e5\u6cd5\u5b66\u6d3e\uff1a\u4e0a\u4e16\u7eaa\u4e94\u5341\u5e74\u4ee3\u3002classical theory and standard theory\u30021988\u5e74\u63d0\u51fa\u4e86government and binding theory\u3002lexicon, D-S, S-S, PF, LF
"},{"location":"docs/2-ling/syntax/conv_gen/#n-bar","title":"N-bar","text":"\u539f\u672cNP\u6839\u636e\u4e00\u7cfb\u5217\u89c4\u5219\u4e0d\u662f\u4e8c\u53c9\u6811\uff0c\u6bd4\u5982N\u2192
N-bar theory\u8ba4\u4e3a\u53ef\u4ee5\u90fd\u53d8\u6210\u4e8c\u53c9\u6811
\u89c4\u5219\u6bd4\u5982
NP -> Det N'\nN' -> AP N'\nN' -> N PP\n
\u7b2c\u4e00\u6761\u79f0\u4e3a\u4e00\u4e2a\u6700\u5927\u6295\u5c04
"},{"location":"docs/2-ling/syntax/conv_gen/#v-bar","title":"V-bar","text":"VP -> V' // \u9884\u7559\u4e00\u4e2a\u4f4d\u7f6e\u7ed9\u6f5c\u5728\u7684specifier\uff0c\u5373\u4f7f\u6ca1\u6709\nV' -> AdvP V' | V' PP | V' AdvP\nV' -> V(NP)\n
"},{"location":"docs/2-ling/syntax/conv_gen/#abj-bar","title":"Abj-bar","text":"AdjP -> Adj'\nAdj' -> (AdvP) Adj' | Adj' (AdvP)\nAdj' -> Adj(PP)\n
"},{"location":"docs/2-ling/syntax/conv_gen/#p-bar","title":"P-bar","text":"PP -> P'\nP' -> P'(PP) | (AdvP)P'\nP' -> P(NP)\n
\u4e2d\u5fc3\u8bcdX \u2192 \u4e2d\u95f4\u6295\u5c04X\u2019 \u2192 \u6700\u5927\u6295\u5c04XP\u3002\u4e0d\u80fd\u76f4\u63a5\u5230XP\uff0c\u4e00\u5b9a\u8981\u6709\u4e2d\u95f4\u6295\u5c04
"},{"location":"docs/2-ling/syntax/conv_gen/#parameter-of-word-orders","title":"Parameter of Word Orders \u7ba1\u7ea6\u8bba\uff0c \u539f\u5219\u4e0e\u53c2\u6570\u7406\u8bba","text":"\u6839\u636eX-bar\u7406\u8bba\uff0c\u53ef\u4ee5\u5bf9\u4e00\u4e9b\u8bed\u8a00\u7684\u4e0d\u540c\u8bed\u5e8f\uff08\u5982SVO\uff0cSOV\u7b49\uff09\u7ed9\u51fa\u8bed\u6cd5\u53c2\u6570\u5316\u89e3\u91ca
specifier\u548ccomplement\u53ef\u4ee5\u51fa\u73b0\u5728\u5176sister\u7684\u4e24\u4fa7\uff0c\u8fd9\u79cd\u6295\u5c04\u7684\u5de6\u53f3\u533a\u522b\u88ab\u79f0\u4e3aparameter setting
"},{"location":"docs/2-ling/syntax/conv_gen/#_2","title":"\u753b\u6811\u7684","text":"head movement: movement from a head to another head position
\u53e5\u5b50\u53ef\u4ee5\u53d1\u751fmovement\u7684\u6807\u5fd7
"},{"location":"docs/2-ling/syntax/conv_gen/#-reading","title":"- \u4e00\u4e2a\u53e5\u6cd5\u7ed3\u6784\u5177\u6709\u4e24\u79cdreading","text":"shortest movement
shortest: let the path of a movement be the set of nodes that dominate the original position of the moved item, and do not dominate the leading site.
"},{"location":"docs/2-ling/syntax/ud_sud/","title":"\u4f9d\u5b58\u53e5\u6cd5 UD & SUD","text":":material-circle-edit-outline: \u7ea6 381 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
In full spelling, Universal Dependency gammar and Surface Syntax Universal Dependency grammar.
"},{"location":"docs/2-ling/syntax/ud_sud/#tools","title":"Tools","text":"AllenNLP Demo CoreNLP Tool
"},{"location":"docs/2-ling/syntax/ud_sud/#concepts","title":"Concepts","text":"Dependency grammar\u00a0(DG) is an approach to the study of the syntax and grammar of natural languages that is quite distinct from\u00a0phrase structure grammar\u00a0(PSG), which is also known as\u00a0constituency grammar. The modern history of DG begins with\u00a0Lucien Tesni\u00e8re's major oeuvre (1959), whereas the modern history of PSG begins arguably with\u00a0Noam Chomsky's first prominent work (1957).
DG views linguistic structures in terms of a\u00a0one-to-one mapping\u00a0of atomic linguistic units to the nodes in structure, whereas PSG assumes a\u00a0one-to-one-or-more mapping. The distinction is clearly visible when one compares the tree structures. The next trees are taken from the\u00a0Wikipedia article on DG:
"},{"location":"docs/2-ling/syntax/ud_sud/#sud","title":"SUD","text":"[Surface Syntactic Universal Dependencies (SUD) | SUD](https://surfacesyntacticud.github.io/ SUD is an annotation scheme for syntactic dependency treebanks, and has a nearly perfect degree of two-way convertibility with the Universal Dependencies scheme (UD). Contrary to UD, it is based on syntactic criteria (favoring functional heads) and the relations are defined on distributional and functional bases.
"},{"location":"docs/2-ling/syntax/ud_sud/#general-principles-of-sud","title":"General principles of SUD","text":"SUD has 4 specific syntactic relations and a few extended relations: - subj - udep - comp - comp:aux - comp:cleft - comp:obj - comp:obl - comp:pred - mod
"},{"location":"docs/2-ling/syntax/uni_gram/","title":"\u666e\u904d\u8bed\u6cd5 Universal Grammar","text":":material-circle-edit-outline: \u7ea6 260 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/2-ling/syntax/uni_gram/#introduction","title":"Introduction","text":"Syntax\u7684\u610f\u4e49\u5728\u4e8e\u627e\u5230\u4e00\u79cdgrammar\uff0c\u80fd\u591f\u751f\u6210\u67d0\u79cd\u8bed\u8a00\u4e2d\u7684\u6240\u6709\u53e5\u5b50\u3002
Grammar\u662f\u57fa\u4e8e\u89c4\u5219\u7684\uff0c\u4e0d\u80fd\u7528high order of statistical approximation to English\u6765\u66ff\u4ee3\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#basic-linguistics","title":"Basic Linguistics","text":"DFA & Regular language
\u8c13\u8bcd\u903b\u8f91\u3002\u4f46\u6211\u4eec\u4e0d\u5173\u5fc3\u5176\u4e2d\u7684\u8bed\u4e49\uff0c\u53ea\u9700\u5173\u5fc3CFG\u7684\u5f62\u5f0f\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#phrase-structure-limitation","title":"Phrase Structure & Limitation","text":"\u81ea\u7136\u8bed\u8a00\u7684CFG\uff08\u4ee5\u82f1\u8bed\u4e3a\u4f8b\uff09\u6784\u6210\u8bed\u6cd5\u7684\u57fa\u7840\u90e8\u5206\u3002
\u4f46\u8fd9\u6837\u63cf\u8ff0\u81ea\u7136\u8bed\u8a00\u7684\u5de5\u5177\u8fd8\u662f\u4e0d\u80fd\u751f\u6210\u6240\u6709\u5408\u7406\u7684\u53e5\u5b50\uff0c\u6545\u5f15\u5165a more powerful model combining phrase structure and grammatical transformation\uff0c\u5f97\u5230\u8f6c\u6362-\u751f\u6210\u6587\u6cd5\u3002
"},{"location":"docs/2-ling/syntax/uni_gram/#on-the-goals-of-linguistic-theory","title":"On the Goals of Linguistic Theory","text":"\u4ece\u4e00\u822c\u8bed\u6cd5\u4e2d\u5f52\u7eb3\u51faUG\u7406\u8bba\uff0c\u5bf9UG\u7684\u671f\u671b\u7531\u5f3a\u81f3\u5f31\u4e3a\uff1a
\u5e94\u8be5\u7814\u7a76competence\uff0c\u800c\u975eperformance
"},{"location":"docs/3-dl/","title":"Deep Learning","text":":material-circle-edit-outline: \u7ea6 26 \u4e2a\u5b57
"},{"location":"docs/3-dl/#contents","title":"Contents","text":"AI\u5185\u5bb9\u751f\u6210\uff08ai-gc\uff09
"},{"location":"docs/3-dl/basics/","title":"Index","text":":material-circle-edit-outline: \u7ea6 0 \u4e2a\u5b57
"},{"location":"docs/3-dl/basics/bpe/","title":"Byte pair encoding (BPE)","text":":material-circle-edit-outline: \u7ea6 144 \u4e2a\u5b57
The original version of this algorithem focuses on compression. It replaces the highest-frequency pair of bytes with a new byte that was not contained in the initial dataset. A lookup table of the replacement is required to rebuild the initial dataset. The modified version builds tokens that match varying amount of source text from single characters to whole words.
Example
Suppose the sentence to be
aaabbaaabac\n
Since the byte pair (each alphabet as a byte) 'aa' occurs the most often, it is replaced by a byte 'Z' (first match).
ZabbZabac\n
Then 'ab' with 'Y'
ZYbZYac\n
Then 'ZY' with X
XbXac\n
Then this sequence can not be further compressed since there are no byte pair appearing more than once.
This algorithm is effective for tokenization because it has low computational overhead and remains consistent and reliable.
References
Wikipedia - Byte Pair Encoding
"},{"location":"docs/3-dl/basics/elmo/","title":"ELMo","text":":material-circle-edit-outline: \u7ea6 207 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
ELMo (embeddings from language model) is a word embedding method for representing a sequence of words as a corresponding sequence of vectors. Its essence is a bidirectional LSTM which takes character-level as inputs and produces word-level embeddings.
According to its original paper (?), it requires training on a corpus of about 30 million sentences and a billion words.
Contributions:
An early example of pretraining-finetuning paradigm: after the ELMo model is pretrained, its parameters are frozen, except for the projection matrix which can be fine-tuned to minimize the loss on specific language.
Contextualized word representation:
e.g., for sentence
She went to the bank to withdraw money.\n
References
Wikipedia ELMo
"},{"location":"docs/3-dl/efficient-train/","title":"Efficient Training","text":":material-circle-edit-outline: \u7ea6 7 \u4e2a\u5b57
"},{"location":"docs/3-dl/efficient-train/#intro","title":"Intro","text":""},{"location":"docs/3-dl/efficient-train/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1101 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/3-dl/efficient-train/hardware/#gpu","title":"GPU","text":"A graphic processing unit (GPU) is an electronic circuit designed for accelerating computer graphics. It is now widely adopted for non-graphic calculations such as the training of neural networks.
GPU Parameters that are most cared about
Memory refers to the total amount of RAM available on a GPU. Since deep learning tasks require a significant amount of GPU, it determines the capacity for storing and accessing data required for processing tasks, impacting the efficiency and capability of the GPU to handle large datasets.
Theoretical Performance indicates the potential computational power of a GPU, typically measured in FLOPS (floating-point operations per second): $FLOPS = cores \\times (boost) clock speed \\times FMA $, where FMA stands for the fused multiply-add operations. This metric helps gauge the GPU's ability to perform complex calculations and handle intensive workloads.
Memory Speed/Bandwidth measures the rate at which data can be transferred between the GPU and its memory. Higher bandwidth allows for quicker data access and processing, enhancing overall GPU performance.
NVLink is a high-speed communication interface that connects multiple GPUs. It enables faster data transfer and synchronization between GPUs, improving the efficiency of parallel processing and multi-GPU setups.
Clock Speed refers to the frequency at which a GPU's cores operate, typically measured in megahertz (MHz) or gigahertz (GHz). Higher clock speeds can lead to faster processing and improved performance for graphics and computing tasks.
Tensor Cores are specialized processing units within a GPU designed to accelerate machine learning and AI workloads. They enable efficient handling of tensor operations, which are critical for deep learning applications.
Slot Width describes the physical space a GPU occupies on a motherboard, usually measured in terms of the number of expansion slots it covers. Wider GPUs may offer enhanced cooling and performance but require more space inside the computer case.
Power (TDP) stands for Thermal Design Power and represents the maximum amount of heat a GPU is expected to generate under typical workloads. It is measured in watts (W) and indicates the power consumption and cooling requirements of the GPU.
In a table:
GPU GPU Memory Memory Bandwidth NVLINK CUDA Cores Turning Tensor cores RT cores T4 16GB 320GB/s No 2,560 320 40 A40 48GB 696GB/s Yes 10,752 336 84 RTX 6000 48GB 960GB/s No 18,176 568 142"},{"location":"docs/3-dl/efficient-train/hardware/#a-taxonomy-of-parallelism","title":"A Taxonomy of Parallelism","text":""},{"location":"docs/3-dl/efficient-train/hardware/#data-parallelism","title":"Data Parallelism","text":"Data Parallelism replicates the model across multiple GPUs, usually with two specific techniques: (1) fully shared data parallelism (FSDP), and (2) distributed data parallelism (DDP).
We denote the training dataset as \\(D\\), the shared model parameters as \\(W\\), the model's operation on the dataset as \\(f(D_i, W)\\), the \\(i\\)th processor as \\(p_i\\), the number of processors as \\(P\\), the \\(i\\)th machine which may be mapped to multiple processors as \\(m_i\\), and the number of machines as \\(M\\). In FSDP, the dataset \\(D\\), ignoring its original division of batches, is further divided into \\(P\\) smaller batches \\(D = {D_1, D_2, ..., D_P}\\). Each processor \\(p_i\\) performs a \\(f(D_i, W)\\) on its small batch. Meanwhile, DDP extends the data parallelism technique across multiple machines. The dataset \\(D\\) is first divided into \\(M\\) subsets \\(D = {D_1, D_2, ..., D_M}\\) for each machine, and each subset on \\(m_i\\) is further divided into \\(P_i\\) subsets according to the number of processors on each machine. After each processor performs the processing \\(f(D_{i,j}, W_k)\\), synchronization will be taken across all machines to aggregate and update the model weights \\(W_k \\leftarrow Aggregate(W_1, W_2, ..., W_M)\\).
While the computation workload is efficiently distributed across GPUs, inter-GPU communication is required to keep the model replicas consistent between training steps.
"},{"location":"docs/3-dl/efficient-train/hardware/#model-parallelism","title":"Model Parallelism","text":"Model parallelism is a distributed model deployment method that partitions the model parameters across GPUs to reduce the need for per-GPU memory. Common techniques of model parallelism include (1) tensor parallelism, (2) pipeline parallelism, and (3) expert parallelism.
We denote the input data tensor as \\(W\\), the model parameters as \\(W\\), the function representing the model's operations as \\(f(X, W)\\), and the \\(i\\)th processor as \\(p_i\\), the number of processors as \\(P\\).
Tensor Parallelism distributes the parameter tensor of an individual layer across GPUs. The model weights are divided along specific dimensions into \\(W = {W_1, W_2, ..., W_P}\\), and thus each processor \\(p_i\\) processes part of the model weights \\(f(X, W_i)\\).
Pipeline Parallelism involves partitioning the computation graph of a model into several stages and assigning each stage to a different processor or machine, making it an analogy to the CPU's pipelining technique. The input tensor \\(X\\) sequentially passes through each processor in each time step until the processing steps finish. This allows for overlapping execution of different stages, increasing the throughput.
Expert Parallelism, also known as Mixture of Experts (MoE), involves dynamically selecting a subset of model parameters, to reach the original performance using the entire model. Additionally, MoE models require a gating network \\(g(X)\\) to select the expert to output, which selects a subset of networks from the total \\(E\\) sub-networks, as $ \\epsilon =g(X), \\epsilon \\subseteq E $. Only the selected networks will be involved in the generation of the output \\(\\sum_{k \\in \\epsilon} f(X, W_k)\\).
"},{"location":"docs/3-dl/efficient-train/hardware/#activition-partitioning","title":"Activition Partitioning","text":"In large language model training, a large memory space is needed to store the input activation of the network layers. The activation partitioning techniques, which involves efficiently distributing the activations to ensure GPU usage, is another crucial technique for efficient training. Commonly used activation partitioning techniques involve (1) sequence parallelism and (2) context parallelism. We denote the input sequence as \\(X\\), the context of this training, including the batches and environments, as \\(C\\), the processing function as \\(f(X, C, W)\\), and \\(P\\) the number of processors.
Sequence Parallelism suggests that partitions are made by distributing computing load and activation memory across multiple GPUs along the sequence dimension of transformer layers. The input sequence \\(X\\) is divided into sub-sequences \\(X = [X_1, X_2, ..., X_P]\\). Each sub-sequence is sent into a processor with inner tensor forwarding techniques from the previous sub-sequence, denoted as \\(f(X_i, C, W_{i-1})\\).
Context Parallelism distributes different contexts, usually including batches and environments, across multiple processors. It is useful in multi-task learning and reinforcement learning scenarios. The context \\(C\\) is divided among processors \\(C = [C_1, C_2, ..., C_P]\\), and each processor processes the context with the entire input sequence, denoted as \\(f(X, C_i, W_i)\\).
"},{"location":"docs/3-dl/efficient-train/hardware/#multi-gpu-training","title":"Multi-GPU Training","text":"TODO
Reference: \ud83e\udd17 Efficient Training on Multiple GPUs
"},{"location":"docs/3-dl/efficient-train/parameter/","title":"Parameter","text":":material-circle-edit-outline: \u7ea6 664 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f
"},{"location":"docs/3-dl/efficient-train/parameter/#parameter-level","title":"Parameter-level","text":"Huggingface's efficient training guide discusses a number of parameters and their effect on training efficiency.
torch_empty_cache_step
is allowed to be set to the model training procedure to clear the unused cache. This technique helps avoid CUDA out-of-memory errors by lowering peak VRAM usage at a cost of around 10\\% slower performance (See https://github.com/huggingface/transformers/issues/31372).torch.compile()
is a feature introduced by Pytorch 2.0 that automatically builds a computation graph for the model and optimizes the computing orders. It optimizes the training efficiency.Relevant table:
Method/tool Improves training speed? Optimizes memory utilization? Batch size choice True True Gradient accumulation False True Gradient checkpointing False True Mixed precision training True Maybe Torch empty cache steps False True Optimizer choice True True Data preloading True False DeepSpeed Zero False True torch.compile True False Parameter-efficient Tuning (PEFT) False True"},{"location":"docs/3-dl/formal-language/","title":"Introduction to Formal Languages","text":":material-circle-edit-outline: \u7ea6 4 \u4e2a\u5b57
"},{"location":"docs/3-dl/formal-language/lecture/","title":"Lectures","text":":material-circle-edit-outline: \u7ea6 411 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/3-dl/formal-language/lecture/#language-model-and-formal-language","title":"Language Model and Formal Language","text":"ACL tutorial 4
big promises
neural language models - expressiblity - formal language
useful tools - RNN: sequntial automata - Transformer: circuits
Definition
a language model p is a distribution on *\\Sigma.
Two language models are equal if p(y) = q(y) for all y on *\\Sigma.
Any language model can be written as an autogressive one.
tightness: for arbituary language model, the sum of all p(y) < 1 can happen. If the sum of all p(y) = 1, it is tight.
A minimum non-tight example: To set the probablity of EOS as 0, thus the generation might never stop.
special features of automaton: parity, hierachy detection
simplist RNN: Elman RNN
RNNs can be both as language models / recognizors (to classify grammatical or not)
RNNs work like language model (TODO: photo)
infinite state automata - with unbounded precision and computation time
a turing machine is equivalent to a two-stack pushdown automaton. (tape = two-stacks)
Theorem: an infinite-precision RNNs with unbounded computation time are Turing complete.
implies: - TODO: photo - we need the hidden states to encode the stacks
stack = neuron
drawbacks: - numbers are in finite precision - RNNs stop within finite time
"},{"location":"docs/3-dl/formal-language/lecture/#improvement-theoretical-model-rnns-with-bounded-computation-time-and-finite-precision","title":"improvement theoretical model: RNNS with bounded computation time and finite precision","text":"Theorem: Finite-precision real-time RNNs are equivalent to FSAs (without stacks, taking the training and inference procedure apart. )
clear: - any finite-precision RNN will define a finite number of states - it can thus be represented by a FSA - an upper bound RNNs can do at most what finite-state automata can
=> Elman RNNs can simulate deterministic FSAs (any non-deterministic FSA can be => deterministic ones)
main differences: - automaton: tabular rules - RNNs: matrix multiplications
Any simple family of automata can efficient simulation of RNNs?
TODO: photo
Some FSA with |Q| states can be compressed into an RNN with O(log|Q|) hidden states.
Takeaways:
an RNN can end up in any rung of the NC hierarchy depending on - whether allowing unbounded processing time - whether allowing unbounded precision
QAs:
the missing bit:
probablistic finite-state automata also compute probalisties
Beyond Binary States: LSTMs and counting
Counter machine:
TODO: photo, position on NC hierarchy
no model currently reach the computation ability of Turing machine. Some advanced models (e.g. ChatGPT) happen to recognize some programs.
LSTM as a counter machine, the memory cell works as the counter. set (TODO: some parameters) as 1 and the updating function of mem cells are as the counter.
"},{"location":"docs/3-dl/formal-language/lecture/#transformers-and-formal-language-theory-part-on-encoder","title":"Transformers and formal language theory, part on encoder","text":"bolean circuits, definition:
runtime without parallelism
definition (depth): longest path from input to output runtime with parallelism (?)
need sth dependent on input time
formal models: Boolean circuits
(what is ACC here)
formal models: first order logic (how did this appear)
TODO: photo, NC hierarchy interact with language classes
does circuits recognize parity?
decisions to make: attention, softmax
uniformity:
dependence on - number of parameters
unique hard attention:
linear temporal logic
TODO: photo on example of L=\\Sigma*ab\\Sigma*
"},{"location":"docs/3-dl/formal-language/lecture/#adding-sequentiality-to-transformers-chain-of-thought-part-of-decoder","title":"adding sequentiality to Transformers, chain-of-thought, part of decoder","text":"so far, only deterministic automata
non-deterministic
"},{"location":"docs/3-dl/formal-language/lecture/#takeaways","title":"takeaways","text":"QAs - the Turing machines can move head left-to-right and right-to-left. if taking that into account, we might
Reference
"},{"location":"docs/3-dl/survey/","title":"Misc Survey","text":":material-circle-edit-outline: \u7ea6 32 \u4e2a\u5b57
If I have written about some topics that I don't read anymore, they will be thrown into this section.
"},{"location":"docs/3-dl/survey/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 1084 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
TODO
"},{"location":"docs/3-dl/survey/explainable-nlp/#survey","title":"Survey","text":""},{"location":"docs/3-dl/survey/explainable-nlp/#a-survey-of-the-state-of-explainable-ai-for-natural-language-processing","title":"A Survey of the State of Explainable AI for Natural Language Processing","text":"This survey thoroughly explains the state of explainable NLP. The Introduction discusses two distinguishing criteria for explanability models (1) whether the explanation is for each prediction individually or the model\u2019s prediction process as a whole, and (2) determining whether generating the explanation requires post-processing or not. In Categorization of Explanations, this paper categorizes the explanation models into local (provides information or justification for the model's prediction on a specific input) vs. global (provides similar justification by revealing how the model's predictive process works, independently of any particular input), and self-explaining (also directly interpretable, generates the explanation at the same time as the prediction, e.g. decision trees, rule-based models, and feature saliency models like attention models) vs. post-hoc (an additional operation is performed after the predictions are made). This section also states that the different categories of models can overlap. In section Aspects of Explanations, this paper introduces three types of explanation techniques: (1) explainability techniques (feature importance, surrogate model, example-driven, provenance-based, declarative induction), (2) operations to enable explainability (first-derivation saliency, layer-wise relevance propagation, and input perturbations, attention, LSTM gating signals, explainability-aware architecture design) and (3) visualization techniques (saliency, raw declarative representations, natural language explanation). The section Evaluation introduces several evaluating metrices.
"},{"location":"docs/3-dl/survey/explainable-nlp/#opinion-papers","title":"Opinion Papers","text":""},{"location":"docs/3-dl/survey/explainable-nlp/#climbing-towards-nlu-on-meaning-form-and-understanding-in-the-age-of-data-2020","title":"Climbing towards NLU: On Meaning, Form, and Understanding in the Age of Data (2020)","text":"This paper argues that the modern NLP models trained on form has no abilities in understanding natural languages based on both the science and philosophy theories. It is structured as follows. In section Large LMs: Hype and analysis, this paper samples example pieces from news and academic literature that exaggerate the understanding abilities in using words including \"understand\"\"comprehension\"\"recall factual knowledge\", and argues that the current LMs have the ability no other than learning the surface linguistic forms of language rather than understanding them. In section What is meaning?, this paper clarifies the meaning of language as the communicative intent that a parole intends to express, and distinguishes the concept \"meaning\" and \"truth\" as the truth is the meaning that is \"grounded\" to the real world. In section The octopus test, this paper detailedly tells a thought experiment of a super intelligent octopus who can mimic the human response by never receiving the knowledge of the grounded real world of the language meaning, by which this paper argues that it might be that how the language receiver decodes the communicative intends affects the conventional meaning of language. In section More constrained thought experiments, two more thought experiments are provided, training the JAVA and training the English LMs without providing the executing methods the communicative intends, and the paper argues that such tasks are impossible. In section Human language acquisition, this paper supports its idea by providing the example of human children's acquiring knowledge is not only grounded on the world image, but also in the interaction with other people. In section Distributional semantics, this paper argues that in NLP, two methods based on the instincts above are training distributional models on corpora augmented with perceptual data, and looking to interaction data (according to Wittgenstein's \"meaning in use\").
"},{"location":"docs/3-dl/survey/explainable-nlp/#information-theory-based-compositional-distributional-semantics-2021","title":"Information Theory-based Compositional Distributional Semantics (2021)","text":"According to the abstract, the contribution of this paper can be concluded as proposing the notion of Information Theory-based Compositional Distributional Semantics (ICDS): (i) We first establish formal properties for embedding, composition, and similarity functions based on Shannon\u2019s Information Theory; (ii) we analyze the existing approaches under this prism, checking whether or not they comply with the established desirable properties; (iii) we propose two parameterizable composition and similarity functions that generalize traditional approaches while fulfilling the formal properties; and finally (iv) we perform an empirical study on several textual similarity datasets that include sentences with a high and low lexical overlap, and on the similarity between words and their description. In section Introduction, the author introduces Frege's concepts of compositionality and contextuality, which respectively refers to that \"the meaning of the whole is a function of the meaning of its parts and the syntactic way in which they are combined\", and that \"the meaning of words and utterances is determined by their context\". This section also introduces the main concern of lacking systematicity by the linguists to the NLP, where systematicity is defined as \"A system is said to exhibit systematicity if, whenever it can process a sentence, it can process systematic variants, where systematic variation is understood in terms of permuting constituents or (more strongly) substituting constituents of the same grammatical category.\" Thus, this section introduces that this paper aims to propose a novel system called Information Theory-based Compositional Distributional Semantics (ICDS). In section Related Work, the author introduces a set of properties in selective proper text representation paradigms which includes \"systematicity\", \"usage context\", \"continuity\", and \"information measurbility\", and introduces a series of previous work under this standard. In section Theoretical Framework, this paper first establishes a geometric interpretation of ICDS, that \"The direction of an embedding represents the pragmatic meaning, and the vector norm of embedding represents how much information the literal utterance provides about its meaning in the pragmatic context\", and then proposes the concept of ICDS as \"there are minimal linguistic units whose semantics are determined by their use and whose amount of information is determined by their specificity. On the other hand, the systematicity of language can be captured by compositional mechanisms while preserving the amount of information of the composite utterance\". Section Formal Definition and Properties formally defines the concepts involved in ICDS, where (\\(\\pi\\),\\(\\delta\\), \\(\\bigodot\\)) stand for \"embedding\", \"semantic similarity\", and \"composition function\" respectively. This section points out the embedding function properties (information measurability and angular isometry), composition function properties (composition neutral element, composition norm monotonicity, and sensitivity to stricture), and similarity function properties (angular distance simialrity monotonicity, orthogonal embedding similarity monotonicity, and equidistant embedding simialrity monotonicity). In section Function Analysis and Generalization, this research evaluates several current embedding vector with the proposed framework, while in section Experiment, the semantic representation abilities of several prevailing LLMs including BERT and GPT are evaluated.
"},{"location":"docs/3-dl/survey/explainable-nlp/#contrastive-explanations-for-model-interpretability-2021","title":"Contrastive Explanations for Model Interpretability (2021)","text":"This paper proposes a data augmentation method to generate counterexample on the bases of NLI datasets, and proves that by training on patterns \"why A rather than B\" with contrastive learning methods, the model performs better than the previous NLI baselines.
"},{"location":"docs/3-dl/survey/explainable-nlp/#using-counterfactual-contrast-to-improve-compositional-generalization-for-multi-step-quantitative-reasoning-2023","title":"Using counterfactual contrast to improve compositional generalization for multi-step quantitative reasoning (2023)","text":""},{"location":"docs/3-dl/survey/llama3_405b/","title":"Llama-3.1-405B \u6280\u672f\u62a5\u544a","text":":material-circle-edit-outline: \u7ea6 3436 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f
"},{"location":"docs/3-dl/survey/llama3_405b/#_1","title":"\u7b80\u4ecb","text":"\u8fd9\u7bc7\u6280\u672f\u62a5\u544a\u662f MetaAI \u5728 2024 \u5e74 7 \u6708 23 \u65e5\u968f 405B \u6a21\u578b\u53d1\u5e03\u7684\u3002\u5148\u524d Llama 3 \u7cfb\u5217\u5df2\u7ecf\u53d1\u5e03\u8fc7 8B \u548c 70B \u4e24\u4e2a\u5927\u5c0f\u7684\u6a21\u578b\uff0c\u672c\u6b21\u53d1\u5e03\u7684\u6a21\u578b\u5728\u89c4\u6a21\u4e0a\u589e\u91cf\u975e\u5e38\u5927\u3002\u5c3d\u7ba1\u89c4\u6a21\u7684\u63d0\u5347\u4f7f\u5176\u6210\u4e3a\u6700\u5f3a\u7684\u5f00\u6e90\u5927\u8bed\u8a00\u5bf9\u8bdd\u6a21\u578b\uff08\u5728\u672c\u6587\u5199\u6210\u65f6\uff0c2024 \u5e74 8 \u6708 1 \u65e5\uff0c\u6839\u636e\u516c\u8ba4\u6bd4\u8f83\u53ef\u4fe1\u7684\u8bc4\u4ef7\u6307\u6807 Chatbot Arena\uff0c\u622a\u56fe\u5982\u4e0b\uff09\uff0c\u4f46\u672c\u6587\u5728 benchmark \u4e0a\u5c55\u73b0\u51fa\u6765\u7684\u6027\u80fd\u6570\u503c\uff0c\u76f8\u6bd4 70B \u63d0\u5347\u4e0d\u5927\uff0c\u666e\u904d\u5728 1-3 \u4e2a\u70b9\u3002\u4e14\u8003\u8651\u5230\u6a21\u578b\u5360\u7528\u7684 GPU \u6210\u672c\uff0c\u5bf9\u4e8e\u666e\u901a\u4eba\u65e5\u5e38\u7528\u9014\uff0c405B \u53ef\u80fd\u6027\u4ef7\u6bd4\u4e0d\u5982 70B \u9ad8\u3002
\u62a5\u544a\u7684\u539f\u6587\u89c1\u6587\u672b ArXiv \u94fe\u63a5\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_2","title":"\u6587\u7ae0\u7ed3\u6784","text":"Llama-3.1-405B \u6709\u6587\u5b57\u3001\u89c6\u9891/\u56fe\u50cf\u548c\u8bed\u97f3\u7b49\u591a\u4e2a\u6a21\u6001\u7684\u80fd\u529b\u3002\u672c\u6587\u7684\u67b6\u6784\u5206\u4e3a\u591a\u4e2a\u7ae0\u8282\uff0c\u5148\u8bb2\u6587\u5b57\u80fd\u529b\u7684\u9884\u8bad\u7ec3\uff08pre-training\uff09\u3001\u5fae\u8c03\uff08post-training\uff09\u3001\u5b9a\u6027\u80fd\u529b\u3001\u5b9a\u91cf\u80fd\u529b\u3001\u5c40\u9650\u6027\u7b49\uff0c\u518d\u8bb2\u89c6\u9891/\u56fe\u50cf\u548c\u8bed\u97f3\u7684\u8bad\u7ec3\u8fc7\u7a0b\u548c\u6027\u80fd\u6570\u503c\u3002
\u6280\u672f\u62a5\u544a\u539f\u6587\u7684\u7ed3\u6784\u5982\u4e0b\uff1a
Data: \u8bad\u7ec3\u7528\u4e86 15T \u7684\u591a\u8bed\u8a00\u6570\u636e\uff0c\u4e3b\u8981\u5728\u8d28\u91cf\u4e0a\u6709\u63d0\u5347\uff08\u6bd4\u5982\u91c7\u53d6\u4e86\u66f4\u6fc0\u8fdb\u7684\u6570\u636e\u8fc7\u6ee4\u7b56\u7565\uff09\u3002\u674e\u6c90\u8868\u793a 15T \u7684\u6570\u636e\u91cf\u8bad\u7ec3\u76ee\u524d\u80fd\u8bad\u7ec3\u7684\u8bed\u8a00\u6a21\u578b\u5df2\u8db3\u591f\u4e86\uff0c\u63a5\u4e0b\u6765\u9700\u8981\u5728\u8d28\u91cf\u800c\u975e\u6570\u91cf\u4e0a\u8fdb\u4e00\u6b65\u63d0\u5347\u3002
Scale: \u8bad\u7ec3\u4f7f\u7528\u4e86 \\(3.8 \\times 10^25\\) FLOPs\uff0cscaling law \u8868\u793a\u66f4\u5927\u7684\u53c2\u6570\u91cf\u5e94\u8be5\u4f1a\u4f7f performance \u66f4\u597d\u3002
Managing Complexity: Llama-3.1-405B \u6a21\u578b\u6ca1\u6709\u91c7\u53d6\u73b0\u5728\u5e38\u7528\u7684 MoE \u67b6\u6784\uff0c\u800c\u662f\u628a\u666e\u901a\u7684 dense Transformer \u7ed3\u6784\u76f4\u63a5\u505a\u5927\uff0c\u5e76\u4e14\u4f7f\u7528\u4e86\u76f8\u5bf9\u7b80\u5355\u7684\u5fae\u8c03\u7b56\u7565\uff08SFT, RS, DPO\uff09\u7b49\uff0c\u6240\u4ee5\u79f0\u4f5c\u6b65\u9aa4\u4e0d\u662f\u7279\u522b\u590d\u6742\u3002\u4e5f\u6709\u6d88\u606f\u79f0 MetaAI \u672c\u6765\u5c06\u4e00\u4e2a MoE \u67b6\u6784\u548c\u4e00\u4e2a dense Transformer \u4e00\u8d77\u8bad\u7ec3\uff0c\u4f46\u662f MoE \u67b6\u6784\u7684\u6a21\u578b\u6548\u679c\u4e0d\u592a\u597d\uff0c\u6240\u4ee5\u53ea\u653e\u51fa\u4e86 dense Transformer \u67b6\u6784\u7248\u7684\u3002\u5176\u4e2d\uff1a
\u5728\u591a\u4e2a benchmark \u4e0a\u6d4b\u8bd5 Llama-3.1-405B \u7684\u6027\u80fd\u3002\u6b64\u5904\u60f3\u5bf9\u672c\u6587\u7528\u5230\u7684 benchmark \u8fdb\u884c\u4e00\u70b9\u6982\u8ff0\u3002
pre-train \u9636\u6bb5\u7ed3\u675f\u540e\uff0c\u7528\u4e8e\u6d4b\u8bd5\u7684 benchmark \u6709\uff1a
SQuAD V2
(Rajpurkar et al., 2018) stf \u505a\u7684\u4e00\u4e2a\u9605\u8bfb\u7406\u89e3 benchmark\uff0c\u6536\u96c6\u4e86 wikipedia \u6587\u7ae0\uff0c\u5bf9\u91cc\u9762\u5185\u5bb9\u505a QA\u3002QuaC
(Choi et al., 2018) \u5168\u79f0\u662f QA in context\uff0c\u4e5f\u662f\u5bf9 wikipedia \u6587\u7ae0\u505a QA\uff0c\u4f46\u662f\u6240\u6807\u6ce8\u7684 QA \u6570\u636e\u662f\u8fde\u7eed\u7684\u5f88\u957f\u7684\u5bf9\u8bdd\u3002\u6bd4\u5982\u683c\u5f0f\u662f\uff0cspeaker A \u95ee\uff0c\u8fd9\u4e2a\u4eba\u51fa\u751f\u5730\u662f\u54ea\u91cc\uff0cB \u56de\u7b54\uff0cA \u518d\u95ee\u8fd9\u4e2a\u4eba\u54ea\u4e00\u5e74\u505a\u4e86\u54ea\u4e2a\u4e8b\u7b49\uff0c\u5982\u6b64\u7ee7\u7eed\u3002RACE
(Lai et al., 2017) \u662f\u4e2d\u56fd\u7684\u82f1\u8bed\u8003\u8bd5\u9605\u8bfb\u7406\u89e3\u9898\u3002HumanEval
(Chen et al., 2021) \u683c\u5f0f\u6709\u70b9\u50cf leetcode \u9898\u76ee\uff0c\u6bcf\u6761\u6570\u636e\u5305\u542b\u9898\u76ee\u8981\u6c42\u548c\u4e00\u7ec4\u6d4b\u8bd5\u70b9\uff0c\u81ea\u52a8\u6d4b\u8bd5\u7a0b\u5e8f\u4f1a\u8fd0\u884c\u6a21\u578b\u751f\u6210\u7684\u4ee3\u7801\uff0c\u5224\u65ad\u901a\u8fc7\u591a\u5c11\u6d4b\u8bd5\u70b9\u3002MBPP
(Austin et al., 2021) \u683c\u5f0f\u5927\u81f4\u540c\u4e0a\u3002CommonSenseQA
(Talmor et al., 2019) \u5728 conceptnet \u6570\u636e\u96c6\u7684\u57fa\u7840\u4e0a\u4ea7\u751f multichoice \u95ee\u9898\u3002PiQA
(Bisk et al., 2020) physical ... \u7269\u7406\u9886\u57df\u7684\u5e38\u8bc6\u63a8\u7406\u3002SiQA
(Sap et al., 2019) social ... \u793e\u4ea4 / \u6587\u5316\u9886\u57df\u7684\u5e38\u8bc6\u63a8\u7406\u3002OpenBookQA
(Mihaylov et al., 2018) \u57fa\u7840\u79d1\u5b66\u95ee\u9898\u3002WinoGrande
(Sakaguchi et al., 2021) adversarial Winograd challenge\uff0c\u56e0\u4e3a Winograd \u5df2\u7ecf\u88ab\u5f88\u591a\u6a21\u578b\u8bad\u7ec3\u8fc7\u4e86\uff0c\u5236\u4f5c\u4e86\u4e0e Winograd \u6570\u636e\u96c6\u540c\u683c\u5f0f\u7684\u65b0\u6570\u636e\u3002GSM8K
(Cobbe et al., 2021) \u5c0f\u5b66\u6570\u5b66\u95ee\u9898\uff0c\u95ee\u9898\u662f\u5e94\u7528\u9898\uff0c\u63d0\u4f9b\u4e00\u7cfb\u5217\u601d\u7ef4\u94fe\u89e3\u9898\u8fc7\u7a0b\uff0c\u6bcf\u4e2a\u6b65\u9aa4\u90fd\u80fd\u7528\u7b80\u5355\u7684\u52a0\u51cf\u4e58\u9664\u89e3\u51b3\u3002MATH
(Hendrycks et al., 2021b) \u7ade\u8d5b\u6570\u5b66\u9898\uff0c\u4e0e GSM8K \u540c\u683c\u5f0f\uff0c\u590d\u6742\u7684\u6570\u5b66\u7b26\u53f7\u7528 LaTeX \u5199\u6210\u3002ARC Challenge
(Clark et al., 2018) \u5168\u79f0 AI2's Reasoning Challenge\uff0c\u662f 3-9 \u5e74\u7ea7\u7684\u79d1\u5b66\u9898\uff0c\u683c\u5f0f\u662f multichoice\u3002DROP
(Dua et al., 2019) discrete reasoning over paragraphs \u6587\u672c\u6bb5\u843d\u4e2d\u5939\u6742\u6570\u5b57\u6216\u5927\u5c0f\u7b49\u5173\u7cfb\uff0c\u5bf9\u8fd9\u4e9b\u6570\u5b57\u6216\u6587\u672c\u8fdb\u884c\u63a8\u7406\u3002WorldSense
(Benchekroun et al., 2023) \u7528\u6587\u672c\u63cf\u8ff0\u7684\u56fe\u5f62\u548c\u7a7a\u95f4\u65b9\u4f4d\u5173\u7cfb\uff0c\u5bf9\u56fe\u5f62\u5c5e\u6027\u548c\u7a7a\u95f4\u65b9\u4f4d\u8fdb\u884c\u63a8\u7406\u3002Adv SQuAD
(Jia and Liang, 2017) \u624b\u52a8\u9020\u4e86 SQuAD \u683c\u5f0f\u7684\u66f4\u96be\u7684\u95ee\u9898\u3002Dynabench SQuAD
(Kiela et al., 2021) dynamic benchmark collection\uff0c\u6709\u4e00\u4e2a\u7f51\u7ad9 Dynabench\uff0c\u5141\u8bb8\u7528\u6237\u968f\u65f6\u4e0a\u4f20\u65b0\u7684\u6570\u636e\u3002GSM-Plus
(Li et al., 2024c) \u5c06 GSM8K \u91cc\u9762\u7684\u6570\u5b57\u6539\u6389\uff0c\u6bd4\u5982 3 \u6539\u6210 30\uff0c\u6574\u6570\u6539\u6210\u5c0f\u6570\u7b49\u3002PAWS
(Zhang et al., 2019) \u95ee\u9898\u683c\u5f0f\u662f\uff0c\u4ea4\u6362\u67d0\u4e2a\u8868\u8fbe\u4e2d\u7684\u4e24\u4e2a\u8bcd\uff08\u6bd4\u5982\uff0cflight from NYC to Florida \u4e2d\u7684 NYC \u548c Florida\uff09\uff0c\u5224\u65ad\u662f\u5426\u7b49\u4ef7\u3002QuALITY
(Pang et al., 2022) \u957f\u6587\u672c\u4e0a\u7684 multichoice \u95ee\u9898\u3002many-shot GSM8K
(An et al., 2023a) \u4f3c\u4e4e\u8fd9\u4e2a benchmark \u641c\u5173\u952e\u8bcd\u6ca1\u6709\u627e\u5230\uff0c\u539f\u6587\u4e2d\u5f15\u7528\u5bf9\u5e94\u7684\u6587\u7ae0\u4e5f\u4e0d\u662f\u8fd9\u4e2a\u540d\u5b57\u3002MMLU
(Hendrycks et al., 2021a) massive multi-task language understanding\uff0c\u5305\u542b 57 \u4e2a STEM \u5b66\u79d1\uff0c\u7528\u6765\u6d4b\u91cf\u5927\u6a21\u578b\u5728\u9884\u8bad\u7ec3\u4e2d\u83b7\u5f97\u7684\u77e5\u8bc6\u3002\u56e0\u4e3a\u6bd4\u8f83\u8001\u4e86\uff0c\u5f88\u591a\u5927\u8bed\u8a00\u6a21\u578b\u90fd\u5728\u8fd9\u4e2a\u6570\u636e\u96c6\u4e0a overfit \u4e86\u3002MMLU-Pro
(Wang et al., 2024b) \u5728 MMLU \u4e2d\u53bb\u6389\u4e86\u4e00\u90e8\u5206\u8d28\u91cf\u5dee\u7684\u95ee\u9898\uff0c\u505a\u4e86\u4e00\u4e2a\u66f4 challenging \u7684 test set\u3002\uff08\u53d1\u73b0\u8fd8\u662f\u5373\u5c06\u4e00\u8d77\u53bb Waterloo \u7684 Yubo \u540c\u5b66\u4e00\u4f5c\uff09AGIEval
(Zhong et al., 2023) \u7531\u4e00\u4e9b\u8003\u8bd5\u9898\u7ec4\u6210\uff0c\u9ad8\u8003\uff0cSAT\uff0cGRE ... \u7b49\u3002BIG-Bench Hard
(Suzgun et al., 2023) \u4e13\u95e8\u9009\u62e9\u4e86\u4e00\u4e9b\u8868\u73b0\u4e0d\u5982\u4eba\u7c7b\u597d\u7684 benchmark \u96c6\u5408\u8d77\u6765\u3002post-train \u9636\u6bb5\u7ed3\u675f\u65f6\uff0c\u6d4b\u8bd5\u7528\u7684 benchmark \u5982\u4e0b\uff1a
MMLU
(Hendrycks et al., 2021a) \u540c\u524d\u6587\u3002MMLU-Pro
(Wang et al., 2024b) \u540c\u524d\u6587\u3002IFEval
(Zhou et al., 2023) Instruction-following evaluation for LLMs\uff0c\u5b9a\u4e49\u4e86\u4e00\u7cfb\u5217\u201c\u53ef\u4ee5\u9a8c\u8bc1\u7684\u6307\u4ee4\u201d\uff0c\u6bd4\u5982\u201c\u5199 400 \u5b57\u201d\u201c\u81f3\u5c11\u8bf4 3 \u6b21\u5173\u952e\u8bcd\u201d\uff0c\u6d4b\u8bd5\u6a21\u578b\u9075\u5b88\u6307\u4ee4\u7684\u80fd\u529b\u3002GSM8K
(Cobbe et al., 2021) \u540c\u524d\u6587\u3002MATH
(Hendrycks et al., 2021b) \u540c\u524d\u6587\u3002GPQA
(Rein et al., 2023) graduate-level Google-proof QA benchmark\uff0c\u7531 biology, physics, chemistry \u9886\u57df\u7684\u4e13\u5bb6\u5199\u6210\u7684\u975e\u5e38\u96be\u7684\u95ee\u9898\u3002ARC-Challenge
(Clark et al., 2018) \u540c\u524d\u6587\u3002HumanEval
(Chen et al., 2021) \u540c\u524d\u6587\u3002MBPP
(Austin et al., 2021) \u540c\u524d\u6587\u3002HumanEval+
(Liu et al., 2024a) \u5c06 HumanEval \u6269\u5927\u4e86 80 \u500d\u505a\u6210\u4e86\u8fd9\u4e2a\u6570\u636e\u96c6\u3002MBPP EvalPlus (base)
(Liu et al., 2024a) \u5c06 MBPP \u6269\u5927\u4e86 35 \u500d\u505a\u6210\u4e86\u8fd9\u4e2a\u6570\u636e\u96c6\u3002MultiPL-E
(Cassano et al., 2023) \u6269\u5c55 HumanEval \u548c MBPP \u5230\u4e86 18 \u79cd\u7f16\u7a0b\u8bed\u8a00\u3002MGSM
(Shi et al., 2022) \u5c06 GSM8K \u6570\u636e\u96c6\u7ffb\u8bd1\u6210\u4e86 10 \u79cd\u6587\u5b57\u4e0d\u540c\u7684\u8bed\u8a00\u3002\uff08\u662f\u6211\u535a\u5bfc\u7684\u5de5\u4f5c\uff09Multilingual MMLU
(internal benchmark) \u5185\u90e8\u6570\u636e\u96c6\uff0c\u6ca1\u6709\u641c\u5230\uff0c\u53ef\u80fd\u6ca1\u6709\u516c\u5f00\u3002Nexus
(Srinivasan et al., 2023) \u5f88\u5947\u602a\uff0c\u8fd9\u4e2a\u6570\u636e\u96c6\u80fd\u641c\u5230\u7684\u6761\u76ee\u53ea\u6709 huggingface \u5e76\u4e14\u70b9\u5f00 404 \u4e86\u3002API-Bank
(Li et al., 2023b) \u7531 73 \u4e2a API \u5de5\u5177\u6784\u6210\uff0c\u6839\u636e\u6a21\u578b\u4ea7\u751f\u7684\u5bf9\u8bdd\u4e2d\u8c03\u7528 API \u7684\u60c5\u51b5\uff0c\u6d4b\u8bd5\u6a21\u578b\u662f\u5426\u80fd\u8c03\u7528\u3001\u68c0\u7d22+\u8c03\u7528\u3001\u89c4\u5212+\u68c0\u7d22+\u8c03\u7528 API\u3002API-Bench
(Patil et al., 2023) \u5206\u4e3a\u4e24\u4e2a subtask\uff1aquery-based API\uff08\u6839\u636e\u81ea\u7136\u8bed\u8a00\u63cf\u8ff0\u7684\u9700\u6c42\u8f93\u51fa API\uff09 \u548c code-based API\uff08\u6839\u636e\u6316\u53bb API \u7684\u4ee3\u7801\u586b\u7a7a\uff09\u3002\u5206\u4e3a Python \u548c Java \u8bed\u8a00\u7248\u672c\u3002BFCL
(Yan et al., 2024) Berkeley function calling leaderboard\uff0c\u591a\u7f16\u7a0b\u8bed\u8a00\uff0c\u4e14\u6709 function call \u7c7b\u578b\u7684\u6570\u636e\u3002ZeroSCROLLS
(Shaham et al., 2023) zero-shot benchmark for long text understanding\uff0c\u4e00\u4e2a\u7efc\u5408\u7684\u957f\u6587\u672c\u591a\u4efb\u52a1\u6570\u636e\u96c6\u3002Needle-in-a-Haystack
(Kamradt, 2023) \u5927\u6d77\u635e\u9488\u5b9e\u9a8c\u3002InfiniteBench
(Zhang et al., 2024) \u591a\u4efb\u52a1 100K token \u957f\u6587\u672c\u6570\u636e\u96c6\u3002\u5728\u8fd9\u4e9b benchmark \u4e0a\u6d4b\u8bd5\u65f6\uff0c\u7531\u4e8e\u5355\u6b21\u7ed3\u679c\u4e0d\u7a33\u5b9a\uff08\u5148\u524d\u6211\u4eec\u666e\u904d\u7684\u505a\u6cd5\u5e38\u5e38\u662f\u591a\u6b21\u7ed3\u679c\u6c42\u5e73\u5747\u503c\u7b49\uff09\uff0c\u672c\u6280\u672f\u62a5\u544a\u91c7\u7528 Maddan et al.(2024) \u63d0\u51fa\u7684 95% confidence interval (CIs) \u65b9\u6cd5\uff0c\u901a\u8fc7\u8ba1\u7b97\u7f6e\u4fe1\u533a\u95f4\u6765\u4f30\u8ba1\u65b9\u5dee\u3002\u8fd9\u4e2a\u65b9\u6cd5\u5047\u8bbe\u6d4b\u8bd5\u5f97\u5230\u7684\u6570\u503c\u670d\u4ece\u6b63\u6001\u5206\u5e03\uff0c\u5982\u679c\u5355\u6b21\u6d4b\u8bd5\u5f97\u5230\u7684\u6570\u503c\u4e3a S\uff0c\u6570\u636e\u96c6\u5927\u5c0f\u4e3a N\uff0c\u90a3\u4e48\u7f6e\u4fe1\u533a\u95f4\u4e3a
\\[ CI(S) = 1.96 \\times \\sqrt{\\frac{S \\times (1 - S)}{N}} \\]\u7531\u7f6e\u4fe1\u533a\u95f4\u5bbd\u5ea6\u9664\u4ee5\u4e34\u754c\u503c 1.96 \u53ef\u4ee5\u5f97\u5230\u6807\u51c6\u5dee -> \u65b9\u5dee\u3002
post-train \u5b8c\u6210\u540e\uff0c\u7ed3\u679c\u7684\u603b\u8868\u5982\u4e0b
\u53ef\u4ee5\u770b\u51fa\u5176\u5b9e Llama-3.1-405B \u5728 70B \u4e0a\u6709\u63d0\u5347\uff0c\u4f46\u76f8\u6bd4\u53c2\u6570\u91cf\u7684\u63d0\u5347\uff0c\u6027\u80fd\u63d0\u5347\u5e76\u4e0d\u662f\u5f88\u5927\uff0c\u5f88\u591a benchmark \u4e0a\u90fd\u5728 2-3 \u4e2a\u70b9\u3002\u8003\u8651\u5230\u524d\u9762\u63d0\u5230\u53ef\u80fd 405B \u53ef\u80fd\u8bad\u7ec3\u4e86 MoE \u548c dense Transformer \u4e24\u4e2a\u6a21\u578b\u4f46\u662f\u540e\u8005\u6ca1\u8bad\u6210\u529f\uff0c\u4e0d\u77e5\u9053\u53d1\u5e03\u7248 405B \u6027\u80fd\u6bd4\u9884\u671f\u4f4e\u662f\u4e0d\u662f\u4e5f\u662f\u8fd9\u4e2a\u539f\u56e0\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_5","title":"\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/llama3_405b/#pre-train","title":"Pre-train \u9884\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/llama3_405b/#_6","title":"\u6574\u4f53\u95ee\u9898","text":"\u9884\u8bad\u7ec3\u7275\u626f\u5230\u7684\u95ee\u9898\u6709\u56db\u5757\uff1a
\u9884\u8bad\u7ec3\u5927\u7ea6\u7528\u4e86\u534a\u5e74\uff0c\u8c03\u53c2\u662f\u5e74\u521d\u5f00\u59cb\u7684\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_7","title":"\u6570\u636e\u6e05\u6d17","text":"\u7528\u5230\u7684\u6570\u636e\u662f\u5728\u4e92\u8054\u7f51\u4e0a common crawl \u4e0b\u6765\u7684\u622a\u81f3 2023 \u5e74\u7684\u6570\u636e\uff0c\u4e4b\u540e\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u3002\u6570\u636e\u7684\u9009\u7528\u4e00\u822c\u5c5e\u4e8e\u516c\u53f8\u79d8\u5bc6\uff0c\u4e0d\u80fd\u8bb2\u592a\u6e05\u695a\u3002\u6e05\u6d17\u7684\u6b65\u9aa4\u867d\u7136\u4e5f\u6ca1\u6709\u8bb2\uff0c\u4e0d\u8fc7\u5927\u81f4\u9075\u5faa\uff081\uff09\u627e\u4e00\u6279\u6570\u636e\u89c2\u5bdf\u5927\u591a\u662f\u5982\u4f55\u810f\u7684 -> \uff082\uff09\u5199\u811a\u672c\u6d17\u6389\u8fd9\u79cd\u7279\u70b9 -> \uff083\uff09\u8fd4\u56de\uff081\uff09\u5faa\u73af\u3002\u6709\u660e\u786e\u8bb2\u7684\u6570\u636e\u6e05\u6d17\u539f\u5219/\u7c7b\u522b\u6709\u4ee5\u4e0b\u51e0\u6761\uff1a
\u6d17\u6389 personally identifiable information (PII) \u5373\u4e00\u4e9b\u4e2a\u4eba\u59d3\u540d\u3001\u90ae\u7bb1\u3001url\uff0c\u548c\u6210\u4eba\u5185\u5bb9\uff1b\u4f46\u674e\u6c90\u8868\u793a\u8fd9\u4e24\u79cd\u4e1c\u897f\u4e5f\u4e0d\u4f1a\u6d17\u592a\u5e72\u51c0\uff0c\u524d\u8005\u6d17\u592a\u5e72\u51c0\u4e86\u53ef\u80fd\u4f1a\u4f7f\u8bad\u7ec3\u6587\u6863\u672c\u8eab\u7684\u610f\u601d\u6709\u53d8\u5316\uff0c\u540e\u8005\u592a\u5e72\u51c0\u4e86\u53ef\u80fd\u6a21\u578b\u5728\u4e00\u4e9b\u6253\u64e6\u8fb9\u7403\u5e94\u7528\u4e0a\u6548\u679c\u4e0d\u592a\u597d\uff0c\u6240\u4ee5\u505a\u6cd5\u53ef\u80fd\u662f\u5bf9\u6587\u6863\u9274\u5b9a\u4e00\u4e2a\u767e\u5206\u6bd4\uff0c\u5982\u679c\u5176\u4e2d\u9700\u8981\u6d17\u6389\u7684\u5185\u5bb9\u5360\u6bd4\u592a\u591a\uff0c\u5219\u4e0d\u8981\u4e86\u3002
\u5728\u7ed3\u6784\u5316\u6587\u6863\u4e2d\u63d0\u53d6\u6587\u672c\uff0c\u6bd4\u5982\u53bb\u6389 html \u548c markdown \u7684\u6807\u7b7e\uff0c\u53ea\u4fdd\u7559\u6587\u672c\u3002
\u5206\u522b\u505a\u4e86 url\u3001\u6587\u6863\u548c\u884c\u7ea7\u522b\u7684\u53bb\u91cd\u3002\u5728 url \u7ea7\u522b\uff0c\u4fdd\u7559\u4e86\u6240\u6709\u9875\u9762\u6700\u65b0\u7684\u7248\u672c\uff1b\u5728\u6587\u6863\u7ea7\u522b\uff0c\u4f7f\u7528\u4e86 MinHash \u7b97\u6cd5\uff1b\u5728\u884c\u7ea7\u522b\uff0c\u5c06\u6bcf 30M \u91cc\u8d85\u8fc7 6 \u6b21\u7684\u884c\u53bb\u9664\u6389\u4e86\uff0c\u8fd9\u663e\u8457\u63d0\u5347\u4e86\u8bc4\u6d4b\u8868\u73b0\u3002
\u5176\u4e2d MinHash \u7b97\u6cd5\u662f\u4e00\u79cd\u5feb\u901f\u6bd4\u8f83\u4e24\u4e2a\u96c6\u5408\u76f8\u4f3c\u5ea6\u7684\u7b97\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7\u6bd4\u8f83\u5355\u8bcd\u76f8\u4f3c\u5ea6\u6765\u5b9e\u73b0\u6587\u672c\u805a\u7c7b\u3002\u5b83\u9884\u8bbe\u4e24\u4e2a\u6587\u672c\u7684\u76f8\u4f3c\u5ea6\u662f\u901a\u8fc7\u8ba1\u7b97\u8bcd\u96c6 A \u548c\u8bcd\u96c6 B \u7684 Jaccard \u76f8\u4f3c\u5ea6 $ J(A, B) = \\frac{| A \\cap B |}{| A \\cup B |} $\u3002\u76ee\u7684\u662f\u4e0d\u9700\u8981\u5b9e\u9645\u8ba1\u7b97\u4e24\u4e2a\u96c6\u5408\u7684\u4ea4\u548c\u5e76\u3002\u5177\u4f53\u6211\u8ba4\u4e3a\u8fd9\u7bc7\u5e16\u5b50\u8bb2\u5f97\u5f88\u6e05\u6670 LSH\u7cfb\u52172\uff1aMinHash&LSH\u2014\u2014\u6587\u6863\uff08\u96c6\u5408\uff09\u76f8\u4f3c\u6027\u3002
\u542f\u53d1\u5f0f\u8fc7\u6ee4\uff0c\u8fc7\u6ee4\u4e86\u4ee5\u4e0b\u4e09\u79cd\u5185\u5bb9\uff1a\u7528 n-gram \u8fc7\u6ee4\u4e86\u4e00\u4e9b\u884c\u91cd\u590d\u6ca1\u53bb\u6389\u7684\u5185\u5bb9\uff0c\u7528\u810f\u8bcd\u8868\u8fc7\u6ee4\u810f\u8bcd\uff0c\u7528 K-L \u6563\u5ea6\u8fc7\u6ee4\u5206\u5e03\u592a\u7279\u6b8a\u7684 token\u3002
\u4ee3\u7801\u548c\u63a8\u7406\u6570\u636e\u3002\u4ece\u722c\u7684\u6570\u636e\u91cc\uff0c\u7528 fasttext \u6216 Llama 2 \u6765\u5224\u522b\u51fa\u4e00\u4e9b\u4ee3\u7801\u3001\u6570\u5b66\u7b49 STEM \u6587\u7ae0\u3002\u8fd9\u4e9b\u6587\u7ae0\u8fdb\u4e00\u6b65\u7528 DistlRoberta \u9009\u51fa\u4e86\u9ad8\u8d28\u91cf\u7684\u8bad\u7ec3\u6570\u636e\u3002
\u591a\u8bed\u8a00\u6570\u636e\u3002\u7528 fasttext \u4ece\u722c\u4e0b\u6765\u7684\u6570\u636e\u4e2d\u8bc6\u522b\u51fa\u4e86 176 \u79cd\u8bed\u8a00\uff0c\u8fd9\u4e9b\u591a\u8bed\u8a00\u6570\u636e\u4e5f\u8fdb\u884c\u4e86\u53bb\u91cd\u3001\u7b5b\u9009\u7b49\u6e05\u6d17\u6b65\u9aa4\u3002
\u5982\u4f55\u51b3\u5b9a\u8bad\u7ec3\u6570\u636e\u7684\u5206\u5e03\u6bd4\u4f8b\uff1a
\u77e5\u8bc6\u5206\u7c7b\u3002\u901a\u8fc7\u4e00\u4e2a\u5206\u7c7b\u5668\u5bf9\u6587\u7ae0\u6240\u5c5e\u7684\u77e5\u8bc6\u79cd\u7c7b\u8fdb\u884c\u5206\u7c7b\uff0c\u4e4b\u540e\u51cf\u5c11\u90a3\u4e9b\u5206\u5e03\u8fc7\u591a\u4f46\u5bf9\u6a21\u578b\u6548\u679c\u5e2e\u52a9\u4e0d\u5927\u7684\u7c7b\u522b\uff0c\u6bd4\u5982\u827a\u672f\u3001\u5a31\u4e50\u3002
scaling law\u3002\u7528\u4e00\u79cd\u6df7\u5408\u6bd4\u4f8b\u5148\u8bad\u7ec3\u4e00\u4e2a\u5c0f\u7684\u6a21\u578b\uff0c\u6d4b\u8bd5\u8868\u73b0\uff0c\u7528 scaling law \u8ba1\u7b97\u51fa\u5728\u66f4\u5927\u6a21\u578b\u4e0a\u4f7f\u7528\u8be5\u6df7\u5408\u6bd4\u4f8b\u7684\u8868\u73b0\uff0c\u8fdb\u800c\u786e\u5b9a\u6df7\u5408\u6bd4\u4f8b\u3002
\u8bad\u7ec3\u6570\u636e\u6df7\u5408\u6bd4\u4f8b\u7684\u603b\u7ed3\uff1a
\u53ef\u89c1\u591a\u8bed\u8a00\u6570\u636e\u4e0d\u9700\u8981\u592a\u591a\uff0c\u4e3b\u8981\u77e5\u8bc6\u7528\u82f1\u8bed\u5b66\u8fc7\u540e\u53ef\u4ee5\u6cdb\u5316\u5230\u5176\u5b83\u8bed\u8a00\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#_9","title":"\u9000\u706b","text":"\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u968f\u7740\u6a21\u578b\u9010\u6e10\u63a5\u8fd1\u8bad\u7ec3\u5b8c\u6210\uff0c\u9010\u6e10\u964d\u4f4e\u5bf9\u65b0\u6570\u636e\u7684\u6743\u91cd\uff0c\u53ef\u4ee5\u8ba9\u6a21\u578b\u66f4\u52a0\u7a33\u5b9a\u5730\u9002\u5e94\u65b0\u6570\u636e\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6a21\u578b\u53c2\u6570\u5267\u70c8\u6ce2\u52a8\u3002\u968f\u7740\u5b66\u4e60\u7387\u964d\u4f4e\uff0c\u53ea\u6709\u9ad8\u8d28\u91cf\u7684\u6570\u636e\u624d\u80fd\u663e\u8457\u63d0\u5347\u6a21\u578b\u7684\u6027\u80fd\u3002\u56e0\u6b64\u9000\u706b\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u6709\u6548\u7684\u65b9\u6cd5\u6765\u8bc4\u4f30\u5c0f\u578b\u7279\u5b9a\u9886\u57df\u6570\u636e\u96c6\u7684\u4ef7\u503c\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#model-architecture","title":"Model Architecture \u6a21\u578b\u67b6\u6784","text":"\u6027\u80fd\u7684\u63d0\u5347\u4e3b\u8981\u6765\u6e90\u4e8e\u6570\u636e\u8d28\u91cf\u7684\u63d0\u9ad8\u548c\u6a21\u578b\u66f4\u5927\u4e86\u3002
\u6a21\u578b\u4e0e\u4e4b\u524d\u7684\u533a\u522b\uff1agroup query attention (GQA) \u53ef\u4ee5\u5e26\u6765\u5185\u5b58\u7684\u8282\u7701\u3002
"},{"location":"docs/3-dl/survey/llama3_405b/#post-train","title":"Post-train \u5fae\u8c03","text":"TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_10","title":"\u591a\u6a21\u6001\u80fd\u529b","text":"\u89c6\u9891/\u56fe\u50cf\u80fd\u529b\u7684\u8bad\u7ec3\u5728\u6587\u5b57\u80fd\u529b\u8bad\u7ec3\u7ed3\u675f\u4e4b\u540e\uff0c\u6709\u989d\u5916\u7684 encoder \u548c decoder\uff0c\u8bad\u7ec3\u65f6\u5c06\u6587\u5b57\u80fd\u529b\u7684\u6743\u91cd\u51bb\u7ed3\uff0c\u53ea\u8c03\u5176\u5b83\u6a21\u6001\u7684\u53c2\u6570\u3002
TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_11","title":"\u76f8\u5173\u5de5\u4f5c","text":"TODO
"},{"location":"docs/3-dl/survey/llama3_405b/#_12","title":"\u53c2\u8003\u8d44\u6599","text":":material-circle-edit-outline: \u7ea6 1080 \u4e2a\u5b57 :fontawesome-solid-code: 15 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f
"},{"location":"docs/3-dl/survey/math-word-problem/#an-introduction-to-math-word-problems","title":"An Introduction to Math Word Problems","text":"The math word problem (MWP) aims to solve simple primary school math problems (in plain-text format) with deep learning methods. The problems usually consists of numbers no larger than 100 and only 5 operators (+, -, *, / and =). This blog is structured as follows. The Dataset part will introduce two main types, one indicating the locations of variables, and the other simply embedding the math formula within the natural language texts. The Methods parts will introduce several prevailing methods in solving this task, including both the models and workflows that improves the accuracy of models.
"},{"location":"docs/3-dl/survey/math-word-problem/#surveys","title":"Surveys","text":""},{"location":"docs/3-dl/survey/math-word-problem/#the-gap-of-semantic-parsing-a-survey-on-automatic-math-word-problem-solvers-2019","title":"The Gap of Semantic Parsing: A Survey on Automatic Math Word Problem Solvers (2019)","text":"This survey provides a comprehensive introduction to the MWP datasets and methods prior to 2019. This survey defines three stages of MWP solving, the Rule-based matching stage (1960-2010), Semantic parsing, feature engineering and statistical learning stage (2011-2017), and Deep learning and reinforcement learning stage (2017-2019).
"},{"location":"docs/3-dl/survey/math-word-problem/#towards-tractable-mathematical-reasoning-challenges-strategies-and-opportunities-for-solving-math-word-problems-2021","title":"Towards Tractable Mathematical Reasoning: Challenges, Strategies, and Opportunities for Solving Math Word Problems (2021)","text":"This survey introduces the contemporary MWP datasets til 2021, and methods including rule-based, and neural network encoder-decoder structures. Specifically, this paper concludes three strategies for math word solving, (i) direct answer generation, (ii) expression tree generation for inferring answers, and (iii) template retrieval for answer computation. Considering the type of problem solving method, this paper concludes two classes. The first class is non-neural approaches (rule-base or pattern matching approaches, semantic parsing, and statistical machine learning approaches), within which a particular strategy of applying domain knowledge in classifying the problems (e.g. into change, part-whole and compare classes). The second class is neural approaches, including intuitions of (i) predicting the answer directly (ii) generating a set of equations or mathematical expressions and inferring answers from the by executing them (iii) retrieving the templates from a pool of templates derived from training data and augmenting numerical quantities to compute the answer. These neural approaches generally follow encoder-decoder architectures, which fall in four types (i) seq-to-seq (ii) Transformer-to-tree (iii) seq-to-tree (iv) graph-to-tree. Among the four methods, the tree-structured decoder attend both parents and siblings to generate the next token, while the bottom-up representation of sub-tree of a sibling could further help to derive better outcomes. The graph-based encoder aims to learn different types of relationships among the constituents of MWPs. This section also mentions that \"Data augmentation is a popular preprocessing technique to increase the size of training data\" (reverse operation-based augmentation techniques, different traversal orders of expression trees, and weak supervision). In section Math Reasoning in Neural Approaches, this paper mentions several further topics under math reasoning, interpretability and explainability, infusing explicit and definitive knowledge, and reinforcement learning.
"},{"location":"docs/3-dl/survey/math-word-problem/#datasets","title":"Datasets","text":""},{"location":"docs/3-dl/survey/math-word-problem/#mawps-a-math-word-problem-repository-2016","title":"MAWPS: A Math Word Problem Repository (2016)","text":"sroy9/mawps: Code for MAWPS: A Math Word Problem Repository (github.com) The data format is as follows.
[\n{\n\"iIndex\": 1,\n\"sQuestion\": \"Joan found 70.0 seashells on the beach. She gave Sam some of her seashells . She has 27.0 seashells . How many seashells did she give to Sam ?\",\n\"lEquations\": [\"X=(70.0-27.0)\"],\n\"lSolutions\": [43.0]\n},\n]\n
"},{"location":"docs/3-dl/survey/math-word-problem/#math23k-deep-neural-solver-for-math-word-problems-2017","title":"Math23k: Deep Neural Solver for Math Word Problems (2017)","text":"Deep Neural Solver for Math Word Problems (aclanthology.org) This dataset is in Chinese.
Problem: Dan have 2 pens, Jessica have 4 pens. How many pens do they have in total ? \nEquation: x = 4+2 \nSolution: 6\n
"},{"location":"docs/3-dl/survey/math-word-problem/#mathqa-2019","title":"MathQA (2019)","text":"MathQA-Dataset (math-qa.github.io) This paper proposes a math dataset which enhances the AQuA dataset by providing fully-specified operational programs. This dataset has a diverse range of operators.
"},{"location":"docs/3-dl/survey/math-word-problem/#math-2021","title":"MATH (2021)","text":"arxiv.org/pdf/2103.03874.pdf MATH is a LaTeX format dataset, with its answer highlighted in a square block.
"},{"location":"docs/3-dl/survey/math-word-problem/#svmap","title":"SVMAP","text":"arkilpatel/SVAMP: NAACL 2021: Are NLP Models really able to Solve Simple Math Word Problems? (github.com) This dataset does not distinguish the data with the texts. An example data is as follows.
"},{"location":"docs/3-dl/survey/math-word-problem/#gsm8k-grade-school-math-2021","title":"GSM8k: grade school math (2021)","text":"Collected by OpenAI, this dataset consists of math problems in natural language descriptions, with the math formulas highlighted with special notes.The numbers are not explicitly highlighted with special symbols. Several examples of the data format are as follows.
"},{"location":"docs/3-dl/survey/math-word-problem/#draw","title":"DRAW","text":"Providing 1000 grounded word problems.
"},{"location":"docs/3-dl/survey/math-word-problem/#algebra","title":"Algebra","text":""},{"location":"docs/3-dl/survey/math-word-problem/#asdiv","title":"AsDiv","text":""},{"location":"docs/3-dl/survey/math-word-problem/#multiarith","title":"MultiArith","text":""},{"location":"docs/3-dl/survey/math-word-problem/#singleeq","title":"SingleEq","text":""},{"location":"docs/3-dl/survey/math-word-problem/#methods","title":"Methods","text":""},{"location":"docs/3-dl/survey/math-word-problem/#models","title":"Models","text":"Prior to 2017, the models for solving MWP are mainly concerning with neural networks. After Transformer has been released in 2017, attention-based models have been thriving. The novel models based on Transformer are mainly modifying the encoder and decoder structures, among which there are graph-encoder and tree-decoders.
"},{"location":"docs/3-dl/survey/math-word-problem/#graph-to-tree-learning-for-solving-math-word-problems-2020","title":"Graph-to-Tree Learning for Solving Math Word Problems (2020)","text":"This paper proposes a attention-based model Graph2Tree, consisting of graph-based encoder and a tree-based decoder. The math word problems are constructed into Quantity Comparison Graph.
"},{"location":"docs/3-dl/survey/math-word-problem/#math-word-problem-solving-with-explicit-numerical-values-2021","title":"Math Word Problem Solving with Explicit Numerical Values (2021)","text":"A novel approach called NumS2T is proposed to solve MWP. NumS2T is constructed with (a) an attention-based seq2seq model to generate its math expressions, (b) a numerical value encoder to obtain the number-aware problem state which are then concatenated with the problem hidden state in (a) to obtain number-aware problem representation, and (c) a numerical properties prediction mechanism for comparing the paired numerical values, determining the category of each numeral and measuring whether they should appear in the target expression.!
"},{"location":"docs/3-dl/survey/math-word-problem/#learning-to-reason-deductively-math-word-problem-solving-as-complex-relation-extraction-2022","title":"Learning to Reason Deductively: Math Word Problem Solving as Complex Relation Extraction (2022)","text":"This paper proposes a novel approach
"},{"location":"docs/3-dl/survey/math-word-problem/#workflows","title":"Workflows","text":"Most of the recent works follow the method of knowledge distilling, which means to generate high quality data with LLMs and then train a small model with the generated (and sometimes then augmented) data. The workflow of such tasks mainly assembles that of the following paper.
"},{"location":"docs/3-dl/survey/math-word-problem/#large-language-models-are-reasoning-teachers","title":"Large Language Models Are Reasoning Teachers","text":"This paper proposes a knowledge distilling method in solving math reasoning problems.
"},{"location":"docs/3-dl/survey/math-word-problem/#solving-math-word-problems-via-cooperative-reasoning-induced-language-models-acl-2023","title":"Solving Math Word Problems via Cooperative Reasoning induced Language Models (ACL 2023)","text":"This paper develops a cooperative reasoning-induced PLM for solving MWPs called Cooperative Reasoning (CoRe), with a generator to generate reasoning paths and a verifier to supervise the evaluation.
"},{"location":"docs/3-dl/survey/math-word-problem/#scaling-relationship-on-learning-mathematical-reasoning-with-large-language-models-2023","title":"Scaling Relationship on Learning Mathematical Reasoning with Large Language Models (2023)","text":"This paper mainly focus on the following two questions: (i) Which is a better performance indicator of LLMs? (pre-training loss amount/model size) (ii) How to improve small model's performance by data augmentation? To answer the second question, this paper proposes a novel methods in data augmentation in the LLM data generation step which is called Rejection Finetuning (RFT). The algorithm of sampling data in RFT mainly adopts the thought of rejection sampling, which is expressed in the following pseudo-code. This paper assumes such an algorithm will yield as many as possible diverse reasoning paths. The workflow of the RFT method is illustrated as follows, where the SFT stands for supervised finetuning. With the novel method RFT, small models such as Llama-7b yields an accuracy of at most 49.7% on GSM8k, 14% higher than the previous SOTA method SFT.
"},{"location":"docs/3-dl/survey/math-word-problem/#pal","title":"PAL","text":"This work is a prompt engineering work.
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? \nA: Roger started with 5 tennis balls. tennis_balls = 5 2 cans of 3 tennis balls each is bought_balls = 2 * 3 tennis balls. The answer is answer = tennis_balls + bought_balls \nQ: The bakers at the Beverly Hills Bakery baked 200 loaves of bread on Monday morning. They sold 93 loaves in the morning and 39 loaves in the afternoon. A grocery store returned 6 unsold loaves. How many loaves of bread did they have left?\n
A: The bakers started with 200 loaves loaves_baked = 200 They sold 93 in the morning and 39 in the afternoon loaves_sold_morning = 93 loaves_sold_afternoon = 39 The grocery store returned 6 loaves. loaves_returned = 6 The answer is answer = loaves_baked - loaves_sold_morning - loaves_sold_afternoon + loaves_returned\n
"},{"location":"docs/3-dl/survey/math-word-problem/#preview","title":"Preview","text":""},{"location":"docs/3-dl/survey/multilingual/","title":"Multilingual Task Survey","text":":material-circle-edit-outline: \u7ea6 768 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
"},{"location":"docs/3-dl/survey/multilingual/#introduction","title":"Introduction","text":"\u591a\u8bed\u8a00\u6a21\u578b multilingual models \u5c31\u662f\u80fd\u89e3\u51b3\u591a\u8bed\u8a00\u4efb\u52a1\u7684\u6a21\u578b\u3002\u5728\u4e3b\u6d41\u8bad\u7ec3\u6570\u636e\u662f\u82f1\u8bed\u3001\u7a00\u6709\u8bed\u8a00\u6570\u636e\u7a00\u7f3a\u7684\u80cc\u666f\u4e0b\uff0c\u5982\u4f55\u5c06\u6a21\u578b\u80fd\u529b\u6cdb\u5316\u5230\u7a00\u6709\u8bed\u8a00\u662f\u91cd\u8981\u7684\u95ee\u9898\u3002\u9664\u4e86\u6700\u8fd1\u7684\u5927\u8bed\u8a00\u6a21\u578b\u5916\uff0c\u8fd8\u4f1a\u4ecb\u7ecd\u4f20\u7edf\u65b9\u6cd5\u548c\u4f20\u7edf\u6a21\u578b\u3002
"},{"location":"docs/3-dl/survey/multilingual/#survey","title":"Survey","text":""},{"location":"docs/3-dl/survey/multilingual/#a-survey-on-large-language-models-with-multilingualism-recent-advances-and-new-frontiers-2024","title":"A Survey on Large Language Models with Multilingualism: Recent Advances and New Frontiers (2024)","text":""},{"location":"docs/3-dl/survey/multilingual/#_1","title":"\u7b80\u4ecb","text":"\u672c\u6587\u4ecb\u7ecd\u591a\u8bed\u8a00\u5927\u8bed\u8a00\u6a21\u578b\u7684\u8bad\u7ec3\u3001\u4f7f\u7528\u3001\u6311\u6218\u3001\u672a\u6765\u7814\u7a76\u65b9\u5411\u7b49\u3002\u7531 Beijing Jiaotong University, University of Montreal \u548c Tsinghua University \u53d1\u5e03\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_2","title":"\u8bad\u7ec3","text":""},{"location":"docs/3-dl/survey/multilingual/#_3","title":"\u6709\u591a\u8bed\u8a00\u80fd\u529b\u7684\u5927\u8bed\u8a00\u6a21\u578b\u6982\u89c8","text":""},{"location":"docs/3-dl/survey/multilingual/#_4","title":"\u591a\u8bed\u8a00\u63a8\u7406\u7b56\u7565","text":""},{"location":"docs/3-dl/survey/multilingual/#_5","title":"\u5b89\u5168\u6027","text":""},{"location":"docs/3-dl/survey/multilingual/#_6","title":"\u591a\u9886\u57df\u591a\u8bed\u8a00\u5927\u8bed\u8a00\u6a21\u578b","text":""},{"location":"docs/3-dl/survey/multilingual/#_7","title":"\u591a\u8bed\u8a00\u6570\u636e\u8d44\u6e90","text":""},{"location":"docs/3-dl/survey/multilingual/#_8","title":"\u591a\u8bed\u8a00\u8bc4\u6d4b","text":""},{"location":"docs/3-dl/survey/multilingual/#_9","title":"\u504f\u89c1\u548c\u516c\u5e73\u6027","text":""},{"location":"docs/3-dl/survey/multilingual/#models","title":"Models","text":""},{"location":"docs/3-dl/survey/multilingual/#datasets","title":"Datasets","text":""},{"location":"docs/3-dl/survey/multilingual/#studies","title":"Studies","text":""},{"location":"docs/3-dl/survey/multilingual/#do-llamas-work-in-english-2024-epfl","title":"Do Llamas Work in English? (2024, EPFL)","text":"\u731c\u60f3\uff1a\u591a\u8bed\u8a00\u6a21\u578b\uff08\u6bd4\u5982 Llama\uff09\u5728\u4f7f\u7528\u4ee5\u82f1\u8bed\u4e3a\u4e3b\u7684\u8bed\u6599\u8fdb\u884c\u8bad\u7ec3\u65f6\uff0c\u4f1a\u5c06\u82f1\u8bed\u4f5c\u4e3a\u4e00\u79cd\u601d\u8003\u7684\u4e2d\u95f4\u6b65\u9aa4 pivot language\u3002
\u5b9e\u9a8c\u65b9\u6cd5\uff1a\u5bf9 Llama-2 \u7cfb\u5217\u6a21\u578b\uff0c\u8bbe\u8ba1\u6570\u636e\u5bf9 (\u975e\u82f1\u8bed\u63d0\u793a\u8bcd\uff0cnext token)\u3002\u4ece\u9876\u5c42\u5411\u91cf\u7a7a\u95f4 high-dimensional space \u63a2\u7d22\u4e2d\u95f4\u5d4c\u5165 intermediate embeddings \u5982\u4f55\u8ba1\u7b97\u4e0b\u4e00\u4e2a\u5355\u8bcd\u7684\u89c4\u5f8b\u3002
\u53d1\u73b0\u4e09\u4e2a\u9636\u6bb5\uff1a
\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1aimtermediate embedding \u6240\u4ee3\u8868\u7684\u62bd\u8c61\u6982\u5ff5\u7a7a\u95f4 concept space \u66f4\u63a5\u8fd1\u82f1\u8bed\uff0c\u53ef\u80fd\u5bfc\u81f4\u591a\u8bed\u8a00\u6a21\u578b\u4e2d\u7684\u504f\u89c1\u95ee\u9898\u3002
"},{"location":"docs/3-dl/survey/multilingual/#language-specific-neurons-the-key-to-multilingual-capability-in-large-language-models-2024-ruc","title":"Language-Specific Neurons: The Key to Multilingual Capability in Large Language Models (2024, RUC)","text":""},{"location":"docs/3-dl/survey/multilingual/#_10","title":"\u80cc\u666f","text":"\u8bc6\u522b\u591a\u8bed\u8a00\u5927\u6a21\u578b\u91cc\uff0c\u4ea7\u751f\u7279\u5b9a\u8bed\u8a00\u80fd\u529b\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u975e\u5e38 challenging\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_11","title":"\u65b9\u6cd5","text":"\u63d0\u51fa\u4e86 language activation probability entropy (LAPE) \u6765\u68c0\u6d4b\u5927\u8bed\u8a00\u6a21\u578b\u4e0d\u540c\u8bed\u8a00\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u3002
LAPE: \u4e3a\u4e86\u51cf\u5c11 RLHF \u53ef\u80fd\u5e26\u6765\u7684\u5bf9\u8bed\u8a00\u504f\u597d\u7684\u7684\u5f71\u54cd\uff0c\u4e3b\u8981\u5173\u6ce8\u9884\u8bad\u7ec3\u8fc7\u7684\u6a21\u578b\uff0c\u800c\u4e0d\u662f\u5fae\u8c03\u540e\u7684\u6a21\u578b\u3002
\u5bf9\u4e8e\u5728\u7b2c i \u5c42\u7684\u7b2c j \u4e2a neuron\uff0c\u5b9a\u4e49\u5728\u8bed\u8a00 k \u4e0a\u7684\u6fc0\u6d3b\u6982\u7387 activation probability
\\[ p_{i,j}^k = E(I(act_fn(\\tilde{h}^iW_1^i)_j \\lt 0 | language\\spacek)) \\]I \u662f indicator function\uff08\u5f53\u7ed9\u5b9a\u6761\u4ef6\u4e3a\u771f\u65f6\uff0c\u6307\u793a\u51fd\u6570\u7684\u503c\u4e3a 1\uff1b\u5f53\u7ed9\u5b9a\u6761\u4ef6\u4e3a\u5047\u65f6\uff0c\u6307\u793a\u51fd\u6570\u7684\u503c\u4e3a 0\uff09\u3002
\u4ee5\u6b64\u53ef\u4ee5\u83b7\u5f97\u6bcf\u4e2a\u795e\u7ecf\u5143\u5bf9\u8bed\u8a00\u7684\u5206\u5e03
\\[ p_{i,j} = (p_{i,j}^1, ... , p_{i,j}^k, ... , p_{i,j}^l) \\]\u5b9a\u4e49\u4e0a\u8ff0\u5206\u5e03\u7684\u71b5\u4e3a language activation probability entropy (LAPE) \u3002
\\[ LAPE_{i,j} = -\\sum^{l}_{k=1} p^{\\prime k}_{i,j} log(p^{\\prime k}_{i,j}) \\]\u4f7f\u7528 Llama-2, BLOOM, Mistral \u548c Phi-2 \u8fdb\u884c\u5b9e\u9a8c\uff0c\u53d1\u73b0\u8fd9\u4e9b\u795e\u7ecf\u5143\u4e3b\u8981\u5728\u9876\u5c42\u548c\u5e95\u5c42 embedding \u4e0a\u3002
"},{"location":"docs/3-dl/survey/multilingual/#_12","title":"\u53d1\u73b0","text":":material-circle-edit-outline: \u7ea6 13 \u4e2a\u5b57
Any tool recommendations, or any tutorial or tutorial remmondations.
"},{"location":"docs/3-dl/tools/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 2098 \u4e2a\u5b57 :fontawesome-solid-code: 82 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f
"},{"location":"docs/3-dl/tools/codabench/#_1","title":"\u7b80\u4ecb","text":"Codabench \u662f\u4e00\u4e2a\u4e3a\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u6bd4\u8d5b\u8bbe\u8ba1\u7684\u4f4e\u4ee3\u7801\u6a21\u578b\u6d4b\u8bd5\u5e73\u53f0\u3002\u5e73\u53f0\u63d0\u4f9b CPU\uff0c\u5141\u8bb8\u6bd4\u8d5b\u521b\u529e\u8005\u901a\u8fc7\u4e0a\u4f20\u811a\u672c\u548c\u6570\u636e\u7684\u65b9\u5f0f\u521b\u529e\u6bd4\u8d5b\uff0c\u5e76\u5141\u8bb8\u5176\u5b83\u7528\u6237\u4f7f\u7528\u5e73\u53f0 CPU \u6765\u8fd0\u884c\u4ee3\u7801\u5f97\u5230\u7ed3\u679c\u3002\u524d\u5e8f\u5de5\u4f5c\u662f CodaLab\uff0c2023 \u5e74 Codabench \u56e2\u961f\u4eff\u7167 CodaLab \u6539\u8fdb\u51fa\u4e86 Codabench\u3002
Codabench \u7684\u4f18\u70b9\u662f\u63d0\u4f9b\u516c\u5171 CPU\uff0c\u4f7f\u6bd4\u8d5b\u521b\u529e\u65b9\u5728\u5c06\u6b63\u786e\u7b54\u6848\u4fdd\u5bc6\u7684\u60c5\u51b5\u4e0b\uff0c\u4e0d\u5fc5\u4eb2\u624b\u6536\u96c6\u53c2\u8d5b\u8005\u7684\u7b54\u6848\u5e76\u4e00\u4e00\u4eb2\u624b\u6d4b\u8bd5\uff0c\u800c\u662f\u5141\u8bb8\u7528\u6237\u81ea\u884c\u901a\u8fc7\u5e73\u53f0\u6d4b\u8bd5\u5e76\u5f97\u5230\u7ed3\u679c\uff0c\u51cf\u8f7b\u8d1f\u62c5\u3002\u800c\u7528\u6237\u4e5f\u53ef\u4ee5\u66f4\u8fc5\u901f\u77e5\u9053\u81ea\u5df1\u7684\u5206\u6570\uff0c\u4e0d\u5fc5\u7b49\u5f85\u6bd4\u8d5b\u65b9\u9a8c\u8bc1\u8fd9\u4e2a\u65f6\u95f4\u8f83\u957f\u7684\u6d41\u7a0b\u3002
"},{"location":"docs/3-dl/tools/codabench/#_2","title":"\u8fd0\u4f5c","text":"\u6bd4\u8d5b\u521b\u529e\u8005\u901a\u8fc7\u4e0a\u4f20\u6bd4\u8d5b\u914d\u7f6e\u540e\uff0c\u6bcf\u5f53\u6709\u7528\u6237\u52a0\u5165\u5e76\u63d0\u4ea4\u4e00\u4e2a\u8fd0\u884c\u8bf7\u6c42\uff0c\u5e73\u53f0\u5c06\u5728 CPU \u4e0a\u4e3a\u6bcf\u4e2a\u63d0\u4ea4\u521b\u5efa\u4e00\u4e2a Docker\uff0c\u5305\u542b\u6bd4\u8d5b\u521b\u529e\u8005\u63d0\u4f9b\u7684\u6bd4\u8d5b\u914d\u7f6e\u548c\u8be5\u7528\u6237\u63d0\u4ea4\u7684\u6570\u636e\uff0c\u5728 Docker \u4e2d\u8fd0\u884c\u6307\u5b9a\u8def\u5f84\u7684\u4ee3\u7801\uff0c\u5e76\u5c06\u7ed3\u679c\u663e\u793a\u5728\u5e73\u53f0\u5c55\u793a\u7684 terminal \u4e0a\u3002
"},{"location":"docs/3-dl/tools/codabench/#_3","title":"\u521b\u5efa","text":"\u5728 Codabench \u5b98\u7f51\u6ce8\u518c\u767b\u9646\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2 Benchmark
-> Management
\uff0c\u53ef\u4ee5\u9009\u62e9 Create
\u6216 Upload
\u6765\u521b\u5efa\u6bd4\u8d5b\u3002
Create
\u662f\u4f7f\u7528\u5e73\u53f0 UI \u521b\u5efa\u6bd4\u8d5bUpload
\u662f\u5728\u672c\u5730\u5199\u597d\u914d\u7f6e\u6587\u4ef6\uff0c\u76f4\u63a5\u4e0a\u4f20\u540e\u88ab\u89e3\u6790\u4e3a\u4e00\u4e2a\u6bd4\u8d5b\u66f4\u63a8\u8350\u7528 Upload
\u6765\u521b\u5efa\uff0c\u56e0\u4e3a UI \u7684\u7528\u6237\u63d0\u793a\u6bd4\u8f83\u6b20\u7f3a\u3002
'bundle' \u6307\u6bd4\u8d5b\u521b\u5efa\u8005\u4e0a\u4f20\u7684\u538b\u7f29\u6587\u4ef6\u3002\u91cc\u9762\u542b\u6709\uff1a
competition.yaml
\u662f\u6bd4\u8d5b\u7684 metadata\u9700\u8981\u671f\u5f85\u7528\u6237\u4e0a\u4f20\uff1a
\u4e0b\u9762\u4ecb\u7ecd\u51e0\u4e2a\u5b98\u65b9\u6587\u6863\u8bb2\u5f97\u4e0d\u592a\u6e05\u695a\u7684\u7ec6\u8282\u3002
"},{"location":"docs/3-dl/tools/codabench/#competitionyaml","title":"competition.yaml
\u6587\u4ef6","text":"competition.yaml
\u6587\u4ef6\u4e0d\u80fd\u6539\u540d\uff0c\u4e14\u5fc5\u987b\u4f4d\u4e8e .zip \u4e2d\u7684\u6700\u9876\u5c42\uff08\u5373\u591a\u9009 competition.yaml
\u548c\u5176\u5b83\u6587\u4ef6\u5939\u540e\u521b\u5efa .zip\uff0c\u800c\u975e\u628a\u542b\u6709 competition.yaml \u548c\u5176\u5b83\u6587\u4ef6\u5939\u7684\u4e0a\u5c42\u6587\u4ef6\u5939\u521b\u5efa\u4e3a .zip\uff09\u3002\u5177\u4f53\u5982\u56fe\u6240\u793a\u3002\u4e0b\u6587\u6240\u63d0\u5230\u7684\u65e0\u9876\u5c42\u6587\u4ef6\u5939 / \u6587\u4ef6\u4f4d\u4e8e\u538b\u7f29\u5305\u9876\u5c42\uff0c\u90fd\u662f\u6307\u5982\u56fe\u6240\u793a\u7684\u538b\u7f29\u5305\u7ed3\u6784\u3002
competition.yaml
\u652f\u6301\u7684\u5b57\u6bb5\u6709\uff1a
title: # \u6bd4\u8d5b\u540d\nversion: # 1 \u6307\u662f CodaLab bundle\uff0c2 \u6307 CodaBench bundle\uff0c\u533a\u522b\u662f\u6709\u4e9b competition.yaml \u5b57\u6bb5\u4e0d\u517c\u5bb9\ndescription: # \u6bd4\u8d5b\u63cf\u8ff0\nimage: # \u6bd4\u8d5b logo.png\nregistration_auto_approve: True # do not require approval from organizers to join\ndocker_image: codalab/codalab-legacy:py39 # the Docker image in which submissions are run\uff0c\u7528\u6b64 default \u5373\u53ef\nenable_detailed_results: True # \u4e0d\u660e\uff0c\u53ef\u4ee5 default\n# Documentation web pages\nterms: pages/terms.md # \u5fc5\u987b\u6709\u4e00\u4e2a terms\npages: # \u53ef\u4efb\u610f\u52a0\u9875\u9762\n- title: # e.g., Overview\nfile: # e.g., pages/overview.md\n# Definition of the tasks\ntasks:\n- index: 0\nname: # e.g., Development Task\ndescription: # \u63cf\u8ff0\nis_public: true # \u516c\u5f00\u53ef\u89c1\ninput_data: # e.g., feedback_phase/input_data, \u6b64\u5904\u53ca\u4e0b\u5217\u8def\u5f84\u9700\u8981\u586b\u5199\u6240\u4e0a\u4f20 bundle \u91cc\u7684\u8def\u5f84\uff0c\u800c\u975e\u6240\u751f\u6210 Docker \u4e2d\u7684\nreference_data: # e.g., feedback_phase/reference_data\nscoring_program: # e.g., scoring_program\ningestion_program: # e.g., ingestion_program\nsolutions: [] # \u4e0d\u660e\n# Sample code submission\nsolutions: # \u53ef\u80fd\u4f1a\u663e\u793a\u5728\u6bd4\u8d5b\u9996\u9875\u7684 resources \u5217\u8868\n- index: 0\ntasks:\n- 0\n- 1\npath: solution/\nphases:\n- index: 0\nname: # phase \u6807\u9898\ndescription: # \u63cf\u8ff0\nstart: 1-1-2024 # Month / Day / Year\nend: 1-30-2024 # end \u7ed3\u675f\u65f6\u95f4\u53ef\u4ee5\u7f3a\u5931\uff0c\u8868\u793a\u6c38\u8fdc\u53ef\u63d0\u4ea4\nmax_submissions_per_day: 5 # \u6700\u5927\u4f3c\u4e4e\u662f 100\uff1f\nmax_submissions: 100 # \u6700\u5927\u4f3c\u4e4e\u662f 10000\uff1f\nexecution_time_limit: 600 # \u6bcf\u6b21\u63d0\u4ea4\u5141\u8bb8\u7684\u6700\u957f\u8fd0\u884c\u65f6\u95f4\uff0c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u5c06\u663e\u793a run time exceed\ntasks: # \u4e0e\u8be5 phase \u5173\u8054\u7684 tasks\n- 0\nsolutions: []\nstarting_kit: # e.g., starting_kit, \u53ef\u80fd\u4f1a\u663e\u793a\u5728\u6bd4\u8d5b\u9996\u9875\u7684 resources \u5217\u8868\npublic_data: # e.g., starting_kit, feedback_phase/input_data\n# Fact sheets to add more information in the leaderboard\nfact_sheet: { # \u4f3c\u4e4e\u662f\u5c55\u793a\u5728 leaderboard \u4e2d\u652f\u6301\u7528\u6237\u4fee\u6539\u7684\u66f4\u591a\u4fe1\u606f\u3002`method_name` \u8be5\u5b57\u6bb5\u5e94\u4e0e\u4e0b\u65b9 `results` \u5e73\u7ea7\u3002\n\"method_name\": {\n\"key\": \"method_name\",\n\"type\": \"text\",\n\"title\": \"Method name\",\n\"selection\": \"\",\n\"is_required\": \"false\",\n\"is_on_leaderboard\": \"true\"\n}\n}\n# Leaderboard\nleaderboards:\n- index: 0\ntitle: Results # leaderboard \u7684 title\nkey: Results # `output.json` \u4e2d\u7528\u4e8e\u5b9a\u4f4d\u7684 key\nsubmission_rule: \"Force_Last\" # \u53ef\u4ee5\u53bb\u6389\uff0c\u9ed8\u8ba4\u4f3c\u4e4e\u662f\u5141\u8bb8\u5c55\u793a\u591a\u4e2a\u7ed3\u679c\ncolumns:\n- title: Average Accuracy # \u5728 output.json \u4e2d\uff0c\u8bfb\u53d6\u8be5 json \u7684\u54ea\u4e2a key\nkey: avg_accuracy # `output.json` \u4e2d\u7528\u4e8e\u5b9a\u4f4d\u7684 key\nindex: 0 # \u5c55\u793a\u5728 leaderboard \u8868\u683c\u4e2d\u7684\u7b2c\u51e0\u5217\nsorting: desc # \u5347\u5e8f/\u964d\u5e8f\u6392\u5217\ncomputation: avg # \u540c\u4e00\u7528\u6237\u7684\u591a\u4e2a\u63d0\u4ea4\uff0c\u6309\u4ec0\u4e48\u8ba1\u7b97\u65b9\u6cd5\u6392\u5e8f\uff1f\ncomputation_indexes: # \u5728\u54ea\u4e00\u5217\u4e0a\u8ba1\u7b97\n- 1\n
"},{"location":"docs/3-dl/tools/codabench/#scoring-program","title":"scoring program \u7684\u8def\u5f84\u8bf4\u660e","text":"\u5947\u5f02\u7684\u662f\uff0c\u6bd4\u8d5b\u8fd0\u884c\u65f6\u6240\u521b\u5efa\u7684 Docker \u4e2d\u6587\u4ef6\u7ed3\u6784\u5e76\u4e0d\u662f bundle \u7684\u7ed3\u6784\uff0c\u6216\u8005\u793a\u4f8b competition.yml \u4e2d\u6307\u793a\u7684\u8def\u5f84\uff0c\u800c\u662f\u4f1a\u628a\u5404\u79cd\u8d44\u6e90\u7ed3\u6784\u6253\u4e71\u653e\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u3002\u5bf9\u6211\u4eec\u5f71\u54cd\u5c31\u662f\uff0c\u5982\u679c scoring program \u9700\u8981\u8bfb\u5176\u5b83\u6587\u4ef6\uff08\u591a\u4ee3\u7801\u6587\u4ef6 / gold answer \u7b49\uff09\uff0c\u5c31\u9700\u8981\u6309\u521b\u5efa\u597d\u7684 Docker \u4e2d\u7684\u65b0\u6587\u4ef6\u8def\u5f84\u8bfb\u53d6\u3002
\u6bd4\u5982\uff0c\u5728\u6211\u7684\u6d4b\u8bd5\u4e2d\uff0cDocker \u7684\u5b9e\u9645\u6587\u4ef6\u5939\u7ed3\u6784\u5982\u4e0b\uff1a
.\n- app\n - codalab // \u4e0d\u660e\n - data // \u4e0d\u660e\n - input\n - res // \u7528\u6237\u7ed3\u679c\n - ref // gold anwser\n - shared // \u4e0d\u660e\n - program // \u6240\u4e0a\u4f20\u811a\u672c\n - score.py\n - metadata.yaml\n - output // \u811a\u672c\u8f93\u51fa\uff0c\u7528\u4e8e leaderboard \u8bfb\u53d6\n - output.json\n
\u5982\u679c\u4e0a\u8ff0\u8def\u5f84\u5728\u4f60\u7684\u6d4b\u8bd5\u4e2d\u4e0d work\uff0c\u53ef\u4ee5\u5148\u4e0a\u4f20\u4e00\u4e2a\u542b\u6709 competition.yaml / scoring program / reference data / result data / ingestion program \u7b49\u6240\u6709\u8d44\u6e90\u7684\u6d4b\u8bd5 bundle\uff0c\u8981\u6c42 scoring program \u8f93\u51fa Docker \u7684\u6587\u4ef6\u5939\u7ed3\u6784\u6811\uff0c\u5728 terminal \u4e2d\u4f9d\u6b21\u8bb0\u4e0b\u8d44\u6e90\u7684\u8def\u5f84\u3002
"},{"location":"docs/3-dl/tools/codabench/#scoring-program_1","title":"scoring program \u7684\u8f93\u51fa\u8bf4\u660e","text":"scoring program \u5728\u8fd0\u884c\u5b8c\u6210\u540e\u88ab\u671f\u5f85\u5199\u4e00\u4e2a output.json \u6587\u4ef6\uff0c\u5176\u8def\u5f84\u5728\u524d\u4e00\u8282\u6709\u8bf4\u660e\u3002\u5176\u7ed3\u6784\u636e\u63a8\u6d4b\u5e94\u5f53\u662f\uff0c
{\n\"leaderboards_key\": {\n\"column_key1\": 0,\n\"column_key2\": 0,\n...\n}\n}\n
\u5176\u4e2d\u51e0\u4e2a 'key' \u5206\u522b\u5bf9\u5e94\u5728 competition.yaml \u7684 leaderboards \u8bbe\u7f6e\u4e2d\u81ea\u5b9a\u4e49\u7684 key\u3002
"},{"location":"docs/3-dl/tools/codabench/#_5","title":"\u5e38\u89c1\u62a5\u9519","text":"\u5c06 bundle \u62d6\u5165 Upload \u9875\u9762\u540e\uff0c\u5982\u679c\u62a5\u9519\u663e\u793a Creation Fail\uff0c\u6b64\u65f6\u9996\u5148\u5e94\u5f53\u68c0\u67e5\u662f\u5426\u6709 competition.yaml
\u6587\u4ef6\uff0c\u6587\u4ef6\u540d\u548c\u5185\u5bb9\u683c\u5f0f\u6b63\u786e\uff0c\u5e76\u4e14\u4f4d\u4e8e\u538b\u7f29\u5305\u9876\u5c42\uff08\u53c2\u7167\u4e0a\u65b9\u538b\u7f29\u56fe\u793a\uff09\u3002\u4e00\u822c\u662f\u6b64\u9519\u8bef\u3002
codalab/competition-examples/codabench \u5b98\u65b9\u63d0\u4f9b\u7684\u51e0\u4e2a bundle \u6a21\u677f\uff0c\u53ef\u4ee5\u5bf9\u6bd4 Codabench \u4e0a\u540c\u540d\u6bd4\u8d5b\u67e5\u770b\u521b\u5efa\u7ed3\u679c\uff0c\u5728\u672c\u4ed3\u5e93\u62ff\u4e00\u4e9b\u9700\u8981\u7684\u5199\u6cd5\u3002
"},{"location":"docs/3-dl/tools/codabench/#ui","title":"UI \u521b\u5efa","text":"\u8fdb\u5165 Codabench \u9996\u9875\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2 Benchmark
-> Management
\uff0c\u9009\u62e9 Upload
\u6765\u521b\u5efa\u6bd4\u8d5b\u3002
\u9876\u5c42\u6709 Details
/ Participation
/ Pages
/ Phases
/ Leaderboard
/ Administrators
\u516d\u4e2a\u9875\u9762\uff0c\u5176\u5b83\u8f83\u6613\u61c2\uff0c\u4e0d\u518d\u8d58\u8ff0\uff0cPhases
\u7684\u8bbe\u7f6e\u6bd4\u8f83\u590d\u6742\u3002
Phases \u6784\u6210\u6bd4\u8d5b\u4e3b\u4f53\u3002\u4e00\u4e2a\u6bd4\u8d5b\u53ef\u4ee5\u6709\u4e00\u4e2a\u6216\u591a\u4e2a phase\uff0c\u8fd9\u6837\u8bbe\u8ba1\u53ef\u80fd\u662f\u6709\u4e9b\u6bd4\u8d5b\u5206\u6210\u5728\u591a\u4e2a\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\uff1b\u4e00\u4e2a phase \u53c8\u53ef\u4ee5\u5305\u542b\u591a\u4e2a tasks\uff0c\u53ef\u80fd\u662f\u4e3a\u4e86\u652f\u6301\u6709\u4e9b\u6bd4\u8d5b\u6bcf\u4e2a phase \u53c8\u6709\u591a\u4e2a\u6570\u636e\u96c6\u3002phase \u4e4b\u95f4\u4e0d\u5171\u4eab\u8d44\u6e90/Docker \u73af\u5883\uff0c\u540c\u4e00\u4e2a phase \u7684\u4e0d\u540c task \u4e4b\u95f4\u5171\u4eab\u8d44\u6e90/\u73af\u5883\u3002
\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u53ef\u4ee5\u53ea\u5b9a\u4e49\u4e00\u4e2a phase\u3002\u533a\u5206\u6570\u636e\u96c6\u751a\u81f3\u53ef\u4ee5\u53ea\u901a\u8fc7 scoring program \u6765\u5b9e\u73b0\u3002
\u5728 phase \u7684 edit \u754c\u9762\u6700\u4e0b\u65b9\uff0c\u53ef\u4ee5\u901a\u8fc7 Manage tasks \u6309\u94ae\u6253\u5f00 task \u7684 edit \u754c\u9762\u3002
\u8be5\u754c\u9762\u4e2d Submission
/ Datasets and programs
/ Bundles
\u4e09\u4e2a\u9875\u9762\u90fd\u53ef\u4ee5\u5ffd\u89c6\uff0c\u53ea\u9700\u8981\u4f7f\u7528 Tasks
\u8fd9\u4e2a\u9875\u9762\u3002
task \u7684\u672c\u8d28\u610f\u4e49\u662f scoring program \u548c reference data / ingestion program / result data \u7684\u5173\u8054\u65b9\u5f0f\u3002
\u5982\u679c\u5b9a\u4e49\u4e00\u4e2a phase \u6709\u591a\u4e2a tasks\uff0c\u5728\u7528\u6237\u63d0\u4ea4\u65f6\uff0c\u4f1a\u663e\u793a\u9009\u62e9\u63d0\u4ea4\u54ea\u4e2a task \u7684\u590d\u9009\u6846\u3002\u5f53\u590d\u9009\u6846\u88ab\u52fe\u9009\u65f6\uff0ctask \u6240\u5173\u8054\u7684 scoring program \u88ab\u8fd0\u884c\u3002
\u5f53\u7136\u4e5f\u6709\u4e0d\u521b\u5efa\u591a\u4e2a task\uff0c\u5c06\u591a\u4e2a\u8bc4\u6d4b\u5408\u5e76\u4e3a\u4e00\u4e2a\u811a\u672c\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u91cc\u68c0\u6d4b\u7528\u6237\u4e0a\u4f20\u4e86\u54ea\u4e9b\u7ed3\u679c\uff0c\u636e\u6b64\u9009\u62e9\u8fd0\u884c\u54ea\u4e9b\u8bc4\u6d4b\u3002\u8fd9\u91cc scoring program \u7684\u8bbe\u8ba1\u81ea\u7531\u5ea6\u6bd4\u8f83\u9ad8\u3002
\u5728 task \u7684\u7f16\u8f91\u9875\u9762\u91cc\uff0c
\u8d44\u6e90\u6587\u4ef6\u5939\u540d\u5fc5\u987b\u4e0e\u6bd4\u8d5b\u521d\u59cb\u5316\u65f6 competition.yaml
\u6307\u5b9a\u7684\u6587\u4ef6\u5939\u540d\u76f8\u540c\uff0c\u538b\u7f29\u5305\u540d\u548c\u5728\u8fd9\u91cc\u586b\u5199\u7684\u8d44\u6e90\u522b\u540d\u5219\u4efb\u610f\u3002\u4f8b\u5982\uff0c\u5728 competition.yaml
\u4e2d\u6307\u5b9a\u4e86 reference data \u7684\u6587\u4ef6\u5939\u540d\u662f ref_data
\uff0c\u90a3\u4e48\u5728\u4e0a\u4f20\u65f6\u4e5f\u9700\u8981\u5c06\u4e00\u4e2a\u540d\u4e3a ref_data
\u7684\u6587\u4ef6\u5939\u8fdb\u884c\u538b\u7f29\u3002\u4f46\u662f\u538b\u7f29\u540e\u5f97\u5230\u7684\u538b\u7f29\u5305\u540d\u5b57\u968f\u610f\uff0c\u53ef\u4ee5\u53eb AAA.zip
\u7b49\uff1b\u4e0a\u4f20\u540e\u5728 UI \u5904\u4f1a\u5141\u8bb8\u4f60\u4e3a\u8fd9\u6b21\u4e0a\u4f20\u7684\u8d44\u6e90\u8d77\u4e00\u4e2a\u522b\u540d\uff0c\u4e5f\u662f\u968f\u610f\u7684\uff0c\u53ef\u4ee5\u53eb ref_data20240925
\u7b49\u3002\u5982\u9047\u5230\u8d44\u6e90\u4e0a\u4f20\u5931\u8d25\u4f46\u65e0\u62a5\u9519\uff0c\u53ef\u4ee5\u4f18\u5148\u8003\u8651\u8fd9\u4e2a\u539f\u56e0\u3002
\u6bcf\u4e2a task \u4e2d\uff0c\u5fc5\u987b\u6dfb\u52a0\u7684\u8d44\u6e90\u662f scoring program\uff0c\u6709\u8fd9\u4e2a\u624d\u80fd\u8fd0\u884c\u3002\u53ef\u6839\u636e\u9700\u8981\u6dfb\u52a0 reference data\u3002
\u8d44\u6e90\u53ea\u6709\u5728\u6ca1\u6709\u4e0e\u4e4b\u5173\u8054\u7684 task \u65f6\u624d\u80fd\u88ab\u4ece\u8d44\u6e90\u5217\u8868\u4e2d\u5220\u9664\u3002\u5f53\u5b58\u5728\u6ca1\u6709 task \u5173\u8054\u7684\u8d44\u6e90\u65f6\uff0c\u4e0b\u9762 Quota and Cleanup \u4e2d\u4f1a\u9ad8\u4eae Delete unused datasets/programs\uff0c\u53ef\u4ee5\u70b9\u51fb\u4e00\u952e\u6e05\u9664\u3002
"},{"location":"docs/3-dl/tools/codabench/#_6","title":"\u4fee\u6539","text":"\u53ea\u652f\u6301\u901a\u8fc7 UI \u4fee\u6539\u3002\u4e0d\u80fd\u91cd\u65b0\u4e0a\u4f20 bundle\uff0c\u6bcf\u6b21\u91cd\u65b0\u4e0a\u4f20 bundle \u5c31\u89c6\u4e3a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6bd4\u8d5b\u3002
\u8fdb\u5165 Codabench \u9996\u9875 -> \u53f3\u4e0a\u89d2 Benchmark
-> Management
-> \u9009\u62e9\u4e00\u4e2a\u5df2\u6709\u7684\u6bd4\u8d5b\u53f3\u4fa7 Edit
\u6309\u94ae\u3002
\u5176\u4f59\u6b65\u9aa4\u540c\u4e0a\u65b9 ### UI \u521b\u5efa
\u4e00\u8282\u3002
Download \u4e2d\u53ef\u4ee5\u4e0b\u8f7d\u5230\u7684\u5185\u5bb9\u4e0e logs \u4e2d\u80fd\u8f93\u51fa\u7684\u5185\u5bb9\u76f8\u4f3c\uff0c\u76f4\u63a5\u67e5\u770b logs \u5373\u53ef\u3002
terminal \u7684\u5de6\u4fa7\u5206\u4e3a prediction \u548c scoring \u4e24\u79cd\uff0c\u5f53\u6709 ingestion program \u65f6\u7b2c\u4e00\u4e2a terminal \u624d\u4f1a\u6709\u8f93\u51fa\u3002stdout \u548c stderr \u5c06 terminal \u8f93\u51fa\u5206\u5f00\u4e86\uff0cstdout \u662f\u7a0b\u5e8f\u6307\u5b9a\u7684\u6b63\u5e38\u8f93\u51fa\uff0cstderr \u662f error \u8f93\u51fa\uff0c\u6709\u65f6\u5019\u4f1a\u5b58\u5728\u5176\u4e2d\u4e00\u4e2a\u6ca1\u6709\u8f93\u51fa\u7684\u60c5\u51b5\uff0c\u53ef\u5207\u6362\u67e5\u770b\u3002
Leaderboard \u7684\u7ed3\u679c\u4e0d\u4f1a\u81ea\u52a8\u66f4\u65b0\u5230 Leaderboard\uff0c\u9700\u8981\u7528\u6237\u540c\u610f\u3002\u70b9\u51fb\u8fd0\u884c\u7ed3\u679c\u53f3\u4fa7\u7684\u6309\u94ae\u66f4\u65b0\u5230 Leaderboard\u3002
"},{"location":"docs/3-dl/tools/codabench/#_8","title":"\u53c2\u8003\u8d44\u6599","text":"\u73b0\u6709\u5b98\u7f51\u53c2\u8003\u8d44\u6599\u4f3c\u4e4e\u90fd\u4e0d\u592a\u5168\u9762\uff0c\u4e0d\u80fd\u8986\u76d6\u5404\u79cd\u5e38\u89c1\u9519\u8bef\uff0c\u56e0\u6b64\u4e00\u4e9b\u521b\u5efa\u6b65\u9aa4\u548c\u884c\u4e3a\u662f\u901a\u8fc7\u6d4b\u8bd5\u548c\u63a8\u6d4b\u5f97\u77e5\u7684\u3002\u5982\u679c\u672c\u6587\u6709\u8bef\uff0c\u6b22\u8fce\u8054\u7cfb\u4f5c\u8005\u6539\u6b63\uff01
"},{"location":"docs/3-dl/tools/nlp_resources/","title":"DL & NLP Resources","text":":material-circle-edit-outline: \u7ea6 213 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u8fd9\u4e2a\u9875\u9762\u7528\u6765\u6536\u96c6 nlp \u5165\u95e8\u8d44\u6599\u7684 minimal closure\uff08\u6307\u8db3\u591f\u5b66\u4f1a\u7684\u6700\u5c0f\u8d44\u6e90\u96c6\u5408\uff09
"},{"location":"docs/3-dl/tools/nlp_resources/#machine-learning-theory","title":"Machine Learning Theory","text":"Google\u7684\u4e00\u4e2a\u6559\u7a0b\uff0c\u91cc\u9762\u7684playground\u505a\u5f97\u6bd4\u8f83\u76f4\u89c2\uff0c\u65e0\u9700\u4ee3\u7801
Machine Learning \u00a0|\u00a0 Google for Developers
"},{"location":"docs/3-dl/tools/nlp_resources/#machine-learning-technology","title":"Machine Learning Technology","text":"TODO
"},{"location":"docs/3-dl/tools/nlp_resources/#deep-learning-theory","title":"Deep Learning Theory","text":"TODO
"},{"location":"docs/3-dl/tools/nlp_resources/#deep-learning-technology","title":"Deep Learning Technology","text":"Pytorch\u6559\u7a0b\uff0c\u53ef\u4ee5\u770b\u7740\u4ee3\u7801\u624b\u6284\u4e00\u4e0b
Welcome to PyTorch Tutorials \u2014 PyTorch Tutorials 2.0.1+cu117 documentation
numpy: numpy 100 exercise
rougier/numpy-100: 100 numpy exercises (with solutions) (github.com)
Pytorch
PyTorch\u6df1\u5ea6\u5b66\u4e60\u5feb\u901f\u5165\u95e8\u6559\u7a0b\uff08\u7edd\u5bf9\u901a\u4fd7\u6613\u61c2\uff01\uff09\u3010\u5c0f\u571f\u5806\u3011_\u54d4\u54e9\u54d4\u54e9_bilibili
Attention-based Models and Transformer
Let's build GPT: from scratch, in code, spelled out. - YouTube
"},{"location":"docs/3-dl/tools/nlp_resources/#natural-language-processing-theory","title":"Natural Language Processing Theory","text":"Stanford CS224N: NLP with Deep Learning | Winter 2021 | Lecture 1 - Intro & Word Vectors - YouTube
"},{"location":"docs/3-dl/tools/nlp_resources/#natural-language-processing-technology","title":"Natural language processing technology","text":"Stanford CS 224N | Natural Language Processing with Deep Learning
"},{"location":"docs/3-dl/tools/nlp_resources/#reinforcement-learning","title":"Reinforcement Learning","text":"\u8611\u83c7\u4e66EasyRL (datawhalechina.github.io)
Codes:
boyu-ai/Hands-on-RL: https://hrl.boyuai.com/ (github.com) datawhalechina/easy-rl: \u5f3a\u5316\u5b66\u4e60\u4e2d\u6587\u6559\u7a0b\uff08\u8611\u83c7\u4e66\uff09\uff0c\u5728\u7ebf\u9605\u8bfb\u5730\u5740\uff1ahttps://datawhalechina.github.io/easy-rl/
"},{"location":"docs/3-dl/tools/nlp_resources/#computer-vision","title":"Computer Vision","text":"Computer Vision | Universit\u00e4t T\u00fcbingen (uni-tuebingen.de)
"},{"location":"docs/4-opinion/","title":"Opinions","text":":material-circle-edit-outline: \u7ea6 1 \u4e2a\u5b57
"},{"location":"docs/4-opinion/plan/","title":"Academic Plans \u5b66\u4e1a\u89c4\u5212","text":":material-circle-edit-outline: \u7ea6 27 \u4e2a\u5b57
!!! \u672c\u7ae0\u8282 bullshits \u548c exaggerations \u542b\u91cf 200%\uff0c\u76f8\u4fe1\u524d\u4e00\u5b9a\u8c28\u614e\u8c28\u614e\u518d\u8c28\u614e
"},{"location":"docs/4-opinion/plan/24fall/","title":"24fall \u7533\u8bf7\u8bb0\u5f55","text":":material-circle-edit-outline: \u7ea6 5341 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 18 \u5206\u949f
\u5199\u4e8e 2024 \u5e74 3 \u6708\u5e95\uff0c\u7ed3\u679c\u5dee\u4e0d\u591a\u51fa\u4e86\uff0c\u6839\u636e\u7ed3\u679c\u53cd\u601d\u4e0b\u5728\u7533\u8bf7\u8def\u7a0b\u4e2d\u505a\u5f97\u5bf9\u4e0e\u4e0d\u5bf9\u7684\u5730\u65b9\uff0c\u5e76\u603b\u7ed3\u4e00\u4e9b\u6709\u7528\u8d44\u6e90\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u5230\u548c\u6211\u4e00\u6837\u7eaf DIY \u7533\u8bf7\u7684\u540c\u5b66\u3002
"},{"location":"docs/4-opinion/plan/24fall/#master","title":"master \u9009\u6821","text":"master \u9009\u9879\u76ee\u4e3b\u8981\u7ecf\u5386\u4e86\u201c\u6dfb\u52a0\u5fc3\u613f\u5355\u201d+\u201c\u7b5b\u9009\u201d\u4e24\u4e2a\u6d41\u7a0b\u3002
\u201c\u6dfb\u52a0\u5fc3\u613f\u5355\u201d\u4e00\u6b65\u4e3b\u8981\u53c2\u7167 zju \u5185\u90e8\u7684\u98de\u8dc3\u624b\u518c + OpenCSApp + GlobalCS + \u5370\u8c61\uff08e.g. \u5b66\u957f\u5b66\u59d0\uff0c1p3a\uff09\u7b49\uff0c\u5148\u5217\u51fa\u5927\u7ea6\u4e09\u4e94\u5341\u4e2a\u5408\u9002\u7684\u9879\u76ee\u3002
\u201c\u7b5b\u9009\u201d\u4e00\u6b65\u4e2d\u518d\u8003\u8651\u5404\u79cd\u9650\u5236\u6761\u4ef6\uff08\u6bd4\u5982\u6211\u7684\uff1a\u5b66\u8d39\u9ad8/\u5c31\u4e1a\u5bfc\u5411\u7684/\u4e0d\u5b89\u5168\u7684/\u5f3a\u5236\u8bed\u8a00\u7684\u4e0d\u7533\uff09\uff0c\u4ee5\u53ca\u6240\u6709\u7533\u5230\u4e5f\u4e0d\u60f3\u53bb\u7684\u90a3\u79cd\u4fdd\u5e95\u9879\u76ee\u4e5f\u65e0\u9700\u7533\u8bf7\u3002 \u5b66\u8d39\u53ef\u4ee5\u53c2\u7167\u7684\u8d44\u6599\u6bd4\u5982 Compare cost of living between cities \u548c\u5404\u4e2a\u9879\u76ee\u5b98\u65b9\u62a5\u7684\u6570\u76ee\u3002
\u53e6\u5916\u5728 UCSD CS37 \u7684\u9879\u76ee\u9875\u9762\u770b\u8fc7\u201c\u5982\u679c\u786e\u5b9a\u7533\u8bf7 PhD\uff0c\u5c31\u4e0d\u8981\u7533\u8bf7 master \u4e86\u201d\uff0c\u53ef\u80fd\u80fd\u4ee3\u8868\u4e00\u90e8\u5206\u5b66\u6821\u8fd9\u4e24\u79cd\u9879\u76ee\u7684\u5b9a\u4f4d\u3002
"},{"location":"docs/4-opinion/plan/24fall/#phd","title":"PhD \u9009\u5bfc","text":"\u6211\u9996\u5148\u9760\u8ddf\u7ec4\u91cc\u540c\u884c\u8ba4\u8bc6\u7684\u5b66\u957f\u5b66\u59d0\u4ea4\u6d41\uff0c\u88ab\u63a8\u8350\u4e86\u4e00\u4e9b\u5f53\u5e74\u6b63\u5728\u62db\u751f\u7684\u4f18\u79c0 prof\u3002\u6b64\u5916\u81ea\u5df1\u4e3b\u8981\u53c2\u8003\u4e86 CSrankings\uff0c\u6328\u4e2a\u6253\u5f00 Google Scholar \u53bb\u8bfb\u6587\u7ae0\u3002\u4e5f\u6709\u53d1\u6325\u6211\u7684\u793e\u725b\u5c5e\u6027\u53bb X(twitter) \u4e0a\u628a\u5927\u5bb6\u90fd\u5173\u6ce8\u7136\u540e\u5237\u6587\u7ae0\u8fd9\u6837\u505a\u3002\u7ecf\u5e38\u5237 Arxiv \u4e5f\u662f\u597d\u4e60\u60ef\uff0c\u53ef\u60dc\u6211\u8fd8\u6ca1\u517b\u6210\u3002\u8fd9\u4e9b\u90fd\u6709\u5229\u4e8e\u773c\u719f\u6559\u6388\uff0c\u4e00\u6bb5\u65f6\u95f4\u540e\u5c31\u53ef\u5f62\u6210\u81ea\u5df1\u7684\u9009\u62e9\u3002
\u53e6\u5916\u9009\u5b66\u6821\u65f6\u5982\u9700\u53c2\u8003 Stipend\uff1aCSStipendRankings\u3002
\u6700\u7ec8 master + PhD \u6211\u4e00\u5171\u7533\u8bf7\u4e86\u4f3c\u4e4e\u662f 14 \u4e2a\uff08\u542b 3 \u4e2a\u514d\u8d39\uff09\u3002\u8fd9\u4e2a\u6570\u76ee\u56e0\u4eba\u800c\u5f02\uff0c\u4e3b\u8981\u770b\u4e0e\u63a8\u8350\u4eba\u6c9f\u901a\u3002\u8eab\u8fb9\u4e5f\u6709\u670b\u53cb\u7533\u5230 50 \u4e2a\u7684\uff0c\u60ca\u4eba\u4f46\u662f\u5c0a\u91cd\u7406\u89e3\u3002
\u6700\u65b0\u5728 24fall \u7fa4\u91cc\u770b\u5230\u7684\u9009\u5bfc\u5e08\u7684\u5176\u5b83\u5de5\u5177
\u5982\u679c\u7533\u8bf7 PhD\uff0c\u90a3\u4e48\u5927\u5bb6\u7684\u7ecf\u9a8c\u6765\u770b\u8fc7\u7ebf\u5c31\u591f\uff0c\u4e0d\u592a\u4f1a\u4e25\u5361\uff0c\u91cd\u70b9\u65e0\u9700\u5728\u8bed\u8a00\u6210\u7ee9\u3002
master \u5219\u5e94\u8be5\u662f\u8bed\u8a00\u6210\u7ee9\u8d8a\u9ad8\u8d8a\u597d\u4e86\uff0c\u5c24\u5176\u5982\u679c\u7ee9\u70b9 below average\uff0c\u90a3\u4e48\u8bed\u8a00\u786e\u5b9e\u9700\u8981\u8003\u9ad8\u4e00\u4e9b\u3002
\u4ee5\u53ca\u6211\u5728\u7533\u8bf7\u5b63\u7684\u51e0\u4e2a\u6708\u91cc\u4e00\u76f4\u6ca1\u80fd\u6253\u5f00 GRE \u7684\u5b98\u7f51\uff08\u4e0d\u662f\u5bc6\u7801\u4e0d\u6b63\u786e\uff0c\u5bc6\u7801\u901a\u8fc7\u53d1\u90ae\u4ef6\u5c31\u80fd\u627e\u56de\u6765\u4e86\uff0c\u662f\u767b\u5f55\u540e\u8df3\u8f6c\u53ea\u80fd\u5230 error \u9875\u9762\uff09\uff0c\u6362\u7f51\u6362\u8bbe\u5907\u6362\ud83e\ude9c\u90fd\u8fd8\u662f\u4e00\u76f4\u5237\u65b0\u4e0d\u51fa\u6765\uff0c\u5bfc\u81f4\u8003\u4e86\u4e5f\u6ca1\u6cd5\u67e5\u5206\uff0c\u6ca1\u6cd5\u591a\u6dfb\u52a0\u9001\u5206\u3002\u56e0\u4e3a\u4e3b\u8981\u76ee\u6807\u8fd8\u662f\u7533 PhD \u4e8e\u662f\u6700\u540e\u5c31\u4e0d\u518d\u6323\u624e\u4e86\u3002GRE \u5b98\u7f51\u662f\u7ecf\u5e38\u62bd\u98ce\u7684\uff0c\u770b\u5230\u8eab\u8fb9\u4e00\u4e9b master \u7533\u8bf7\u8005\u4f1a\u9009\u62e9\u5728\u5927\u4e09\u5c31\u628a GRE \u8003\u51fa\u6765\uff0c\u5efa\u8bae\u4e5f\u50cf\u4ed6\u4eec\u4e00\u6837\u63d0\u524d\u51c6\u5907\uff0c\u5982\u679c\u4e5f\u767b\u9646\u4e0d\u8fdb\u53bb\uff0c\u591a\u6c42\u52a9\u6c42\u52a9\u8eab\u8fb9\u7684\u4eba\u501f\u8bbe\u5907\u8bd5\u8bd5\uff0c\u6700\u597d\u63d0\u524d\u51c6\u5907\uff0c\u907f\u514d\u5230\u7533\u8bf7\u5b63\u53d1\u73b0\u5f71\u54cd\u9001\u5206\u3002
\u9001\u5206 Code \u8fd8\u6709\u4e00\u4e9b\u5e16\u5b50\u603b\u7ed3\u8fc7\u7684\uff08\u53ef\u81ea\u884c\u641c\u7d22\uff09\uff0cTG \u90fd\u662f\u7528\u7684\u662f\u540c\u4e00\u4e2a\u9001\u5206 Code\uff0c\u4ee5\u53ca GRE \u5728\u8003\u573a\u91cc\u90a3\u6b21\u514d\u8d39\u9001\u5206\u673a\u4f1a\u4e0d\u7528\u80cc\u9001\u5206 Code\uff0c\u5728\u8003\u573a\u91cc\u4e5f\u53ef\u4ee5\u6309\u6821\u540d\u641c\u7d22\u6dfb\u52a0\u7684\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_2","title":"\u63a8\u8350\u4fe1","text":"\u63a8\u8350\u4fe1\u5982\u4f55\u88ab\u5ba1\u6838\uff1a\u636e\u8bf4\u4e00\u822c\u5728\u62db\u751f\u5b98\u624b\u91cc\uff0c\u63a8\u8350\u4fe1\u662f\u4e0e\u7533\u8bf7\u8005\u7684\u5176\u5b83\u6750\u6599\u4e00\u8d77\u62fc\u6210\u4e00\u957f\u4efd\u591a\u9875 PDF \u4e00\u8d77\u88ab\u5ba1\u6838\u7684\uff0c\u51e0\u4efd\u63a8\u8350\u4fe1\u524d\u540e\u5e76\u5217\u3002\u6240\u4ee5\u5173\u4e8e\u201c\u98ce\u683c\u660e\u663e\u4e0d\u660e\u663e\u201d\u201c\u5f3a\u5ea6\u660e\u663e\u4e0d\u660e\u663e\u201d\u201c\u4f1a\u5ba1\u6587\u4ef6\u4fe1\u606f\u201d\u7b49\u95ee\u9898\u53ef\u4ee5\u60f3\u8c61\u4e00\u4e0b\u5ba1\u6750\u6599\u7684\u8fd9\u4e2a\u573a\u666f\uff0c\u4ece\u8fd9\u4e2a\u89d2\u5ea6\u6765\u8003\u8651\u3002
\u5173\u4e8e\u627e\u591a\u4f4d\u63a8\u8350\u4eba\uff1a\u5927\u7ea6 12.2 \u53f7\u770b\u5230 PhD \u7533\u8bf7\u7fa4\u91cc\u6709\u4eba\u8bf4\uff0c\u5176\u5b9e\u4e0d\u8981\u627e 3 \u4e2a\u63a8\u8350\u4eba\u5c31\u7ed3\u675f\uff0c\u6700\u597d\u63d0\u524d\u627e 4 \u5230 5 \u4e2a\uff0c\u56e0\u4e3a\u591a\u4ea4\u6ca1\u6709\u5173\u7cfb\uff0c\u5927\u90e8\u5206\u5b66\u6821\u90fd\u6709\u6dfb\u52a0\u591a\u4e2a\u63a8\u8350\u4eba\u7684\u9009\u9879\uff08\u6211\u7684\u9009\u6821\u91cc\u53ea\u6709loo\u548cumich\u4e0a\u9650\u4e09\u4e2a\uff09\uff0c\u4f46\u662f\u7ecf\u5e38\u6709\u63a8\u8350\u4eba\u5fd9\u5fd8\u4e86\u6700\u540e\u6ca1\u4ea4\u7684\u60c5\u51b5\u3002\u518d\u95ee\u53e6\u4e00\u4e2a\u7fa4\uff0c\u5f97\u77e5\u5982\u679c\u662f US PhD\uff0c\u4e0d\u4f1a\u56e0\u4e3a\u6709\u4e00\u4e2a\u63a8\u8350\u4eba\u5fd8\u4e86\u4ea4\u62d2\u4f60\uff0c\u4f46\u662f\u5927\u591a master 3 \u5c01\u4ea4\u4e0d\u9f50\u5c31\u65e0\u6cd5\u5f00\u59cb\u5ba1\u6750\u6599\uff0c\u53ef\u80fd\u56e0\u6b64\u4e00\u76f4\u7559\u5728\u6c60\u5b50\u91cc\uff0c\u6216\u8005\u53ef\u80fd\u56e0\u6b64\u9ed8\u62d2\u3002\u4e5f\u6709\u542c\u8bf4\u5982\u679c\u672c\u8be5\u4ea4 3 \u5c01\u4ea4\u4e86 4 \u5c01\uff0c\u53ef\u80fd\u56e0\u6b64\u964d\u4f4e\u5176\u4e2d\u6700\u91cd\u8981\u7684\u90a3\u5c01\u7684\u6548\u529b\uff0c\u8fd9\u70b9\u5982\u679c\u6536\u5230 >3 \u5c01\u63a8\u8350\u4fe1\u5176\u5b9e\u53ef\u4ee5\u901a\u8fc7 exclude \u4e00\u4efd\u6765\u89e3\u51b3\uff0c\u7ecf\u9a8c\u6765\u770b\u70b9 exclude \u65f6\u63a8\u8350\u4eba\u5e94\u8be5\u4e0d\u4f1a\u6536\u5230\u901a\u77e5\u3002
\u540c\u4e00\u5b66\u6821\u53ef\u4ee5\u5171\u7528\u63a8\u8350\u4fe1\u5417: \u4e00\u822c\u4e0d\u80fd\u3002\u6211\u7533\u8bf7\u7684\u5b66\u6821\u4e2d\u53ef\u4ee5\u7684\u6709
\u63a8\u8350\u4fe1\u7cfb\u7edf\u4e0d\u5927\u667a\u80fd\u7684\u5730\u65b9:
\u542c\u8bf4\u8fc7\u67e5 IP/MAC \u5730\u5740\u7684: \u76ee\u524d\u5927\u8305\u548c\u54e5\u5927\u6709\u89c1\u8fc7 DP \u6536\u5230\u5b66\u6821\u90ae\u4ef6\u8bf4\u67e5\u5230\u4fe1\u662f\u81ea\u5df1\u53d1\u7684\u3002\u636e\u6b64\u770b\u6765\u662f\u4e0d\u662f\u85e4\u6821\u4e25\u4e00\u4e9b\u3002IP/MAC addr \u5982\u679c\u67e5\u5e94\u8be5\u662f\u989d\u5916\u67e5\u7684\uff0c\u4e0d\u662f\u5ba1\u6750\u6599\u7684\u62db\u751f\u5b98\u8d1f\u8d23\u67e5\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_3","title":"\u5957\u74f7","text":"\u4e00\u5f00\u59cb\u770b\u5230\u7684\u6d88\u606f\u662f\u5957\u5230\u74f7\u624d\u80fd\u7533\u8bf7\uff0c\u540e\u6765\u770b\u5230 n+e's blog \u77e5\u9053\u4e5f\u4e0d\u4e00\u5b9a\uff0c\u5148\u6295\u4e86\u518d\u5957\u4e5f\u53ef\u4ee5\uff0c\u6709\u4e9b\u6559\u6388\u7279\u522b\u5fd9\uff0c\u53ef\u80fd\u62c5\u5fc3\u6709\u4e9b\u5b66\u751f\u804a\u4e86\u4e5f\u6ca1\u6295\uff0c\u53ef\u80fd\u503e\u5411\u5b66\u751f\u786e\u5b9e\u6295\u4e86\u518d\u804a\uff0c\u6216\u8005\u7b49\u5230\u4ed6\u4eec\u81ea\u5df1\u4ece\u6c60\u5b50\u91cc\u635e\u4eba\u7684\u65f6\u95f4\u7ebf\u518d\u804a\u3002\u4e5f\u53ef\u4ee5\u53c2\u8003\u5f3a prof \u548c\u5f3a committee \u5b66\u6821\u7684\u4e00\u4e9b\u540d\u5355\uff08\u76ee\u524d\u770b\u5230\u4e00\u4e2a CS PhD\u5f3acommittee&\u5f3aprofessor List(\u4ec5\u4f9b\u53c2\u8003) \u4e0d\u8fc7\u4e0d\u4e00\u5b9a\u5f88\u51c6\uff0c\u5370\u8c61\u4e2d\u91cc\u9762\u8bf4\u662f\u5f3a committee \u7684\u4e00\u4e9b\u4e5f\u6709\u4e0e prof \u804a\u597d\u5c31\u5f55\u4e86\u7684 DP\uff09\u3002
double \u7684\u7fa4\u91cc\u8fd8\u6709\u4e2a\u670b\u53cb\u505a\u4e86\u4e2a\u533f\u540d google docs \u4f9b\u7fa4\u53cb\u5206\u4eab\u62ff\u5230\u9762\u8bd5\u7684\u5927\u81f4\u65f6\u95f4\u6bb5\uff0c\u5171\u4eab\u5404\u5b66\u6821\u9762\u8bd5\u53d1\u5230\u4ec0\u4e48\u8fdb\u5ea6\u4e86\uff0c\u53ef\u60dc\u8be5\u8868\u683c\u4e0d\u5e0c\u671b\u88ab\u5916\u4f20\u3002\u4ee5\u540e\u7684\u7533\u8bf7\u7fa4\u91cc\u5927\u5bb6\u4e5f\u53ef\u4ee5\u81ea\u53d1\u521b\u5efa\u4e00\u4e2a\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_4","title":"\u7f51\u7533","text":"\u5bfb\u627e\u7f51\u7533\u9875\u9762\u7684\u901a\u7528\u505a\u6cd5\u4e00\u822c\u662f\u641c\u7d22\u5f15\u64ce\u641c\u7d22 \u5b66\u6821\u548c program \u540d\u5b57
+ application
\uff0c\u7ed3\u679c\u524d\u51e0\u6761\u4e2d\u4e00\u822c\u5c31\u542b\u6b63\u786e\u7684\u7533\u8bf7\u754c\u9762\u3002\u7f51\u7533\u5185\u5bb9\u611f\u89c9\u8fd8\u662f\u9700\u8981\u81ea\u5df1\u586b\uff0c\u4e0d\u8981\u627e\u4ee3\u586b\uff0c\u4fe1\u606f\u5f88\u591a\uff0c\u975e\u672c\u4eba\u4e0d\u719f\u6089\u592a\u5bb9\u6613\u586b\u9519\u4e86\u3002
\u4e0b\u9762\u8bb0\u5f55\u4e00\u4e9b program-specific \u7684\u5751\u70b9\u3002
CMU: \u5982\u679c\u76f4\u63a5\u641c\u7d22 MLT application \u51fa\u73b0\u7684\u4ee5\u4e0b\u9875\u9762\u53ca\u7533\u8bf7\u94fe\u63a5\u662f\u627e\u4e0d\u5230MLT\u9879\u76ee\u7684
Application Management (cmu.edu) \u8fd9\u4e2a\u9875\u9762\u548c\u4ee5\u4e0b\u622a\u56fe\u662f\u6b63\u786e\u7684\uff0c\u540c\u7406mscv\u548cmsaii\u4ec0\u4e48\u7684\u9879\u76ee\u4e5f\u5728\u8fd9\u91cc\u7533\u8bf7\u3002
mscs \u7684 video essay \u662f\u63d0\u524d\u5f55\u597d\u4e86\u4e0a\u4f20\u5230 youtube \u8fd9\u79cd\u7684\uff0c\u53ef\u4ee5\u81ea\u5df1\u968f\u610f\u5f55\u591a\u6b21\uff0c\u4f46\u6211\u4f30\u8ba1\u4e0d\u8981\u62fc\u63a5\u75d5\u8ff9\u592a\u91cd\uff0c\u4e00\u53e3\u6c14\u8bf4\u4e0b\u6765\u6700\u597d\u3002\u5185\u5bb9\u6211\u8bb0\u5f97\u6ca1\u6709\u9650\u5236\uff0c\u968f\u610f\u8bbe\u8ba1\u81ea\u6211\u4ecb\u7ecd\uff0c\u636e\u8bf4\u4e3b\u8981\u662f\u4e3a\u4e86\u770b\u7533\u8bf7\u4eba\u6027\u683c\u3001\u53e3\u8bed\u3001\u8868\u8fbe\u80fd\u529b\u4e4b\u7c7b\u7684\u6f5c\u5728\u7279\u70b9\u3002
\u5728\u7ec6\u5206\u7684\u90a3\u51e0\u4e2a ai \u9879\u76ee\u7684 video earry \u662f\u9650 3 \u6b21\u673a\u4f1a\uff0c\u6bcf\u6b21\u968f\u673a\u95ee\u9898\uff0c\u9650\u65f6\u51c6\u5907\uff0c\u9650\u65f6\u8bf4\u3002\u6211\u770b\u5230\u7684\u7f51\u4e0a\u7684\u5e16\u5b50\u8bf4\u597d\u50cf miis ini ece\uff08\u8bb0\u4e0d\u4f4f\u8fd9\u51e0\u4e2a\u9879\u76ee\u540d\u5b57\uff0c\u603b\u4e4b\u7c7b\u4f3c\uff09\u662f 30s \u51c6\u5907\uff0c180s \u8bf4\uff0c\u95ee\u7684\u95ee\u9898\u5927\u7c7b\u6709\uff1a\u4f60\u961f\u53cb\u600e\u4e48\u8bc4\u4ef7\u4f60\uff0c\u4f60\u6536\u5230\u7684\u961f\u53cb\u7684\u4e00\u6761\u8d1f\u9762\u8bc4\u4ef7\u662f\uff0c\u4f60\u600e\u4e48\u9886\u5bfc project\uff0c\u4e00\u4e2a\u6210\u529f\u7684 project \u5bf9\u4f60\u6765\u8bf4\u662f\u600e\u6837\u7684\uff0c\u4f60\u559c\u6b22\u4ec0\u4e48\u6c9f\u901a\u6a21\u5f0f\uff0c\u5bf9\u4f60\u6765\u8bf4\u4ec0\u4e48\u662f\u5f88\u96be\u505a\u7684\u51b3\u5b9a\uff0c\u4f60\u9047\u5230\u632b\u6298\u4e86\u4f1a\u600e\u4e48\u6837...\u8fd9\u79cd\u5f88\u8ddf course project \u548c\u5408\u4f5c\u6709\u5173\u7684\u3002
\u4f46\u662f\u6211\u5728 mlt \u91cc\u6253\u5f00\u9047\u5230\u7684\u662f 10s \u51c6\u5907\uff0c210s \u8bf4\uff0c\u9047\u5230\u7684\u4e24\u4e2a\u95ee\u9898\u4f9b\u53c2\u8003:
\u8fd9\u6837\u5f88\u7814\u7a76\u5bfc\u5411\u7684\u95ee\u9898\uff0c\u4e00\u822c\u90fd\u6765\u81ea SoP\u3002
UWaterloo: \u7533\u8bf7\u5206\u4e3a\u4e24\u4e2a\u9636\u6bb5\uff0c\u7b2c\u4e00\u4e2a\u9636\u6bb5\u91cc\u4ea4\u6389\u624d\u80fd\u5728\u7b2c\u4e8c\u4e2a\u9636\u6bb5\u4e0a\u4f20 cv \u6587\u4e66 \u8bed\u8a00\u6210\u7ee9\u7b49\u4e1c\u897f\uff0c\u7b2c\u4e8c\u9636\u6bb5\u7684\u94fe\u63a5\u4f1a\u5728\u7b2c\u4e00\u9636\u6bb5\u540e 2-4 \u5929\u6536\u5230\u3002\u7533\u8bf7\u8d39\u5728\u7b2c\u4e00\u9636\u6bb5\u4ea4\u3002\u63a8\u8350\u4eba\u5728\u7b2c\u4e00\u9636\u6bb5\u6dfb\u52a0\uff0c\u90ae\u4ef6\u968f\u7740\u7b2c\u4e00\u9636\u6bb5\u63d0\u4ea4\u88ab\u53d1\u51fa\u3002\u7b2c\u4e00\u4e2a\u9636\u6bb5\u4e00\u5b9a\u8981\u6bd4 ddl \u63d0\u524d\u4e24\u4e09\u5929\u4ea4\u3002\u4e14 loo \u7684\u7cfb\u7edf\u597d\u50cf\u7ef4\u62a4\u6bd4\u8f83\u9891\u7e41\uff0c\u53ef\u4ee5\u591a\u9884\u7559\u4e00\u4e9b\u65f6\u95f4\u3002
UT-Austin: \u540c\u7533\u8bf7\u5206\u4e3a\u4e24\u4e2a\u9636\u6bb5\uff0c\u7b2c\u4e00\u4e2a\u9636\u6bb5\u4ed8\u6b3e\uff0c\u5ba1\u6838 1-3 \u5929\u540e\u624d\u80fd\u5f00\u59cb\u7b2c\u4e8c\u4e2a\u9636\u6bb5\uff08\u542b\u6dfb\u52a0\u63a8\u8350\u4eba\u7b49\uff09\u3002\u7b2c\u4e00\u9636\u6bb5\u63d0\u4ea4\u4e00\u5b9a\u8981\u6bd4 ddl \u65e9\u4e24\u4e09\u5929\u3002
Umich\uff1a\u7f51\u7533\u7cfb\u7edf\u4e00\u5f00\u59cb\u56db\u4e94\u4e2a\u9875\u9762\u8981\u987a\u5e8f\u586b\u5b8c\uff08\u5305\u62ec\u6dfb\u52a0\u63a8\u8350\u4eba\u7684\u90e8\u5206\uff09\uff0c\u540e\u9762\u7684\u9875\u9762\u624d\u80fd\u8df3\u7740\u586b\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_5","title":"\u6587\u4e66","text":"\u6211\u5199\u6587\u4e66\u4e3b\u8981\u53c2\u7167\u7684\u8d44\u6599\u6709 CS-SOP, CMU sop guideline, \u548c\u4e24\u4e09\u4f4d\u5b66\u957f\u5b66\u59d0\u548c peer \u7684\u4fee\u6539\u610f\u89c1\u3002
CV \u6211\u8ba4\u4e3a\u4e00\u822c\u5927\u5bb6\u505a\u51fa\u6765\u7684\u90fd\u6ca1\u95ee\u9898\uff0c\u5c11\u91cf\u503c\u5f97 comment \u7684\u4e00\u4e9b\u70b9\u6709\uff1a
(1) \u8d1f\u8d23\u4ec0\u4e48 (2) \u9047\u5230\u4e86\u4ec0\u4e48\u95ee\u9898 (3) \u81ea\u5df1\u63d0\u51fa\u4e86\u4ec0\u4e48\u65b9\u6cd5\u6765\u89e3\u51b3 (4) \u8fbe\u5230\u4e86\u600e\u6837\u7684\u91cf\u5316\u7684\u7ed3\u679c
\u7684\u516c\u5f0f\u6765\u5206\u4e3a\u4e09\u56db\u4e2a\u5c0f\u70b9\u5199\u3002\u8fd9\u6837\u5927\u81f4\u4fdd\u8bc1\u4e86\u591a\u6761\u7ecf\u5386\u7684\u683c\u5f0f\u6574\u9f50\uff0c\u4e14\u6bd4\u8f83\u660e\u786e\u81ea\u5df1\u7684\u8d21\u732e\uff0c\u89c2\u611f\u4e0a\u4f1a\u6e05\u6670\u4e9b\u3002SOP
SOP \u53ef\u4ee5\u7406\u89e3\u4e3a\u5173\u4e8e\u81ea\u5df1\u5b66\u672f\u7ecf\u5386\u548c\u8ba1\u5212\u7684\u4e00\u4efd\u6587\u4e66\u3002\u7ecf\u9a8c\u6765\u770b\u5982\u679c\u4e00\u4e9b\u5b66\u6821\u53ea\u8981\u6c42 PS \u4e0d\u8981\u6c42 SOP\uff0c\u90a3\u4e48 PS \u5e94\u5f53\u5f53\u4f5c\u4e00\u4e2a\u683c\u5f0f\u4e0d\u90a3\u4e48\u4e25\u683c\u7684 SOP \u6765\u5199\u3002
\u6240\u6709\u9879\u76ee\u7684\u6587\u4e66\u52a0\u8d77\u6765\u5927\u7ea6\u751f\u4ea7\u4e86\u8fd1 20 \u4efd\uff0c\u5176\u4e2d\u5982\u679c\u5185\u5bb9\u76f8\u4f3c\u7684\u5408\u5e76\u4e3a\u540c\u4e00\u4efd\uff0c\u90a3\u5927\u6982\u4e5f\u6709\u516d\u4e03\u4efd\u5b8c\u5168\u4e0d\u540c\u7684\u3002\u4e00\u4e2a\u6709\u70b9\u7384\u5b66\u7684\u611f\u89c9\u662f\u6211\u4e13\u95e8\u4e3a\u5176\u5199\u4e86\u4e00\u4efd\u65b0\u6587\u4e66\u7684\u9879\u76ee\uff0cPhD \u5bfc\u5e08\u5c31\u53d1\u4e86\u9762\u8bd5\uff0cmaster \u5c31\u53d1\u4e86 offer\uff0c\u800c\u4ece\u522b\u7684\u9879\u76ee\u6539\u6539\u800c\u6765\u7684\u90a3\u4e9b\u4e00\u5b9a\u6ca1\u6709\u53d1\u9762\u8bd5/\u62ff offer\u3002\u6709\u53ef\u80fd\u56e0\u679c\u5173\u7cfb\u6709\u201c\u6211\u611f\u89c9\u4e0d\u4f1a\u4e2d/\u4e0d\u662f\u7279\u522b\u5408\u9002\u201d -> \u201c\u56e0\u6b64\u66f4\u52a0\u6ca1\u6709\u8ba4\u771f\u51c6\u5907\u6587\u4e66\u201d -> \u201c\u56e0\u6b64\u5f53\u7136\u62ff\u4e0d\u5230\u201d\u8fd9\u4e00\u5c42\u3002
\u4e00\u822c\u662f\u81ea\u5df1\u62df\u597d\u8349\u7a3f\u540e\u4ea4\u7ed9\u5b66\u957f\u5b66\u59d0\u6216 peer \u6765\u6539\uff0c\u540e\u6765\u8d76 ddl \u5927\u5bb6\u90fd\u6bd4\u8f83\u5fd9\uff0c\u6709\u4e9b\u5c31\u81ea\u5df1\u5199\u597d\u76f4\u63a5\u4ea4\u4e86\u3002\u5012\u662f\u89c9\u5f97\u81ea\u5df1\u5199\u5b8c\u6709\u6ca1\u6709\u627e\u4eba review \u8fd9\u70b9\u5bf9\u7ed3\u679c\u7684\u5f71\u54cd\u6ca1\u6709\u5f88\u5927\uff0cPhD \u5bfc\u5e08\u4eec\u4e5f\u8868\u793a\u770b\u91cd\u7684\u66f4\u591a\u662f\u65b9\u5411 match \u4e0d match\uff0c\u4fe1\u606f\u8868\u8fbe\u6b63\u786e\u5230\u4f4d\u662f\u6700\u91cd\u8981\u7684\uff0c\u8bed\u8a00\u7f8e\u5316\u5012\u5728\u5176\u6b21\u3002\u4e14\u4e00\u4e9b\u5b66\u6821\uff08Waterloo, UW, Uchi\uff09\u6587\u4e66\u4e5f\u4f1a\u9650\u5236 500/1000 words\uff0c\u8fd9\u6837\u77ed\u7684\u9650\u5236\u91cc\u786e\u5b9e\u8868\u8fbe\u4e0d\u4e86\u591a\u5c11\uff0c\u4e5f\u8bf4\u660e\u4f20\u8fbe\u4fe1\u606f\u662f\u7b2c\u4e00\u4f4d\u7684\u3002\u81ea\u5df1\u5199\u4e5f\u6709\u4e00\u5957\u6bd4\u8f83\u9ad8\u6548\u7684\u6d41\u7a0b\uff0c\u7075\u611f\u6765\u6e90\u4e8e\u5927\u4e00\u4e0a EW1 \u7684\u9b54\u9b3c\u5916\u6559\u8001\u5e08\u8bb2\u7684 shitty first draft \u6982\u5ff5\uff1a\u7b2c\u4e00\u7a3f\u96be\u4e0b\u624b\u5e38\u5e38\u662f\u56e0\u4e3a\u60f3\u8981\u540c\u65f6\u517c\u987e\u4fe1\u606f\u548c\u8868\u8fbe\uff0c\u90a3\u4e48\u628a\u4e24\u4ef6\u4e8b\u62c6\u5f00\uff0c\u7b2c\u4e00\u7a3f\u5148\u4e00\u53e3\u6c14\u5199\u51fa\u4e2a\u8868\u8fbe\u4fe1\u606f\u5168\u9762\u6b63\u786e\u4f46\u7528\u8bed\u975e\u5e38 shitty \u7684\u6587\u7ae0\uff0c\u7b2c\u4e8c\u7a3f\u53ea\u987e\u4f18\u5316\u8868\u8fbe\uff0c\u90a3\u5c31\u4e0d\u4f1a\u5361\u58f3\u3002\u6211\u5199\u7684\u6d41\u7a0b\u4e5f\u5927\u81f4\u662f\u8fd9\u6837\uff0c\u5148\u628a\u6240\u6709\u60f3\u8868\u8fbe\u7684\u4fe1\u606f\u5410\u51fa\u6765\uff0c\u5f62\u6210\u4e00\u7bc7\u81f3\u5c11\u957f\u5f97\u50cf\u6587\u7ae0\u7684\u6587\u7ae0\uff08\u4f46\u751a\u81f3\u4e0d\u4f1a\u987e\u53ca\u7528\u4ec0\u4e48\u8bed\uff0c\u7ecf\u5e38\u4e00\u534a\u82f1\u8bed\u4e00\u534a\u4e2d\u6587\uff09\uff0c\u7136\u540e\u4e00\u6bb5\u4e00\u6bb5\u8f93\u5165 ChatGPT \u8bf7\u5b83 \"please refine this paragraph from a {\u6587\u4f53} for me: {paragraph}\"\uff0c\u518d\u4e00\u53e5\u4e00\u53e5\u6bd4\u5bf9 ChatGPT \u8f93\u51fa\u7ed3\u679c\u4e0e\u81ea\u5df1\u7684\u5199\u4f5c\uff0c\u624b\u52a8\u628a\u4e00\u4e2a\u89c9\u5f97\u66f4\u597d\u7684\u7ed3\u679c\u6572\u56de\u5230\u6587\u7ae0\u4e2d\uff08\u8fd9\u91cc\u6211\u4e2a\u4eba\u8ba4\u4e3a\u8fc7\u4e00\u904d\u8111\u5b50\u540e\u4eb2\u81ea\u51b3\u5b9a\u600e\u4e48\u6539\u662f\u6bd4\u76f4\u63a5\u590d\u5236\u66f4\u9ad8\u6548\u66f4\u660e\u667a\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a ChatGPT \u5bf9\u4e8e\u7533\u8bf7\u6587\u4e66\u7c7b\u7684\u6587\u4f53\u5e38\u5e38\u6709\u4e00\u5957\u7279\u522b\u56fa\u5b9a\u4e14\u5b98\u65b9\u7684\u7528\u8bcd\uff0c\u4f7f\u5176\u4e0d\u592a\u5408\u9002\u4e14\u592a\u5bb9\u6613\u8bc6\u522b\u51fa\u662f\u673a\u5668\u5199\u7684\uff09\u3002\u6700\u540e\u628a\u8fd9\u904d\u81ea\u5df1\u6539\u8fc7\u7684\u5199\u4f5c\u8fc7\u4e00\u904d grammarly \u68c0\u67e5\u8bed\u6cd5\uff0c\u7b80\u5355\u68c0\u67e5\u540e\u5c31\u57fa\u672c\u53ef\u4ee5\u5b9a\u7a3f\u4e86\u3002
\u6b64\u5916\u8fd8\u6709\u4e00\u70b9\u662f\uff0c\u6211\u4e2a\u4eba\u8ba4\u4e3a\u5728\u5ba1\u6587\u4e66\u65f6\u6bcf\u4efd\u6587\u4e66 5-10 \u5206\u949f\uff0c\u53ef\u80fd\u6240\u6709\u4eba\u80fd\u4e00\u773c\u770b\u5230\u7684\u662f (1) \u5c0f\u6807\u9898 (2) \u52a0\u7c97\u7684\u5173\u952e\u8bcd\uff0c\u6700\u540e\u624d\u4f1a\u7ec6\u770b\u5927\u91cf\u666e\u901a\u6587\u5b57\u3002\u4e00\u4e2a\u4f8b\u5b50\u662f\u6211\u4e0a\u6b21\u53c2\u52a0\u4e00\u95e8\u8bfe\u7684 group tutorial \u65f6\uff0c\u5f53\u65f6\u5c0f\u7ec4\u6210\u5458\u5408\u5199\u4e86\u4e00\u4efd rp\uff0c\u5176\u4e2d\u6211\u5199\u7684\u662f\u6700\u6666\u6da9\u7684 lit review\uff0c\u5373\u4e13\u4e1a\u672f\u8bed\u5bc6\u5ea6\u6700\u9ad8\u8fd8\u53e5\u5b50\u6700\u957f\uff0c\u4f46\u662f\u6211\u7ed9\u6bcf\u4e2a\u5206\u4e3b\u9898\u52a0\u4e86\u5c0f\u6807\u9898\uff0c\u5176\u5b83\u540c\u5b66\u5199\u7684\u90e8\u5206\u6ca1\u6709\u52a0\u3002\u8001\u5e08\u5728\u4e0e\u6211\u4eec\u8c08\u8bdd\u7684\u95f4\u9699\u7784\u4e86\u51e0\u773c\u6211\u4eec\u7684\u6587\u4ef6\uff0c\u77ed\u77ed\u7684\u65f6\u95f4\u91cc\u5c31\u53ea\u770b\u8fdb\u53bb\u4e86 lit review \u7684\u5c0f\u6807\u9898\uff0c\u70b9\u8bc4\u4e86\u4e00\u4e0b\u8fd9\u90e8\u5206\u3002\u56e0\u6b64\u505a\u6e05\u6670\u7684\u5206\u6bb5\u548c\u5c0f\u6807\u9898\u5f88\u91cd\u8981\uff08\u8fd9\u91cc\u771f\u7684\u6709\u70b9\u50cf\u8bbe\u8ba1\u56db\u539f\u5219\uff0c\u5bf9\u6bd4/\u805a\u5408\uff09\uff0c\u5c24\u5176\u662f\u65f6\u95f4\u7cbe\u529b\u4e0d\u591f\u65f6\uff0c\u5176\u4e2d\u7684\u7ec6\u8282\u5185\u5bb9\u8bf4\u4e0d\u5b9a\u4e0d\u7528\u62a0\u592a\u7ec6\uff0c\u53ef\u80fd\u62db\u751f\u5b98\u548c prof \u5728\u77ed\u6682 review \u7684\u65f6\u95f4\u91cc\u6355\u6349\u5230\u7684\u4fe1\u606f\u4e5f\u53ea\u6709\u5c11\u91cf\u6700\u663e\u773c\u7684\u3002\u56e0\u6b64\u6211\u7684\u6bcf\u4efd\u6587\u4e66\u90fd\u505a\u4e86\u52a0\u7c97 \\noindent \u8fd9\u6837\u7684\u5c0f\u6807\u9898\u6765\u5f15\u5bfc\u62db\u751f\u5b98\uff0c\u4e0d\u77e5\u9053\u5408\u4e0d\u5408\u89c4\uff0c\u4f46\u662f\u5e94\u8be5\u4e5f\u6ca1\u6709\u89c4\u77e9\uff0c\u4e14 CS-SOP \u4e0a\u4e0d\u5c11\u6587\u4e66\u4e5f\u662f\u8fd9\u6837\u52a0\u5c0f\u6807\u9898\u5199\u7684\uff0c\u6211\u8ba4\u4e3a\u8fd9\u6837\u6bd4\u8f83\u6709\u5229\u6240\u4ee5\u5c31\u8fd9\u6837\u505a\u597d\u4e86\u3002
\u9644\u81ea\u5df1\u9605\u8bfb CS-SOP \u540e\u5199\u81ea\u5df1\u7684 SOP \u524d\uff0c\u7ed9\u81ea\u5df1\u5199\u7684\u7ed3\u6784\u6307\u5bfc
\u7b2c\u4e00\u6bb5\uff1axxx \u662f\u5f88\u91cd\u8981\u7684\uff0c\u6211\u4e00\u76f4\u5bf9 xxx \u611f\u5174\u8da3\uff0c\u6211\u9009\u62e9\u5728 x \u6821\u8bfb phd is naturally a continuation of my previous interests and experiences\u3002\u5177\u4f53\u800c\u8a00\uff0c\u6211\u7684\u7814\u7a76\u5174\u8da3\u4e3a\uff1a ( \u6b64\u5904\u53ef\u4ee5\u6709\u5c0f\u6807\u9898\u548c\u4e00\u53e5\u8bdd\u4ecb\u7ecd \\1. AAA aaaa \\2. BBB bbbb \\3. CCC cccc )
\u7b2c\u4e8c\u6bb5\uff1aAAA \uff08\u5c0f\u6807\u9898\u53ef\u4ee5\u5199\u5b8c\u4e00\u6574\u6bb5\u540e\u6700\u540e\u518d\u8d77\uff09
\u7b2c\u4e09\u6bb5\uff1aBBB \u540c\u4e0a
\u6211\u5728\u5199\u6587\u4e66\u4e4b\u524d\uff0c\u4e00\u76f4\u8ba4\u4e3a\u6211\u7684\u8fc7\u53bb\u7814\u7a76\u7ecf\u5386\u4e0e\u6211\u672a\u6765\u7684\u76ee\u6807\u65b9\u5411\u4e0d\u76f8\u4f3c\uff0c\u4f46\u662f\u6700\u540e push \u81ea\u5df1\u5fc5\u987b\u53bb\u5bfb\u627e\u4e00\u4e2a\u5e73\u8861\u70b9\uff0c\u5bfb\u627e\u80fd\u628a\u5b83\u4eec\u90fd\u6982\u62ec\u4f4f\u7684\u4e24\u4e09\u4e2a\u5c0f\u6807\u9898\u3002\u8fd9\u4e24\u4e09\u4e2a\u5c0f\u6807\u9898\u7684\u9009\u62e9\u9996\u5148\u8981\u670d\u52a1\u4e8e\u672a\u6765\u65b9\u5411\uff0c\u7136\u540e\u56e0\u4e3a\u8fc7\u53bb\u7684\u6bcf\u4e2a\u9879\u76ee\u4e0d\u53ef\u80fd\u53ea\u6709\u4e00\u4e2a\u5c5e\u6027/\u9886\u57df\uff0c\u53ef\u4ee5\u9009\u62e9\u80fd\u591f\u670d\u52a1\u4e8e\u672a\u6765\u65b9\u5411\u7684\u65b9\u9762\u6765\u652f\u6491\u8fd9\u4e9b\u5c0f\u6807\u9898\uff0c\u7528\u201c\u6211\u53d7\u5230\u4e86 xx \u65b9\u9762\u7684\u542f\u53d1\u201d\u201c\u5728\u505a\u8be5\u9879\u76ee\u7684\u65f6\u5019\u4e00\u76f4\u5728\u601d\u8003\u67d0\u65b9\u9762\u4e0d\u8db3\u201d\u4e4b\u7c7b\u7684\u8bdd\u8fde\u63a5\u8d77\u6765\u3002\u6700\u540e\u7684\u611f\u609f\u662f\u5199\u4f5c\u6587\u4e66\u7684\u8fc7\u7a0b\uff08\u63cf\u8ff0\u81ea\u5df1\u7684\u8fc7\u7a0b\uff09\u5373\u8ba4\u8bc6\u548c\u5b9a\u4e49\u81ea\u5df1\u8fc7\u53bb\u7684\u7814\u7a76\u7684\u8fc7\u7a0b\uff0c\u611f\u89c9\u5199\u5b8c\u540e\u6211\u5bf9\u4e4b\u524d\u7814\u7a76\u7684\u8ba4\u8bc6\u4e5f\u786e\u5b9e\u53d8\u6210\u4e86\u8fde\u8d2f\u7684\u4e00\u4e2a\u6574\u4f53\uff0c\u4e14\u4ea7\u751f\u4e86\u4e00\u4e9b\u5bf9\u672a\u6765\u7814\u7a76\u7684\u542f\u53d1\u3002
\u4ee5\u53ca\u90e8\u5206\u9879\u76ee\u4e5f\u4f1a\u5728\u7f51\u7533\u9875\u9762\u7ed9\u51fa\u6587\u4e66\u5199\u4f5c\u6307\u5bfc\uff08e.g. UCSD, CMU\uff09\uff0c\u53ef\u7559\u610f\u9605\u8bfb\u8fd9\u4e9b\u6307\u5bfc\uff0c\u6309\u5177\u4f53\u9879\u76ee\u7684\u6765\u589e\u5220\u6539\u3002
PS
\u5982\u4e0a\u6587\u63d0\u5230\uff0c\u5982\u679c\u90e8\u5206\u5b66\u6821\u53ea\u8981\u6c42\u4e00\u4efd PS\uff0c\u90a3\u4e48\u5e94\u5f53\u662f\u9700\u8981\u5f53\u4f5c SOP \u6765\u5199\u5b66\u672f\u548c\u804c\u4e1a\u5185\u5bb9\u7684\u3002\u6211\u662f\u8fd9\u6837\u89c4\u5212\u7ed3\u6784\u7684\uff1a
\u5982\u679c PS \u548c SOP \u540c\u65f6\u9700\u8981\uff0c\u90a3\u4e48 PS \u7528\u6765\u8bb2\u6545\u4e8b\u6bd4\u8f83\u597d\u3002\u6211\u6ca1\u6709\u8bbe\u8ba1\u4e00\u4efd\u901a\u7528\u7684\u6545\u4e8b\uff0c\u57fa\u672c\u662f\u770b\u9879\u76ee\u8981\u6c42\u3001\u5f55\u53d6\u504f\u597d\u7136\u540e\u5199\u5bf9\u5e94\u7684\u6545\u4e8b\uff0c\u6bd4\u5982 NEU MSCS \u6211\u5199\u4e86\u4e00\u7bc7\u201c\u81ea\u5df1\u5982\u4f55\u4e00\u76f4\u559c\u6b22 cs \u5e76\u4e00\u70b9\u4e00\u70b9\u505a\u5f00\u6e90\u9879\u76ee\u201d\u7684\u6545\u4e8b\uff0cRice \u8ba9\u5199\u4e00\u4e2a\u514b\u670d\u56f0\u96be\u7684\u6545\u4e8b\uff0c\u6211\u5c31\u5199\u6211\u53d7\u5230\u4e86\u4e00\u4e9b\u4e13\u4e1a\u6b67\u89c6\u4f46\u8fd8\u662f\u52aa\u529b\u53bb\u53c2\u4e0e CS \u8bfe\u7a0b\u548c\u793e\u7fa4\u7684\u7ecf\u5386\u3002\u8fd9\u4e24\u6bb5\u90fd\u662f\u6bd4\u8f83\u4e2a\u4eba\u5316\uff0c\u6709\u70b9 emotional\uff0c\u4f46\u662f\u4e3b\u9898\u53c8\u8ddf\u4e2a\u4eba\u54c1\u8d28\u548c\u5b66\u4e1a\u6709\u5173\u7684\uff0c\u6839\u636e\u9762\u8bd5\u6216 offer \u7b49\u9014\u5f84\u7684\u53cd\u9988\u6765\u770b\u611f\u89c9\u62db\u751f\u5b98\u8fd8\u6bd4\u8f83\u770b\u597d\u3002
\u6210\u7ee9\u5355
\u628a\u6210\u7ee9\u5355\u5217\u4e3a\u6587\u4e66\u662f\u56e0\u4e3a\u6211\u4ea4\u4e86\u4e00\u4efd\u975e\u5e38\u4e0d\u5bfb\u5e38\u7684\u6210\u7ee9\u5355\uff0c\u5728\u6210\u7ee9\u5355\u524d\u9762\u9644\u4e86 4 \u9875 cover letter \u8bba\u8ff0\u6211\u8fd9\u51e0\u5e74\u901a\u52e4\u7389\u6cc9\u5927\u6982\u82b1\u8d39\u603b\u65f6\u95f4\u591a\u5c11\uff0c\u6211\u7684\u603b\u5b66\u5206\u6bd4\u522b\u4eba\u591a\u591a\u5c11\uff0c\u6211\u7533\u8bf7\u540e\u6bd5\u4e1a\u524d\u9884\u8ba1\u5b8c\u6210\u7684\u8bfe\u7a0b\u8fd8\u6709\u54ea\u4e9b\uff0c\u603b\u4e4b\u786e\u5b9e\u4e0a\u8bfe\u7684\u5de5\u4f5c\u91cf\u5927\uff0c\u5e0c\u671b\u62db\u751f\u5b98\u4e5f\u80fd\u8003\u8651\u8fd9\u4e2a\u56e0\u7d20\u7b49\u3002\u4e5f\u4e0d\u77e5\u9053\u5408\u4e0d\u5408\u89c4\uff0c\u4f46\u8fd9\u4e9b\u4e1c\u897f\u786e\u5b9e\u4e0d\u77e5\u9053\u54ea\u91cc\u53bb\u5199\u3002\u76ee\u524d\u8fd8\u6ca1\u6709\u76f4\u63a5\u6216\u95f4\u63a5\u7684\u53cd\u9988\u80fd\u544a\u8bc9\u6211\u8fd9\u6837\u505a\u5bf9\u4e0d\u5bf9\u6216\u597d\u4e0d\u597d\u3002
"},{"location":"docs/4-opinion/plan/24fall/#_6","title":"\u6691\u7814","text":"\u5bf9\u4e8e\u6691\u7814\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684 comment \u662f\u5982\u679c\u60f3\u7533\u5317\u7f8e PhD \u5c31\u76f4\u63a5\u53bb\u9676\u74f7\u5317\u7f8e\uff0c\u4e0d\u8981\u5728\u610f\u201c\u5317\u7f8e rank \u4e0d\u597d\u7684\u5b66\u6821\u662f\u4e0d\u662f\u4e0d\u5982\u522b\u7684\u5730\u533a rank \u597d\u7684\u5b66\u6821\u201d\uff0c\u56e0\u4e3a\u5730\u533a\u5185\u5708\u5b50\u7684\u8001\u5e08\u8fd8\u662f\u4f1a\u6bd4\u5730\u533a\u5916\u719f\u4e00\u4e9b\uff0c\u4e14\u90e8\u5206\u8001\u5e08\u6691\u7814\u7684\u98ce\u683c\u662f\u628a\u597d\u5b66\u751f\u63a8\u5411\u66f4\u597d\u7684\u8001\u5e08\u4ee5\u5efa\u7acb\u5b66\u672f connection\u3002\u4ee5\u53ca\u867d\u7136\u5728\u5317\u7f8e onsite \u7814\u7a76\u786e\u5b9e\u5bf9\u793e\u4ea4\u6709\u5229\uff0c\u4f46\u6761\u4ef6\u5f88\u96be\u5177\u5907\uff0c\u56e0\u4e3a\u7b7e\u8bc1\u529e\u7406\u96be\u5ea6\u5927\uff0c\u5bf9\u6559\u6388\u6765\u8bf4\u5e38\u5e38\u6295\u5165\u5927\u4e8e\u56de\u62a5\uff0c\u5b66\u751f\u9002\u5e94\u6210\u672c\u4e5f\u9ad8\uff0c\u4e0d\u4e00\u5b9a\u80fd\u6709\u5229\u4e8e\u6548\u7387\uff0c\u6240\u4ee5\u5982\u679c\u6709 prof \u8ddf\u6211\u8bf4\u4e0d\u613f\u4e3a\u6211\u529e\u7b7e\u8bc1\u6211\u662f\u80fd\u7406\u89e3\u7684\u3002online \u6548\u529b\u4e5f\u4e0d\u4f4e\u7684\u3002
\u5e38\u5e74\u5f00\u653e\u7684\u51e0\u4e2a\u6691\u7814\uff08\u4e0d\u5168\u9762\uff0c\u5efa\u8bae\u591a\u65b9\u53c2\u8003\uff0c\u66f4\u5efa\u8bae\u5927\u80c6\u76f4\u63a5\u90ae\u4ef6\u5957\u74f7\uff09
https://github.com/zhanglj37/Tutorial-on-PhD-Application
"},{"location":"docs/4-opinion/plan/asundergrad/","title":"As An Undergrad \u672c\u79d1\u7684\u4e00\u8def\u8d70\u6765","text":":material-circle-edit-outline: \u7ea6 284 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
\u4e00\u5207\u8981\u4ece\u5927\u5b66\u662f\u4ec0\u4e48\u7684\u5b9a\u4e49\u8c08\u8d77
\u662f\u5426\u6709\u5fc5\u8981\u8c08\u8fd9\u4e48\u6839\u672c\uff1f\u6709
\u3002\u3002\u3002\u6551\u547d
\u5148\u5806\u79ef\u4e00\u4e9b\u60f3\u5bf9\u672a\u6765\u7684\u81ea\u5df1\u8bf4\u7684\u53e5\u5b50\u5427
\u53c8\u56de\u5bb6\u770b\u5230\u8001\u5e08\u5728\u4f53\u7cfb\u7fa4\u6f47\u6d12\u7559\u4e0b\u4e00\u884c\uff1a\u201c\u8981\u5728\u6da7\u6c34\u6cc9\u58f0\u3001\u6797\u6d9b\u677e\u98ce\u3002\u201d\uff08\u6211\u6ca1\u6709\u67e5\u5230\u8fd9\u53e5\u7684\u51fa\u5904\uff0c\u7591\u4f3c\u662f\u201c\u4e00\u79cd\u5b64\u9ad8\u4e0d\u6613\u6500\uff0c\u6b64\u8eab\u53ea\u5408\u4f4f\u6df1\u5c71\u3002\u517b\u6210\u9cde\u7532\u4e3a\u9f99\u53bb\uff0c\u5316\u4f5c\u4e91\u6d9b\u5f85\u9e64\u8fd8\u3002\u58f0\u5165\u7a7a\u6797\u4eba\u5bc2\u5bc2\uff0c\u54cd\u5f52\u5e7d\u6da7\u6c34\u6f7a\u6f7a\u3002\u53ee\u5b81\u83ab\u628a\u677e\u98ce\u5356\uff0c\u7559\u5728\u5343\u5ca9\u4e07\u58d1\u95f4\u3002\u201d\u4e00\u9996\u8bd7\uff1f\uff09\u6709\u540c\u5b66\u63a5\uff1a\u6362\u4e2a\u5f62\u5f0f\u966a\u5927\u5bb6\uff0c\u90fd\u5728\u7684\u3002\u4e8e\u662f\u53c8\u611f\u5230\u4f55\u5fc5\u9053\u522b\uff0c\u6211\u5df2\u7ecf\u628a\u8fd9\u4e9b\u5e74\u5404\u4f4d\u6240\u6709\u4eba\u8d60\u4e88\u6211\u7684\u77e5\u8bc6\u3001\u6027\u683c\u3001\u89c2\u5ff5\u3001\u529b\u91cf\u5168\u90e8\u5e26\u5728\u8eab\u4e0a\u5e26\u8d70\u4e86\u3002
"},{"location":"docs/4-opinion/plan/find1job/","title":"Find a job in academia or industries?","text":":material-circle-edit-outline: \u7ea6 23 \u4e2a\u5b57
"},{"location":"docs/4-opinion/plan/find1job/#opinions","title":"Opinions","text":"In academia
"},{"location":"docs/4-opinion/plan/find1job/#-","title":"-","text":"In industries
"},{"location":"docs/4-opinion/plan/find1job/#-_1","title":"-","text":""},{"location":"docs/4-opinion/plan/find1job/#my-choice","title":"My Choice?","text":""},{"location":"docs/4-opinion/plan/find1job/#resources","title":"Resources","text":":material-circle-edit-outline: \u7ea6 1 \u4e2a\u5b57
Reference
"},{"location":"docs/4-opinion/plan/zju_ling_cs/","title":"ZJU English Major to CS","text":":material-circle-edit-outline: \u7ea6 4032 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f
\u26a0\ufe0f \u611f\u89c9\u5f53\u65f6\u5199\u5f97\u4e0d\u662f\u5f88\u597d\uff0c\u73b0\u5728\u5f88\u591a\u89c2\u5ff5\u53c8\u6709\u4e9b\u6539\u53d8\uff0c\u53ef\u80fd24\u5e74\u6625\u8282\u671f\u95f4\u7a7a\u4e0b\u6765\u4f1a\u518d\u8ba4\u771f\u6539\u4e00\u4e0borz
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_1","title":"\u672c\u6587\u6863\u662f\u4ec0\u4e48\uff1f","text":"\u7b14\u8005\u8f6c\u4e13\u4e1a\u8e29\u8fc7\u7684\u5751\u548c\u5bf9\u540e\u8f88\u7684\u5efa\u8bae\uff0c\u771f\u5fc3\u60f3\u5efa\u7acb\u8d77ZJU\u5185\u90e8\u826f\u597d\u7684\u4f20\u5e2e\u5e26\u6c1b\u56f4\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_2","title":"\u89c2\u5ff5&\u4e60\u60ef\u95ee\u9898","text":"\u5728\u5177\u4f53\u5efa\u8bae\u524d\u9996\u5148\u56de\u7b54\u4e00\u4e9b\u5e38\u6709\u7684\u62c5\u5fe7+\u505a\u4e00\u4e9b\u4e60\u60ef\u65b9\u9762\u7684\u63d0\u9192
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#cs","title":"\u6211\u80fd\u8f6c\u5230CS\u5417\uff1f","text":"\u80fd\u3002\u6709\u5982\u4e0b\u6848\u4f8b\uff08\u4e0d\u4ee3\u8868\u6240\u6709\u4eba\u613f\u610f\u88ab\u8054\u7cfb\u5230\uff0c\u4e0d\u4fdd\u8bc1\u63d0\u4f9b\u8054\u7cfb\u65b9\u5f0f\uff09
\u60f3\u8c61\u4e00\u4e2a\u7b80\u5386 \u80fd\u5728\u7b80\u5386\u4e0a\u5f88\u663e\u773c\u548c\u4e00\u4e2a\u77ed\u8bed\u4ee5\u5185\u80fd\u8868\u8ff0\u7684\u7ecf\u5386\uff0c\u624d\u8981\u52aa\u529b\u53bb\u5237\u3002 \u6bd4\u5982\u76f8\u6bd4\u4e8e\u201c\u53cc\u4e13\u4e1a\uff0c\u662f\u4e00\u4e2azju\u7279\u6709\u7684\u8f85\u4fee\uff0c\u4e0d\u6c34\u7684\uff0c\u5b83\u8981\u6c42\u7684\u8bfe\u6bd4\u8f85\u4fee\u591a\uff0c\u4f8b\u5982\u6211\u4fee\u4e86xxx\uff0c\u6211\u53ea\u662f\u6ca1\u4feexxx\u201d\u548c\u201c\u4fee\u4e86\u4e00\u534aCS\u8bfe\u4e00\u534aAI\u8bfe\u201d\uff0c\u201cCS\u53cc\u5b66\u4f4d\u201d\u5c31\u66f4\u9002\u5408\u51fa\u73b0\u5728\u7b80\u5386\u4e0a\u3002
\u505a\u91cd\u5927\u51b3\u5b9a\u65f6\uff0c\u81f3\u5c11\u54a8\u8be220\u4e2a\u4eba\u7684\u5efa\u8bae\uff0c\u8981\u4e48\u54a8\u8be2\u4e86\u89e3n\u4e2a\u4eba\u5efa\u8bae\u7684\u4eba\uff08\u6bd4\u5982\u76f8\u5e94\u884c\u4e1a\u7684\u4eb2\u4eba\u670b\u53cb\u3001\u5b66\u751f\u5f88\u591a\u7684\u8001\u5e08\uff09\u6765\u62b5n\u4e2a\u4eba\uff0c\u603b\u4e4b\u603b\u548c\u8981\u62ff\u523020\u4e2a\u4eba\u5de6\u53f3\u7684\u5efa\u8bae\u3002
\u4e0d\u662f\u7684\u3002 - \u7406\u8bba\u4e0a\u662f\u5b8c\u5168\u53ef\u4ee5\u5b66\u597d\u7684\u3002NLP\u5708\u6709\u5f88\u591a\u7814\u7a76\u8005\u8bfb\u8fc7\u8bed\u8a00\u5b66\u548cCS\u53cc\u672c\u79d1\uff0c\u4ee3\u8868AP\u6709AllenNLP Noah Smitch, Colimbia University Zhou Yu\uff08ZJU\u7684\u672c\u79d1\uff09. \u8bfb\u8bed\u8a00\u5b66\u6ca1\u6709\u803d\u8bef\u4ed6\u4eec\u7684\u8111\u5b50\uff0c\u53cd\u800c\u662f\u4e00\u4e2a\u5f88\u597d\u7684idea\u6765\u6e90\u3002\u6211\u611f\u89c9\u6709\u5f88\u591a\u5929\u624d\u7684\u6848\u4f8b\u53ef\u4ee5\u8bc1\u660e\u4eba\u7684\u77e5\u8bc6\u5bb9\u91cf\u548c\u5b66\u4e60\u80fd\u529b\u4e0a\u9650\u662f\u8d85\u51fa\u5927\u5bb6\u60f3\u8c61\u7684\uff0c\u5b66\u4e24\u4e2a\u4e13\u4e1a\u8fd9\u4ef6\u5c0f\u4e8b\u8fdc\u8fdc\u5728\u8fd9\u4e2a\u4e0a\u9650\u4e4b\u4e0b\u3002\u6211\u6c38\u8fdc\u8ba4\u4e3a\u6bc5\u529b\u548c\uff08\u5bf9\u81ea\u5df1\u4eba\u751f\u4e0a\u9650\u7684\uff09\u60f3\u8c61\u529b\u6bd4\u5f53\u524d\u80fd\u529b\u66f4\u6709\u51b3\u5b9a\u4f5c\u7528\u3002 - \u5b9e\u9645\u82f1\u8bed\u4e13\u4e1a\u53bbCS\u53cc\u4e13\u4e1a\u5bb9\u6613\u5403\u4f4e\u7ee9\u70b9\u7684\u539f\u56e0\uff0c\u5f80\u5f80\u4e0d\u662f\u80fd\u529b\u667a\u529b\u4e0d\u8db3\uff0c\u800c\u662f\u6709\u4fe1\u606f\u5dee\uff1a\u751f\u6d3b\u5728\u6587\u79d1\u7684\u6563\u6f2b\u73af\u5883\u4e2d\u96be\u4ee5\u77e5\u9053\u5927\u90e8\u5206\u540c\u5b66\u7684\u81ea\u5b66\u8fdb\u5ea6\uff0c\u548c\u5982\u679c\u67d0\u4e9b\u8bfe\u7a0b\u6709\u5b9e\u8df5\u4e0a\u7684\u5751\uff0c\u6ca1\u6709\u4e0e\u5927\u90e8\u961f\u4e00\u8d77\u5b66\u4e60\u7684\u540c\u5b66\u5c31\u96be\u4ee5\u77e5\u9053\u600e\u6837\u7075\u6d3b\u5e94\u5bf9\u3002\u6240\u4ee5\u5efa\u8bae\u4e0e\u540c\u5b66\u4e00\u8d77\u5b66\u4e60\uff0c\u53c2\u89c1\u4e0b\u4e00\u6761\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#cscs","title":"\u8981\u62e5\u6709\u4e00\u4e2a\u6216\u51e0\u4e2a\u540c\u6837\u8de8\u4e13\u4e1a\u5b66CS\u7684\u670b\u53cb\uff0c\u6216\u76f4\u63a5\u878d\u5165\u540c\u4e00\u7ea7\u7684CS\u672c\u79d1\u751f\u5708\u5b50\u91cc\u3002\u5982\u679c\u5b9e\u5728\u6ca1\u6709\uff0c\u4e00\u4e9b\u5176\u5b83\u5de5\u79d1\u7684\u540c\u5b66\u4e5f\u53ef\u4ee5\u3002","text":"\u540c\u5b66\u7684\u7528\u5904\u6709\uff1a - \u5e2e\u52a9\u4f60\u8ddf\u4e0a\u5b66\u4e60\u8282\u594f\u3002CS\u7684\u751f\u6d3b\u8282\u594f\u662f\u82f1\u8bed\u4e13\u4e1a\u76842\u500d\uff0c\u662f\u7406\u79d1\u4e13\u4e1a\u76841.5\u500d\uff0c\u5982\u679c\u51b3\u5b9a\u8f6c\u4e13\u4e1a\u662f\u9700\u8981\u4e3b\u52a8\u63d0\u9ad8\u4e00\u4e0b\u751f\u6d3b\u8282\u594f\u7684\uff0c\u505a\u4e8b\u79ef\u6781\u4e00\u70b9\uff0c\u544a\u522b\u62d6\u5ef6\u3002 - \u4e92\u76f8\u63a8\u8350\u597d\u7684\u81ea\u5b66\u8d44\u6599\uff0c\u4e92\u76f8\u5206\u4eab\u7b14\u8bb0\u548c\u8ba8\u8bba\u9898\u76ee\uff0c\u5206\u5de5\u6574\u7406\u671f\u672b\u590d\u4e60\u8d44\u6599\uff0c\u671f\u672b\u4e92\u76f8\u63d0\u95ee\uff0c\u5f62\u6210\u81ea\u5b66\u6c1b\u56f4\uff0c\u8282\u7701\u4e00\u4e9b\u8e29\u5751\u65f6\u95f4\u3002 - \u5982\u679c\u67d0\u4e9b\u8bfe\u7a0b\u5b89\u6392\u6709\u6559\u5b66\u4e8b\u6545\uff0c\u4f60\u53ef\u4ee5\u53ca\u65f6\u77e5\u9053\u5927\u90e8\u5206\u540c\u5b66\u662f\u600e\u6837\u5e94\u5bf9\u7684\uff0c\u53ca\u65f6\u8c03\u6574\u81ea\u5df1\u7684\u5e94\u5bf9\u63aa\u65bd\uff0c\u9632\u6b62\u5982\u679c\u6210\u7ee9\u5360\u6bd4\u7a81\u7136\u8c03\u6574\uff0c\u81ea\u5df1\u5c06\u52aa\u529b\u82b1\u5728\u4e86\u6700\u540e\u5360\u6210\u7ee9\u6bd4\u91cd\u5f88\u5c0f\u7684\u5730\u65b9\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_5","title":"\u8981\u591a\u8bb0\u7b14\u8bb0","text":"\u8bb0\u7b14\u8bb0\u662f\u8d39\u66fc\u5b66\u4e60\u6cd5\u7684\u6295\u5165\u4ea7\u51fa\u6bd4\u6700\u9ad8\u7684\u5b9e\u8df5\u5f62\u5f0f\uff0c\u5373\u65e2\u5e2e\u52a9\u68c0\u67e5\u7406\u89e3\uff0c\u7b14\u8bb0\u53c8\u9020\u798f\u540e\u4eba\u3002\u4f60\u53ef\u4ee5\u79c9\u627f\u5f00\u6e90\u7cbe\u795e\uff0c\u50cf\u524d\u8f88\u4e00\u6837\u591a\u5c06\u7b14\u8bb0\u516c\u5e03\u9020\u798f\u540e\u4eba\uff08\u4e0d\u8fc7\u8bf7\u9075\u5b88\u8bda\u4fe1\u5b88\u5219\uff09\u3002\u975e\u5e38\u5e0c\u671bZJU\u80fd\u9010\u6e10\u5f62\u6210\u8f83\u597d\u7684\u4f20\u5e2e\u5e26\u6c1b\u56f4\uff0c\u8ba9\u540e\u8f88\u4e5f\u6709\u826f\u597d\u6821\u53cb\u8d44\u6e90\u53ef\u4eab\u7528\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_6","title":"\u6211\u53ef\u4ee5\u4ee5\u600e\u6837\u7684\u8eab\u4efd\u672c\u79d1\u6bd5\u4e1a\uff1f\u6211\u6709\u54ea\u4e9b\u53ef\u884c\u7684\u51fa\u8def\uff1f","text":"\u4ee5\u4e0b\u8fd9\u4e9b\u90fd\u662f\u53ef\u80fd\u505a\u5230\u7684\uff0c\u6211\u4e5f\u5206\u522b\u5217\u51fa\u4e86\u6211\u8ba4\u4e3a\u9700\u8981\u51c6\u5907\u7684\u80cc\u666f\u3002 - \u51fa\u56fdms\uff1a\u7ee9\u70b9\uff0c\u6691\u7814/\u5b9e\u4e60 - \u51fa\u56fd\u76f4\u63a5phd\uff1a\u6691\u7814\uff0cpaper - \u672c\u6821\u76f4\u535a\uff1a\u7ee9\u70b9\uff0c\u8fdb\u672c\u6821\u7ec4\uff0c\u590f\u4ee4\u8425\uff0cpaper - \u8de8\u6821\u76f4\u535a\uff1a\u7ee9\u70b9\uff0c\u5bf9\u65b9\u6821\u590f\u4ee4\u8425\uff0cpaper - \u5de5\u4f5c\uff1a\u5237\u9898\uff0c\u5b9e\u4e60 \u5176\u4e2d\u6211\u8ba4\u4e3a\u503c\u5f97\u6ce8\u610f\u7684\u8fd8\u6709\uff0c\u5177\u4f53\u6700\u597d\u7531\u8bfb\u8005\u518d\u54a8\u8be2\u76f8\u5e94\u8eab\u4efd\u7684\u4eba\u7684\u5efa\u8bae\u3002\u672c\u6761\u9002\u7528\u524d\u9762\u6240\u8ff0\u201c20\u4e2a\u4eba\u5efa\u8bae\u201d\u51c6\u5219\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_7","title":"\u8bfe\u7a0b","text":""},{"location":"docs/4-opinion/plan/zju_ling_cs/#cs_4","title":"CS\u5fc5\u4fee\u8bfe","text":"\u9996\u5148\u8981\u660e\u786e\u4e00\u4e2a\u8ba4\u77e5\u95ee\u9898\uff1a\u8bfbCS\u53cc\u5b66\u4f4d\u662f\u4e00\u4e2a\u539f\u5b50\u6027\u7684\u4e8b\u52a1\uff0c\u8981\u4e48\u4e0d\u8bfb\uff0c\u8981\u4e48\u6309\u9700\u6c42\u8bfb\u5b8c\u6216\u8f85\u4fee\u6216\u53cc\u5b66\u4f4d\uff0c\u8fd9\u4e24\u79cd\u9009\u62e9\u90fd\u662f\u6295\u5165\u4ea7\u51fa\u6bd4\u8f83\u9ad8\u7684\uff1b\u6295\u5165\u4ea7\u51fa\u6bd4\u6700\u4f4e\u7684\u662f\u8bfb\u4e00\u534a\uff08\u5fae\u8f85\u4fee\u6216\u53cc\u4e13\u4e1a\uff09\u3002 \u8be5\u56fe\u4e2d\u9664\u6570\u7406\u57fa\u7840\u6a21\u5757\u4e0d\u662f\u53cc\u5b66\u4f4d\u5fc5\u4fee\uff0c\u5176\u5b83\u662f\u5fc5\u4fee\u3002 \uff08\u8fd9\u4e2a\u56fe\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6709\u4e2a\u7ea2\u5708\uff0c\u627e\u4e0d\u5230\u539f\u56fe\u4e86\uff0c\u6279\u8bc4cyh\u540c\u5b66\u4e71\u753b\uff09
\u9009\u4e0d\u4e0aCS\u7684\u8bfe\u600e\u4e48\u529e\uff1f - \u6700\u6709\u6548\uff1a\u8865\u9009+\u5728\u8865\u9009\u7684\u51e0\u5929\u91cc\u7ebf\u4e0b\u53bb\u9009\u8bfe\u529e\u6216\u7ed9\u9009\u8bfe\u529e\u53d1\u90ae\u4ef6\u3002\u674e\u6653\u8001\u5e08\u548c\u5f20\u4f20\u534e\u8001\u5e08\u90fd\u5f88nice\uff0c\u8868\u793a\u81ea\u5df1\u5f88\u60f3\u9009\u8bfe\uff0c\u8ddf\u8001\u5e08\u8bf4\u660e\u539f\u56e0\u3002 - \u7b2c\u4e8c\u6709\u6548\uff1a\u5982\u679c\u4efb\u8bfe\u8001\u5e08\u5728\u8ba1\u9662\u8bdd\u8bed\u6743\u8f83\u5927\uff0c\u8bf7\u4efb\u8bfe\u8001\u5e08\u5e2e\u5fd9\u8ddf\u9009\u8bfe\u529e\u8bf4\uff0c\u80fd\u4fdd\u8bc1\u4f60\u9009\u4e0a\u8be5\u8001\u5e08\u7684\u8bfe\u3002 - \u7b2c\u4e09\u6709\u6548\uff1a\u9009\u8bfe\u65f6\u4e0eCS\u7684\u540c\u5b66\u5546\u91cf\uff0c\u505a\u51fa\u65f6\u95f4\u6b63\u597d\u7684\u4e00\u4e9b\u8bfe\u8868\u3002\u53ef\u80fd\u6d89\u53ca\u5230\u201c\u7528\u4e00\u4e9b\u8bfe\u5835\u4f4f\u53e6\u4e00\u4e9b\u8bfe\u201d\u8fd9\u79cd\u590d\u6742\u64cd\u4f5c\uff0c\u6240\u4ee5\u5408\u4f5c\u6bd4\u8f83\u5212\u7b97\u3002
\u600e\u4e48\u5b66\uff1f - ZJU\u8bfe\u7a0b\u5171\u4eab\u8ba1\u5212 https://github.com/QSCTech/zju-icicles - \u56fe\u7075\u73ed\u8bfe\u7a0b\u901f\u901a\u8ba1\u5212 https://github.com/ZJU-Turing/TuringCourses - \u4e00\u4f4d\u5b66\u957f\u7684\u4f18\u8d28\u7b14\u8bb0 \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4\uff01 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4 (xuan-insr.github.io) - \u4e00\u4f4d\u5b66\u957f\u7684\u4f18\u8d28\u7b14\u8bb0 https://github.com/Zhang-Each/CourseNoteOfZJUSE
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#ai","title":"AI","text":"AI\u8bfe\u4e00\u822c\u6bd4CS\u8bfe\u597d\u9009\uff0c\u4f46\u662f\u5982\u679c\u9009\u4e0d\u4e0a\u4e5f\u8bf7\u9075\u7167\u4e0a\u6761\u4e2d\u7684\u5efa\u8bae\u3002 \u975e\u5fc5\u8981\u4e0d\u9009AI\u8bfe\uff0cAI\u8bfe\u6700\u5927\u7684\u6536\u83b7\u662f\u5728\u7b80\u5386\u4e0a\u4f5c\u4e3a\u4e00\u4e2a90+\u8bfe\u7a0b\u51fa\u73b0\uff0c\u57fa\u672c\u5b66\u4e0d\u5230\u4e1c\u897f\uff08\u9664\u4e86NLP\u8bfe\u6211\u611f\u89c9\u542c\u8bfe\u6536\u83b7\u633a\u5927\u7684\uff09\uff0c\u4e3b\u8981\u9760\u81ea\u5b66\u540e\u5377\u51fa\u5927\u4f5c\u4e1a\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_8","title":"\u8bed\u8a00\u5b66","text":"\u56e0\u4e3a\u82f1\u4e13\u57f9\u517b\u65b9\u6848\u8fd8\u662f\u8981\u6c42\u4fee\u5927\u91cf\u4e13\u4e1a\u8bfe\u7684\uff0c\u611f\u89c9\u53ef\u4ee5\u5c3d\u91cf\u628a\u8bed\u8a00\u5b66\u6a21\u5757\u591a\u4fee\u4e00\u70b9\uff0c\u6709\u4e9b\u5728\u8fdb\u7ec4\u7684\u65f6\u5019\u53ef\u80fd\u8fd8\u662f\u8ba4\u53ef\u7684\u3002 \u4ee5\u4e0b\u8bfe\u7a0b\u5982\u679c\u62ff\u4e86\u9ad8\u5206\u503c\u5f97\u5728\u7b80\u5386\u4e0a\u4e00\u63d0 - \u5f53\u4ee3\u8bed\u8a00\u5b66 - \u8bed\u97f3\u5b66 - \u53e5\u6cd5\u5b66 - \u5fc3\u7406\u8bed\u8a00\u5b66 - \u8bed\u4e49\u5b66 - \u8bed\u7528\u5b66 - \u8bed\u6599\u5e93\u8bed\u8a00\u5b66
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_9","title":"\u6570\u5b66","text":"\u5bf9\u4e8ePhD\u3001\u627e\u5de5\u548c\u56fd\u5185\u76f4\u535a\uff1a \u53ef\u80fd\u4e0d\u9700\u8981\u6570\u5b66\u3002\u3002\u3002\u8ba4\u4e3a\u6700\u597d\u4e0d\u8981\u989d\u5916\u9009\u6570\u5b66\u8bfe \u6211\u81f3\u4eca\u9047\u5230\u7684\u8001\u5e08\u6ca1\u6709\u56e0\u4e3a\u6211\u7b80\u5386\u4e0a\u4efb\u4f55\u6570\u5b66\u76f8\u5173\u7684\u4e1c\u897f\u800c\u5f55\u6211\u6216\u62d2\u6211\u7684\uff0c\u90fd\u662f\u53ea\u95ee\u7f16\u7a0b\u3002 CS\u4e13\u4e1a\u8bfe\u91cc\u7684\u79bb\u6563\u6570\u5b66\u548c\u8ba1\u7b97\u7406\u8bba\uff08\u548c\u53ef\u80fd\u8fd8\u6709\u6570\u903b\uff09\u5df2\u7ecf\u8db3\u591f\u57f9\u517b\u6570\u5b66\u601d\u7ef4\u3002 \u5982\u679c\u62c5\u5fc3\u6570\u636e\u5206\u6790\u548c\u7edf\u8ba1\u6280\u80fd\uff0c\u6587\u6570\u91cc\u636e\u8bf4\u5e94\u7528\u7edf\u8ba1\u5b66\u8fd9\u95e8\u8bfe\u7a0b\u6bd4\u9ad8\u7b49\u6570\u5b66\u597d\u4f7f\uff0c\u8fd8\u6709\u673a\u4f1a\u7684\u540c\u5b66\u53ef\u4ee5\u8bd5\u4e00\u4e0b\u3002
\u5bf9\u4e8ems\uff1a \u786e\u5b9e\u6709\u4e00\u4e9b\u9879\u76ee\u8981\u6c42\u4fee\u8fc7\u4e00\u4e9b\u6570\u5b66\u8bfe\u7a0b\uff0c\u4f8b\u5982\u521a\u770b\u5230SUTD\u7684ISTD ms\u8981\u6c42\u4e24\u5b66\u671f\u5fae\u79ef\u5206\uff0c\u4e00\u5b66\u671f\u7ebf\u4ee3\u548c\u4e00\u5b66\u671f\u6982\u7edf\uff0c\u8fd9\u79cd\u65e0\u7591\u662f\u6bd4\u8f83\u4e0d\u53cb\u597d\u7684\u9879\u76ee\u4e86\u3002 \u4e5f\u6709\u6bd4\u8f83\u53cb\u597d\u7684\u9879\u76ee\uff0c\u5317\u7f8e\u4e00\u4e9b0\u57fa\u7840\u8f6c\u7801\u9879\u76ee\u53ef\u53c2\u7167OpenCSapp\uff0c\u82f1\u56fd\u7684IC\u548cUCL\u5728\u524d\u5e74\u4e5f\u5f00\u4e86\u96f6\u57fa\u7840\u8f6c\u7801\u9879\u76ee\uff0c\u4e0d\u8fc7\u51fa\u8def\u548c\u542b\u91d1\u91cf\u9700\u8981\u81ea\u5df1\u8861\u91cf\uff0c\u8fd8\u662f\u5efa\u8bae\u201c\u54a8\u8be220\u4e2a\u4eba\u201d\u51c6\u5219\u3002\u4ee3\u8868dp\u662f18\u7ea7SJTU\u82f1\u8bed\u4e13\u4e1a\uff0c4\u6bb5\u79d1\u7814\u6216\u4e92\u8054\u7f51\u5382NLP\u4ea7\u54c1\u5b9e\u4e60\uff0c\u5c11\u91cf\u9ad8\u5206\u6570\u5b66\u548c\u7f16\u7a0b\u8bfe\u7a0b\uff0c\u7ee9\u70b990+ \u2192 IC CS ms
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_10","title":"\u7ee9\u70b9","text":"\u53c2\u7167\u8fd9\u4e9b\u9876\u4f1a\u90fd\u6709\u4ec0\u4e48track\uff0c\u4e0b\u9762\u662f\u6700\u8fd1\u4e00\u671f\u6bcf\u4e2atrack\u7684best paper - Best Papers - ACL 2023 (aclweb.org) - Best Paper Awards - emnlp 2022 (balhafni.github.io) - Transactions of the Association for Computational Linguistics (transacl.org) - Announcing the NAACL 2022 Best Paper Awards! - NAACL-HLT 2022
\u7279\u522b\u5730\uff0c\u60f3\u5230NLP\u91cc\u6bd4\u8f83\u7eaf\u8bed\u8a00\u5b66\u7684\u4e3b\u9898/\u65b9\u6cd5\u4e5f\u6709\u4e00\u4e9b\uff0c\u6709\u5982\u4e0b\u51e0\u4e2a \u4e3a\u4ec0\u4e48\u8981\u8bb2\u8fd9\u4e00\u5757\u56e0\u4e3a\u62c5\u5fc3\u4f60\u5728\u9762\u8bd5\u7684\u65f6\u5019\u4f1a\u9700\u8981\u5411\u8001\u5e08\u8bc1\u660e\u4f60\u7684\u53e6\u4e00\u90e8\u5206\u4e13\u4e1a\u77e5\u8bc6\u4e5f\u662f\u6709\u7528\u7684 \u4e00\u822c\u6b27\u6d32\u7684NLP\u4f1a\u504f\u8bed\u8a00\u5b66\u4e00\u70b9 - \u5b9e\u9a8c\u8bed\u97f3\u548c\u97f3\u7cfb\u5b66 - \u7528\u8bed\u8a00\u5b66\u77e5\u8bc6\u505a\u6570\u636e\u548c\u6570\u636e\u589e\u5f3a - AI\u4e2d\u7684\u4f26\u7406\u9053\u5fb7\u95ee\u9898 - \u7a00\u6709\u8bed\u8a00\u6316\u6398
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_12","title":"\u5982\u4f55\u9009\u5bfc\uff1f","text":"\u56fd\u5916\u5bfc\u5e08\uff1a\u5e38\u8bfb\u6bcf\u5e74\u7684\u9876\u4f1a\u6709\u610f\u601d\u8bba\u6587\uff0c\u5e76\u53c2\u7167CSRankings: Computer Science Rankings\uff0c\u5173\u6ce8\u5b66\u672f\u5708\u517b\u597d\u53f7\u540e\u5e38\u5237Twitter \u56fd\u5185\u6821\u5185\u5bfc\u5e08\uff1a\u5982\u679c\u6709\u60f3\u8be2\u95ee\u7684\u5bfc\u5e08\u540d\u5355\u53ef\u4ee5\u90ae\u4ef6\u95ee\u6211 \u9009\u5bfc\u6216\u8005\u8054\u7cfbPhD\u7684\u65f6\u5019\u5982\u679c\u63a5\u5230\u7684\u4efb\u52a1\u662f\u4e8c\u4f5c\u4e09\u4f5c\u5f80\u540e\uff0c\u5f88\u53ef\u80fd\u662f\u6253\u767d\u5de5\uff0c\u57fa\u672c\u53ef\u4ee5\u62d2\u7edd\u3002\u9664\u975e\u4f60\u8ba4\u4e3a\u4f60\u627f\u62c5\u7684\u5de5\u4f5c\u8f83\u4e3a\u91cd\u8981\uff0c\u8001\u5e08\u53ef\u4ee5\u7ed9\u4f60\u63a8\u8350\u4fe1\uff0c\u4e8c\u4f5c\u4e09\u4f5c\u7684\u4f5c\u7528\u53ef\u80fd\u6ca1\u6709\u63a8\u8350\u4fe1\u5927\u3002 \u5982\u679c\u7533\u8bf7PhD\uff0c\u63a8\u8350\u4fe1\u7684\u529b\u5ea6\uff1a\u4f60\u4e0e\u63a8\u8350\u4eba\u7684\u4ea7\u51fa\u5f88\u91cd\u8981+\u76ee\u6807PhD\u5bfc\u8ba4\u8bc6\u7684\u4eba > \u4f60\u4e0e\u63a8\u8350\u4eba\u7684\u4ea7\u51fa\u5f88\u91cd\u8981+\u76ee\u6807PhD\u5bfc\u4e0d\u8ba4\u8bc6\u7684\u4eba > \u5176\u5b83
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_13","title":"\u7533\u8bf7","text":"\u56e0\u4e3a\u4fdd\u7814\u548c\u627e\u5de5\u6211\u786e\u5b9e\u4e0d\u61c2\uff0c\u8fd9\u91cc\u6682\u65f6\u53ea\u5199\u7533\u8bf7\u4e86\u3002\u540e\u7eed\u6709\u8bf7\u5171\u540c\u4f5c\u8005\u6269\u5c55\u5185\u5bb9\u7684\u8ba1\u5212\uff0c\u5982\u613f\u610f\u8d21\u732e\u8bf7\u8054\u7cfb\u6211\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#check-point","title":"Check Point","text":"\u5927\u4e00\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u4e13\u5fc3\u5b66\u4e13\u4e1a\u8bfe \u5927\u4e8c\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u8fdb\u7ec4\uff0c\u5b66\u4f1apytorch\uff0c\u8bad\u8fc7\u4e00\u4e9b\u5e38\u7528\u7684\u6a21\u578b \u5927\u4e09\u6691\u5047\u7ed3\u675f\u65f6\uff1a\u4ea7\u51fa\u4e00\u4f5c\u6216\u5171\u4e00\u8bba\u6587
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_14","title":"\u6211\u8981\u4e0d\u8981\u627e\u4e2d\u4ecb\uff1f","text":"\u4e0d\u8981\u3002 \u539f\u56e0\u4e00\uff1aCS\u7684\u5728\u7ebf\u514d\u8d39\u8d44\u6599\u8db3\u591f\u4f7f\u7528 \u539f\u56e0\u4e8c\uff1a\u4e2d\u4ecb\u7684\u4fe1\u606f\u66f4\u65b0\u901f\u5ea6\u8d76\u4e0d\u4e0aCS\u5b66\u79d1\u7684\u53d1\u5c55\u901f\u5ea6
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_15","title":"\u6211\u7533\u8bf7\u53ef\u4ee5\u53c2\u8003\u54ea\u4e9b\u8d44\u6599\uff1f","text":"\u7533\u8bf7MS - \u5317\u7f8e\u7684CS master Home - Open CS Application - \u9664\u5317\u7f8e\u5916\u7684\u5176\u5b83CS master Global CS (global-cs-application.github.io) - \u4e00\u4ea9\u4e09\u5206\u5730/\u5bc4\u6258\u5bb6\u56ed\u7b49\u8bba\u575b - CC98\u4e0a\u6bcf\u4e00\u5e74CS\u7684\u98de\u8dc3\u624b\u518c
\u7533\u8bf7PhD - \u6b27\u7f8eNLP\u5708\u5bf9PhD\u7533\u8bf7\u7684\u5efa\u8bae https://github.com/zhijing-jin/nlp-phd-global-equality - \u4e86\u89e3\u5b66\u79d1\u4f18\u52bf\u5b66\u6821\u548c\u5bfc\u5e08 CSRankings: Computer Science Rankings - \u6ce8\u518c\u4e00\u4e2aTwitter\u8d26\u53f7\uff0c\u5f00\u59cb\u5173\u6ce8NLP\u5708\u7684PhD\u548cAP\uff0c\u5404\u79cd\u7533\u8bf7\u673a\u4f1a\u4ed6\u4eec\u90fd\u4f1a\u5c3d\u5feb\u53d1\u5e03\u7684\u3002\u6bd4\u5982\u4f60\u53ef\u4ee5\u5148\u4eceAndrew Ng\u3001Christopher Manning\u3001Geoffrey Hinton\u8fd9\u79cd\u8001\u6559\u6388\u5173\u6ce8\u8d77\uff0c\u7136\u540e\u5173\u6ce8\u4ed6\u4eec\u7684\u5173\u6ce8\u8fd9\u6837\u6765\u641e\u3002 - \u5173\u6ce8\u4e00\u4ea9\u4e09\u5206\u5730/CC98/\u4e00\u4e9b\u5fae\u4fe1\u516c\u4f17\u53f7/\u77e5\u4e4e\u7684\u62db\u751f\u4fe1\u606f
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_16","title":"\u6295\u9012\u6691\u7814\u6ce8\u610f\u4e8b\u9879","text":"\u6d41\u7a0b\u540c\u7533\u8bf7PhD \u5df2\u7ecf\u719f\u8bc6\u7684\u5bfc\u5e08\u63a8\u8350\u662f\u6700\u5feb\u7684\uff1b\u5426\u5219\u5c31\u81ea\u5df1\u6d77\u6295\uff0c\u6295\u53d1\u5e03\u8fc7\u62db\u751f\u5e7f\u544a\u6216\u4e3b\u9875\u8868\u660e\u6b63\u5728\u62db\u751f\u7684\u8001\u5e08\u662f\u6700\u5feb\u7684\u3002\u6709\u7684\u65f6\u5019\u53ef\u4ee5\u5c1d\u8bd5\u6295\u8ba4\u8bc6\u7684PhD\uff0c\u56e0\u4e3a\u6691\u7814\u671f\u95f4\u5927\u90e8\u5206\u60c5\u51b5\u8fd8\u662f\u8ddf\u7740PhD\u6253\u5de5\u3002 \u5982\u679c\u8001\u5e08\u7ed9\u4f60\u7684\u8d23\u4efb\u6bd4\u8f83\u91cd\uff0c\u4e14\u4f60\u6709\u6bd4\u8f83\u597d\u7684\u5de5\u4f5c\u73af\u5883\uff0c\u6211\u8ba4\u4e3a\u7ebf\u4e0a\u7ebf\u4e0b\u533a\u522b\u4e0d\u5927\u3002 \u60f3\u53bb\u5317\u7f8e\u5c31\u5957\u5317\u7f8e\uff0c\u6211\u89c9\u5f97\u6700\u597d\u4e0d\u8981\u627e\u8df3\u677f\uff0c\u6709\u5317\u7f8e\u7684\u7ebf\u4e0a\u6691\u7814\u4e5f\u5f88\u597d\uff0c\u53ea\u8981\u662f\u4f60\u4e00\u4f5c\uff0c\u65f6\u957f6\u4e2a\u6708\u4ee5\u4e0a\uff0c\u6bcf\u5468\u6c47\u62a5\u8fdb\u5ea6\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_17","title":"\u6295\u9012\u5b9e\u4e60\u6ce8\u610f\u4e8b\u9879","text":"\u9700\u8981\u5b9e\u4e60 iff \u4f60\u6253\u7b97\u627e\u5de5or\u8bfb\u5b8c\u7855\u58eb\u627e\u5de5\uff0c\u7533\u8bf7\u5b66\u672f\u7c7bms\u548cPhD\u7684\u8bdd\uff0c\u5b9e\u4e60\u4e0d\u5f3a\u6c42\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#-xuan-insrgithubio","title":"- \ud83c\udff3\ufe0f\u200d\ud83c\udf08 \u603b\u89c8 - \u54b8\u9c7c\u6684\u7684\u4ee3\u7801\u7a7a\u95f4 (xuan-insr.github.io) \u627e\u6691\u671f\u5b9e\u4e60\u548c\u79cb\u62db\u7684\u7ecf\u9a8c\u5e16","text":"http://www-cc98-org-s.webvpn.zju.edu.cn:8001/topic/4950730
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#_18","title":"\u5173\u4e8e\u7b14\u8005&\u8054\u7cfb\u7b14\u8005","text":"\u7b14\u8005\u4f30\u8ba1\u662f\u4ece\u82f1\u8bed\u4e13\u4e1a\u8f6cNLP\u89c4\u5212\u6700\u4e0d\u987a\u3001\u8fdb\u5ea6\u6700\u66f2\u6298\u7684\u4e00\u4e2a\u3002\u8fd9\u4efd\u6587\u6863\u4e0d\u662f\u4ec0\u4e48\u6210\u529f\u7ecf\u9a8c\u5206\u4eab\uff0c\u6211\u5e76\u4e0d\u6210\u529f\uff0c\u53ea\u662f\u60f3\u628a\u6211\u8e29\u8fc7\u7684\u5751\u544a\u8bc9\u540e\u4eba\uff0c\u5e0c\u671b\u5c11\u6709\u4eba\u91cd\u8e48\u6211\u7684\u8986\u8f99\u3002\u6211\u89c9\u5f97\u6211\u7684\u9ad8\u4e2d\u548c\u672c\u79d1\u8fc7\u5f97\u592a\u574e\u5777\u4e86\uff0c\u771f\u8bda\u5730\u60f3\u5e2e\u52a9\u5b66\u5f1f\u5b66\u59b9\uff0c\u5e0c\u671b\u4f60\u4eec\u4e00\u5207\u987a\u5229\u3002\u8bfb\u8005\u53ef\u4ee5\u4ee5\u6211\u4f5c\u4e3a\u57fa\u51c6\uff0c\u5728\u56db\u5e74\u540e\u4e0d\u80fd\uff08\u5f53\u7136\u5982\u679c\u65e9\u505a\u89c4\u5212\uff0c\u4e00\u76f4\u5728\u52aa\u529b\uff0c\u4e5f\u4e0d\u4f1a\uff09\u6bd4\u6211\u66f4\u5dee\u3002\u6bd5\u7adf\u4e00\u6761\u8def\u8d70\u7684\u4eba\u591a\u4e86\uff0c\u540e\u4eba\u4e00\u5b9a\u662f\u8981\u8d8a\u8d70\u8d8a\u987a\u7684\u3002
\u5982\u6709\u5efa\u8bae\u6216\u7591\u95ee\u8bf7\u901a\u8fc7\u90ae\u4ef6\u8054\u7cfb\u6211 RuoxiNing@outlook.com\u3002
"},{"location":"docs/4-opinion/plan/zju_ling_cs/#recommended-readings","title":"Recommended Readings","text":":material-circle-edit-outline: \u7ea6 47 \u4e2a\u5b57
\u8bb0\u5f55\u4e00\u70b9\u597d\u7528\u7684\u5de5\u5177
"},{"location":"docs/4-opinion/tools/#contents","title":"Contents \u76ee\u5f55","text":"\u96f6\u6563\u7684\u5c31\u653e\u5728\u8fd9\u91cc
"},{"location":"docs/4-opinion/tools/#_2","title":"\u5728\u7ebf\u6253\u65f6\u95f4\u8f74\u5de5\u5177","text":"https://judes.me/lrc_editor/
"},{"location":"docs/4-opinion/tools/howtocite/","title":"How to cite elegantly?","text":":material-circle-edit-outline: \u7ea6 17 \u4e2a\u5b57
"},{"location":"docs/4-opinion/tools/howtocite/#which-format","title":"Which format?","text":""},{"location":"docs/4-opinion/tools/howtocite/#in-text-citation","title":"In-text citation","text":""},{"location":"docs/4-opinion/tools/howtocite/#references","title":"References","text":""},{"location":"docs/4-opinion/tools/howtocite/#tools","title":"Tools","text":"... But the best tool is by hand
"},{"location":"docs/4-opinion/tools/notes/","title":"\u5bf9\u7b14\u8bb0\u5de5\u5177\u548c\u4fe1\u606f\u8bb0\u5f55\u7684\u601d\u8003","text":":material-circle-edit-outline: \u7ea6 423 \u4e2a\u5b57 :fontawesome-solid-code: 3 \u884c\u4ee3\u7801 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f
"},{"location":"docs/4-opinion/tools/notes/#_2","title":"\u4e3a\u4ec0\u4e48\u8981\u5199\u8fd9\u4e9b\u7b14\u8bb0","text":"\u672c\u6765\u60f3\u5199\u591a\u4e00\u70b9\u7684\uff0c\u4f46\u662f\u592a\u61d2\u4e86
"},{"location":"docs/4-opinion/tools/notes/#_3","title":"\u7b14\u8bb0\u5de5\u5177\uff1f","text":"\u5bf9\u6211\u6765\u8bf4\u4e00\u4e2a\u5b8c\u5168\u9762\u5411\u8fc7\u7a0b\u7684 -> \u4e00\u4e2a\u5b8c\u5168\u9762\u5411\u5bf9\u8c61\u7684
\u6bd4\u5982 notion \u662f\u9762\u5411\u6d41\u7a0b\u7684
\u800c\u5982\u679c\u8981\u6709\u7ed3\u6784\u5199\u4f5c\uff0c\u5c31\u7528 mkdocs
"},{"location":"docs/4-opinion/tools/notes/#notionobsidian","title":"\u9009\u62e9Notion\u548cObsidian","text":"\u5148\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u7ed3\u8bba
\u4f18\u70b9/\u5de5\u5177 Notion Obsidian \u8bed\u6cd5 \u81ea\u5df1\u7684\u4e00\u5957\u8bed\u6cd5\uff0c\u90e8\u5206\u662fmarkdown \u7eafmarkdown \u4e66\u5199\u901f\u5ea6 \u6162 \u5feb \u6587\u6863\u6574\u9f50\u7a0b\u5ea6 \u9ad8 \u4f4e \u90e8\u7f72\u5230mkdocs\u96be\u6613 \u6613\uff0c\u53ef\u76f4\u63a5\u7528 \u96be\uff0c\u9700\u8c03\u6574\u5f88\u591a\u683c\u5f0f \u5bfc\u51fa\u4e2d\u6587\u652f\u6301\u7a0b\u5ea6 \u53ea\u6709\u4e09\u79cd\u5b57\u4f53\uff0c\u90e8\u5206\u4e2d\u6587\u7f3a\u5b57 \u5b57\u4f53\u591a\uff0c\u652f\u6301\u6bd4\u8f83\u597d\u76ee\u524d\u6211\u9009\u62e9\u7684 workflow: \u5b8c\u5168\u629b\u5f03 Ob \u4e86\uff01
graph TD\n \u542c\u5199 --> Notion \n Notion -- \u6709\u65f6\u95f4 --> mkdocs\n
"},{"location":"docs/4-opinion/tools/notes/#_4","title":"\u6587\u732e\u7ba1\u7406\u5de5\u5177","text":"TODO
\u5176\u5b9e\u4ed3\u5e93\u91cc\u672c\u6587\u4ef6\u5939\u4e0b\u7684asset\u91cc\u73b0\u5728\u6709\u4e2a\u600e\u4e48\u914d\u7f6ezotero\u7684ppt\uff0c\u592a\u61d2\u6ca1\u65f6\u95f4\u6574\u8fc7\u6765\uff0c\u53ef\u4ee5\u5148\u53bb\u4ed3\u5e93\u91cc\u627e\u627eorz
"},{"location":"docs/4-opinion/tools/notes/#_5","title":"\u8bba\u6587\u7b14\u8bb0","text":"TODO
"},{"location":"docs/4-opinion/tools/notes/#todolist","title":"TODOlist\uff1f","text":"\u5bf9\u6211\u6765\u8bf4\u4e5f\u9700\u8981\u4e00\u4e2a\u9762\u5411\u8fc7\u7a0b\u7684\uff08\u60f3\u5230\u9700\u8981\u505a\u6240\u4ee5\u8bb0\u4e0b\u6765\u7684\u6a21\u7cca\u4efb\u52a1\uff09+ \u4e00\u4e2a\u9762\u5411\u5bf9\u8c61\u7684\uff08\u4e00\u4e2a\u6709\u660e\u786e\u8d77\u6b62\u65f6\u95f4\u7684\u3001\u7ed3\u675f\u6807\u5fd7\u7684\u4efb\u52a1\uff09\u3002
\u524d\u8005\u6211\u5e0c\u671b\u662f\u4e00\u4e2a\u53ef\u4ee5\u65e0\u9650\u6269\u5c55\u7684 list\uff0c\u5e76\u4e14\u5141\u8bb8\u6dfb\u52a0\u5404\u79cd sublist -> \u4e00\u4e2a\u5f88\u8212\u670d\u7684 markdown \u7f16\u8f91\u5668\u5373\u53ef\u3002
\u540e\u8005\u5219\u6700\u597d\u6709\u5929\u3001\u5468\u3001\u6708\u7b49 view \u53ef\u4ee5\u770b\u4efb\u52a1\u7684 availability\u3002
\u6211\u73b0\u5728\u7684\u65b9\u6cd5
"},{"location":"docs/5-life/","title":"C'est la vie","text":":material-circle-edit-outline: \u7ea6 4 \u4e2a\u5b57
"},{"location":"docs/5-life/portfolio/","title":"Portfolio for CMU METALS Application","text":":material-circle-edit-outline: \u7ea6 80 \u4e2a\u5b57
Hi there! \ud83d\udc4b
This site is a temporary portfolio for CMU METALS application.
"},{"location":"docs/5-life/portfolio/#frontend-works","title":"Frontend Works","text":"GlyphGun violence in US visualization
"},{"location":"docs/5-life/portfolio/#graphic-design","title":"Graphic Design","text":"Calendar Card1 Card2 Card3
logo
"},{"location":"docs/5-life/annual-summary/","title":"Annual Summary \u5e74\u5ea6\u603b\u7ed3","text":"
:material-circle-edit-outline: \u7ea6 10 \u4e2a\u5b57
"},{"location":"docs/5-life/annual-summary/#contents","title":"Contents \u76ee\u5f55","text":":material-circle-edit-outline: \u7ea6 967 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f
Never believe in anything that claims to bring you success, never, never, never.
We are what we talk about every day. Talking about math and science and technology makes us full of math and science and technology. Talking about the school administration fills us with nothing but only makes rule adaptors. Talking about unserious entertainment chores makes us trivial characters. Talking about the name of technologies instead of the real details and ideas behind them makes us only excited at the thoughts of 'I will learn/am learning this technology soon!' and become distracted suddenly after clicking into a post or a video about it.
The topic of rules and policies also reminds me of the story of a senior professor who works on computational syntax in the school of international studies at my undergrad school, who ended his 10-year career here and joined another school of a similar (or slightly lower) ranking in Shanghai this year. I saw in his annual summary a sentence going like, in the next 10 years I plan to deal less with the administration materials and procedures but to put the stress on the research that I am really fond of; now given this change in my career, this goal seems pretty at hand.
I sneered for sharing the same feeling with this prof. After joining UWaterloo, I felt that it was the first time in a long time that I was cared for by people around (administrators, profs, colleagues) as an ordinary student -- not because I was doing anything excellent -- in fact, I lagged behind my peers too much. And this is the reason why I should tell myself from time to time, that feeling well for now does not mean feeling well for good. Don't trust your feelings cause it does not lead you to the goal.
To be specific in my researches -- I am mainly in (or to say, leading?) 3 researches this year, and none of them finally yields any paper. Sarcastically, another research that I am not leading was accepted fluently by a top conference (I sincerely thank the talented first author and other helpful co-workers who made the acceptance of this work so undoubtful on the meanwhile of critizing my unintelligence).
I reflected a lot from the rest 3 research on why they currently failed (at least according to my criteria). The first research is a stupid (sorry) benchmark, whose birth now appears too reckless to me -- I was too slow to catch up with the user demands so now few people are using it. I think I will hereby say that I will not make a benchmark unless I desperately feel that a great number of people, or a few but important people, are or will be in need of it, or that I will be the only person who can make it across the world and during the following at least 10 years. Besides, my poor code and data management at the beginning of the year also led to several pitfalls which took me a great amount of time to fix, so now I would like to set up rules for myself, that is to always use unchangeable data ID to identify data pieces and to always consider the searching efficiency when designing the data structure, and to always think of reusing codes (thus I should maintain them more with oop structures). For the rest two projects which are on syntax and multimodal information encoding, I always felt that I didn't know how to introduce them to others esp. my roommates -- always commented that I had no improvement on the models and thus my research was of no use. Okay, I have no words to refute so how to refute will be one of the important questions that I will address in my papers.
Here should have been another paragraph about my another research. It was such a painful experience collaborating with those collaborators that I don't want to recall and write it down here. If you are interested, let's talk about it privately.
I spent much time pondering on choosing the industry or academia, some time looking for an internship, and little time submitting applications, and got response from none. I browsed several posts discussing the career planning for PhDs in the middle of which I found a website open-sourcing the salaries of employed professors from each Canadian university, with their real name. I am a bit shocked by the mere salaries of full professors. A solution to this question also desperately awaits in the following year.
I also traveled a lot and watched a lot of musicals and operas this year (if you are interested in my recommendations, I am working on a list of my favorite musical works), but again I think I should talk about them less and less, since we will become what we talk about. Let's make our conversations full of technologies and ideas that will nurture our knowledge and thoughts.
Anyway, my primary new year's resolution for 2025 is that,
to have a paper such that, whenever people talk about this research area, they think of me; and whenever they think of me, they think of my paper.
This will be the foundation of anything else.
Besides, I hope I can have time to
It was the most determined year and it was the most confused year, and it will be the most confused year and it will be the most determined year. I'm ready to see.
"},{"location":"docs/5-life/read-watch-listen/","title":"Read, Watch, Listen \u4e66\u5f71\u97f3","text":":material-circle-edit-outline: \u7ea6 14 \u4e2a\u5b57
"},{"location":"docs/5-life/read-watch-listen/#my-top-10-updating","title":"My Top 10 (Updating)","text":""},{"location":"docs/5-life/read-watch-listen/#contents","title":"Contents","text":":material-circle-edit-outline: \u7ea6 3094 \u4e2a\u5b57 :material-clock-time-two-outline: \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_2","title":"\u6982\u8ff0","text":"\u4e00\u4e9b\u7269\u7406\u6982\u5ff5
\u4e50\u7406\u7684\u57fa\u7840\u89c4\u5219\u6709\u4e09\u6761
\u4ee5\u53ca\u4ee5\u6b64\u5ef6\u4f38\u7684\u51e0\u6761\u89c4\u5219
!!! \ud83d\udca1 TODO: \u8fd9\u4e2a\u663e\u793a\u9891\u7387\u7684\u662f\u4ec0\u4e48\u5de5\u5177\uff1f
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_4","title":"\u7eaf\u97f3","text":"\u53ea\u5305\u542b\u4e00\u79cd\u9891\u7387\u7684\u97f3\u79f0\u4e3a\u7eaf\u97f3\u3002
\u591a\u79cd\u9891\u7387\u590d\u5408\u5728\u4e00\u8d77\u7684\u97f3\u79f0\u4e3a\u590d\u5408\u97f3\u3002
\u5b9e\u9645\u6f14\u594f\u4e2d\uff0c\u4e00\u822c\u6bd4\u5982\u6f14\u594f\u67d0\u9891\u7387\u7684\u97f3\u65f6\uff0c\u4e5f\u4f1a\u540c\u65f6\u4ea7\u751f2\u500d\u9891\u7387\uff08\u7b2c2\u6cdb\u97f3\uff0c\u57fa\u97f3\uff09\u30013\u500d\u9891\u7387\uff08\u7b2c3\u6cdb\u97f3\uff09\u2026\u7b49\u97f3\u3002\u8fd9\u662f\u7531\u4e8e\u58f0\u97f3\u5728\u7a7a\u6c14\u4e2d\u4f20\u64ad\u65f6\u53cd\u5c04\uff0c\u53cd\u5c04\u540e\u7684\u6ce2\u5f62\u4f1a\u4e0e\u539f\u6ce2\u5f62\u53e0\u52a0\u4ea7\u751fN\u500d\u6cdb\u97f3\u3002\u6bcf\u4e2a\u4e50\u5668\u7684\u97f3\u8272\u4e0d\u540c\uff0c\u672c\u8d28\u4e0a\u662f\u5b83\u4eec\u7684\u6cdb\u97f3\u7684\u632f\u5e45\u4e0e\u57fa\u97f3\u4e0d\u540c\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_5","title":"\u94a2\u7434","text":""},{"location":"docs/5-life/read-watch-listen/music-theory/#_6","title":"\u5c0f\u63d0\u7434","text":"\u51cf\u5f31\u5e45\u5ea6\u6ca1\u6709\u94a2\u7434\u5927\uff0c\u6240\u4ee5\u6bd4\u94a2\u7434\u5c16\u9510\uff08\u56e0\u4e3a\u9891\u7387\u8d8a\u9ad8\u8d8a\u5c16\u9510\uff09
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_7","title":"\u53cc\u7c27\u7ba1","text":"\u7b2c2\u6cdb\u97f3\u6bd4\u57fa\u97f3\u5927
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_8","title":"\u97f3\u5f8b","text":"\u97f3\u5f8b\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6307\u4e00\u79cd\u201c\u9009\u62e9\u54ea\u4e9b\u9891\u7387\u6765\u4f5c\u4e3a\u4e00\u4ef6\u4e50\u5668\u7684\u97f3\u201d\u8fd9\u79cd\u89c4\u5219\u6216\u4ee5\u6b64\u9009\u51fa\u6765\u7684\u4e00\u7ec4\u9891\u7387\u3002\u5982\u679c\u5177\u4f53\u4e00\u70b9\u6765\u8bb2\uff0c\u4e50\u5668\u53ef\u4ee5\u62bd\u8c61\u6210\u4e00\u7ec4\u957f\u5ea6\u4e0d\u540c\u7684\u5f26\uff0c\u7531\u4e8e\u957f\u5ea6\u4e0d\u540c\u6240\u4ee5\u53d1\u51fa\u4e0d\u540c\u9891\u7387\u7684\u97f3\uff0c\u800c\u4e50\u5668\u8bbe\u8ba1\u8005\u6700\u5173\u5fc3\u7684\u95ee\u9898\u5c31\u662f\u600e\u6837\u8bbe\u8ba1\u8fd9\u7ec4\u5f26\u957f\uff08\u8fd9\u7ec4\u9891\u7387\uff09\uff0c\u4ee5\u4f7f\u53d1\u51fa\u7684\u9891\u7387\u6700\u7b26\u5408\u542c\u4f17\u5fc3\u4e2d\u90a3\u4e9b\u548c\u8c10\u7684\u97f3\u3002
\u4e00\u4e2a\u5e38\u8bc6\u662f\uff0c\u4e00\u822c\u9700\u8981\u5dee\u5f02 5% \u53ca\u4ee5\u4e0a\u7684\u4e24\u4e2a\u9891\u7387\uff0c\u53ef\u4ee5\u88ab\u6b63\u5e38\u4eba\u5206\u8fa8\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u97f3\u3002\u6240\u4ee5\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u6700\u5c0f\u5dee\u8ddd\u4e0d\u5fc5\u5c0f\u4e8e\u8fd9\u4e2a\u9891\u7387\u5dee\u3002
\u5728\u6b64\u989d\u5916\u63d0\u51fa\u4e00\u4e2a\u97f3\u7a0b\u7684\u5b9a\u4e49\uff1a\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u9891\u7387\u4e4b\u5dee\u53eb\u97f3\u7a0b\u3002\u6211\u4eec\u5728\u8fd9\u91cc\u4e3b\u8981\u5173\u5fc3\u7684\u97f3\u7a0b\u662f\u4e00\u4e2a\u516b\u5ea6\u3002
\u8bbe\u5b9a\u97f3\u5f8b\u7684\u8457\u540d\u505a\u6cd5\u4e3b\u8981\u6709\u4ee5\u4e0b\u4e09\u79cd\uff0c\u4e09\u5206\u635f\u76ca\u6cd5\uff0c\u4e94\u5ea6\u76f8\u751f\u6cd5\uff0c\u548c\u5341\u4e8c\u5e73\u5747\u5f8b\uff0c\u6211\u4eec\u4f9d\u6b21\u4ecb\u7ecd\u3002
\u4e09\u5206\u635f\u76ca\u6cd5
\u53d6\u4e00\u6839\u5f26\uff0c\u5206\u522b\u5728\u51761/2\uff0c1/3\uff0c1/4\u5904\u53d6\u4e00\u4e2a\u97f3\u3002
\u4e94\u5ea6\u76f8\u751f\u6cd5
\u7531\u6bd5\u8fbe\u54e5\u62c9\u65af\u63d0\u51fa\u3002\u5206\u522b\u57282/3\uff0c4/9\uff0c8/27\uff0c16/81\uff0c32/243\u5904\u53d65\u4e2a\u97f3\u3002
\u5341\u4e8c\u5e73\u5747\u5f8b Equal temperament
\u7531\u660e\u4ee3\u6731\u8f7d\u5809\uff08y\u00f9\uff09\u5728\u4e07\u5386\u5341\u4e8c\u5e74\u63d0\u51fa\uff0c\u540e\u4f20\u5165\u897f\u65b9\uff0c\u5b83\u7684\u8d21\u732e\u4e3b\u8981\u662f\u4fee\u6b63\u4e86\u4e94\u5ea6\u76f8\u751f\u6cd5\u4ea7\u751f\u7684\u97f3\uff0c\u5728\u8f6c\u8c03\u540e\u4f1a\u4e0e\u539f\u6765\u7684\u97f3\u7a0b\u6709\u4e00\u4e9b\u533a\u522b\u8fd9\u4e2a\u95ee\u9898\u3002\u662f\u73b0\u4ee3\u97f3\u4e50\u4f53\u7cfb\u4e2d\u6700\u5e95\u5c42\u7684\u4e00\u4e2a\u8bbe\u5b9a\uff0c\u5b83\u89c4\u5b9a\u4e86\u4e24\u4e2a\u5355\u97f3\u7684\u76f8\u5bf9\u97f3\u9ad8\uff0c\u5177\u4f53\u505a\u6cd5\u662f\u5c06\u4e00\u4e2a\u7eaf\u516b\u5ea6\u5206\u621012\u4efd\uff0c\u6bcf\u4efd\u79f0\u4e00\u4e2a\u534a\u97f3\uff0c\u4e24\u4efd\u4e00\u4e2a\u5168\u97f3\uff0c\u8fd9\u6837\u5c31\u5b9a\u4e49\u51fa\u4e86\u6240\u6709\u4e2d\u95f4\u7684\u5355\u97f3\u3002\u516b\u5ea6\u97f3\u7684\u9891\u7387\u5206\u4e3a\u5341\u4e8c\u7b49\u4efd\u7684\u505a\u6cd5\uff0c\u5c31\u662f\u5206\u4e3a\u5341\u4e8c\u9879\u7b49\u6bd4\u6570\u5217\uff0c\u6bcf\u4e2a\u97f3\u7684\u9891\u7387\u4e3a\u524d\u4e00\u4e2a\u97f3\u7684 2 \u7684 12 \u6b21\u65b9\u6839\u3002
\u897f\u65b97\u97f3\u53d6\u7684\u662f\u5176\u4e2d7\u4e2a\uff08\u767d\u952e\uff09\uff0c\u4e1c\u65b95\u97f3\u53d6\u4e865\u4e2a\uff08\u9ed1\u952e\uff09\u3002
\u8c03\u6027\u4e3b\u8981\u5305\u542b\u4e86\u8c03\u9ad8\uff08\u4e3b\u97f3\uff09\u4e0e\u8c03\u5f0f\u4e24\u5927\u65b9\u9762\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_10","title":"\u8c03\u5f0f","text":"\u674e\u91cd\u5149\u300a\u57fa\u672c\u4e50\u7406\u901a\u7528\u6559\u7a0b\u300b\u4e2d\u5b9a\u4e49\u8c03\u5f0f\u4e3a
\u51e0\u4e2a\u97f3\uff08\u4e00\u822c\u4e0d\u8d85\u8fc7\u4e03\u4e2a\uff0c\u4e0d\u5c11\u4e8e\u4e09\u4e2a\uff09\u6309\u7167\u4e00\u5b9a\u7684\u5173\u7cfb\uff08\u9ad8\u4f4e\u5173\u7cfb\u3001\u7a33\u5b9a\u4e0e\u4e0d\u7a33\u5b9a\u7684\u5173\u7cfb\u7b49\uff09\u8054\u7ed3\u5728\u4e00\u8d77\uff0c\u6784\u6210\u4e00\u4e2a\u97f3\u7ec4\u7ec7\uff0c\u5e76\u4ee5\u67d0\u4e00\u4e2a\u97f3\u4e3a\u4e2d\u5fc3\uff0c\u8fd9\u4e2a\u97f3\u7ec4\u7ec7\u5c31\u53eb\u201c\u8c03\u5f0f\u201d\u3002
\u8c03\u5f0f\u4e4b\u95f4\u7684\u5dee\u5f02\u65e2\u6709\u97f3\uff0c\u4e5f\u6709\u97f3\u7a0b
e.g. \u5206\u6790\u4e24\u4e2a\u8c03\u6bcf\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u97f3\u7a0b\u5173\u7cfb\u3002
C\u81ea\u7136\u5927\u8c03\uff1a1\u30012\u30013\u30014\u30015\u30016\u30017\u30011 \u5168\u5168\u534a\u5168\u5168\u5168\u534a
\u97f3\u7a0b\u7ed3\u6784\u4e3a\u5927\u4e8c\u5ea6\uff081-2\uff09\uff0c\u5927\u4e8c\u5ea6\uff082-3\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff083-4\uff09\uff0c\u5927\u4e8c\u5ea6\uff084-5\uff09\uff0c\u5927\u4e8c\u5ea6\uff085-6\uff09\uff0c\u5927\u4e8c\u5ea6\uff086-7\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff087-1\uff09
a\u81ea\u7136\u5c0f\u8c03\uff1a6\u30017\u30011\u30012\u30013\u30014\u30015\u30016 \u5168\u534a\u5168\u5168\u534a\u5168\u5168
\u97f3\u7a0b\u7ed3\u6784\u4e3a\u5927\u4e8c\u5ea6\uff086-7\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff087-1\uff09\uff0c\u5927\u4e8c\u5ea6\uff081-2\uff09\uff0c\u5927\u4e8c\u5ea6\uff082-3\uff09\uff0c\u5c0f\u4e8c\u5ea6\uff083-4\uff09\uff0c\u5927\u4e8c\u5ea6\uff084-5\uff09\uff0c\u5927\u4e8c\u5ea6\uff085-6\uff09
\u53e6\u4e00\u4e2a\u56de\u7b54\u5219\u8bf4\u533a\u522b\u5728\u4e0e\u4e3b\u97f3\u4e4b\u95f4\u7684\u97f3\u7a0b\u5173\u7cfb\u3002\u5e94\u8be5\u662f\u4e00\u6837\u7684\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_11","title":"\u5173\u7cfb\u5927\u5c0f\u8c03\u548c\u4e94\u5ea6\u5708","text":"\u4e0a\u8ff0\u4e24\u4e2a\u8c03\u662f\u5173\u7cfb\u5927\u5c0f\u8c03\uff0c\u4e5f\u5c31\u662f\u53ea\u6709\u5faa\u73af\u987a\u5e8f\u6539\u53d8\u4e86\uff0c\u5347\u964d\u5173\u7cfb\u662f\u76f8\u540c\u7684\u3002\u4ee5\u6b64\u6211\u4eec\u5f97\u5230\u4e00\u4e2a\u4e94\u5ea6\u5708
\u8fd9\u4e2a\u56fe\u4e0a\u53ef\u4ee5\u5f97\u5230\u7684\u4fe1\u606f\u6709\uff1a
\u5982\u4f55\u9ad8\u6548\u8bb0\u5fc6\u4e94\u5ea6\u5708\uff1a
\u4e0a\u534811\u70b9\uff0cFat Cat Go Down And Eat Bread\uff0c\u6240\u4ee5\u4e94\u5ea6\u5708\u4ece11\u70b9\u5f00\u59cb\u987a\u65f6\u9488\u65b9\u5411\u662fFCGDAEB
\u4e0b\u53486\u70b9\uff0cGo Down And Eat Bread\uff0c\u4ece6\u70b9\u65b9\u5411\u5f00\u59cb\u53c8\u662fGDAEB\uff0c\u7531\u4e8e\u662f\u665a\u4e0a\u6240\u4ee5\u90fd\u8981\u964d\u534a\u97f3
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_12","title":"\u5927\u8c03\u4e0e\u5c0f\u8c03","text":"\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u5f15\u5165\u4e86\u5927\u8c03\u4e0e\u5c0f\u8c03\u7684\u6982\u5ff5\u3002\u4e00\u4e2a\u66f4\u6b63\u5f0f\u7684\u5b9a\u4e49\u5982\u4e0b
\u5f53\u628a\u4e0a\u8ff0\u97f3\u7a0b\u5173\u7cfb\u5957\u5165\u4e00\u4e2a\u7528\u4efb\u610f\u4e3b\u97f3\u5f00\u59cb\u7684\u97f3\u8282\uff0c\u5c31\u4f1a\u51fa\u73b0\u5e26\u5404\u79cd\u5347\u964d\u53f7\u7684\u8c03\u6027\uff0c\u6bcf\u79cd\u6709\u4e00\u4e2a\u8c03\u53f7\u6765\u547d\u540d\u3002
\u8c03\u53f7\u7684\u4e00\u4e2a\u8bb0\u5fc6\u89c4\u5219\u662f
\u53d7\u9650\u4e8e\u4ee5\u524d\u7684\u5f8b\u5236\u548c\u6bcf\u4e2a\u97f3\u9891\u7387\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5173\u7cfb\uff0c\u4ee5\u524d\u662f\u65e0\u6cd5\u968f\u610f\u7ad9\u6362\u8c03\u6027\u7684\uff0c\u56e0\u4e3a\u5982\u679c\u8f6c\u6362\uff0c\u97f3\u7b26\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5c31\u4e0e\u4e4b\u524d\u4e0d\u4e00\u6837\u4e86\u3002\u4f46\u56e0\u4e3a\u6709\u5341\u4e8c\u5e73\u5747\u5f8b\uff0c\u8f6c\u8c03\u53d8\u5f97\u968f\u610f\u3002
\u4e0a\u8ff0\u8ba8\u8bba\u7684\u4e94\u5ea6\u5708\u548c\u5927\u5c0f\u8c03\u662f\u7406\u8bba\u5f97\u51fa\u7684\uff0c\u53ef\u80fd\u4e5f\u53ef\u4ee5\u79f0\u4e3a\u81ea\u7136\u97f3\u9636\u8c03\u5f0f\uff0c\u5f85\u8003\u8bc1\u3002\u4e0b\u9762\u6765\u4ecb\u7ecd\u4e00\u4e9b\u5386\u53f2\u4e0a\u5e38\u7528\u7684\u7ecf\u5178\u8c03\u5f0f\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#7","title":"7\u79cd\u4e2d\u53e4\u8c03\u5f0f\uff08\u6559\u4f1a\u8c03\u5f0f\uff09","text":"\u6559\u4f1a\u8c03\u5f0f \u97f3\u540d \u534a\u97f3\u95f4\u9694 \u7279\u70b9 Ionian\u5927 CDEFGAB 2212221 \u5927\u8c03\uff0c\u542c\u8d77\u6765\u660e\u6717\u5f00\u9614 Dorian DEFGABC 2122212 \u6c11\u65cf\u97f3\u4e50\uff0c\u5e38\u7528\u4e8e\u6e38\u620f\u548c\u7535\u5f71\u97f3\u4e50 Phrygian EFGABCD 1222122 \u5c0f\u4e8c\u5ea6\u7684Phrygian\u8c03\u5f0f\u542c\u8d77\u6765\u6c89\u91cd\uff0c\u5e38\u7528\u4e8e\u60b2\u5267\u7535\u5f71\u97f3\u4e50 Lydian FGABCDE 2221221 \u6ca1\u6709\u7eaf\u56db\u5ea6\u7684Lydian\u8c03\u5f0f\u9065\u8fdc\u6d69\u701a\uff0c\u6709\u79d1\u5e7b\u611f\uff0c\u5e38\u7528\u4e8e\u79d1\u5e7b\u7535\u5f71\u97f3\u4e50\u3002 Mixoly GABCDEF 2212212 \u6bd4\u5927\u8c03\u91cd\u53e0\u7387\u9ad8\uff08\u5177\u4f53\u91cd\u53e0\u7387\u7684\u8ba1\u7b97\u53ef\u4ee5\u89c1\u4e0b\u65b9\u5e16\u5b50\uff09\uff0c\u4e14\u660e\u6717\u751f\u52a8\u7684Mixoly\u5e38\u7528\u84dd\u8c03\u548c\u786c\u6838\u6447\u6eda Aeolian\u5c0f ABCDEFG 2122122 \u67d4\u548c\u6697\u6de1 Locrian BCDEFGA 1221222 \u6ca1\u6709\u7eaf\u4e94\u5ea6\u7684Locrian\u542c\u8d77\u6765\u6050\u6016\u9ed1\u6697\uff0c\u5e38\u7528\u4e8e\u707e\u96be\u6050\u6016\u7535\u5f71\u97f3\u4e50\u4e00\u4e2a\u6559\u4f1a\u8c03\u5f0f\u4e2d\u5177\u6709\u7684\u5ea6\u4e0e\u542c\u611f\u7684\u5173\u7cfb\u5206\u6790\u5982\u8fd9\u4e2a\u5e16\u5b50\u6240\u793a\uff1a
\u97f3\u7a0b - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_14","title":"\u8c03\u53f7\u4e0e\u60c5\u7eea\u8272\u5f69\u7684\u5173\u7cfb","text":"\u81ea\u7136\u97f3\u9636\u5404\u8c03\u5f0f\u4e0e\u60c5\u7eea\u8272\u5f69\u7684\u5173\u7cfb\u3002\u5f88\u6709\u610f\u601d
\u6211\u7684\u4e2a\u4eba\u89c2\u70b9\uff08TODO \u5f85\u66f4\u65b0\uff09
\u8c03\u5f0f \u8272\u5f69 \u610f\u8c61 C \u5927\u8c03 C \u5c0f\u8c03 D \u5927\u8c03 \u91d1\u8272 \u91d1\u78a7\u8f89\u714c\u7684\u5bab\u6bbf D \u5c0f\u8c03 E \u5927\u8c03 E \u5c0f\u8c03 F \u5927\u8c03 F \u5c0f\u8c03 \u58a8\u84dd\u8272 \u9ed1\u4e91\u5bc6\u5e03\u6d77\u6d6a\u7ffb\u6d8c G \u5927\u8c03 G \u5c0f\u8c03 A \u5927\u8c03 A \u5c0f\u8c03 \u51b0\u5ddd\u84dd \u707f\u70c2\u9633\u5149\u4e0b\u95ea\u8000\u7684\u51b0\u5ddd B \u5927\u8c03 B \u5c0f\u8c03"},{"location":"docs/5-life/read-watch-listen/music-theory/#_15","title":"\u548c\u58f0\u7406\u8bba","text":"\u62cd\u97f3\uff1a\u4e00\u79cd\u590d\u5408\u97f3\uff0c\u6765\u81ea\u4e8e\u540c\u4e00\u79cd\u4e50\u5668\u6216\u4e0d\u540c\u4e50\u5668\u7684\u4e24\u4e2a\u5355\u97f3\u76f8\u4e92\u53e0\u52a0\uff0c\u5f62\u6210\u5177\u6709\u89c4\u5f8b\u7684\u5f3a\u5f31\u53d8\u5316\u3002\u4e0e\u8c10\u6ce2\u4e0d\u540c\u7684\u662f\uff0c\u62cd\u97f3\u4e00\u822c\u8981\u6c42\u4e24\u4e2a\u97f3\u7684\u632f\u5e45\u76f8\u8fd1\uff0c\u4f46\u4e0d\u4e00\u5b9a\u9891\u7387\u4e3a\u500d\u6570\u5173\u7cfb\u3002\u5982\u56fe
\u548c\u58f0\uff1a\u7531\u8d85\u8fc7\u4e00\u4e2a\u5355\u97f3\u7ec4\u5408\u6210\u7684\u58f0\u97f3\u3002\u4e00\u822c\u897f\u65b9\u7406\u8bba\u4e2d\u548c\u58f0\u4e3b\u8981\u6307\u4e24\u4e2a\u97f3\u7684\u5173\u7cfb\uff0c\u800c\u4e09\u4e2a\u53ca\u4e09\u4e2a\u4ee5\u4e0a\u5219\u5c5e\u4e8e\u548c\u5f26\u7684\u8303\u7574\u3002
\u62cd\u97f3\u90fd\u662f\u548c\u58f0\uff0c\u4f46\u662f\u548c\u58f0\u4e0d\u4e00\u5b9a\u4ea7\u751f\u62cd\u97f3\uff0c\u56e0\u4e3a\u8d85\u51fa\u4eba\u8033\u53ef\u4ee5\u542c\u5230\u7684\u9891\u7387\u7684\u4e0d\u7b97\u62cd\u97f3\uff0c\u4e0d\u540c\u4e50\u5668\u53d1\u51fa\u7684\u4e5f\u4e0d\u53eb\u62cd\u97f3\uff0c\u540c\u65f6\u62cd\u97f3\u4e5f\u4e25\u683c\u8981\u6c42\u6240\u6709\u97f3\u7684\u9891\u7387\u8d77\u59cb\u4f4d\u7f6e\u4e25\u683c\u5bf9\u9f50\uff0c\u800c\u548c\u58f0\u53ea\u8981\u6709\u540c\u65f6\u53d1\u58f0\u7684\u65f6\u523b\u5373\u53ef\u3002
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_16","title":"\u548c\u58f0\u4e0e\u548c\u8c10\u7a0b\u5ea6\u7684\u5173\u7cfb","text":"\u9996\u5148\u6709\u76f8\u90bb\u4e24\u4e2a\u97f3\u4e4b\u95f4\u7684\u9891\u7387\u6bd4\u7ea6\u4e3a 1.06\uff08\u8bb0\u4e3ap\uff09\u3002\u5404\u4e2a\u97f3\u7a0b\u7684\u9891\u7387\u6bd4\uff08\u5373\uff0c\u76f8\u8ddd\u67d0\u4e2a\u97f3\u7a0b\u7684\u4f4e\u97f3\u4e0e\u9ad8\u97f3\u9891\u7387\u4e4b\u6bd4\uff09\u5219\u53ef\u4ee5\u7531\u5176\u97f3\u6570t\u6309\u516c\u5f0f\u7b97\u5f97 \\(1/2^{2t/12} = 1/06^{-2t}\\) \uff0c\u5176\u4e2d\uff0c\u7b49\u5f0f\u5de6\u8fb9\u662f\uff0c\u7b49\u5f0f\u53f3\u8fb9\u662f
\u4e8e\u662f\u5f97\u5230\u7684\u6240\u6709\u5173\u7cfb\uff08\u5e76\u7ecf\u8fc7\u5b9e\u9a8c\uff09\u5f97\u5230\u4e00\u4e2a\u7ecf\u9a8c\u8868\u683c\u3002\u8fd9\u4e2a\u8868\u683c\u5e94\u8be5\u6700\u65e9\u662f\u7531\u516c\u5143\u524d\u6bd5\u8fbe\u54e5\u62c9\u65af\u5f97\u51fa\u7684\uff0c\u4ed6\u8868\u8ff0\u4e3a\uff1a\u4e24\u4e2a\u97f3\u7684\u7434\u5f26\u957f\u4e4b\u6bd4\u7684\u6700\u5927\u516c\u7ea6\u6570\u8d8a\u5c0f\uff0c\u4e24\u4e2a\u97f3\u540c\u65f6\u5f39\u594f\u5c31\u8d8a\u548c\u8c10\u3002\uff08\u5982\u679c\u56de\u5fc6\u6211\u4eec\u4e0a\u9762\u8ba8\u8bba\u7684\u6cdb\u97f3\uff0c\u6cdb\u97f3\u91cd\u53e0\u6bd4\u4f8b\u8d8a\u9ad8\u5c31\u8d8a\u548c\u8c10\uff09
\u5341\u4e8c\u5e73\u5747\u5f8b\u97f3\u9ad8\u53c2\u8003\u7ebf\uff1a
\u53ef\u67e5\u9605\u7684\u548c\u8c10\u4e0e\u4e0d\u548c\u8c10\u8868\u683c\uff1a
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_17","title":"\u4f34\u594f","text":"\u6bcf\u79cd\u8c03\u5f0f\u53ef\u91c7\u7528\u7684\u548c\u5f26\u79cd\u7c7b\uff0c\u53ef\u4ee5\u7528\u4ee5\u4e0b\u8868\u683c\u6765\u67e5\u9605\u3002
\u4f34\u594f\u4e0d\u4e00\u5b9a\u662f\u548c\u5f26\u4e2d\u6240\u6709\u97f3\u4e00\u8d77\u5f39\uff0c\u4e5f\u53ef\u4ee5\u62c6\u89e3\u3002\u5e38\u89c1\u7684\u62c6\u89e3\u6cd5\u6709
\u4e09\u548c\u5f26\u8f6c\u4f4d TODO
\u6bd4\u5982\u6709\u4e00\u4e2a\u4e09\u548c\u5f26CEG\uff0c\u79f0\u4e3a\u539f\u4f4d\uff0c\u5c06C\u53d8\u6210\u9ad8\u516b\u5ea6\u7684C\uff0c\u79f0\u4e3a\u7b2c\u4e00\u8f6c\u4f4d\uff0c\u5728\u7b2c\u4e00\u8f6c\u4f4d\u57fa\u7840\u4e0a\u5c06E\u53d8\u6210\u9ad8\u516b\u5ea6\u7684E\uff0c\u79f0\u4e3a\u7b2c\u4e8c\u8f6c\u4f4d\u3002
\u7ec8\u6b62\u5f0f TODO
\u4e0d\u5b8c\u5168\u7ec8\u6b62\u5f0f TODO
\u4e03\u548c\u5f26 TODO
\u548c\u5f26 - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
"},{"location":"docs/5-life/read-watch-listen/music-theory/#_18","title":"\u53c2\u8003\u8d44\u6599","text":"pianofanie - \u77e5\u4e4e (zhihu.com) \u3010\u8bfe\u7a0b\u3011\u4e50\u7406\u77e5\u8bc6\u8bb2\u91cd\u70b9
Devymex Wang - \u77e5\u4e4e (zhihu.com) \u5199\u7ed9\u7406\u5de5\u79d1\u4eba\u770b\u7684\u4e50\u7406
\u3010\u9633\u5149\u8bb2\u4e50\u7406\u3011\u5c0f\u767d\u5411\u4e50\u7406\u6559\u7a0b12\u96c6\u5168\u3010doyoudo\u51fa\u54c1\u3011_\u54d4\u54e9\u54d4\u54e9_bilibili
\u3010\u4e50\u7406\u77e5\u8bc6\u5165\u95e8\u3011\u4ec0\u4e48\u662f\u8c03\u6027\uff1f\u4ec0\u4e48\u662f\u5927\u5c0f\u8c03\u5f0f\uff1f\u79d1\u5b66\u7406\u89e3\u5927\u5c0f\u8c03\u77e5\u8bc6\uff0c\u63a2\u8ba8\u6709\u6548\u5b66\u4e60\u80cc\u540e\u7684\u601d\u7ef4\u6a21\u5f0f - \u77e5\u4e4e (zhihu.com)
\u6982\u8ff0 - \u97f3\u4e50\u7406\u8bba\u7684\u79d1\u5b66\u4e0e\u8d77\u6e90 - \u97f3\u4e50\u7406\u8bba\u81ea\u5b66\u5165\u95e8\u57fa\u7840\u6559\u7a0b (pianoabrsm.com)
\u5341\u4e8c\u5e73\u5747\u5f8b - \u7ef4\u57fa\u767e\u79d1\uff0c\u81ea\u7531\u7684\u767e\u79d1\u5168\u4e66 (wikipedia.org)
\u300a\u97f3\u4e50\u7406\u8bba\u57fa\u7840\u300b\uff0c\u674e\u91cd\u5149\u7f16\u8457\uff0c\u4eba\u6c11\u97f3\u4e50\u51fa\u7248\u793e\uff1b
\u300a\u57fa\u672c\u4e50\u7406\u6559\u7a0b\u300b\uff0c\u8d75\u5c0f\u5e73\u7f16\u8457\uff0c\u4eba\u6c11\u97f3\u4e50\u51fa\u7248\u793e\uff1b
\u300a\u57fa\u672c\u4e50\u7406\u6559\u7a0b\u300b\uff0c\u7ae5\u5fe0\u826f\u7f16\u8457\uff0c\u4e0a\u6d77\u97f3\u4e50\u51fa\u7248\u793e\u3002
:material-circle-edit-outline: \u7ea6 7 \u4e2a\u5b57
Musical Recommendations
"},{"location":"docs/5-life/read-watch-listen/musicals/#austrian-german-musicals","title":"Austrian & German Musicals","text":"TODO
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 529fe3b6..0bf7dffe 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ