Re:What if we tested laws before passing them?
by rntz on Monday December 13, 2010 @10:35AM
(#2000726)
You have your Prolog backwards.
foo(X) :- bar(X).
means that foo(X) is true if bar(X) is true, not the other way around. So your code would indicate that anything that's not a law is unconstitutional, and anything unconstitutional prohibits free exercise of religion (for example).
But if we were going to try to reduce the complicated, inherently human, and uncertain concept of law to computer code, surely you'd agree that a declarative programming language would be a better choice. Something like:
prohibits_free_exercise_of_religion(X) :- unconstitutional(X). respects_establishment_of_religion(X) :- unconstitutional(X). unconstitutional(X) :- not_law(X).
Now, all you have to do is write Prolog code to test for when a law prohibits the exercise of religion or respects the establishment of religion!