http:^^www.cs.cornell.edu^info^people^yanhong^incrementalization.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 155 行
HTML
155 行
MIME-Version: 1.0
Server: CERN/3.0
Date: Monday, 16-Dec-96 21:39:08 GMT
Content-Type: text/html
Content-Length: 7002
Last-Modified: Saturday, 29-Jun-96 22:41:27 GMT
<TITLE>Incrementalization</TITLE><h1>Incrementalization-</h1><ul><h4>A General Systematic Approach to Efficiency Improvement</h4></ul><hr><h2>Objectives</h2><ul> <li> We are engaged in an ambitious effort to <i>derive</i>incremental programs automatically (or semi-automatically) fromnon-incremental programs written in standard programming languages.This approach contrasts with earlier approaches that aimed toincrementally <i>evaluate</i> non-incremental programs.<p> <li> In essence, every program computes by fixed-point iteration,expressed as recursive functions or loops. This is why loopoptimizations are so important. A loop body can be regarded as aprogram <i>f</i> parameterized by an induction variable <i>x</i> thatis incremented on each iteration by a change operation <i>+</i>.Efficient iterative computation relies on effective use of state,i.e., computing the result of each iteration using stored results ofprevious iterations. This is why strength reduction and relatedtechniques are crucial for performance. <p> <li> Given a program <i>f</i> and an input change operation<i>+</i>, a program <i>f'</i> that computes <i>f(x+y)</i> efficientlyby using the result of the previous computation of <i>f(x)</i> iscalled an <i>incremental version</i> of <i>f</i> under <i>+</i>.Sometimes, information other than the result of <i>f(x)</i> needs tobe maintained and used for efficient incremental computation of<i>f(x+y)</i>. We call a function that computes such information an<i>extended version</i> of <i>f</i>. Thus, the goal of computingloops efficiently corresponds to constructing an extended version of aprogram <i>f</i> and deriving an incremental version of the extendedversion under an input change operation <i>+</i>. <p> <li> In general, incremental computation aims to solve a problemon a sequence of inputs that differ only slightly from one another,making use of the previously computed output in computing a newoutput, instead of computing the new output from scratch. Incrementalcomputation is a fundamental issue relevant throughout computersoftware, e.g., optimizing compilers, transformational programdevelopment, and interactive systems. </ul><P> <HR> <P><h2>Results</h2><P><ul> <p> <li> Thus far, we have partitioned the problem of derivingincremental programs into three subproblems:<ul> <p> <li> <b>P1.</b> Exploiting the <i>result</i> of <i>f(x)</i>,i.e., the return value of <i>f(x)</i>.<p> <li> <b>P2.</b> Caching, exploiting, and maintaining<i>intermediate results</i> of <i>f(x)</i>, i.e., values computed inthe middle of computing <i>f(x)</i>.<p> <li> <b>P3.</b> Discovering, computing, exploiting, andmaintaining <i>auxiliary information</i> of <i>f(x)</i>, i.e.,information not computed at all <i>f(x)</i>, that can be inexpensivelymaintained. </ul><p> We summarize here the essence of our methods: <p> <li> <b>P1.</b> In <!WA0><!WA0><!WA0><!WA0><ahref="ftp://ftp.cs.cornell.edu/pub/yanhong/Inc-SCP95.ps.Z">"Systematic Derivation of Incremental Programs"</a>, we gave a generalsystematic transformational approach for deriving an incrementalversion <i>f'</i> of a program <i>f</i> under an input change<i>+</i>. The basic idea is to identify in the computation of<i>f(x+y)</i> those subcomputations that are also performed in thecomputation of <i>f(x)</i> and whose values can be retrieved from thecached result <i>r</i> of <i>f(x)</i>. The computation of<i>f(x+y)</i> is symbolically transformed to avoid re-performing thesesubcomputations by replacing them with corresponding retrievals. Thisefficient way of computing <i>f(x+y)</i> is captured in the definitionof <i>f'(x,y,r)</i>.<p> <li> <b>P2.</b> In <!WA1><!WA1><!WA1><!WA1><ahref="ftp://ftp.cs.cornell.edu/pub/yanhong/Cir-PEPM95.ps.Z"> "CachingIntermediate Results for Program Improvement"</a>, we gave a method,called <i>cache-and-prune</i>, for statically transforming programs tocache all intermediate results useful for incremental computation.The basic idea is to<ul> <p> <li> <b>I.</b> extend the program <i>f</i> to a program<i>f-bar</i> that returns all intermediate results,<p> <li> <b>II.</b> incrementalize the program <i>f-bar</i> under<i>+</i> to obtain an incremental version <i>f-bar'</i> of<i>f-bar</i> using our method for P1,<p> <li> <b>III.</b> analyze the dependencies in <i>f-bar'</i>, thenprune the extended program <i>f-bar</i> to a program <i>f-hat</i> thatreturns only the useful intermediate results, and prune the program<i>f-bar'</i> to obtain a program <i>f-hat'</i> that incrementallymaintains only the useful intermediate results. </ul><p> <li> <b>P3.</b> In <!WA2><!WA2><!WA2><!WA2><ahref="ftp://ftp.cs.cornell.edu/pub/yanhong/Dai-POPL96.ps.Z">"Discovering Auxiliary Information for Incremental Computation"</a>,we proposed a approach for finding auxiliary information. Auxiliaryinformation is, by definition, useful information about <i>x</i> thatis <i>not</i> computed by <i>f(x)</i>. Where, then, can one find it?The key insight of this approach is:<ul> <p> <li> <b>A.</b> Consider, as candidate auxiliary informationfor <i>f</i>, all intermediate computations of an incremental versionof <i>f</i> that depend only on <i>x</i>; such an incremental versioncan be obtained using some techniques we developed for solving P1 andP2. (We use techniques developed for solving P1 and P2, instead ofjust P1, so that the candidate auxiliary information includesauxiliary information useful for efficiently maintaining theintermediate results.) </ul><p> How can one discover which pieces of candidate auxiliaryinformation are useful and how they can be used? We proposed:<ul> <p> <li> <b>B.</b> Extend <i>f</i> with all candidate auxiliaryinformation, then apply some techniques used in our methods for P1 andP2 to obtain an extended version and an incremental extended versionthat together compute, exploit, and maintain only useful intermediateresults and useful auxiliary information. </ul><p> <li> Thus, on the one hand, one can regard the method for P2 as anextension to method for P1; on the other hand, one can regard methodfor P1 as aids for solving P2. Similarly, on the one hand, one canregard the method for P3 as an extension to methods for P1 and P2; onthe other hand, one can regard methods for P1 and P2 as aids forsolving P3. The modular components complement one another to form acomprehensive principled approach for incremental computation andtherefore also for efficient iterative computation generally.Although the entire approach seems complex, each module or step issimple.<p> <li> In <!WA3><!WA3><!WA3><!WA3><ahref="ftp://ftp.cs.cornell.edu/pub/yanhong/Cachet-KBSE95.ps.Z">"CACHET: An Interactive, Incremental-Attribution-Based ProgramTransformation System For Deriving Incremental Programs"</a> wedescribe our prototype implementation of these ideas. </ul><hr><address><!WA4><!WA4><!WA4><!WA4><a href="http://www.cs.cornell.edu/home/yanhong/">Y. Annie Liu</a> <kbd>yanhong@cs.cornell.edu</kbd>Last updated 6/29/96 </address></body>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?