Ask HN: Has anyone tried to rewrite a law in Prolog?

6 points by mrtie ↗ HN
Curious if it is possible and if it makes sense to define everything in a law or constitutional act as logical rules using a logic-based programming language such as Prolog.

It'd be really fun to simply type a logical question and directly see whether it is legal or illegal based on all the definitions.

5 comments

[ 3.7 ms ] story [ 23.0 ms ] thread
Interestingly, the law is not what's written in the Constitution, U.S. Code, state laws, or other legislative produces.
Possible yes, sensible no. Any logical outcome can be set aside on fundamentally arbitrary bases, and as soon as you start trying to maintain compatibility with precedent or enforce some sort of axiomatic consistency the whole thing will collapse.
Represent the model probabilistically, like with markov chains or similar.