You should reconsider your mental model of the law. With respect, it’s misinformed.
Law in its writing and interpretation is less deterministic, and quantity of statute is far less of a factor in its complexity than most in STEM realise.
Further, to parse law in a sense that it could be sensibly refactored, would be impossible with AI/ML as the field stands today, and I think will never be possible.