首页> 外文会议>Programming Languages and Systems; Lecture Notes in Computer Science; 4421 >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.
机译:许多算法使用带有一些其他不变量的具体数据类型。满足不变量的一组值通常是某些方程理论的等价类的一组代表。例如,排序列表是特定的代表性可交换性。关联性,中性元素,幂等之类的理论也很常见。现在,当想要合并各种不变量时,可能很难找到合适的代表并有效地实现不变量。整个程序中不变量的保存更加困​​难并且容易出错。传统上,程序员使用两种技术的组合来解决此问题:为代表定义适当的构造函数,并通过编译器验证确保这些函数的一致使用。确保一致性的常用方法是为代表使用抽象数据类型。不幸的是,代表的模式匹配丢失了。一个更具吸引力的替代方法是使用私有构造函数定义一个具体的数据类型,以便授予编译器验证和代表上的模式匹配。在本文中,我们详细介绍了私有数据类型的概念,并研究了构造函数的存在。我们还描述了一个称为Moca的原型,该原型解决了用不变量定义具体数据类型的整个问题:它为常见不变量的组合生成有效的构造函数,并使用私有构造函数构建属于具体数据类型的代表。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号