There is a long-standing branch of Artificial Intelligence which is working on formal representation of laws and regulations, part of the “AI and Law” community. (See, for example, the biannual International Conference series on AI and Law — ICAIL.) A key research team in this effort has been the AI Department of the Dutch Tax Office, which has been working to develop formal representations of tax codes for precisely the reasons mentioned by other commentators: to enable automatic verification of consistency, and automatic identification of conflicts in proposed codes. A recent research project funded by the EC in this area was the Estrella project. See: http://www.estrellaproject.org
Similar efforts in formal representation and inferencing over the rules governing the operation of the US electricity grid may have prevented the outages which occurred there earlier this decade, since the outages were supposedly caused by conflicts between various operational regulations.