Grammatical Framework

Grammatical Framework (GF) is a special-purpose functional language for defining grammars. It uses a Logical Framework (LF) for a description of abstract syntax, and adds to this a notation for defining concrete syntax. GF grammars themselves are purely declarative, but can be used both for linearizing syntax trees and parsing strings. GF can describe both formal and natural languages. The key notion of this description is a grammatical object, which is not just a string, but a record that contains all information on inflection and inherent grammatical features such as number and gender in natural languages, or precedence in formal languages. Grammatical objects have a type system, which helps to eliminate run-time errors in language processing. In the same way as a LF, GF uses dependent types in abstract syntax to express semantic conditions, such as well-typedness and proof obligations. Multilingual grammars, where one abstract syntax has many parallel concrete syntaxes, can be used for reliable and meaning-preserving translation. They can also be used in authoring systems, where syntax trees are constructed in an interactive editor similar to proof editors based on LF. While being edited, the trees can simultaneously be viewed in different languages. This paper starts with a gradual introduction to GF, going through a sequence of simpler formalisms till the full power is reached. The introduction is followed by a systematic presentation of the GF formalism and outlines of the main algorithms: partial evaluation and parser generation. The paper concludes by brief discussions of the Haskell implementation of GF, existing applications, and related work.

[1]  Y. Bar-Hillel A Quasi-Arithmetical Notation for Syntactic Description , 1953 .

[2]  Gérard P. Huet,et al.  The Zipper , 1997, Journal of Functional Programming.

[3]  Thierry Coquand,et al.  An Algorithm for Type-Checking Dependent Types , 1996, Sci. Comput. Program..

[4]  Bengt Nordström,et al.  The ALF Proof Editor and Its Proof Engine , 1994, TYPES.

[5]  Paul Hudak,et al.  Building domain-specific embedded languages , 1996, CSUR.

[6]  A Prince,et al.  Optimality: From Neural Networks to Universal Grammar , 1997, Science.

[7]  John J. McCarthy,et al.  A Thematic Guide to Optimality Theory , 2001 .

[8]  Furio Honsell,et al.  A framework for defining logics , 1993, JACM.

[9]  John J. McCarthy,et al.  Optimality Theory in Phonology: A Reader , 2003 .

[10]  David H. D. Warren,et al.  Definite Clause Grammars for Language Analysis - A Survey of the Formalism and a Comparison with Augmented Transition Networks , 1980, Artif. Intell..

[11]  Gilles Kahn,et al.  Extracting Text from Proofs , 1995, TLCA.

[12]  Aarne Ranta,et al.  An Extensible Proof Text Editor , 2000, LPAR.

[13]  John Launchbury,et al.  Constructing Natural Language Interpreters in a Lazy Functional Language , 1989, Comput. J..

[14]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[15]  Paul Hudak,et al.  Using Types to Parse Natural Language , 1995, Functional Programming.

[16]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[17]  Anneke Kleppe,et al.  The object constraint language: precise modeling with UML , 1998 .

[18]  Aarne Ranta,et al.  An Authoring Tool for Informal and Formal Requirements Specifications , 2002, FASE.

[19]  Zhaohui Luo,et al.  Mathematical Vernacular and Conceptual Well-Formedness in Mathematical Language , 1997, LACL.

[20]  M. Baltin,et al.  The Mental representation of grammatical relations , 1985 .

[21]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[22]  George C. Necula,et al.  Proof-carrying code , 1997, POPL '97.

[23]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[24]  Alan S. Prince,et al.  Faithfulness and reduplicative identity , 1995 .

[25]  Colin Wilson,et al.  Consonant cluster neutralisation and targeted constraints , 2001, Phonology.

[26]  Magnus Carlsson,et al.  Fudgets - Purely Functional Processes with applications to Graphical User Interfaces , 1998 .

[27]  Aarne Ranta,et al.  Dialogue Systems as Proof Editors , 2004, J. Log. Lang. Inf..

[28]  Armin Fiedler User-adaptive proof explanation , 2001 .

[29]  Alan S. Prince,et al.  Faithfulness and Identity in Prosodic Morphology , 1999 .

[30]  J. Lambek The Mathematics of Sentence Structure , 1958 .

[31]  MARTIN KAY The Proper Place of Men and Machines in Language Translation , 2004, Machine Translation.

[32]  P. Smolensky,et al.  Optimality Theory: Constraint Interaction in Generative Grammar , 2004 .

[33]  Aravind K. Joshi,et al.  Natural language parsing: Tree adjoining grammars: How much context-sensitivity is required to provide reasonable structural descriptions? , 1985 .

[34]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[35]  Mark Steedman,et al.  Combinators and Grammars , 1988 .

[36]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.

[37]  Ellen Broselow,et al.  Unmarked structures and emergent rankings in second language phonology , 2004 .

[38]  L. Lombardi Segmental Phonology in Optimality Theory: Why Place and Voice Are Different: Constraint-Specific Alternations in Optimality Theory , 2001 .

[39]  Mitsuhiko Ota,et al.  Optimality Theory: an overview , 2000 .

[40]  Bernard Lang,et al.  Metal: A Formalism to Specify Formalisms , 1983, Sci. Comput. Program..

[41]  Ellen Broselow,et al.  THE EMERGENCE OF THE UNMARKED IN SECOND LANGUAGE PHONOLOGY , 1998, Studies in Second Language Acquisition.

[42]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[43]  Aarne Ranta,et al.  XML and Multilingual Document Authoring: Convergent Trends , 2000, COLING.

[44]  Bengt Nordström,et al.  Programming in Martin-Lo¨f's type theory: an introduction , 1990 .

[45]  Stuart M. Shieber,et al.  An Introduction to Unification-Based Approaches to Grammar , 1986, CSLI Lecture Notes.

[46]  J. Grimshaw Projection, heads, and optimality , 1997 .

[47]  Richard Power,et al.  Multilingual Authoring Using Feedback Texts , 1998, COLING-ACL.

[48]  Ivan A. Sag,et al.  Book Reviews: Head-driven Phrase Structure Grammar and German in Head-driven Phrase-structure Grammar , 1996, CL.

[49]  Per Martin-Löf,et al.  Intuitionistic type theory , 1984, Studies in proof theory.

[50]  Aarne Ranta Type-Theoretical Grammar , 1995 .

[51]  Thomas Reps,et al.  Programming Techniques and Data Structures , 1981 .

[52]  Glyn Morrill,et al.  Type Logical Grammar: Categorial Logic of Signs , 1994 .

[53]  John J. McCarthy,et al.  Optimality Theory in Phonology , 2004 .