That'd be a neat trick. Not even the humans can understand legal language. Perhaps the singularity begins with an expert system suddenly grokking the entirety of law, resolving the paradoxes and contradictions, and then suing all humanity for infringement. Hard-takeoff trolling...
Asimov's "I, Robot" stories cover this territory well. The robots must follow three laws, which are simple enough on their surface, but in application prove tough to predict. The humans begin to see that the laws have unintended and undesirable consequences.
I just recently finished Accelerando, where corporations are composed of and contracts are carried out by software agents (the story starts out with them just being expert systems). It's not the main topic, but a major supporting background.