文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > A Denotational Approach to Measuring Complexity in Functional Programs
侵权投诉

A Denotational Approach to Measuring Complexity in Functional Programs

A Denotational Approach to Measuring Complexity in Functional Programs

6

CHAPTER 1. INTRODUCTION

Compositionality: Th

e meaning of an expression will be dependent only on the meaning of its

subparts. We can thus analyze the properties of an expression without needing to know in what context the expression occurs. In particular, the context can a ect the cost associated with evaluating an expression under the call-by-name strategy, so the compositional semantics must contain su cient information so that its meaning is still accurate regardless of the context. Soundness: We will relate all the semantic functions to a relatively abstract operational model: one that other researchers ( 37]) have studied. One particularly important relationship we will show is that the denotational semantics is sound. A denotational semantics is sound relative to an operational semantics if, whenever an expression e evaluates to v under the operational semantics, the (extensional) meanings of e and v are the same. With intensional semantics the relationship is more complicated; e.g., if e evaluates to v in time t in the intensional operational semantics, then the denotational meaning of e should be closely related to the meaning of v except that it should also include an additional cost of t. Once we de ne the intentional semantics we will make precise the meaning of\including an additional cost." Adequacy: Another important relationship between the denotational and operational semantics concerns the behavior of programs that fail to terminate. A denotational semantics is adequate when a program fails to terminate in the operational model precisely when its denotational meaning indicates non-termination. With soundness and adequacy we can generally use the denotational model to analyze properties of programs and know that the properties hold for the operational model as well. In this dissertation the adequacy property will also ensure that, although the mathematical model may contain cost in unusual locations, the meaning of an expression will either indicate non-termination or be essentially a pairing of a nal value and the cost it took to evaluate it. Separability: Each intensional semantic function will have a related extensional semantics, one that gives the same nal results but does not contain any consideration of costs. It is important to be able to recover this semantics to make sure that the intensional semantics treats the data the same way it would extensionally. We will be de ning each semantic function such that we can easily obtain their extensional versions. Furthermore, the semantic functions are robust and exible in that the technique used to de ne the semantic functions applies to more than one operational semantics and more than one language. Thus the overall structure for both semantic functions will be very similar, each based on the same general cost construction. In addition we can easily add new constants, or adjust the meaning of old ones, and show that the new language is still sound, adequate, and separable. These properties indicate that other semantic f

unctions may also be created to work with a variety of languages or operational de nitions.

1.5 Related Work When a program contains neither high-order nor lazy data types, we can analyze its complexity using many of the same techniques that have been used to analyze the complexity of imperative programs (e.g., see 2]). In these cases the applicative nature of functional programming is helpful, making it easy to convert a program to a functional description of its complexity. Some early work in automatic cost or complexity calculations ( 50], 22]) took advantage of the structure of functional programs to develop recursive de nitions of program complexity ( 22]) or cost ( 50]).

上一页第20页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email