Static analyses based on typestates are important in certifying correctness of code contracts. Such analyses rely on Deterministic Finite Automata (DFAs) to specify properties of an object. We target the analysis of contracts in low-latency environments, where many useful contracts are impractical to codify as DFAs and/or the size of their associated DFAs leads to sub-par performance. To address this bottleneck, we present a lightweight typestate analyzer, based on an expressive specification language that can succinctly specify code contracts. By implementing it in the static analyzer Infer, we demonstrate considerable performance and usability benefits when compared to existing techniques. A central insight is to rely on a sub-class of DFAs with efficient bit-vector operations.
翻译:基于类型状态的静态分析对于证明代码合同的正确性十分重要。 这种分析依赖于确定性非技术性自制自动数据(DFAs)来指定一个对象的特性。 我们的目标是分析低纬度环境中的合同,因为许多有用的合同不切实际,无法以 DFAs 和/或其相关DFA的大小进行编码,导致分级性能。为了解决这一瓶颈问题,我们提出了一个轻量型态分析器,其依据是能够简明地说明代码合同的清晰规格语言。 通过在静态分析器 Infer 中实施,我们展示了与现有技术相比相当的性能和可用性效益。一个核心的洞察力是依靠具有高效的位量操作的子级DFAs。