文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 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

4

CHAPTER 1. INTRODUCTION

to correspond in some useful fashion. In this dissertation the operational semantics is arguably more intuitive and closer in spirit to machine-level implementation, but for ease of analysis we want a compositional semantics. Therefore we create a denotational semantics for analysis, and compare it with the operational semantics to show that our semantics is computationally reasonable.

1.1.2 Extensional vs. Intensional Another way of classifying semantics concerns the level of abstraction at which a semantics is pitched. A semantics (operational or denotational) is extensional if it is primarily concerned with the nal result and not other aspects of computation such as the time it takes to complete, the amount of space required, or the path traversed during computation. Conversely, a semantics is intensional precisely when it is concerned with such internal details. These two classi cations are relative more than absolute, as the de nition of\ nal result" and\internal details" may vary depending on the purpose of the semantic model. Most traditional semantic models focus on extensional properties alone. Sometimes, to get a extensional de nition, one must start with an intensional one and then abstract away the internal details, as was done f

or the example in the game semantics of 1]. In particular, a transition semantics technically is concerned with the path of a computation as well as the nal result, but in practice when using a transition semantics we ignore the path and consider only the extensional properties. In this dissertation, however, the intensional properties are what is of interest so the semantics used must be intensional, although we also need to relate it to an extensional semantics.

1.2 Complexity versus Cost Whenever we mention the cost of an expression or program, we are referring to a precise evaluation time, measured in some number of basic operations (recursive calls, CPU operations, etc.). Costs come in two varieties, the more abstract macro cost counts major operations such as function applications, and the more concrete micro cost counts low-level operations such as register accesses, which often better re ect the actual time it takes for the expression to be evaluated. Complexity, on the other hand, refers to an asymptotic relation between the measure of the input to a function and the time it takes to determine the output. For example, the complexity of the reverse function for lists is typically written as O(n), where n is the length of the list, meaning that the cost of reversing the list is bounded by a linear function on n for su ciently large lists. Those who analyze the e ciency of algorithms traditionally work with complexities because exact costs are frequently machine or compiler dependent. Language pro lers, however, work with costs, primarily because determining costs is an easy task for a computer to do and in many cases the goal of a pro ler is to nd extra costs, such as constants costs, that asymptotic complexity analysis would not necessarily distinguish as signi cant. In this dissertation we will concentrate on cost information rather than complexity. Our primary reason is one of feasibility: there is no standard for measuring the size of input for some data types, particularly higher-order types. We will, however, work only with macro costs, as our semantics would otherwise only be relevant to a particular machine whereas we want to nd a more abstract notion of evaluation time. Furthermore, using macro costs, the semantic functions will be more easily converted to complexity functions (where it is possible to de ne complexity) because complexity functions also usually measure time by counting high-level operations. Our semantic functions will have su cient mathematical structure so that measures and nal costs can be derived from the more precise cost analysis. For example, the call-by-value semantics will tell us that the

上一页第18页

你可能喜欢

热门文档

相关文档

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