正在加载图片...
P 2 Ditected Gtpph AT sttpctiH We will build a graph abstraction to capt ure the relationships as shown in Figures s and 2, as well as enable us to have some contents at each node. You should st udy the co de in HFI nEl THEO provided with the project very closely; parts of it are described in the following discussion We will assume that our graph is represented as a collect ion of graph-elements. Each graph-element will itself consist of a node (represented as a sy mbol-the name of the node), a list of children no des, and some contents stored at the node (which in general can be of any type). The constructors, r the -nl Alt enfCer mabst l rrr rapn Abe-raf-i(s a f(llef-i(s (f rapnielemes-e rrr rapniElemes- a s(te, u-g(isg filtres fr(m -ne ste, ast f(s-es-e (f -ne s(t rrr N(te emb(1 a ey mb(l label (r same f(r -ne s(te (s-es-e= asy -ype ne f(s-es-e (f -ne s te rr111111111111111 rr rapniElemes- r makeigrapnielemes-: Nte, lie-<Nte>,C(s-es-e i> Elemes htefise hmakeigrapnielemes- s(te fniltres f(s-es-e) hlie-'grapnielemes-s(te filtres f(s-es-e)) htefise hgrapnielemes es-) r asy-ype i> b((leas hast hpair? elemes-) grapnielemes- hfar elemes-)))) s(te h-ne Same) fr(m -ne rapnielemes htefise hgrapnielemes-i>s(te elemes-) r rapnielemes- i>N(te hif hs(-hgrapnielemes-? elemes-)) herr(r "(bjef- s(- elemes-:" elemes-) hire- hftr el r e- -ne filtres ha lie-(f (u-g(isg s(te samee)fr(m -ne rapniElemes- htefise hgrapnielemes-i>fniltres elemes-)r rapniElemes- 1> lie-<N (te> hif hs (-hgrapnielemes-? elemes-)) herr(r"(bjef- s(-elemes-:" elemes-) heef(st hftr elemes-)))) fr(m -ne rapn htefise hgrapnielemes-if(s-es-e elemes-) r rapniElemes- i> C(s-es-e hif hs ( hgrapnielemes-? elemes-)) n elemes-) h-nirt hftr elemes-)))) Given this represent at ion for a graph-element, we can build the graph out of these element s as follows htefise hmakeigrapn elemes-e) r lie-<Elemes->i> rapn hf(se 'gran elemes-e))￾         (         3 1 ,  + ,%   + %+% % %+1  % ￾  '& % 1 % , %  +2 % %  + !  %+ %* +    ￾ 2 1+ +  - 2* %*F %    %,  + 1 %%%! 3 1 %% +  + % % %    +=%! + += 1 % %%    8% %  %*, D +   + 9&  %  + %&  % % %  +  81++    ,  * *9! + %%& * &  %%%  + # ￾  ,%  %+1 ,1)                                 ! "  "        # ! ""             $   % &# &   ￾ ￾        ￾   '       ￾ ￾ (   "" &   ￾ ￾(  ￾)( '  ￾      ￾      ￾ ￾ &     &  ￾ ￾ ￾ (  ￾ *+  $ *  ￾  ￾       ￾            ￾ ￾ &      &  % & ￾ ￾ ￾ (  ￾ *+  $ *  ￾  ￾          ￾ ￾ &     & # ￾ ￾ ￾ (  ￾ *+  $ *  ￾ ￾  2 +% %   +=& 1  , + +   +% % % 1%) ￾ ￾      % & &  ￾ '  
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有