Static Analysis 01 Introduction

Programming Languages

  • 命令式编程语言(C++,Java)
  • 函数式编程语言(Js,Pascal,Python)
  • 逻辑式编程语言/声明式编程语言()

Why We Need Static Analysis

  • Program Reliability
    • Null pointer dereference
    • memory leak
    • etc…
  • Program Security
    • Private information leak
    • injection attack
    • etc…
  • Compiler Optimization
    • Dead code elimination 死代码清除
    • code motion
    • etc…
  • Program Understanding
    • IDE call hierarchy
    • type indication
    • etc…

Unfortunately, by Rice’s Theorem, there is no such approach to determine whether P satisfies such non-trivial properties, i.e., giving exact answer: Yes or No

  • Compromise soundness (false negatives) 漏报
  • Compromise completeness (false positives) 误报

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EdNh9Ccq-1666225318054)(…/…/…/…/…/…/AppData/Roaming/Typora/typora-user-images/image-20220722224103692.png)]

Static Analysis — Bird‘ s Eye View

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-II0mm2tY-1666225318054)(D:/tengxun/709034836/FileRecv/E316C0F1C7AAF56C9096CA3026FCD6FA.png)]

Static Analysis: ensure (or get close to) soundness, while making good trade-offs between analysis precision and analysis speed

Two Words to Conclude Static Analysis

  • Abstraction
  • Over-approximation
    • Transfer functions
    • Control flows

抽象 + 近似

Abstraction

Over-approximation

Transfer Functions

  • In static anaysis , transfer functions define how to evaluate different program statements on abstract values.
  • Transfer functions are defined according to “analysis problem” and the “semantics” of different program statements.

Control flows

控制流

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值