A Denotational Approach to Measuring Complexity in Functional Programs
Chapter 1
Introduction Early low-level programming languages closely imitated the actions of the computer to simplify the translation of a program into machine instructions. Over time, however, our ability to translate programs has become more sophisticated, resulting in a number of programming languages designed to more closely match a speci cation of the desired result rather than a set of instructions. In particular, functional languages are designed so that programs resemble mathematical speci cations more than machine instructions. Because of this property, it is often clear that a program will always return a correct result, but it may be more di cult to understand those internal properties that closely relate to machine instructions, such as the amount of time a program takes to run or the amount of memory needed in the process. Functional languages typically share a number of properties. Perhaps the most important property of a functional language is the applicative structure of programs. Programs in a\pure" functional language typically consist of a series of function de nitions. There are no assignment statements; instead of for or while loops a programmer uses recursion. Even in\impure" functional languages that also include assignment statements, programs are frequently written in such a style that assignments are the exception rather than the rule. Another important aspect of functional programs is their treatment of functions as\ rst-class citizens." Many imperative languages treat procedures and functions di erently from other data such as integers; for example, one cannot necessarily store a procedure in an array. In a functional language, however, functions are treated as data just as integers or lists are and can be passed to other functions as parameters, returned as results, or used as part of a data structure such as a list or tree. Apart from the simplicity (in concept) of treating all data types equally, such languages have several advantages. One is the ability to de ne general functions that manipulate data structures and then use them to create a wide variety of programs. For example, map applies a function to each element of a list; thus whenever we want a program that performs some conversion on each element of a list, we can simply use map. The function map is also polymorphic in that its behavior can be used for lists of any type (relative to the mapped function) and its behavior is essentially the same in each case. Another advantage is to be able to partially evaluate a procedure by applying it to some but not all of its arguments. The result is a procedure or function that takes the rest of the arguments. This can result in savings when a procedure is called many times with many of the same arguments. There are some functional languages where functions are not rst-class citizens; in particular,
they do not allow functions to take other functions as arguments. Such languages are considered\functional" primarily because they do not allow assignments. These languages are called rstorder functional languages; functional languages that allow functions as arguments are then called 1
Managing Code Complexity... 暂无评价 4页 免费 A Denotational Approach ... 暂无评价 256页 免费 Measuring relational com... 暂无评价 14页 免费 ...
A Denotational Approach ... 暂无评价 256页 免费 Comparing the Complexity.... Measuring relational complexity in oddity discrimination tasks A relation-based...
Tilbury Methods of measuring the size and complexity of PLC programs in different logic control design methodologies? Received: 26 June 2003 / Accepted: 8...
Measuring Functional siz... 暂无评价 4页 免费 A Vector-Based Approach .... FROM MEASUREMENT OF SOFTWARE FUNCTIONAL SIZE TO MEASUREMENT OF COMPLEXITY D....
Computational Complexity and Lexical.Functional Grammar Computational Complexity ...Denotational Semantics for "Natural" Language Question-Answering Programs Main,...
Communication Complexity Method for Measuring Nondeterminism in Finite Automata While deterministic nite automata seem to be well understood, surprisingly many ...
A principled approach to detecting surprising ... or computational complexity reasons, is problematic...belongs to the same functional family as the ...
Functional Dependencies ... 暂无评价 5页 2.00...The metrics reflect the complexity of event ...The reactive approach aims at measuring dependencies...
functional and implementation/(software solutions) ...Complexity of CI Mutual dependency of CIs ...Vulnerability Measuring/identification possibility ...
Functional knowledge Sociolinguistic knowledge Strategic... measuring general ability or skill Aptitude tests...complexity of response Discrete-point tests: ...
热门文档