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 end, a principle of structural induction on many-sorted algebras is formulated, justified, and applied.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.