A Denotational Approach to Measuring Complexity in Functional Programs
1.1. TYPES OF SEMANTIC FUNCTIONS
3
large amount of time. Furthermore, when various parts of an evaluation are delayed we may have di culty predicting if and when evaluation will occur, adding to the problem of predicting the time it takes to evaluate a program.
1.1.1 Denotational vs. Operational
1.1 Types of Semantic functions
a natural operational semantics describes how to nd the result of an expression in one big step. The equivalent to the transition rules above would thus be
e1?! e01 e1e2?! e01e2 (lam x:e)e2?! e2=x]e where e2=x]e indicates the expression e with e2 substituted for all free occurrences of x. Conversely, e1=) lam x:e e2=x]e=) v e1 (e2 )=) v
In this dissertation there will be two independent classi cations of semantic functions. The rst, common to most discussions of semantics is the distinction between operational semantics and denotational semantics. In general, an operational semantics for a programming language is provided as a collection of rules describing the steps taken by an abstract machine during expression evaluation. Many operational semantics come in one of two forms: transition (or single-step) semantics and natural (or big-step) semantics. A transition semantics for a language describes the rules for making a single action in the process of an evaluation. For example, if we let e?! e0 mean that the expression e reduces to e0 in one step, then the following could be rules for the evaluation of an application:
where e=) v means that e evaluates to the ( nal) result v . A denotational semantics, on the other hand, is a function mapping expressions to meanings,
which typically are some form of mathematical entity. In particular, a denotational semantics forms the meaning of an expression from the meanings of its syntactic subparts. The natural deduction rule for application listed previously was not derived from the rules for evaluating e1 and e2, but from rules for e1 and e2=x]e. If we say that e] is the denotational meaning of an expression e, however, then the equivalent de nition for an application would look something like the following:
e1 (e2)]]= e1] ( e2] ) i.e., the meaning of e1 (e2 ) only requires the meanings of e1 and e2 . This property, called compositionality, can often be an advantage to analysis as we do not have to account for anything but the expression itself and knowledge of the mathematical structure of the collection of meanings. It is not always clear whether it is better to use an operational semantics or a denotational semantics. Depending on the exact language and semantics in use, either the denotational semantics or the operational semantics can be more intuitively\correct," thus in cases where the correctness of the de nition is the goal, it is best to use the form that is more intuitively correct regardless of whether it is an operational or denotational semantics. In cases where the relation between the semantics and the computer instructions is important, an operational semantics is more likely to be the appropriate one to use. In cases where compositionality is a goal, a denotational semantics will be desired. If the desired semantics is not the one that is most obviously correct, another type of semantics will frequently be used as well, and then the two forms of semantics will need to be shown
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: ...
热门文档