a rewriting system for curly-brace languages