An adaptive grammar is a formal grammar that explicitly provides mechanisms within the formalism to allow its own production rules to be manipulated.
John N. Shutt defines adaptive grammar as a grammatical formalism that allows rule sets (aka sets of production rules) to be explicitly manipulated within a grammar. Types of manipulation include rule addition, deletion, and modification.[1]
The first description of grammar adaptivity (though not under that name) in the literature is generally[2] [3] [4] taken to be in a paper by Alfonso Caracciolo di Forino published in 1963.[5] The next generally accepted reference to an adaptive formalism (extensible context-free grammars) came from Wegbreit in 1970[6] in the study of extensible programming languages, followed by the dynamic syntax of Hanford and Jones in 1973.[7]
Until fairly recently, much of the research into the formal properties of adaptive grammars was uncoordinated between researchers, only first being summarized by Henning Christiansen in 1990[2] in response to a paper in ACM SIGPLAN Notices by Boris Burshteyn.[8] The Department of Engineering at the University of São Paulo has its Adaptive Languages and Techniques Laboratory, specifically focusing on research and practice in adaptive technologies and theory. The LTA also maintains a page naming researchers in the field.[9]
While early efforts made reference to dynamic syntax[7] and extensible,[6] modifiable,[10] dynamic,[11] and adaptable[2] [12] grammars, more recent usage has tended towards the use of the term adaptive (or some variant such as adaptativa,[13] [14] depending on the publication language of the literature).[3] Iwai refers to her formalism as adaptive grammars,[13] but this specific use of simply adaptive grammars is not typically currently used in the literature without name qualification. Moreover, no standardization or categorization efforts have been undertaken between various researchers, although several have made efforts in this direction.[3] [4]
Shutt categorizes adaptive grammar models into two main categories:[3] [15]
Jackson refines Shutt's taxonomy, referring to changes over time as global and changes over space as local, and adding a hybrid time-space category:[4]
Adaptive formalisms may be divided into two main categories: full grammar formalisms (adaptive grammars), and adaptive machines, upon which some grammar formalisms have been based.
The following is a list (by no means complete) of grammar formalisms that, by Shutt's definition above, are considered to be (or have been classified by their own inventors as being) adaptive grammars. They are listed in their historical order of first mention in the literature.
Described in Wegbreit's doctoral dissertation in 1970,[6] an extensible context-free grammar consists of a context-free grammar whose rule set is modified according to instructions output by a finite state transducer when reading the terminal prefix during a leftmost derivation. Thus, the rule set varies over position in the generated string, but this variation ignores the hierarchical structure of the syntax tree. Extensible context-free grammars were classified by Shutt as imperative.[3]
First introduced in 1985 as Generative Grammars[16] and later more elaborated upon,[17] Christiansen grammars (apparently dubbed so by Shutt, possibly due to conflict with Chomsky generative grammars) are an adaptive extension of attribute grammars. Christiansen grammars were classified by Shutt as declarative.[3]
The redoubling language
L=\{ww|wisaletter\}
where w-rule =
G’> → wFirst introduced in May 1990[8] and later expanded upon in December 1990,[10] modifiable grammars explicitly provide a mechanism for the addition and deletion of rules during a parse. In response to the ACM SIGPLAN Notices responses, Burshteyn later modified his formalism and introduced his adaptive Universal Syntax and Semantics Analyzer (USSA) in 1992.[18] These formalisms were classified by Shutt as imperative.[3]
Introduced in 1993, Recursive Adaptive Grammars (RAGs) were an attempt to introduce a Turing powerful formalism that maintained much of the elegance of context-free grammars.[3] Shutt self-classifies RAGs as being a declarative formalism.
Boullier's dynamic grammars, introduced in 1994,[11] appear to be the first adaptive grammar family of grammars to rigorously introduce the notion of a time continuum of a parse as part of the notation of the grammar formalism itself.[4] Dynamic grammars are a sequence of grammars, with each grammar Gi differing in some way from other grammars in the sequence, over time. Boullier's main paper on dynamic grammars also defines a dynamic parser, the machine that effects a parse against these grammars, and shows examples of how his formalism can handle such things as type checking, extensible languages, polymorphism, and other constructs typically considered to be in the semantic domain of programming language translation.
The work of Iwai in 2000[13] takes the adaptive automata of Neto[19] further by applying adaptive automata to context-sensitive grammars. Iwai's adaptive grammars (note the qualifier by name) allow for three operations during a parse: ? query (similar in some respects to a syntactic predicate, but tied to inspection of rules from which modifications are chosen), + addition, and - deletion (which it shares with its predecessor adaptive automata).
Introduced in 2000[20] and most fully discussed in 2006,[4] the §-Calculus (§ here pronounced meta-ess) allows for the explicit addition, deletion, and modification of productions within a grammar, as well as providing for syntactic predicates. This formalism is self-classified by its creator as both imperative and adaptive, or, more specifically, as a time-space adaptive grammar formalism, and was further classified by others as being an analytic formalism.[14] [21]
The redoubling language
L=\{ww|w\in\{a,b\}+\}
grammar ww ;
(Note on notation: In the above example, the statements identify the points in the production R that modify the grammar explicitly. represents a global modification (over time) and the statement identifies a local modification (over space). The statement in the S production effectively declares a global production called A.X by placing the empty string into that production before its reference by R.)
First described by Neto in 2001,[22] adaptive devices were later enhanced and expanded upon by Pistori in 2003.[23]
In 2002,[24] Adam Carmi introduced an LALR(1)-based adaptive grammar formalism known as Adapser. Specifics of the formalism do not appear to have been released.
In 2004,[14] César Bravo introduced the notion of merging the concept of appearance checking[25] with adaptive context-free grammars, a restricted form of Iwai's adaptive grammars,[13] showing these new grammars, called Adaptive CFGs with Appearance Checking to be Turing powerful.
The formalisms listed below, while not grammar formalisms, either serve as the basis of full grammar formalisms, or are included here because they are adaptive in nature. They are listed in their historical order of first mention in the literature.