I think I'm accidentally re-inventing the pre-inference part of XRATE with a weaker class of grammars.