recursively extend rule