arXiv.itsnick.co

an independent field guide to 23 million papers from arXiv & OpenAlex — not affiliated with arXiv.org

Computer Science · Artificial Intelligence

Denotational semantics for program analysis

Shan-Jon Chao, Barrett R. Bryant

· ACM SIGPLAN Notices

See on the map

Abstract

The denotational semantics approach to formal specification of programming languages contain s detailed information for the implementation of that language, unlike the axiomatic semantics approach . This feature makes the denotational semantics approach more flexible than the operational approach in it s not having any specific abstract machine . A compiler can be systematically constructed from the formal denotational semantics specification by applying the function of the specification to the source program . This is called a compile-evaluate approach for denotational semantics or compiler generation . Compile r generation addresses the issue of proving compiler correctness . This paper describes how to apply denotational semantics to program analysis, specifically cod e optimization, and to the parallel implementation of sequential imperative languages . In considering cod e optimization, the object code derived from the denotational semantics specification is a set of denotations which we claim can be further optimized by partial evaluation . Partial evaluation [5] of a subject progra m evaluates that program with respect to only a portion of its input parameters, resulting in a residua l program . By definition, running the residual program on any remaining input yields the same result a s running the original subject program on all of its input . >From this point of view then, partial evaluatio n is nothing but a special case of program transformation for the purpose of optimization . Partial evaluatio n performs those simplification steps which are not dependent on execution-time values . To determine whic h simplifications to perform, we make an expression unfrozen if it can be simplified before execution-time . A frozen expression may not be simplified . Declarations, environments, and store algebras are all mad e unfrozen resulting in more efficient code . Code optimization on declarations, type checking, constant folding , and inline function expansion will be carried out .

More like this