通过非侵入式属性缓存实现实用的运行时间检查
Practical Run-time Checking via Unobtrusive Property Caching
摘要:
在动态编程语言中,使用被称为断言或契约的注释来描述要为其生成运行时间测试的程序属性已经变得频繁。然而,提出来支持这种运行时间测试的框架通常在标准程序执行上引起高的时间和/或空间开销。我们提出了一种方法,用于减少这种开销,是基于使用memoization缓存检查评估的中间结果,避免重复检查以前验证的属性。与减少检查频率的方法相比,我们的建议具有穷举的优点(即,在所有点检查所有测试),同时仍然比标准运行时间检查有效得多。与以前有限的记忆化工作相比,它不需要修改数据结构表示或检查代码即可执行任务。虽然这种方法是通用的和系统无关的,我们提出了具体的上下文中的Ciao运行时间检查框架,这使我们能够提供一个操作语义检查和缓存。我们还报告了一个原型实现,并提供了一些实验结果,支持使用一个相对较小的缓存导致显着降低运行时间检查开销。
英文摘要:
The use of annotations, referred to as assertions or contracts, to describe program properties for which run-time tests are to be generated, has become frequent in dynamic programing languages. However, the frameworks proposed to support such run-time testing generally incur high time and/or space overheads over standard program execution. We present an approach for reducing this overhead that is based on the use of memoization to cache intermediate results of check evaluation, avoiding repeated checking of previously verified properties. Compared to approaches that reduce checking frequency, our proposal has the advantage of being exhaustive (i.e., all tests are checked at all points) while still being much more efficient than standard run-time checking. Compared to the limited previous work on memoization, it performs the task without requiring modifications to data structure representation or checking code. While the approach is general and system-independent, we present it for concreteness in the context of the Ciao run-time checking framework, which allows us to provide an operational semantics with checks and caching. We also report on a prototype implementation and provide some experimental results that support that using a relatively small cache leads to significant decreases in run-time checking overhead.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。