Abstract. This paper presents a formulation, within the framework of initial algebra semantics, of Knuthian semantic systems (K-systems) which contain both synthesized and inherited attributes. The approach is based on viewing the semantics of a derivation tree of a context-free grammar as a set of values, called an attribute valuation, assigned to the attributes of all its nodes. Any tree's attribute valuation which is consistent with the semantic rules of the K-system may be chosen as the semantics of that derivation tree.The set of attribute valuations of a given tree is organized as a complete partially ordered set such that the semantic rules define a continuous transformation on this set. The least fixpoint of this transformation is chosen as the semantics of a given derivation tree. The mapping from derivation trees to their least fixpoint semantics is a homomorphism between certain algebras. Thus, the semantics of a K-system is an application of the Initial Algebra Semantics Principle of Goguen and Thatcher. This formulation permits a precise definition of K-systems, and generalizes Knuth's original formulation by defining the meaning of recursive (circular) semantic specifications.The algebraic formulation of K-systems is applied to proving the equivalence of K-systems having the same underlying grammar. Such proofs may require verifying that a K-system possesses certain properties and to *This paper is a revision of a paper presented at the 17th Annual IEEE Symposium on
An aspect of the interaction between compiler theory and practice is addressed. Presented is a technique for the syntax-directed specification of compilers together with a method for proving the correctness of their parse-driven implementations. The subject matter is presented in an orderalgebraic framework; while not strictly necessary, this approach imposes beneficial structure and modularity on the resulting specifications and implementation correctness proofs. Compilers are specified using an order-algebraic definition of attribute grammars. A practical class of compiler implementations is considered, consisting of those driven by LR(W) or LL(k) parsers which cause a sequence of translation routine activations to modify a suitably initialized collection of data structures (called a translation environment). The implementation correctness criterion consists of appropriately comparing, for each source program, the corresponding object program (contained in the final translation environment) produced by the compiler implementation to the object program dictated by the compiler specification. Provided that suitable intermediate assertions (called trans&ion invariants) are supplied, the program consisting of the (parse-induced) sequence of translation routine activations can be proven partially correct via standard inductive assertion methods.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.