Imagine this source code becoming the unit tests for the legal code. Future tax-code changes would be accompanied by corresponding changes in GitHub. Inconsistencies would surface as new code and tests break the old ones. As courts introduce new nuances to the law's interpretation, new unit tests would follow.
This wouldn't replace human judgment; nobody in power would allow that. But even the capriciousness of politics can be expressed as Boolean logic (var isDeductible = taxpayerIsMe && !taxpayerIsYou). The tests could at least memorialize all the pork.
good luck with that; interpretation make things like this very difficult, if not impossible.
I agree that this would be nice, however. as a non-lawyer and someone who considers themself to be not a "real" developer (even though I write software every day) I have often wondered how alike law and code are, really, when it comes to defining intent via a keyboard.
The interpretation aspect isn't solvable in code, but it's representable. That's what I was getting at with the Boolean comment. A branch point might be "bool answerUnanswerableQuestion()" and the unit tests would mock it as true and then false. Even if the question isn't deterministically answerable in real life, at least the code can show what happens when it is answered.
You're conflating determination of factual and legal questions (out of scope) with modeling the decision tree (in scope and useful).
The function you ask about would be "getDeductiblePercentage()," and the unit tests would return various hard coded numbers. Actually determining that value for a real taxpayer is still hard.
Being able to show how information flows through the US tax code would be useful, even if it doesn't solve all the problems that arise from its intricacy.
This wouldn't replace human judgment; nobody in power would allow that. But even the capriciousness of politics can be expressed as Boolean logic (var isDeductible = taxpayerIsMe && !taxpayerIsYou). The tests could at least memorialize all the pork.