# How do I call a system like a grammar, but where a rule has to be applied to all matches at once?

For example, given rules $$\{ a \to x, a \to y \}$$ and input $$aa$$ , I am usually allowed to derive strings $$\{ xx, xy, yx, yy \}$$. I would like to restrict this to only performing “consistent” rewrites, so that the language would be like $$\{ xx, yy \}$$. It is evidently possible to synchronize rewrites in distant parts of a sentence within the usual formal grammar setting, but I wonder if this possibility is better explored under a different name or in a different arrangement.

I notice that context-sensitive grammars pose trouble with this “consistency” condition. For example, given a ruleset $$\{ aa \to x\}$$ and initial string $$aaa$$, I am not sure if I should allow anything to be derived. Then again, it is entirely possible that only some rules, and specifically some context-free rules, may be enhanced with consistency.

I am rather sure the system I have in mind defines a language, and even that I could with some thinking propose a formal way to rewrite a given grammar so that some select context free rules are made consistent. But I wonder if this is actually widely known under some other name.