Static analyses based on typestates are important in certifying correctness of industrial code contracts. At their heart, such analyses rely on finite-state machines (FSMs) to specify important properties of an object. Unfortunately, many useful contracts are impractical to encode as FSMs and/or their associated FSMs have a prohibitively large number of states, which leads to sub-par performance for low-latency environments. To address this bottleneck, we present a lightweight typestate analyzer, based on a specification language that can succinctly specify code contracts with significant expressivity. A central idea in our analysis is that using a class of FSMs that can be expressed and analyzed as bit-vectors can unlock substantial performance improvements. We validate this idea by implementing our lightweight typestate analyzer in the industrial-strength static analyzer Infer. We show how our lightweight approach exhibits considerable performance and usability benefits when compared to existing techniques, including industrial-scale static analyzers.
翻译:基于类型状态的静态分析对于证明工业编码合同的正确性十分重要。 在其内心,这种分析依靠有限状态机器来说明某一物体的重要特性。 不幸的是,许多有用的合同对于编码来说是不切实际的,因为FSM和(或)其相关的FSM有许多令人望而生畏的状态,从而导致低纬度环境的次等性能。为了解决这一瓶颈问题,我们提出了一个轻量级类型分析器,其依据的是一种规格语言,可以简洁地规定具有显著的直观性能的代码合同。我们分析中的一个中心思想是使用一类FSMS进行表达和分析,因为比特微量器可以打开实质性的性能改进。我们通过在工业强度静态分析器中采用轻量型状态分析器来验证这一想法。 我们展示了我们的轻量级方法与包括工业规模静态分析器在内的现有技术相比,如何表现出相当大的性能和可用性效益。