首页> 外文学位 >Constraint-based type inference for polymorphic programs.
【24h】

Constraint-based type inference for polymorphic programs.

机译:多态程序的基于约束的类型推断。

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

摘要

Precise type information is invaluable for analysis and optimization of computer programs. Constraint-based type inference infers types with subtyping constraints. Such types can capture detailed flow information about a program. Thus constraint-based type inference can be used for extensive type checking and precise flow analysis.; Polymorphism in programming languages makes it difficult for a constraint-based type inference algorithm to be both efficient and accurate. We develop a novel framework for polymorphic constraint-based type inference. A concrete type inference algorithm can be obtained by instantiating the framework with a particular strategy for handling polymorphism. In particular, we define existing algorithms such as Shivers' nCFA and Agesen's Cartesian Product Algorithm (CPA) as instantiations of the framework. We prove the soundness of the framework, which entails the soundness of every algorithm defined as an instantiation of the framework.; Data Polymorphism is a special form of polymorphism associated with programming languages with state, and it is a common and important form of polymorphism in object-oriented programming. Agesen's Cartesian Product Algorithm (CPA) can analyze programs with parametric polymorphism in a reasonably precise and efficient manner, but CPA is imprecise when analyzing programs with data polymorphism. We have developed a novel algorithm, Data Polymorphic CPA (DCPA), a constraint-based type inference algorithm that extends CPA with the ability to accurately and efficiently analyze data-polymorphic programs.; We also study the construction of practical constraint-based type inference systems for realistic programming languages. We have constructed a type inference system for the full Java language. The system includes implementations of algorithms 0CFA, CPA and DCPA, and it has incorporated a number of novel implementation techniques. The system is used to statically verify the correctness of Java downcasts. Benchmark results on realistic Java applications are given which show that the DCPA algorithm has good precision and efficiency: it is significantly more accurate than CPA and its efficiency is comparable to CPA.
机译:精确的类型信息对于计算机程序的分析和优化是非常宝贵的。基于约束的类型推断可推断出具有子类型约束的类型。这些类型可以捕获有关程序的详细流信息。因此,基于约束的类型推断可用于广泛的类型检查和精确的流分析。编程语言中的多态性使得基于约束的类型推断算法难以高效且准确。我们为基于多态约束的类型推断开发了一个新颖的框架。具体的类型推断算法可以通过使用特定的处理多态性策略实例化框架来获得。特别是,我们将现有算法(例如Shivers的 n CFA和Agesen的笛卡尔积算法(CPA))定义为框架的实例。我们证明了框架的健全性,这意味着定义为框架实例化的每种算法的健全性。数据多态是与状态编程语言关联的一种特殊形式的多态,它是面向对象编程中一种常见且重要的多态形式。 Agesen的笛卡尔积算法(CPA)可以以合理的精确和高效的方式分析具有参数多态性的程序,但是当分析具有数据多态性的程序时CPA是不精确的。我们已经开发了一种新颖的算法,数据多态CPA(DCPA),这是一种基于约束的类型推断算法,该算法扩展了CPA,从而能够准确,高效地分析数据多态程序。我们还研究了用于现实编程语言的,基于约束的实用类型推断系统的构建。我们已经为完整的Java语言构建了类型推断系统。该系统包括算法0CFA,CPA和DCPA的实现,并且已合并了许多新颖的实现技术。该系统用于静态验证Java下调的正确性。给出了在实际Java应用程序上的基准测试结果,这些结果表明DCPA算法具有良好的精度和效率:它比CPA准确得多,并且效率与CPA相当。

著录项

  • 作者

    Wang, Tiejun.;

  • 作者单位

    The Johns Hopkins University.;

  • 授予单位 The Johns Hopkins University.;
  • 学科 Computer Science.
  • 学位 Ph.D.
  • 年度 2001
  • 页码 105 p.
  • 总页数 105
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类 自动化技术、计算机技术;
  • 关键词

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号