首页> 外文会议>European Symposium on Programming >On the Implementation of Construction Functions for Non-free Concrete Data Types
【24h】

On the Implementation of Construction Functions for Non-free Concrete Data Types

机译:关于非自由混凝土数据类型的施工函数的实施

获取原文

摘要

Many algorithms use concrete data types with some additional invariants. The set of values satisfying the invariants is often a set of representatives for the equivalence classes of some equational theory. For instance, a sorted list is a particular representative wrt commutativity. Theories like associativity, neutral element, idempotence, etc. are also very common. Now, when one wants to combine various invariants, it may be difficult to find the suitable representatives and to efficiently implement the invariants. The preservation of invariants throughout the whole program is even more difficult and error prone. Classically, the programmer solves this problem using a combination of two techniques: the definition of appropriate construction functions for the representatives and the consistent usage of these functions ensured via compiler verifications. The common way of ensuring consistency is to use an abstract data type for the representatives; unfortunately, pattern matching on representatives is lost. A more appealing alternative is to define a concrete data type with private constructors so that both compiler verification and pattern matching on representatives are granted. In this paper, we detail the notion of private data type and study the existence of construction functions. We also describe a prototype, called Moca, that addresses the entire problem of defining concrete data types with invariants: it generates efficient construction functions for the combination of common invariants and builds representatives that belong to a concrete data type with private constructors.
机译:许多算法使用具有一些额外不变的具体数据类型。满足不变性的一组价值观通常是一些等同理论的等同类的一组代表。例如,排序列表是特定代表性的WRT换向。相互作用,中性元素,幂等性等的理论也是很常见的。现在,当人们想要结合各种不变性时,可能很难找到合适的代表并有效地实现不变性。在整个程序中保存不变性甚至更加困难和易于错误。经典上,程序员使用两种技术的组合来解决这个问题:通过编译器验证确保了代表的适当施工函数的定义和这些功能的一致用法。确保一致性的常用方式是使用代表的抽象数据类型;不幸的是,在代表上的模式匹配丢失了。更具吸引力的替代方法是使用私有构造函数定义一个具体数据类型,以便授予代表的编译器验证和模式匹配。在本文中,我们详细介绍了私有数据类型的概念,并研究了施工功能的存在。我们还描述了一种称为MOCA的原型,该原型解决了具有不变性的具体数据类型的整个问题:它为常用不变性的组合生成了有效的构造功能,并构建属于具有私有构造函数的具体数据类型的代表。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号