You greatly overestimate how amenable the law is to being treatable as code.
Language is not discrete.