此為編譯原理實(shí)驗(yàn)報(bào)告 學(xué)習(xí)消除文法左遞規(guī)算法,了解消除文法左遞規(guī)在語(yǔ)法分析中的作用 內(nèi)含 設(shè)計(jì)算法 目的 源碼 等等.... 算法:消除左遞歸算法為: (1)把文法G的所有非終結(jié)符按任一種順序排列成P1,P2,…Pn 按此順序執(zhí)行 (2)FOR i:=1 TO n DO BEGIN FOR j:=1 DO 把形如Pi→Pjγ的規(guī)則改寫成 Pi→δ1γ δ2γ … δkγ。其中Pj→δ1 δ2 … δk是關(guān)于Pj的所有規(guī)則; 消除關(guān)于Pi規(guī)則的直接左遞歸性 END (3)化簡(jiǎn)由(2)所得的文法。即去除那些從開始符號(hào)出發(fā)永遠(yuǎn)無(wú)法到達(dá)的非終結(jié)符的 產(chǎn)生規(guī)則。
Finds the polynomial p10 of degree less than or equal to 10 that interpolates
cos x on the interval [0, PI/2] at 11 equally spaced points. Study the error betwee
between the function and the polynomial at 41 equally spaced points over the
same interval. Repeat the latter but use your 11 points to be Chebyshevs.
The cart with an inverted pendulum, shown below, is "bumped" with an impulse
force, F. Determine the dynamic equations of motion for the system, and lin
earize about the pendulum s angle, theta = Pi (in other words, assume that p
endulum does not move more than a few degrees away from the vertical, chosen
to be at an angle of Pi). Find a controller to satisfy all of the design re
quirements given below.