We consider the relationship between grammars and formal languages, exploring the following idea: Normally, when considering the process of deriving a string using a grammar, all structures remain fixed except for the string which is changed only by replacement of substrings. By introducing a more dynamic view of this process, we may allow the grammar to change in various ways as the derivation proceeds, or we may change the notion of application of a rule to a string, or the intermediate strings may be modified between application of rules. We call these more dynamic approaches to language generation 'reactive grammars' and explore, in this paper a range of such reactivities. Some of these are related to previously introduced notions of generative grammars, others appear to be new. Reactivity of computational structures has been explored in other areas, e.g. in Kripke structures and in the general areas of evolvable and adaptive systems.
Background and motivationA standard approach to defining models of computation is to introduce fixed structures over which computation may take place. Such structures include graphs, algebras, grammars, automata, etc. An alternative is to allow the structures themselves to change as computation proceeds. Such computational systems are called 'evolutionary', 'adaptive' or (the term we shall use) 'reactive'. The advantages of this additional flexibility are several: (1) they allow us to model desirable aspects of computation in dynamic settings where we require systems which may reconfigure themselves during computation, (2) they allow us to model the influence of external activity under which computation may have to adapt by changing computational structure, (3) they allow us to re-examine the relationship of a computational model with its semantics. The semantics may be a function computed, or a language generated or recognised, or a logical expression satisfied (e.g. for modal logics and Kripke models). The extra degree of freedom that reactivity introduces allows us additional mechanisms for generating a required semantics. It is this feature of reactive systems that we consider in this paper, where we explore ideas of reactivity in grammars and the relationship of these with the generation of formal languages.For grammars, reactivity is realised through transformations that interact with the derivation steps by which a grammar generates a word in a language. The interaction may for example, at each step of a derivation, control which grammar rules may be applied, or change the notion of application of a rule to a string, or modify rules as they are used, or transform the intermediate strings as they are generated in a derivation. Introducing such reactive elements into the definitions of grammars allows us to re-examine the mathematical structures involved in language recognition and generation, to relate languages according to their reactive structure as well as their production rules, and to model more dynamically changing computational systems.Before exploring rea...