arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.20056cs.PLcs.LO
收藏

在 Java 字节码层面推理异常行为

Reasoning About Exceptional Behavior At the Level of Java Bytecode

Marco Paganoni, Carlo A. Furia

AI总结:

本文扩展 ByteBack,提出通过 Vimp 中间层在 Java 字节码层面建模并验证异常行为,可支持多版本 Java 及 Scala、Kotlin。

摘要:

程序的异常行为会显著复杂化其控制流,从而使准确推理程序正确性变得困难。另一方面,对真实程序进行形式化验证很可能涉及异常——这是现代编程语言中普遍存在的特性。本文提出一种验证 Java 程序异常行为的新方法,该方法扩展了我们此前关于 ByteBack 的工作。ByteBack 在程序的字节码上工作,同时提供在源代码层面指定期望行为的手段;这一方法使 ByteBack 区别于大多数面向源代码的最新验证工具。为了以便于形式化推理的方式显式建模程序的异常行为,我们引入了 Vimp:一种高层字节码表示,它用面向验证的特性扩展了 Soot 框架的 Grimp,从而充当字节码与 Boogie 中间验证语言之间的中间层。通过该中间层在字节码上工作,为适应新的语言版本和变体带来了灵活性与适配性:正如我们的实验所表明,ByteBack 能够验证所有 Java 版本以及 Scala 和 Kotlin(另外两种流行的 JVM 语言)中涉及异常行为的程序。

英文摘要:

A program's exceptional behavior can substantially complicate its control flow, and hence accurately reasoning about the program's correctness. On the other hand, formally verifying realistic programs is likely to involve exceptions -- a ubiquitous feature in modern programming languages. In this paper, we present a novel approach to verify the exceptional behavior of Java programs, which extends our previous work on ByteBack. ByteBack works on a program's bytecode, while providing means to specify the intended behavior at the source-code level; this approach sets ByteBack apart from most state-of-the-art verifiers that target source code. To explicitly model a program's exceptional behavior in a way that is amenable to formal reasoning, we introduce Vimp: a high-level bytecode representation that extends the Soot framework's Grimp with verification-oriented features, thus serving as an intermediate layer between bytecode and the Boogie intermediate verification language. Working on bytecode through this intermediate layer brings flexibility and adaptability to new language versions and variants: as our experiments demonstrate, ByteBack can verify programs involving exceptional behavior in all versions of Java, as well as in Scala and Kotlin (two other popular JVM languages).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑