From 8ac4aeae822a0525873c4629f9d3d645e6adbcaf Mon Sep 17 00:00:00 2001 From: James Deng Date: Mon, 16 Feb 2015 16:25:53 +0800 Subject: [PATCH] lec3b.final finished. --- Srt/lec3b.srt | 449 +++++++++++++++++++++++++------------------------- 1 file changed, 229 insertions(+), 220 deletions(-) diff --git a/Srt/lec3b.srt b/Srt/lec3b.srt index cee1016..d7ee9ec 100644 --- a/Srt/lec3b.srt +++ b/Srt/lec3b.srt @@ -20,7 +20,7 @@ Symbolic Differentiation: Quotation 5 00:00:19,100 --> 00:00:23,413 -教授:Harold教授讲解了如何构造健壮的系统 +教授:嗯 Harold教授讲解了如何构造健壮的系统 PROFESSOR: Well, Hal just told us how you build robust systems. 6 @@ -31,7 +31,6 @@ The key idea was-- 7 00:00:26,813 --> 00:00:30,200 我想你们大多还没吃透其中的要点 - I'm sure that many of you don't really assimilate that yet-- 8 @@ -71,17 +70,17 @@ The way he was explaining how to do that 15 00:00:49,460 --> 00:00:54,786 - +与其在问题分解出的子问题上 求解具体问题 was instead of solving a particular problem at every level of decomposition of the problem at the subproblems, 16 00:00:55,080 --> 00:00:56,780 - -when you solve the class of problems, +你不如解决一类问题 +where you solve the class of problems, 17 00:00:56,780 --> 00:01:00,400 - +也就是你想要解决的具体问题的“邻居” which are a neighborhood of the particular problem that you're trying to solve. 18 @@ -616,7 +615,7 @@ It's just the answers. 124 00:07:43,093 --> 00:07:45,186 -表达式的导数与它的书写别无二致 +表达式的导数也是一个表达式 The derivative of an expression is the way it's written. 125 @@ -636,7 +635,7 @@ syntax of expressions and things like that. 128 00:07:54,706 --> 00:07:55,933 -首先是“分情况分析” +首先要做“分情况分析” Well, there's a case analysis. 129 @@ -806,12 +805,12 @@ I want to make a sum. 162 00:09:53,533 --> 00:09:55,680 -#TBD -Do you remember which is the sum for end or the menu end? +(意义不明) +Do you remember which is the sub for head or the menu end? 163 00:09:57,146 --> 00:10:01,093 -#TBD +是叫做被除数和除数一类的么? Or was it the dividend and the divisor or something like that? 164 @@ -996,12 +995,12 @@ Let's attack that. 200 00:12:57,960 --> 00:13:00,000 -#TBD +首先 我要用到一种“双关”思想 Well, first of all, I'm going to play a pun. 201 00:13:00,906 --> 00:13:02,120 - +这种“双关”思想非常重要 It's an important pun. 202 @@ -1176,12 +1175,12 @@ I can't break it up, and yet it isn't that variable. 236 00:15:18,900 --> 00:15:25,120 -这也并不是说 存在一些复杂的常量表达式 +这也并不是说 一些复杂的表达式就不是常量表达式 That does not mean that there may be other expressions that are more complicated that are constants. 237 00:15:25,200 --> 00:15:28,920 -#TBD +我只是想用这种方式考察基本常量 It's just that I'm going to look at the primitive constants in this way. 238 @@ -1196,7 +1195,7 @@ I can combine predicate expressions which return true or false with and. 240 00:15:38,626 --> 00:15:46,826 -表达式是原子的么?这意味着它不能被细分 +表达式是原子的么?--原子表达式不可以再被细分 Something atomic, The expression is atomic, meaning it cannot be broken into parts. 241 @@ -1231,7 +1230,7 @@ things like x, and y, things like this. 247 00:16:19,746 --> 00:16:22,373 -#TBD +当然 像这样的组合式就可以再被细分 Whereas, of course, something like this can be broken up into pieces. 248 @@ -1791,7 +1790,7 @@ And I define M1 to be cadr and M2 to be caddr. 359 00:26:00,093 --> 00:26:02,386 -#TBD +当你说行话的时候 你就上道了 You get to be a good Lisp programmer because you start talking that way. 360 @@ -1896,7 +1895,7 @@ Well the answer is right. 380 00:27:30,120 --> 00:27:35,146 -#TBD +当我们还需要用户额外检验一下 真是糟糕投了 But I give people take off points on an exam for that, sadly enough. 381 @@ -2040,921 +2039,931 @@ We've just developed a fairly plausible program for computing the derivatives of It's an incomplete program, if you would like to add more rules. 409 -00:29:42,133 --> 00:29:49,706 -#TBD -And perhaps you might extend it to deal with uses of addition with any number of arguments and multiplication with any of the number of arguments. +00:29:42,130 --> 00:29:47,746 +你可能需要加强这个系统 使得它能够处理 +And perhaps you might extend it to deal with uses of addition with any number of arguments 410 +00:29:47,760 --> 00:29:49,700 +多元加法和多元乘法 +and multiplication with any of the number of arguments. + +411 00:29:49,893 --> 00:29:51,386 这些都相当简单 And that's all rather easy. -411 +412 00:29:52,733 --> 00:29:56,933 但这里面也有一些瑕疵 However, there was a little fly in that ointment. -412 +413 00:29:57,480 --> 00:30:02,373 回到这张幻灯片来 We go back to this slide. -413 +414 00:30:02,946 --> 00:30:08,600 我们发现 得到的表达式相当乱 We see that the expressions that we get are rather bad. -414 +415 00:30:08,880 --> 00:30:11,013 这个表达式非常糟糕 This is a rather bad expression. -415 +416 00:30:11,466 --> 00:30:13,106 我们是怎么得到这样的表达式的? How do we get such an expression? -416 +417 00:30:13,840 --> 00:30:15,506 为什么是这样呢? Why do we have that expression? -417 +418 00:30:16,840 --> 00:30:18,746 我们详细地分析一下这个表达式 Let's look at this expression in some detail. -418 +419 00:30:18,920 --> 00:30:20,760 找出这些片段都是出自哪里 Let's find out where all the pieces come from. -419 +420 00:30:21,693 --> 00:30:24,560 如我们所见 这里的和式 As we see here, we have a sum-- -420 +421 00:30:24,560 --> 00:30:26,560 也就是上一小节中给你们提到的 just what I showed you at the end of the last time-- -421 +422 00:30:27,120 --> 00:30:29,093 (+ (* X 1) (* 1 X)) of X times 1 plus 1 time X. -422 +423 00:30:29,586 --> 00:30:31,386 是这个乘式的导数 That is a derivative of this product. -423 +424 00:30:32,520 --> 00:30:36,413 也就是A乘上这个的积 这里A不是X的函数 The product of a times that, where a does not depend upon x, -424 +425 00:30:36,410 --> 00:30:38,410 因此A关于X是一个常数 and therefore is constant with respect to x, -425 +426 00:30:39,040 --> 00:30:44,533 导数为这个和式 从这里到这里 再到这里 is this sum, which goes from here all the way through here and through here. -426 +427 00:30:44,800 --> 00:30:48,893 因为这个是乘数乘以被乘数的导数 Because it is the first thing times the derivative of the second -427 +428 00:30:49,573 --> 00:30:54,453 加上被乘数乘以乘数的导数 plus the derivative of the first times the second -428 +429 00:30:54,666 --> 00:30:59,066 我们在黑板上的程序告诉我们确实是这样的 as the program we wrote on the blackboard indicated we should do. -429 +430 00:31:00,653 --> 00:31:05,360 当然 这里B乘以X的积 And, of course, the product of bx over here -430 +431 00:31:05,493 --> 00:31:09,813 被化成了 B*1+0*X manifests itself as B times 1 plus 0 times X -431 +432 00:31:10,813 --> 00:31:16,066 因为B不是X的函数 because we see that B does not depend upon X. -432 +433 00:31:16,466 --> 00:31:18,560 因此B的导数为0 And so the derivative of B is this 0, -433 +434 00:31:18,773 --> 00:31:21,480 而X对自己求导则为1 and the derivative of X with respect itself is the 1. -434 +435 00:31:23,066 --> 00:31:28,640 -这里的加法化成了 这两个导数的和#TBD +这里的加法化成了 这两个导数的和 And, of course, the derivative of the sums over here turn into these two sums of the derivatives of the parts. -435 +436 00:31:29,373 --> 00:31:33,506 所以这里 我想告诉你和之前一样的东西 So what we're seeing here is exactly the thing I was trying to tell you about -436 +437 00:31:33,666 --> 00:31:35,893 也就是在讲斐波那契数那时候 with Fibonacci numbers a while ago, -437 +438 00:31:37,773 --> 00:31:39,493 -所谓的 “过程的形式” +所谓的 “过程的形状” that the form of the process -438 +439 00:31:41,386 --> 00:31:46,440 就是通过局部的规则向低层次展开 is expanded as low as from the local rules that you see in the procedure, -439 +440 00:31:48,053 --> 00:31:52,573 也就是过程代表了一系列用于演进过程局部规则 that the procedure represents a set of local rules for the expansion of this process. -440 +441 00:31:53,360 --> 00:32:00,093 -#TBD +这里 过程还遗留了一些东西--也就是答案 And here, the process left behind some stuff, which is the answer. -441 +442 00:32:00,253 --> 00:32:06,266 -#TBD +这是通过遍历表达式的树结构构造出来的 And it was constructed by the walk it takes of the tree structure, which is the expression. -442 +443 00:32:08,413 --> 00:32:12,613 答案中的每个部分对应问题中的某个部分 So every part in the answer we see here derives from some part of the problem. -443 +444 00:32:14,466 --> 00:32:17,786 比如说 现在我们考察FOO的导数 Now, we can look at, for example, the derivative of foo, -444 +445 00:32:17,786 --> 00:32:19,653 也就是AX^2+BX+C which is ax square plus bx plus c, -445 +446 00:32:19,840 --> 00:32:23,053 并另令自变量 比如像这里 with respect to other things, like here, for example, -446 +447 00:32:24,146 --> 00:32:27,480 我们令A为自变量 求FOO的导数 we can see that the derivative of foo with respect to a. -447 +448 00:32:28,106 --> 00:32:31,773 这都非常相似 实际上 它们是同样的代数表达式 And it's very similar. It's, in fact, the identical algebraic expression, -448 +449 00:32:32,453 --> 00:32:35,240 只是它们之中0和1的位置不一样罢了 except for the fact that theses 0's and 1's are in different places. -449 +450 00:32:36,066 --> 00:32:38,600 这是因为在这个树结构的遍历中 Because the only degree of freedom we have in this tree walk -450 +451 00:32:38,973 --> 00:32:43,853 只可能是CONSTANT?和SAME-VAR?会因变量的不同 is what's constant with respect to the variable we're taking the derivative with respect to -451 +452 00:32:44,280 --> 00:32:45,813 而造成不同结果 and what's the same variable. -452 +453 00:32:48,266 --> 00:32:52,093 回到黑板上来再看看 In other words, if we go back to this blackboard and we look, -453 +454 00:32:52,653 --> 00:32:57,493 我们在求和式或乘式的导数时根本没有发挥的余地 we have no choice what to do when we take the derivative of the sum or a product. -454 +455 00:32:58,080 --> 00:33:04,480 真正可以做文章的地方 则是表达式和自变量 The only interesting place here is, is the expression the variable, -455 +456 00:33:04,800 --> 00:33:10,106 -表达式是否为关于自变量的常数 #TBD 33:11 +以及对于那些短小的表达式 是否为关于自变量的常量 or is the expression a constant with respect to that variable for very, very small expressions? -456 -00:33:10,360 --> 00:33:14,493 +457 +00:33:10,360 --> 00:33:12,413 +就是这些地方导致了不同的0和1的产生 +In which case we get various 1's and 0's, -In which case we get various 1's and 0's, which if we go back to this slide, +458 +00:33:12,693 --> 00:33:14,490 +回过头来看这张幻灯 +which if we go back to this slide, -457 +459 00:33:15,120 --> 00:33:18,160 这里就出现了“0” we can see that the 0's that appear here, for example, -458 +460 00:33:18,373 --> 00:33:22,746 这里是求FOO(A)的导数时得到的“1” this 1 over here in derivative of foo with respect to A, -459 +461 00:33:22,960 --> 00:33:24,866 我们得到了X^2 which gets us an X square, -460 +462 00:33:24,960 --> 00:33:32,533 -#TBD +这个1是X*X关于X的导数 关于B求导时1变成了0 because that 1 gets the multiply of X and X into the answer, that 1 is 0. -461 +463 00:33:32,640 --> 00:33:34,893 -#TBD +这里 我们求FOO关于C的导数 Over here, we're not taking the derivative of foo with respect to c. -462 +464 00:33:36,786 --> 00:33:39,306 但是这些表达式的轮廓是一致的 But the shapes of these expressions are the same. -463 +465 00:33:40,546 --> 00:33:43,960 看看这些轮廓 都是相同的 See all those shapes. They're the same. -464 +466 00:33:50,373 --> 00:33:52,280 那么 难道是我们的规则出了问题? Well is there anything wrong with our rules? -465 +467 00:33:53,586 --> 00:33:55,026 不 这些规则都对 No. They're the right rules. -466 +468 00:33:56,120 --> 00:33:57,773 我们曾经遇到过这种问题 We've been through this one before. -467 +469 00:33:58,066 --> 00:34:03,533 -#TBD +你将会发现 这其中缺乏一些非常好的思想 One of the things you're going to begin to discover is that there aren't too many good ideas. -468 +470 00:34:06,320 --> 00:34:09,746 昨天 我们在考察有理数时 When we were looking at rational numbers yesterday, -469 +471 00:34:12,120 --> 00:34:14,480 想要得到3/4却得到6/8 the problem was that we got 6/8 rather then 3/4. -470 +472 00:34:14,973 --> 00:34:16,493 答案没有化简 The answer was unsimplified. -471 +473 00:34:18,093 --> 00:34:20,906 当然 当下的问题也非常类似 The problem, of course, is very similar. -472 +474 00:34:21,186 --> 00:34:25,413 -#TBD +我想把不相同的表达式通过化简来使相同 There are things I'd like to be identical by simplification that don't become identical. -473 +475 00:34:27,573 --> 00:34:31,893 当然 有理数加法和乘法的规则依然正确 And yet the rules for doing addition a multiplication of rational numbers were correct. -474 +476 00:34:33,973 --> 00:34:37,413 因此这里 我们依葫芦画瓢 So the way we might solve this problem is do the thing we did last time, which always works. -475 +477 00:34:37,786 --> 00:34:39,893 上次能行的办法 这次也没问题 If something worked last time it ought to work again. -476 +478 00:34:40,533 --> 00:34:42,053 也就是改换一下它的表示 It's changed representation. -477 +479 00:34:43,133 --> 00:34:46,440 或许在将其表示出来时我们可以进行 Perhaps in the representation we could put in a simplification step -478 +480 00:34:47,880 --> 00:34:49,786 一步产生简化表示的步骤 that produces a simplified representation. -479 +481 00:34:50,173 --> 00:34:51,733 当然啦 这也不是万用万灵 This may not always work, of course. -480 +482 00:34:52,493 --> 00:34:54,146 我也不想证明它是万能的 I'm not trying to say that it always works. -481 +483 00:34:55,120 --> 00:35:00,440 但这也是控制复杂度的一招妙计 But it's one of the pieces of artillery we have in our war against complexity. -482 +484 00:35:01,466 --> 00:35:03,853 我们小心翼翼地解决这些问题 You see, because we solved our problem very carefully. -483 +485 00:35:04,306 --> 00:35:07,200 我们所做的 就是把问题划分为几个部分 What we've done, is we've divided the world in several parts. -484 +486 00:35:07,573 --> 00:35:08,733 分别是求导规则 There are derivatives rules -485 +487 00:35:11,320 --> 00:35:15,800 和在这种层面上的一般代数规则 and general rules for algebra of some sort at this level of detail. -486 +488 00:35:16,380 --> 00:35:21,226 然后就有一道抽象屏障 and i have an abstraction barrier. -487 +489 00:35:22,480 --> 00:35:33,493 -这里是代数表达式的表示——表结构 +这里是代数表达式的表示--表结构 And i have the representation of the algebraic expressions, list structure. -488 +490 00:35:37,333 --> 00:35:42,560 在这道屏障中 我定义了接口过程 And in this barrier, I have the interface procedures. -489 +491 00:35:43,253 --> 00:35:49,826 比如 CONSTANT? SAME-VAR? I have constant, and things like same-var. -490 +492 00:35:54,600 --> 00:35:58,720 又比如 SUM? MAKE-SUM I have things like sum, make-sum. -491 +493 00:36:02,226 --> 00:36:05,573 还有 A1 A2 I have A1, A2. -492 +494 00:36:06,600 --> 00:36:08,586 还有 PRODUCT? 之类的东西 I have products and things like that, -493 +495 00:36:08,746 --> 00:36:11,906 我所需要的、针对各式代数表达式的东西 all the other things I might need for various kinds of algebraic expressions. -494 +496 00:36:12,946 --> 00:36:19,146 构筑这些屏障我可以随意地改换表示法 Making this barrier allows me to arbitrarily change the representation -495 +497 00:36:20,146 --> 00:36:23,200 而不用改变在某种表示法下编写的规则 without changing the rules that are written in terms of that representation. -496 +498 00:36:25,040 --> 00:36:29,080 如果我能通过改变表示法来解决问题 So if I can make the problem go away by changing representation, -497 +499 00:36:30,386 --> 00:36:34,520 那么把问题分解为两个部分则帮了我大忙 the composition of the problem into these two parts has helped me a great deal. -498 +500 00:36:35,653 --> 00:36:37,546 好吧 举一个非常简单的例子 So let's take a very simple case of this. -499 +501 00:36:38,826 --> 00:36:40,080 我们的问题是什么? What was one of the problems? -500 +502 00:36:40,266 --> 00:36:43,613 回到这张幻灯片来 Let's go back to this transparency again. -501 +503 00:36:44,506 --> 00:36:47,346 看这里 哦 这相当糟糕 And we see here, oh yes, there's horrible things -502 +504 00:36:47,626 --> 00:36:51,866 这里是一个表达式与“0”的和 like here is the sum of an expression and 0. -503 +505 00:36:53,146 --> 00:36:56,666 毋庸置疑这应该是该表达式本身 Well that's no reason to think of it as anything other than the expression itself. -504 +506 00:36:57,213 --> 00:37:01,906 为什么这里还会有加号? Why should the summation operation have made up this edition? -505 +507 00:37:03,386 --> 00:37:04,573 这其实可以更智能点 It can be smarter than that. -506 +508 00:37:05,560 --> 00:37:10,080 又比如说这里 是某表达式与“1”的积 Or here, for example, is a multiplication of something by 1. -507 +509 00:37:11,160 --> 00:37:12,293 这和之前一个道理 It's another thing like that. -508 +510 00:37:12,866 --> 00:37:15,680 又像这里 与“0”相乘显然是“0” Or here is a product of something with 0, which is certainly 0. -509 +511 00:37:17,866 --> 00:37:19,520 因此我们也不用去构造这些式子了 So we won't have to make this construction. -510 +512 00:37:21,440 --> 00:37:22,626 我们为什么不这么做呢? So why don't we just do that? -511 +513 00:37:23,666 --> 00:37:27,960 我们需要去修改表示法 基本上就是那里了 We need to change the way the representation works, almost here. -512 +514 00:37:37,400 --> 00:37:41,840 定义 MAKE-SUM 为 Make-sum to be. -513 +515 00:37:42,053 --> 00:37:43,760 呃 现在就不是那么简单了 Well, now it's not something so simple. -514 +516 00:37:44,000 --> 00:37:50,400 除非是有必要 否则我不会简单地把加号和式子组合成表 I'm not going to make a list containing the symbol plus and things unless I need to. -515 +517 00:37:51,720 --> 00:37:53,053 那么 还有哪些可能呢? Well, what are the possibilities? -516 +518 00:37:54,560 --> 00:37:58,533 如果……这里有一些可能的情况 If...I have some sort of cases here. -517 +519 00:37:59,386 --> 00:38:08,200 如果都是数值的话 如果A1是数值的话 If I have numbers, if a1 is a number-- -518 +520 00:38:09,053 --> 00:38:10,933 这个基本过程我刚刚提到过 and here's another primitive I've just introduced, -519 +521 00:38:10,933 --> 00:38:13,186 也就是用来检测参数是否为数值 it's possible to tell whether something's number-- -520 +522 00:38:15,386 --> 00:38:23,826 并且A2也是数值的话 也就是A2不是符号表达式 and if number A2, meaning they're not symbolic expressions, -521 +523 00:38:24,453 --> 00:38:26,200 那么我们就直接把它们加起来 then why not do the addition now? -522 +524 00:38:26,453 --> 00:38:29,920 结果就是A1加上A2的和 The result is just a plus of A1 and A2. -523 +525 00:38:32,320 --> 00:38:33,986 我并不是检查它们代表数值 I'm not asking if these represent numbers. -524 +526 00:38:33,986 --> 00:38:35,986 这里所有的符号都代表数值 Of course all of these symbols represent numbers. -525 +527 00:38:37,333 --> 00:38:41,226 就比如 我想要考察的是这个东西是否为数值3 I'm talking about whether the one I've got is the number 3 right now. -526 +528 00:38:43,400 --> 00:38:44,400 另一种情况 And, for example, -527 +529 00:38:48,773 --> 00:38:59,613 假设A1是数值 并且为0 supposing A1 is a number, and it's equal to 0, -528 +530 00:39:04,200 --> 00:39:06,386 那么答案就是A2 well then the answer is just A2. -529 +531 00:39:06,933 --> 00:39:08,680 不用再构造什么 There is no reason to make anything up. -530 +532 00:39:10,986 --> 00:39:23,413 如果A2是数值 并且为0 And if A2 is a number, and equal A2 0, -531 +533 00:39:27,160 --> 00:39:28,906 那么答案就是A1 then the result is A1. -532 +534 00:39:30,040 --> 00:39:33,653 如果没有比这些更好的情况 And only if I can't figure out something better to do with this situation, -533 +535 00:39:34,133 --> 00:39:35,613 我就需要构造一个表 well, I can construct a list. -534 +536 00:39:37,866 --> 00:39:42,866 构造一个用于表示答案的表 Otherwise I want the representation to be the list -535 +537 00:39:44,133 --> 00:39:52,333 其中有 '+、A1和A2 containing the quoted symbol plus, and A1, and A2. -536 +538 00:39:58,666 --> 00:40:01,653 当然 积的导数也可以类比此法 And, of course, a very similar thing can be done for products. -537 +539 00:40:03,013 --> 00:40:05,040 这里 我就不细讲了 And I think I'll avoid boring you with them. -538 +540 00:40:05,440 --> 00:40:07,240 我就直接在黑板上写出结果 I was going to write it on the blackboard. -539 +541 00:40:07,653 --> 00:40:09,800 这并不是很重要 你们已经了解它的思想了 I don't think it's necessary. You know what to do. -540 +542 00:40:10,760 --> 00:40:11,613 非常简明 It's very simple. -541 +543 00:40:12,866 --> 00:40:19,893 现在 我们来看看用这种方式改造程序后 效果如何 But now, let's just see the kind of results we get out of changing our program in this way. -542 +544 00:40:21,680 --> 00:40:27,880 哦 这是修改表达式构造函数后的求导结果 Well, here's the derivatives after having just changed the constructors for expressions. -543 +545 00:40:28,986 --> 00:40:32,213 对同样地FOO求导:AX^2+BX+C The same foo, aX square plus bX plus c, -544 +546 00:40:33,280 --> 00:40:40,706 我得到了 2AX+B and what I get is nothing more than the derivative of that is 2aX plus B. -545 +547 00:40:40,706 --> 00:40:42,106 虽然它并没有化到最简 Well, it's not completely simplified. -546 +548 00:40:42,600 --> 00:40:44,533 我应该合并同类项和求和 I would like to collect common terms and sums. -547 +549 00:40:45,066 --> 00:40:46,080 但这又是另外一回事了 Well, that's more work. -548 +550 00:40:47,120 --> 00:40:51,866 当然啦 完成这个功能的代码就大而复杂了 And, of course, programs to do this sort of thing are huge and complicated. -549 +551 00:40:52,280 --> 00:40:55,280 代数化简 是一项繁复的工作 Algebraic simplification, it's a very complicated mess. -550 +552 00:40:56,373 --> 00:41:00,133 你们可能听过MIT以前开发的一个非常出名的程序 MAXIMA There's a very famous program you may have heard of called Maxima developed at MIT in the past, -551 +553 00:41:00,426 --> 00:41:03,146 它有5000页的LISP代码 which is 5,000 pages of Lisp code, -552 +554 00:41:03,920 --> 00:41:06,506 大部分是代数化简的操作 mostly the algebraic simplification operations. -553 +555 00:41:08,080 --> 00:41:12,213 这里是FOO的导数 There we see the derivative of foo. -554 +556 00:41:12,213 --> 00:41:16,866 -#TBD 41:20 -In fact, X is at something I wouldn't take off more than 1 point for on an elementary calculus class. +要是我的话 我会在初等微积分课上讲讲“改换主变量”这个东西 +In fact, alias is something I wouldn't take off more than 1 point for on an elementary calculus class. -555 +557 00:41:18,386 --> 00:41:22,493 以A为自变量 FOO的导数则是X*X And the derivative of foo with respect to a, well it's gone down to X times X, -556 +558 00:41:22,800 --> 00:41:23,800 看起来还不差 which isn't so bad. -557 +559 00:41:24,746 --> 00:41:27,533 以B为自变量 FOO的导数则是X本身 And the derivative of foo with respect to b is just X itself. -558 +560 00:41:28,066 --> 00:41:30,120 以C为自变量 FOO的导数则为“1” And the derivative of foo with respect to c comes out 1. -559 +561 00:41:30,706 --> 00:41:32,040 我对这些结果很满意 So I'm pretty pleased with this. -560 +562 00:41:34,106 --> 00:41:39,013 你所看到的 都是精心设计、仔细规划的例子 What you've seen is, of course, a little bit contrived, carefully organized example -561 +563 00:41:39,560 --> 00:41:42,600 用以展示如何操作代数表达式 to show you how we can manipulate algebraic expressions, -562 +564 00:41:42,960 --> 00:41:47,933 我们如何不用具体的语法 而用抽象的语法抽象地进行 how we do that abstractly in terms of abstract syntax rather than concrete syntax -563 +565 00:41:49,213 --> 00:41:56,293 以及我们如何使用抽象屏障控制构造这些表达式 and how we can use the abstraction to control what goes on in building these expressions. -564 +566 00:41:57,800 --> 00:42:00,413 真正的奥义并不是如此的简单 But the real story isn't just such a simple thing as that. -565 +567 00:42:01,000 --> 00:42:04,453 实际上 真正的奥义在于我在操作这些表达式时 The real story is, in fact, that I'm manipulating these expressions. -566 +568 00:42:04,453 --> 00:42:06,720 -代数表达式和代码表达式—— +代数表达式和代码表达式-- And the expressions are the same expressions-- -567 +569 00:42:06,720 --> 00:42:07,973 回过头来看看幻灯片 going back to the slide-- -568 +570 00:42:08,080 --> 00:42:10,520 都是同一种Lisp表达式 as the ones that are Lisp expressions. -569 +571 00:42:12,026 --> 00:42:12,973 这样一语双关 一石二鸟 There's a pun here. -570 +572 00:42:13,826 --> 00:42:21,493 我用表示代码相同的方法来作为我的表示法 I've chosen my representation to be the same as the representation in my language of similar things. -571 +573 00:42:22,893 --> 00:42:26,520 为了要这样做 我得付出点代价 By doing so, I've invoked a necessity. -572 +574 00:42:26,906 --> 00:42:30,346 我需要使用类似于“引用”的东西 I created the necessity to have things like quotation -573 +575 00:42:30,973 --> 00:42:38,173 -#TBD +这是因为 我的语言可以编写讨论语言表达式的表达式 because of the fact that my language is capable of writing expressions that talk about expressions of the language. -574 +576 00:42:39,760 --> 00:42:43,226 我需要有某种东西指出 这个是我需要讨论的表达式 I need to have something that says, this is an expression I'm talking about -575 +577 00:42:43,760 --> 00:42:46,133 而不是说 (去求)这个表达式的值 rather than this expression is talking about something, -576 +578 00:42:47,200 --> 00:42:48,440 我想要的是前者 and I want to talk about that. -577 +579 00:42:51,346 --> 00:42:55,360 引用阻止表达式被求值 其语义为“就是表达式本身” So quotation stops and says, I'm talking about this expression itself. -578 +580 00:42:57,973 --> 00:43:00,853 有了这种能力以后 Now, given that power, -579 +581 00:43:01,586 --> 00:43:03,826 如果我可以操作语言的表达式 if I can manipulate expressions of the language, -580 +582 00:43:04,800 --> 00:43:09,000 我可以在语言层之上构建更加有力的层次 I can begin to build even much more powerful layers upon layers of languages. -581 +583 00:43:09,773 --> 00:43:12,640 因为我可以编写不仅仅是内嵌于Lisp的语言 Because I can write languages that not only are embedded in Lisp -582 +584 00:43:13,466 --> 00:43:14,800 或者是其它的语言 or whatever language you start with, -583 +585 00:43:15,266 --> 00:43:17,760 我可以编写一种完全不同的语言 but languages that are completely different, -584 +586 00:43:18,586 --> 00:43:22,240 而其实质上则是被Lisp或其它语言所解释 that are just, if we say, interpreted in Lisp or something like that. -585 +587 00:43:23,173 --> 00:43:25,466 我们以后还会对此有更深入的理解 We'll get to understand those words more in the future. -586 +588 00:43:26,560 --> 00:43:32,093 我现在只是想让你们意识到 But right now I just want to leave you with the fact that we've hit a line -587 +589 00:43:32,360 --> 00:43:34,986 我们已经感触到了一种惊人的力量 which gives us tremendous power. -588 +590 00:43:36,000 --> 00:43:37,826 现在我们有了方天画戟 And this point we've bought a sledgehammer. -589 +591 00:43:38,173 --> 00:43:40,920 当我们使用它时 也得万分小心 We have to be careful to what flies when we apply it. -590 +592 00:43:42,170 --> 00:43:43,000 谢谢大家 Thank you. -591 +593 00:43:44,106 --> 00:43:49,666 MIT OpenCourseWare http://ocw.mit.edu -592 +594 00:43:50,000 --> 00:44:00,546 本项目主页 https://github.com/DeathKing/Learning-SICP