English 中文(简体)
形式建设 控制流动图
原标题:Formally constructing Control Flow Graph

撰写大学项目的汇编者,我谨将我的“史蒂尔·辛塔克斯”树改为“控制流动图”。

意料中,化学文摘社编号(V)应当从中删除。 我非常了解如何构造边套(G=(V,E)),但很难用时间书写过程,更正式地计算出轨迹。

我先造就了这种cal式比对(Pseudo):

def edges(n:Node)(nestedin_next: Node) : List[(Node,Node)] = 
    n match {
       case (c_1 :: c_2::tl) => (c1,c2) :: edges(c2::tl)(nestedin_next)++
                                   edges(c_1)(c_2)//recurse
       case c_1 :: Nil => (c_1,nestedin_next)::Nil
       case  i@ IF(_,c1,c2) => (i,c1)::(i,c2)::edges(c1)(nestedin_next)++
                                edges(c2)(nestedin_next)
       case _ => Nil
     }

应与中世纪统计结构相匹配:

( IF(1,
       ASSIGN(x,1), // ia1
       ASSIGN(x,2) // ia2
     ) ::  // i1
  ASSIGN(y,2) ::  // a1
  ASSIGN(z,ADD(x,y)) :: //a2 
  IF(z, 
       RET(z), //i2r1
         assign(z,0):: // i2a1
         ret(z) // i2r2
  ) :://i2
   Nil
)

并且提供一种优势,例如:

{ i1 -> ia1,
   i1 -> ia2,
   ia1 -> a1,
   ia2 -> a1,
   a1 -> a2,
   a2 -> i2,
   i2 -> i2r1
   i2-> i2a1
   i2a1 -> i2r2
   i2r2 -> _|_
   i2r1 -> _|_ 
}

CFG(dot) DotSrc

任何人在如何比“假代码”更正式地做这个比什么方面?

Im:

e[[ IF(_,b1,b2) ]] = (if -> b1) + (if -> b2) cup e[[ b1 ]] cup e[[ b2 ]]
e[[ b1, b2 ]] = e[[b1]] cup e[[b2]]

(以上仅提供树木,而不是图表。) 例如,从时边到下台的边远。

EDIT:

我先在,然后读到Scala的数据流,我喜欢“succ”和“following”方法。 然而,我很抱着硬的时间 b倒,这种 b倒成了更正规的描述,这主要归功于Nifty childAttr,s.next,其中隐藏了一些细节,在我试图正式指明这些细节时,这些细节就显得模糊不清。

EDIT:

I ve通过《哥伦书》和“Modern Compiler Implementation inML”以及的其他材料 学习撰写《汇编》,一些/大部分提到数据流动和控制流动,但从来未触及母国行动,以任何形式创建国别清单。

EDIT3:

通过Kiama author,Associate Professor Tony Sloane 我拿到了

只要我能看到这些书本的“去做”是以该方案的“每份说明”为基础,而不是以“基本区块”为基础。 尽管如此,我们还是作出了大量投入。

最佳回答
问题回答




相关问题
XML-RPC Standard and XML Data Type

I was looking at XML-RPC for a project. And correct me if I m wrong, but it seems like XML-RPC has no XML datatype. Are you supposed to pass as a string? or something else? Am I missing something? ...

Is it exists any "rss hosting" with API for creating feeds

I am creating a desktop app that will create some reports. I want to export these reports as RSS or ATOM feeds. I can easily create feeds with Rome lib for Java. But I have no idea how to spread them. ...

Improving Q-Learning

I am currently using Q-Learning to try to teach a bot how to move in a room filled with walls/obstacles. It must start in any place in the room and get to the goal state(this might be, to the tile ...

High-traffic, Highly-secure web API, what language? [closed]

If you were planning on building a high-traffic, very secure site what language would you use? For example, if you were planning on say building an authorize.net-scale site, that had to handle tons ...

Def, Void, Function?

Recently, I ve been learning different programming langages, and come across many different names to initalize a function construct. For instance, ruby and python use the def keyword, and php and ...

热门标签