A Linguistics Oriented Programming Language

Vaughan R. PrattIJCAI 1973

Abstract

This paper introduces LINGOL (Linguistics Oriented Language), a domain-specific programming language designed to bridge the gap between formal syntax and computer-executable semantics. By treating a parse tree as a program to be executed, LINGOL provides a modular framework for building natural language processors. The system separates the "cognitive" (parsing) and "generative" (semantic) phases, leveraging LISP’s symbolic power to allow researchers to build functional translators and analyzers efficiently.

Introduction

In the early 1970s, natural language processing (NLP) was often a cumbersome exercise in string manipulation. Existing tools like COMIT or SNOBOL were primarily string processors that struggled to account for the deep structural complexities of language. Researchers faced significant challenges at the syntax-semantics interface: transforming a grammatical structure into meaningful output without creating a tangled mess of global variables. Handling linguistic markers, such as gender agreement in French or negation placement, was computationally inefficient. Vaughan R. Pratt developed LINGOL to provide a clean, modular framework that makes NLP programming significantly less "painful."

The LINGOL Architecture

LINGOL operates on a translation paradigm divided into two distinct phases:

The Cognitive Phase (Parsing)

This phase utilizes context-free grammar rules to transform a source sentence into a syntactic structure, or parse tree. Users can provide "hints" (referred to as COG) to assist the parser in resolving ambiguities by providing feedback based on context.

A parse tree generated by LINGOL for the sentence 'THE DOG LOVE THE SEA'.

The Generative Phase (Semantics)

This phase introduces the "Program Paradigm," where each node in the parse tree is treated as a function, and its subtrees serve as arguments. To translate or process a sentence, LINGOL executes the tree from the top down. This approach allows for elegant, recursive processing where the tree itself embodies the logic required for translation.

Implementation and Technical Innovations

LINGOL's power stems from several key technical features:

  • Syntax-Directed Translation: Semantics are attached directly to grammar rules. When a rule is matched, a corresponding snippet of LISP code (GEN) is prepared for execution.
  • Local Variable Scoping: By leveraging LISP’s scoping, LINGOL handles linguistic markers cleanly. Instead of passing markers like "gender" manually through every node, local variables are used within relevant clauses or noun groups.
  • Unknown Word Handling: A built-in morphological analyzer guesses parts of speech based on sentence position, minimizing interruptions for user clarification.
Example of LINGOL grammar rules defining sentence structure and associated semantic actions.

Evaluation and Results

As LINGOL predates modern large-scale datasets, it was evaluated using hand-crafted grammars and dictionaries. Notable applications included:

  • An English-to-German translator built by a student in just two weeks.
  • English-to-French translators developed in as little as five hours.
  • A question-answering system based on a relational world model.

Pratt demonstrated the language's efficiency by writing and debugging a functional English-to-French translator in a single morning. On 1973 hardware, LINGOL achieved parsing speeds of approximately 30 milliseconds per word. Furthermore, adding complex features like "self-tutoring" capabilities (learning new words through interaction) required only a few additional hours of development.

Discussion and Limitations

A key insight from LINGOL's development is that the generative (semantic) component of a program is typically three times larger than the cognitive (syntactic) component, suggesting that linguistic complexity resides primarily in meaning rather than structure.

However, LINGOL faced several limitations:

  • Structural Complexity: The system struggled with conjunctions and adverbs, which are difficult to map with simple context-free rules.
  • Pragmatics: While syntax and semantics were well-handled, "pragmatics" (world knowledge) remained a significant hurdle left largely to the user.
  • Context-Free Constraints: Pratt acknowledged that context-free rules might not suffice for all linguistic phenomena, pointing toward a future need for more procedure-oriented systems.

Despite these limits, LINGOL proved that isolating syntax from semantics allows the "cognitive" part of a program to focus on understanding, leaving stylistic details to the generative phase.

Summary updated

BibTeX
@inproceedings{pratt1973linguistics,
  author = {Vaughan R. Pratt},
  title = {{A Linguistics Oriented Programming Language}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1973},
}
Figure