Lecture Notes on Static Analysis

Thanks to Michael I.Schwartzbach. We will read his paper Lecture Notes on Static Analysis.
Lecture Notes on Static Analysis Michael I. Schwartzbach BRICS, Department of Computer Science University of Aarhus, Denmark mis@brics.dk

There are many interesting questions that can be asked about a given program:
 does the program terminate?
 how large can the heap become during execution?
 what is the possible output?
Other questions concern individual program points in the source code:
 does the variable x always have the same value?
 will the value of x be read in the future?
 can the pointer p be null?
 which variables can p point to?
 is the variable x initialized before it is read?
 is the value of the integer variable x always positive?
 what is a lower and upper bound on the value of the integer variable x?
 at which program points could x be assigned its current value?
 do p and q point to disjoint structures in the heap?
Rice's theorem is a general result from 1953 that informally can be paraphrased as stating that all interesting questions about the behavior of programs are undecidable.
The solution is to settle for approximative answers that are still precise enough to fuel our applications.
Consider again the problem of determining if a variable has a constant value.
If our intended application is to perform constant propagation, then the analysis may only answer yes if the variable really is a constant and must answer no if the variable may or may not be a constant. The trivial solution is of course to answer no all the time, so we are facing the engineering challenge of answering yes as often as possible while obtaining a reasonable performance.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值