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.
The first description of grammar adaptivity (though not under that name) in the literature is generally taken to be in a paper by Alfonso Caracciolo di Forino published in 1963. The next generally accepted reference to an adaptive formalism (extensible context-free grammars) came from Wegbreit in 1970 in the study of extensible programming languages, followed by the dynamic syntax of Hanford and Jones in 1973.
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, 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.
The redoubling language
L
=
{
w
w
|
w
is a letter
}
{\displaystyle L=\{ww|w{\mbox{ is a letter}}\}}
is demonstrated as follows:
<program↓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. Shutt self-classifies RAGs as being a declarative formalism.
The work of Iwai in 2000 takes the adaptive automata of Neto 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 and most fully discussed in 2006, 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.
The redoubling language
L
=
{
w
w
|
w
∈
{
a
,
b
}
+
}
{\displaystyle L=\{ww|w\in \{a,b\}^{+}\}}
is demonstrated as follows:
grammar ww {
S ::= #phi(A.X<-"") R;
R ::= $C('[ab]') #phi(A.X<-A.X C) #phi(N<=A.X) N | R;
};
(Note on notation: In the above example, the #phi(...) statements identify the points in the production R that modify the grammar explicitly. #phi(A.X<-A.X C) represents a global modification (over time) and the #phi(N<=A.X) statement identifies a local modification (over space). The #phi(A.X<-"") 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, adaptive devices were later enhanced and expanded upon by Pistori in 2003.
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.
Self-modifying finite state automata (Shutt & Rubinstein)
Introduced in 1994 by Shutt and Rubinstein, Self-Modifying Finite State Automata (SMFAs) are shown to be, in a restricted form,
Shutt, John N. "What is an Adaptive Grammar?". Retrieved 6 February 2019. http://web.cs.wpi.edu/~jshutt/adapt/adapt.html
Christiansen, Henning, "A Survey of Adaptable Grammars," ACM SIGPLAN Notices, Vol. 25 No. 11, pp. 35-44, Nov. 1990. https://web.archive.org/web/20170816110832/https://pdfs.semanticscholar.org/1d4a/e919601b166856d5f7c35d080f99d38c9546.pdf
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Jackson, Quinn Tyler, Adapting to Babel: Adaptivity and Context-Sensitivity in Parsing, Ibis Publications, Plymouth, Massachusetts, March 2006. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.403.8977
Caracciolo di Forino, Alfonso, "Some Remarks on the Syntax of Symbolic Programming Languages," Communications of the ACM, Vol. 6, No. 8., pp. 456-460, August 1963. http://dl.acm.org/citation.cfm?id=367584
Wegbreit, Ben, Studies in Extensible Programming Languages[dead link], ESD-TR-70-297, Harvard University, Cambridge, Massachusetts, May 1970. In book form, Garland Publishing, Inc., New York, 1980. http://www.dtic.mil/get-tr-doc/pdf?AD=AD0715332
Hanford, K.V. & Jones, C.B., "Dynamic Syntax: A Concept for the Definition of the Syntax of Programming Languages," Annual Review in Automatic Programming 7, Pergamon Press, Oxford, pp. 115-142, 1973. http://www.sciencedirect.com/science/article/pii/0066413873900037
Christiansen, Henning, "A Survey of Adaptable Grammars," ACM SIGPLAN Notices, Vol. 25 No. 11, pp. 35-44, Nov. 1990. https://web.archive.org/web/20170816110832/https://pdfs.semanticscholar.org/1d4a/e919601b166856d5f7c35d080f99d38c9546.pdf
Burshteyn, Boris. "On the Modification of the Formal Grammar at Parse Time", ACM SIGPLAN Notices, Vol. 25 No. 5, pp. 117-123, May 1990. https://dl.acm.org/citation.cfm?id=382639
http://www.pcs.usp.br/~lta/union/index.php?cp=4&categoria=28 [dead link] http://www.pcs.usp.br/~lta/union/index.php?cp=4&categoria=28
Hanford, K.V. & Jones, C.B., "Dynamic Syntax: A Concept for the Definition of the Syntax of Programming Languages," Annual Review in Automatic Programming 7, Pergamon Press, Oxford, pp. 115-142, 1973. http://www.sciencedirect.com/science/article/pii/0066413873900037
Wegbreit, Ben, Studies in Extensible Programming Languages[dead link], ESD-TR-70-297, Harvard University, Cambridge, Massachusetts, May 1970. In book form, Garland Publishing, Inc., New York, 1980. http://www.dtic.mil/get-tr-doc/pdf?AD=AD0715332
Burshteyn, Boris, "Generation and Recognition of Formal Languages by Modifiable Grammars," ACM SIGPLAN Notices, Vol. 25 No. 12, pp. 45-53, December 1990. https://dl.acm.org/citation.cfm?id=122196
Boullier, Pierre, "Dynamic Grammars and Semantic Analysis," INRIA Research Report No. 2322, August 1994. https://hal.inria.fr/inria-00074352/document
Christiansen, Henning, "A Survey of Adaptable Grammars," ACM SIGPLAN Notices, Vol. 25 No. 11, pp. 35-44, Nov. 1990. https://web.archive.org/web/20170816110832/https://pdfs.semanticscholar.org/1d4a/e919601b166856d5f7c35d080f99d38c9546.pdf
John Shutt originally called his Recursive Adaptive Grammars by the name Recursive Adaptable Grammars, and notes his change to adaptive at this URL: John Shutt's MS Thesis. http://web.cs.wpi.edu/~jshutt/thesis/top.html
Iwai, Margarete Keiko, Um formalismo gramatical adaptativo para linguagens dependentes de contexto, Doctoral thesis, Department of Engineering, University of São Paulo, Brazil, January 2000.
Bravo, César, Grámmaticas Livres de Contexto Adaptativas com verificação de aparência, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, January 2004. http://www.teses.usp.br/teses/disponiveis/3/3141/tde-31032005-134438/publico/CESARPARIENTE.pdf
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Iwai, Margarete Keiko, Um formalismo gramatical adaptativo para linguagens dependentes de contexto, Doctoral thesis, Department of Engineering, University of São Paulo, Brazil, January 2000.
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Jackson, Quinn Tyler, Adapting to Babel: Adaptivity and Context-Sensitivity in Parsing, Ibis Publications, Plymouth, Massachusetts, March 2006. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.403.8977
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Shutt, John N., "Imperative Adaptive Grammars" Web page dated 28 March 2001, at the URL: http://web.cs.wpi.edu/~jshutt/adapt/imperative.html http://web.cs.wpi.edu/~jshutt/adapt/imperative.html
Jackson, Quinn Tyler, Adapting to Babel: Adaptivity and Context-Sensitivity in Parsing, Ibis Publications, Plymouth, Massachusetts, March 2006. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.403.8977
Wegbreit, Ben, Studies in Extensible Programming Languages[dead link], ESD-TR-70-297, Harvard University, Cambridge, Massachusetts, May 1970. In book form, Garland Publishing, Inc., New York, 1980. http://www.dtic.mil/get-tr-doc/pdf?AD=AD0715332
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Christiansen, Henning, "Syntax, Semantics, and Implementation Strategies for Programming Languages with Powerful Abstraction Mechanisms," Proceedings of the 18th Hawaii International Conference on System Sciences, Vol. 2, pp. 57-66, 1985.
Christiansen, Henning, "The Syntax and Semantics of Extensible Languages," Datalogiske skrifter 14, Roskilde University, 1988. http://akira.ruc.dk/~henning/publications/SSofExtLang1988.pdf
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Christiansen, Henning, "The Syntax and Semantics of Extensible Languages," Datalogiske skrifter 14, Roskilde University, 1988. http://akira.ruc.dk/~henning/publications/SSofExtLang1988.pdf
Burshteyn, Boris. "On the Modification of the Formal Grammar at Parse Time", ACM SIGPLAN Notices, Vol. 25 No. 5, pp. 117-123, May 1990. https://dl.acm.org/citation.cfm?id=382639
Burshteyn, Boris, "Generation and Recognition of Formal Languages by Modifiable Grammars," ACM SIGPLAN Notices, Vol. 25 No. 12, pp. 45-53, December 1990. https://dl.acm.org/citation.cfm?id=122196
Burshteyn, Boris, "USSA–Universal Syntax and Semantics Analyzer," ACM SIGPLAN Notices, Vol. 27 No. 1, pp. 42-60, January 1992. http://dl.acm.org/citation.cfm?id=130724
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Shutt, John N., Recursive Adaptable Grammars, Master’s Thesis, Worcester Polytechnic Institute, 1993. (16 December 2003 emended revision.) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1220&context=computerscience-pubs
Boullier, Pierre, "Dynamic Grammars and Semantic Analysis," INRIA Research Report No. 2322, August 1994. https://hal.inria.fr/inria-00074352/document
Jackson, Quinn Tyler, Adapting to Babel: Adaptivity and Context-Sensitivity in Parsing, Ibis Publications, Plymouth, Massachusetts, March 2006. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.403.8977
Iwai, Margarete Keiko, Um formalismo gramatical adaptativo para linguagens dependentes de contexto, Doctoral thesis, Department of Engineering, University of São Paulo, Brazil, January 2000.
Neto, João Jose, "Adaptive Automata for Context-Sensitive Languages," ACM SIGPLAN Notices, Vol. 29 No. 9, pp. 115-124, September 1994.
Jackson, Quinn Tyler, "Adaptive Predicates in Natural Language Parsing," Perfection, Vol. 1 No. 4, April 2000. https://www.researchgate.net/profile/Quinn_Jackson/publication/2497744_Adaptive_Predicates_in_Natural_Language_Parsing/links/0fcfd50c9e2125678e000000.pdf
Jackson, Quinn Tyler, Adapting to Babel: Adaptivity and Context-Sensitivity in Parsing, Ibis Publications, Plymouth, Massachusetts, March 2006. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.403.8977
Bravo, César, Grámmaticas Livres de Contexto Adaptativas com verificação de aparência, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, January 2004. http://www.teses.usp.br/teses/disponiveis/3/3141/tde-31032005-134438/publico/CESARPARIENTE.pdf
Okhotin, Alexander, Boolean Grammars: Expressive Power and Algorithms, Doctoral thesis, School of Computing, Queens University, Kingston, Ontario, August 2004.
Neto, João Jose, "Adaptive Rule-Driven Devices: General Formulation and Case Study[permanent dead link]," B. W. Watson, D. Wood (Eds.): Implementation and Application of Automata 6th International Conference, CIAA 2001, Lecture Notes in Computer Science, Vol. 2494, Pretoria, South Africa, Springer-Verlag, pp. 234–250, 23–25 July 2001. ftp://nozdr.ru/biblio/kolxo3/Cs/CsLn/Implementation%20and%20Application%20of%20Automata,%206%20conf.,%20CIAA%202001(LNCS2494,%20Springer,%202002)(ISBN%203540004009)(298s).pdf#page=243
Pistori, Hemerson, Tecnologia Adaptativa em Engenharia de Computação: Estado da Arte e Aplicações, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, 2003. http://www.gpec.ucdb.br/pistori/disciplinas/ml/arquivos/apresentacao_tese.pdf
Carmi, Adam, "Adapser: An LALR(1) Adaptive Parser[permanent dead link]," The Israeli Workshop on Programming Languages & Development Environments, Haifa, Israel, 1 July 2002. https://research.ibm.com/haifa/info/ple/papers/AdapserPaper.pdf
Bravo, César, Grámmaticas Livres de Contexto Adaptativas com verificação de aparência, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, January 2004. http://www.teses.usp.br/teses/disponiveis/3/3141/tde-31032005-134438/publico/CESARPARIENTE.pdf
Salomaa, Arto, Formal Languages, Academic Press, 1973.
Iwai, Margarete Keiko, Um formalismo gramatical adaptativo para linguagens dependentes de contexto, Doctoral thesis, Department of Engineering, University of São Paulo, Brazil, January 2000.
Shutt, John & Rubinstein, Roy, "Self-Modifying Finite Automata," in B. Pehrson and I. Simon, editors, Technology and Foundations: Information Processing '94 Vol. I: Proceedings of 13th IFIP World Computer Congress, Amsterdam: North-Holland, pp. 493-498, 1994. (archive) http://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=1184&context=computerscience-pubs
Neto, João Jose, "Adaptive Automata for Context-Sensitive Languages," ACM SIGPLAN Notices, Vol. 29 No. 9, pp. 115-124, September 1994.
Iwai, Margarete Keiko, Um formalismo gramatical adaptativo para linguagens dependentes de contexto, Doctoral thesis, Department of Engineering, University of São Paulo, Brazil, January 2000.
Pistori, Hemerson, Tecnologia Adaptativa em Engenharia de Computação: Estado da Arte e Aplicações, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, 2003. http://www.gpec.ucdb.br/pistori/disciplinas/ml/arquivos/apresentacao_tese.pdf
Bravo, César, Grámmaticas Livres de Contexto Adaptativas com verificação de aparência, Doctoral thesis, Department of Electrical Engineering, University of São Paulo, January 2004. http://www.teses.usp.br/teses/disponiveis/3/3141/tde-31032005-134438/publico/CESARPARIENTE.pdf