Incremental Attribute Evaluation for Multi-User Semantics-Based Editors

Incremental Attribute Evaluation for Multi-User Semantics-Based Editors

Incremental Attribute Evaluation for Multi-User Semantics-Based Editors Josephine Micallef Columbia University Department of Computer Science New York, NY 10027 May 1991 CUCS-023-91 Incremental Attribute Evaluation for Multi-User Semantics-Based Editors Josephine Micallef Submitted in panial fulfillment of the requirements for the degree of Doctor of Philosophy in the Graduate School of Arts and Sciences. Columbia University 1991 Copyright © 1991 Josephine Micallef ALL RIGHTS RESERVED Abstract Incremental Attribute Evaluation for Multi-User Semantics-Based Editors Josephine Micallef This thesis addresses two fundamental problems associated with perfonning incremental attribute evaluation in multi-user editors based on the attribute grammar formalism: (1) multiple asynchronous modifications of the attributed derivation tree, and (2) segmentation of the tree into separate modular units. Solutions to these problems make it possible to construct semantics-based editors for use by teams of programmers developing or maintaining large software systems. Multi-user semantics­ based editors improve software productivity by reducing communication costs and snafus. The objectives of an incremental attribute evaluation algorithm for multiple asynchronous changes are that (a) all attributes of the derivation tree have correct values when evaluation terminates, and (b) the cost of evaluating attributes necessary to reestablish a correctly attributed derivation tree is minimized. We present a family of algorithms that differ in how they balance the tradeoff between algorithm efficiency and expressiveness of the attribute grammar. This is important because multi-user editors seem a practical basis for many areas of computer-supported cooperative work, not just programming. Different application areas may have distinct definitions of efficiency, and may impose different requirements on the expressiveness of the attribute grammar. The characteristics of the application domain can then be used to select the most efficient strategy for each particular editor. To address the second problem, we define an extension of classical attribute grammars that allows the specification of interface consistency checking for programs composed of many modules. Classical attribute grammars can specify the static semantics of monolithic programs or modules, but not inter-module semantics; the latter was done in the past using ad hoc techniques. Extended attribute grammars support programming- in-the-Iarge constructs found in real prograrrurung languages, including textual inclusion, multiple kinds of modular units and nested modular units. We discuss attribute evaluation in the context of prograrnrning-in-the-Iarge, particularly the separation of concerns between the local evaluator for each modular unit and the global evaluator that propagates attribute flows across module boundaries. The result is a unifOIUl approach to formal specification of both intra-module and inter-module static semantic properties, with the ability to use attribute evaluation algorithms to carry out a complete static semantic analysis of a multi-module program. Table of Contents 1. Introduction 1 1.1. Motivation 1 1.2. Thesis Problem 2 1.3. Application Scenarios 3 1.3.1. Smod 3 1.3.2. Calendar 7 1.4. Overview of Technical Results 12 1.4.1. Multiple Asynchronous Modifications 12 1.4.2. Segmentation of Derivation Tree 17 1.5. Related Work 19 1.6. Organization of Thesis 22 2. Background 24 2.1. Attribute Grammars 24 2.2. Incremental Attribute Evaluation 29 3. Incremental Attribute Evaluation for Multiple Asynchronous 36 Subtree Replacements 3.1. Problem Formulation 37 3.2. A Naive Algorithm for Multiple Updates 38 3.3. Collision-Merging Algorithm for Multiple Updates 39 3.4. Terminology 42 3.5. Multiple Cursors and Characteristic Graphs 44 3.5.1. Effect of Cursor Moyement on Characteristic Graphs 4S 3.5.2. Updating Characteristic Graphs after Subtree Replacement 48 3.6. Detecting Collisions 53 3.7. Merging Colliding Models 55 3.7.1. Merging Models after Expansion Collision 62 3.7.2. Merging Models after Initialization Collision 6S 3.8. Analysis of Collision-Merging Algorithm 68 3.9. Related Work 70 4. Static Evaluators for Incremental Attribute Evaluation of 73 Multiple Subtree Replacements 4.1. Overview of Static Evaluators 7S 4.1.1. Non-Incremental Driver for Static Evaluator 77 4.1.2. Incremental Driver for Static Evaluator 79 4.2. Static Incremental Evaluator for Multiple Asynchronous 81 Subtree Replacements 4.2.1. Determining Relative Order Among Plan Instructions 89 4.2.2. Analysis of Multiple Subtree Replacement Static Evaluator 90 4.2.3. Improvements 91 4.3. Pairwise Ordered Attribute Grammars 94 4.3.1. Algorithm to Compute Plans for POAGs 94 4.3.2. Computation of Relative Order Among Plans 97 4.4. Related Work 100 5. Extending Attribute Grammars to Support Static Semantic 102 Analysis for Programming-in-the-Large 5.1. Introduction 102 5.2. Segmentable Context-Free Grammars 106 5.2.1. Example 1: Ada 107 5.2.2. Example 2: C 109 5.2.3. Example 3: Pascal 109 5.3. Transforming the Segment Organization of a Program 112 5.3.1. List Segment Transformation 112 5.3.2. Optional Segment Transformation 11S 6. Segmentable Attribute Grammars 118 6.1. Attribute Evaluation for Segmented Derivation Trees 122 6.2. Segment Linkage 124 6.2.1. Constraints on Segment Linkage Attributes 126 6.2.2. Built-in Operators Related to Segment Linkage 129 6.3. Representation and Attribute Evaluation of Shared Segments 131 6.4. Conglomerate Attributes 136 6.4.1. Definition of Conglomerate Attributes 137 6.4.2. Selective Propagation 139 6.4.2.1. Updating a Segment's Uses Set 141 6.4.2.2. Change to Component's Used-by Set 143 6.4.2.3. Propagation after Change to Conglomerate Attribute 144 6.4.3. The isUnique Operator 146 7. Summarizable Attribute Grammars 149 7.1. Transformation involving Direct Dependencies 151 7.1.1. Case 1: Direct Dependency from an Inherited to a Synthesized IS4 Attribute. 7.1.2. Case 2: Direct dependency from a synthesized to an inherited ISS attribute. 7.2. Transformation involving Transitive Dependencies 156 7.2.1. Removing Transitive Dependency from an Inherited to a 159 Synthesized Attribute 7.2.2. Removing Transitive Dependency for AG with Nested 161 Segments 7.3. Related Work 162 8. Conclusion 166 ii 8.1. Contributions 166 8.2. Future Work 167 Bibliography 170 Appendix A. The MERCURY System 178 A.t. Overview 178 A.2. The Editor Generator 179 A.3. Run-Time Support: The Attribute Propagation Layer 180 A.4. Kernel Algorithms 183 A.5. Conclusion 185 Appendix B. Attribute Grammar for Distributed Calendar 186 Application iii List of Figures Figure 1-1: Two Smod modules before Interface Change 4 Figure 1-2: Two Smod modules after Interface Change 6 Figure 1-3: Two Calendar Schedules before Meeting Request 8 Figure 1-4: Two Calendar Schedules after Meeting Request 9 Figure 1-5: Two Calendar Schedules after Original User Confirms 10 Figure 1-6: Two Calendar Schedules after Other User Confirms 11 Figure 2-1: An Attribute Grammar Example 26 Figure 2-2: A String Derivedfrom the Grammar of Figure 2-1 28 Figure 2-3: Reps' Incremental Attribute Evaluation Algorithm 33 Figure 2-4: Expanding a Model 34 Figure 3-1: Startup Algorithm 40 Figure 3-2: Propagate Algorithm for Asynchronous Subtree 41 Replacements Figure 3-3: Characteristic Graphs Requiredfor Multiple Editing 45 Cursors Figure 3-4: Reestablishing Prepared for Propagation Invariantfor 49 Multiple Cursors Figure 3-5: Changing Transitive Dependencies 50 Figure 3-6: Algorithm to Update Incorrect Characteristic Graphs 51 Figure 3-7: Characteristic Graph Update (cont.) 52 Figure 3-8: Scenario for Collisions during Model Expansion 54 Figure 3-9: Algorithm to Expand Model and Detect Collisions 56 Figure 3-10: Clearing in-model Field when Evaluation Process 57 Terminates Figure 3-11: A Downward Collision due to a Downward Expansion 57 Figure 3-12: Search for Attributes to be Reinserted into a Colliding 59 Model Figure 3-13: Antifreeze Algorithm 62 Figure 3-14: Algorithm to Expand Model, Detect Collisions, and 63 Merge Models Figure 3-15: Replace Subtree Operation 66 Figure 3-16: Startup Algorithm (revisited) 67 Figure 4-1: Non-Incremental Driver 78 Figure 4-2: Incremental Driver 80 Figure 4-3: StartUp Algorithm 84 IV Figure 4-4: Schedule Algorithm 85 Figure 4-5: Evaluate Algorithm 86 Figure 4-6: Algorithm to Check if a Pending Evaluation has been 87 Reached Figure 4-7: Regions of the Computation Sequence 87 Figure 4-8: Attribute Grammar that is not Pairwise Ordered 92 Figure 4-9: Attribution Algorithms for Attribute Grammar of 93 Figure 4-8 Figure 4-10: Two Semantic Trees 93 Figure 4-11: Algorithm to Compute TDP 96 Figure 4-12: Algorithm to Compute ANCESTOR Relation 98 Figure 4-13: Computation of MapVisitParentToPlanlndex 99 Figure 5-1: Segmented Derivation Tree 103 Figure 5-2: Segmented Attribute Evaluation 105 Figure 5-3: Extended CFGfor Definition and Interconnection of 107 Segments in Ada Figure 5-4: Extended CFG for Definition and Interconnection of 109 Segments in C Figure 5-5: Extended CFG for Definition and Interconnection of 110 Segments in Pascal Figure 5-6: Other Segmentation Structures for Pascal 111 Figure 5-7: Transformation of Segment Organization of a Program 113 Figure 6-1: Specification of a Simple Modular Language 121 Figure 6-2: Attribute Grammar for Matching Segments in Ada 125 Figure 6-3: A Noncircular Attribute Grammar 128 Figure 6-4: Dependency Graphs of Trees Derivedfrom AG of 129 Figure 6-3 Figure 6-5: Checking for Duplicate

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    219 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us