A Modular Approach to Denotational Semantics
暂无分享,去创建一个
We propose an incremental approach to the denotational semantics of complex programming languages based on the idea of monad transformer. The traditional way of giving denotational semantics to a programming language is to translate it into a metalanguage ML with a fixed intended interpretation in the category Cpo of cpos (or some variant of it). We depart from this approach by translating a programming language PL in a metalanguage ML(E), where some constants do not have a fixed intended interpretation in Cpo. These constants, specified in the signature ~, include a unary type constructor T and a collection of (polymorphic) operations for constructing terms of type TA. A key property of the translation is that programs of type A are translated into terms of type T(A°), where A ° is the translation of A. This approach does not yield any new semantics for PL, since eventually one has to interpret the constants in E, e.g. by translating them into ML. However, it is an integral part of the incremental approach to be able to change the interpretation of constants in E (without invalidating adequacy of the denotational semantics w.r.t, some given operational semantics), when extending the programming language. Suppose that PL is obtained from PLo by a sequence of simple extensions PLI C PLi+I and that we have a semantics for PLo, how can we built a semantics for PL? In terms of signatures for metalanguages the problem can be rephrased as follows: