【24h】

Validity Invariants and Effects

机译:有效性不变性和影响

获取原文
获取原文并翻译 | 示例

摘要

Object invariants describe the consistency of object states, and are crucial for reasoning about the correctness of object-oriented programs. However, reasoning about object invariants in the presence of object -abstraction and encapsulation, arbitrary object aliasing and re-entrant method calls, is difficult.We present a framework for reasoning about object invariants based on a behavioural contract that specifies two sets: the validity invariant—objects that must be valid before and after the behaviour; and the validity effect—objects that may be invalidated during the behaviour. The overlap of these two sets is critical because it captures precisely those objects that need to be re-validated at the end of the behaviour. When there is no overlap, no further validity checking is required.We also present a type system based on this framework using ownership types to confine dependencies for object invariants. In order to track the validity invariant, the type system restricts updates to permissible contexts, even in the presence of re-entrant calls. Object referencing and read access are unrestricted, unlike earlier ownership type systems.
机译:对象不变性描述了对象状态的一致性,对于推理面向对象程序的正确性至关重要。但是,在存在对象抽象和封装,任意对象别名和重入方法调用的情况下,很难对对象不变量进行推理。我们提出了一种基于行为契约的对象不变量推理框架,该行为契约指定了两个集合:有效性不变的-在行为之前和之后必须有效的对象;和有效性效果-在行为期间可能无效的对象。这两个集合的重叠非常关键,因为它精确地捕获了在行为结束时需要重新验证的那些对象。当没有重叠时,不需要进一步的有效性检查。我们还提出了一个基于该框架的类型系统,该系统使用所有权类型来限制对象不变量的依赖性。为了跟踪有效性不变性,类型系统将更新限制为允许的上下文,即使存在重入调用也是如此。与早期的所有权类型系统不同,对象引用和读取访问不受限制。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号