Artificial intelligence set to rewrite rules for legal profession