控制流分析

控制流分析()簡稱CFA,是一種確認程式控制流程靜態代碼分析技術。控制流程會以控制流圖來表示。對於函數程式語言物件導向程式設計,CFA都是指計算控制流程的演算法。

控制流分析一詞最早是由Neil D. Jones[1]及Olin Shivers[2]開始使用。

對於像是Scheme之類有高階函數的程式語言,不一定可以會程式中直接看出函數呼叫的目標,例如以下的程式片段

(lambda (f) (f x))

根據上述程式無法確認程序f是指什麼,此情形下的控制流分析需考慮何時會執行此程式碼,及當時的傳入值。

抽象釋義約束補償型別系統都可以用來進行控制流分析。

參考資料

  1. Neil D. Jones, , Automata, Languages and Programming, 1981: 114–128, doi:10.1007/3-540-10843-2_10
  2. Shivers, Olin, , Proceedings of the ACM SIGPLAN'88 Conference on Programming Language Design and Implementation (PLDI), SIGPLAN Notices, Vol.23, No.7, 1988: 164–174, doi:10.1145/53990.54007, Reprinted in \emph{20 Years of the ACM SIGPLAN Conference on Programming Language Design and Implementation (1979--1999): A Selection 参数|quote=值左起第62位存在換行符 (帮助)
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.