1 / 13

This slide was a material for the “Reading PLDI Papers ( PLDIr )” study group

This slide was a material for the “Reading PLDI Papers ( PLDIr )” study group written by Kazuhiro Inaba ( www.kmonos.net ), under my own understanding of the papers published at PLDI So, it may include many mistakes etc

fionan
Download Presentation

This slide was a material for the “Reading PLDI Papers ( PLDIr )” study group

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. This slide was • a material for the “Reading PLDI Papers (PLDIr)” study group • written by Kazuhiro Inaba ( www.kmonos.net ), under my own understanding of the papers published at PLDI • So, it may include many mistakes etc • For your correct understanding, please consult the original paper and/or the authors’ presentation slide!

  2. k.inaba (稲葉 一浩), reading: PLDIr #12Mar 12, 2011 paper written by J. Kodumal and A. Aiken(PLDI 2004) The Set Constraint/CFL ReachabilityConnection in Practice

  3. 解きたい問題(の例) 「taintedとマークされた値がuntaintedマークの変数に入らない」の静的検証 int id(int y1) { int y2 = y1; return y2; } int main(void) { taintedint x1; int z1, x2; untaintedint z2; z1 = id(x1); // call site 1 z2 = id(x2); // call site 2 }

  4. 典型手法:グラフの到達可能性問題と見なす int id(int y1){int y2=y1; return y2;} int main(void) { taintedint x1; int z1, x2; untaintedint z2; z1 = id(x1); // call site 1 z2 = id(x2); // call site 2 } 危 から 安 に行ける? 危 x1 z1 y1 y2 x2 z2 安

  5. Betterな精度の典型手法:グラフのCFL到達可能性問題と見なすBetterな精度の典型手法:グラフのCFL到達可能性問題と見なす int id(int y1){int y2=y1; return y2;} int main(void) { taintedint x1; int z1, x2; untaintedint z2; z1 = id(x1); // call site 1 z2 = id(x2); // call site 2 } 危 から 安 に c1r1 | c2r2 で 行ける? 危 x1 z1 r1 c1 y1 y2 r2 x2 c2 z2 安

  6. CFL Reachabilityを解く典型手法:“Set Constraint” 問題に帰着 • CFL Reachabilityの計算量 • O( |文法|3 |グラフ|3 ) • CYK構文解析 +Warshall-Floyd 到達可能性 • 多項式時間だけど実用には厳しい重さ • ヒューリスティックス Solver のある問題に帰着  “Set Constraint” 問題

  7. “Set Constraint” 問題 こんな連立方程式を解く問題。 • 集合Xの要素とYの要素をconsしたら Y に入る • nil というアトムは集合 Y に入る • 集合 Y の cons の形の要素の第一要素はone cons(X, Y) ⊆Y nil ⊆Y 1(Y) ⊆ one cons

  8. 既存のやり方の流れ int id(int y1){int y2=y1; return y2;} int main(void) { taintedint x1; int z1, x2; untaintedint z2; z1 = id(x1); // call site 1 z2 = id(x2); // call site 2 } cons(X, Y) ⊆Y nil ⊆Y 1(Y) ⊆ one cons 危 x1 z1 解析の問題を CFL Reachabilityに r1 c1 y1 y2 CFLReachabilityをSet Constraint に r2 x2 c2 z2 安 解く

  9. 問題点 cons(X, Y) ⊆Y nil ⊆Y 1(Y) ⊆ one cons 危 x1 z1 r1 c1 CFL ReachabilityをSet Constraint に [Melski&Reps 97] y1 y2  まだ遅い r2 x2 c2 z2 安

  10. 観察 • 一般の CFLReachを解きたいわけじゃない • プログラム解析から現れるような CFLReachが解ければよい • “Call-Ret の対応が取れてる” を表す文法のCFLReachが解ければ十分では? 危 x1 z1 r1 c1 y1 y2 r2 x2 c2 z2 安

  11. この論文のやったこと:“DyckCFL” に特化した帰着法 • k-DyckCFL • S ::= P* • P ::= (1 S )1 | (2 S )2 | … | (k S )k • 「対応のとれた括弧の列」

  12. tbw

  13. 結果 • 漸近計算量 • O( |文法|3 |グラフ|3 )  O( |文法| |グラフ|3 )

More Related