Legal codification by software methods