The Obama Administration's "CTO" office pushed for more laws to include working/testable Python code as artifacts to work through conditional logic in the law. A very small selection of Federal laws did get that added, I don't recall which ones.
Exploring the boundaries between legal code and programming code is a fascinating subject, and one of these decades maybe there will be the right combination of nerds in government to see something systematic attempted.
Sure there would be learning involved, but not nearly as much memorization.