ebook img

The Functional Treatment of Parsing PDF

165 Pages·1993·5.235 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview The Functional Treatment of Parsing

THE FUNCTIONAL TREATMENT OF PARSING THE KLUWER INTERNATIONAL SERIES IN ENGINEERING AND COMPUTER SCIENCE NATURAL LANGUAGE PROCESSING AND MACHINE TRANSLATION Consulting Editor Ja ime Carbonell Other books in the series: NATURAL LANGUAGE PROCESSING: TUE PLNLP APPROACH, Karen Jensen, George E. Heidom, Stephen D. Richardson ISBN: 0-7923-9279-5 ADAPTIVE PARSING: Selr-Extending Natural Language Interfaces, J. F. Lehman ISBN: 0-7923-9183-7 GENERALIZED L. R. PARSING, M. Tomita ISBN: 0-7923-9201-9 CONCEPTUAL INFORMATION RETRIEVAL: A Case Study in Adaptive Partial Parsing, M. L. Mauldin ISBN: 0-7923-9214-0 CURRENT ISSUES IN PARSING TECI-INOLOGY. M. Tomita ISBN: 0-7923-9131-4 NATURAL LANGUAGE GENERATION IN ARTIF1CIAL INTELLIGENCE AND COMPUTATIONAL LINGUISTICS, C. L. Paris, W. R. Swartout, W. C. Mann ISBN: 0-7923-9098-9 UNDERSTANDING EDITORIAL TEXT: A Computer Model or Argument Comprebension, S. J. Alvarado ISBN: 0-7923-9123-3 NAIVE SEMANTICS FOR NATURAL LANGUAGE UNDERSTANDING, K. Dahlgren ISBN: 0-89838-287-4 INTEGRATED NATURAL LANGUAGE DIALOGUE: A Computatiooal Model, R. E. Frederking ISBN: 0-89838-255-6 A NATURAL LANGUAGE INTERFACE FOR COMPUTER AIDED DESIGN, T. Samad ISBN: 0-89838-222-X EFF1CIENT PARSING FOR NATURAL LANGUAGE: A Fast AIgorithm ror Practical Systems, M. Tomita ISBN: 0-89838-202-5 THE FUNCTIONAL TREATMENT OFPARSING by Rene Leermakers Institute for Perception Research, Eindhoven, The Netherlands SPRINGER SCIENCE+BUSINESS MEDIA, B.V. Library of Congress Cataloging-in-Publication Data Leermakers. Rena The functional treatment of parsing / by Rena Leermakers. p. cm. -- (Kluwer international series in engineering and computer science ; v. 242) Includes bibliographical references and index. 1. Natural language processing (Computer science) 2. Parsing (Computer grammar) 3. Functional programming (Computer science) I. Title. II. Series: Kluwer international series in engineering and computer science SECS 242. QA76.9.N38L42 1993 005.13' 1--dc20 93-22799 ISBN 978-1-4613-6397-2 ISBN 978-1-4615-3186-9 (eBook) DOI 10.1007/978-1-4615-3186-9 Printed on acid-free paper All Rights Reserved © 1993 Springer Science+Business Media Dordrecht Originally published by Kluwer Academic Publishers in 1993 Softcover reprint of the hardcover 1s t edition 1993 No part of the material protected by this copyright notice may be reproduced or utilized in any form or by any means, electronic or mechanical, inc1uding photocopying, recording Of by any information stofage and retrieval system, without written permission from the copyright owner. To my family but in particular to my son Arjeh who made bis first steps as this book went to press and to my daughter Mirjam FOREWORD Formal-Ianguage thoory, thooreticallinguistics and computationallinguistics have shared roots in the 1950s, with the seminal work of Kleene, Chomsky, Miller and Bar-Hille1 on regular languages and phrase-structure grammars. However, various social, cultural and technological factors have since then conspired to split those disciplines and weaken their understanding and ap preciation of each other. Efficiency considerations and the fact that program ming languages are human artifacts may partly justify the focus on determin istic languages and parsers in the theory of context-free parsing. However, naturallanguages are highly ambiguous and thus non-deterministic, making much of that theory seem irrelevant 10 natural-Ianguage parsing. It has thus been difficult to convince the computational linguist of the importance of context-free-parsing thoory, if not for specific algorithms, then for concepts and techniques essential to the rigorous analysis of natural-Ianguage parsers. Looking in the other direction, the formal-Ianguage theorist is mostly un aware of the special problems of natural-Ianguage parsing, and thus not only misses a potentially rich area for new research but also falls to appreciate the efforts of computational linguists. For these reasons, the publication of The Functional Treatment 0/ Parsing is doubly welcome. For the computationallinguist, Rene Leermakers's book brings out the rele vance of the thoory of context-free parsing to natural-Ianguage parsing. His innovative use of functional notation makes algorithrns and their derivation less mysterious, and eliminates much of the need for the laborious inductive proofs of correctness found in other parsing thoory texts. In addition, the functional approach ties well with the widespread acquaintance of current and recent students with the functional programming paradigm through lan guages such as Scheme and ML. Delicate data structure issues in parsing are c1early located in elegant abstractions representing nondeterminism and" result reuse. For the computer scientist, The Functional Treatment 0/ Parsing offers a fresh and unified perspective on a variety of parsing algorithms, some well known and some less so. This new perspective offers much simpler proofs vii viii THE FUNCTIONAL TREATMENT OF PARSING of correctness and computational complexity, and eliminates the artificial distinction between stack-based and tabular parsers. The use of equational reasoning rather than special-purpose inductive proofs to relate algorithms to their specifications is an excellent application of an approach to program derivation and verification that has received strong support in the wodes of Boyer, Moore, Dijkstra and Gries. From a more practical angle, Leer makers' s approach provides a theoretical basis for the parsing component of interactive language-development environments, for which the standard detenninistic parsing methods have been proven unwieldy. Parsing theory has many subtleties, requiring attentive and thoughtful study. While the present book does not excuse the student from those obligations, it will provide ample rewards to readers at all levels. In addition to a self contained and elegant treatment of all the main ideas of context-free parsing, it brings out the underlying unity of the subject as no other book I know of, and ofIers a wealth of conceptual and technical riches, of which I particularly enjoyed the application of Lambek types to the analysis of grammatical covers and attribute grammars. There have been increasing signs in the research literature of a long-overdue convergence between fonnal-Ianguage theory and computationallinguistics, in particular in the area of context-free parsing. The Functional Treatment 0/ Parsing not only demonstrates that convergence for the first time in book fonn, but also revives context-free parsing theory as an interesting and rele vant topic for computationallinguists and computer scientists alike. Femando C.N. Pereira. CONTENTS FOREWORD by Fernando Pereira vii PREFACE xiii 1 CONTEXT-FREE GRAMMARS 1 2 BUNCH NOTATION 7 2.1 Bunches 8 2.2 Algorithmic interpretation 12 3 GRAMMAR INTERPRETATIONS IS 3.1 The natural interpretation 15 3.2 Derivation 20 3.3 The Lambek types 23 3.4 Recognition functions 26 3.5 Generation 28 3.6 Summary of interpretations 29 4 RECURSIVE DESCENT 33 4.1 The functional interpretation 33 4.2 Termination 35 4.3 Complexity and memoization 35 4.4 Look ahead 38 4.5 Error recovery 42 S GRAMMAR TRANSFORMATIONS 4S 5.1 Making grammars bilinear 45 ix x THE FUNCTIONAL TREATMENT OF PARSING 5.2 Recursive descent for EG 48 5.3 Partial elimination of left recursion 49 5.4 Recursive descent for F G 57 6 RECURSIVE ASCENT 61 6.1 The algorithm 62 6.2 Tennination 65 6.3 A variant that works with strings 66 6.4 Complexity 68 6.5 EBNF grammars 69 7 PARSE FOREST 75 7.1 Infonnal introduction 75 7.2 The gramm ar E~ 77 7.3 Forest for bilinear grammars 78 7.4 The set Q 82 7.5 Standard Earley parser 85 7.6 Earley versos Earley 87 8 ATTRIBUTE GRAMMARS 91 8.1 Notational conventions 92 8.2 Attribute functions 94 8.3 Example 96 8.4 Function graphs 100 8.5 Attribute grammar parser 103 8.6 Direct attribute evaluation 104 9 LR PARSERS 115 9.1 LR(O) recognizer 115 9.2 The detenninistic case 120 9.3 Implementation with stacks 123 9.4 Some variants 126 9.5 Look ahead 128 9.6 Attributes 130 9.7 Continuations 131 9.8 Error recovery 134 Contents xi 9.9 The methods by Lang and Tomita 137 9.10 Evaluation w.r.t. standard approaches 138 9.11 Earley versos LR 140 10 SOMENOTES 143 10.1 Context-free grammars 143 10.2 Names 144 10.3 Bunches 145 10.4 Functional programming 145 10.5 Grammar transfonnations 146 10.6 Memo-functions 146 10.7 Parse forests 147 10.8 Earley 147 10.9 Attribute grammars 147 10.10 Naturallanguage 148 10.11 Other applications 148 10.12 LR parsing 149 10.13 EBNF 149 10.14 Conclusion 150 REFERENCES ISI INDEX 157

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.