These things are knowable, but unless you've spent some time studying it intensely, it's certain that you only know a fraction of the places where the program is written.
If it's helpful, programmers should imagine that it's written in C. At a glance you can tell what something's doing, but once you study it you can find UB all over the place and suddenly it's hard to say what the right answer is until you know the intricacies of the compiler and the target platform. You can't really determine the exact behavior without all that information that lives outside the code. Now, once you have all that, you can surely reason through it all. But how many people actually know all that, or even realize which parts they don't know?
"This is pretty straightforward" is a sure sign of someone who doesn't actually understand it well.
> These things are knowable
There are absolutely undefined, unknowable areas of law that are waiting on future SCOTUS decisions to be defined.
Heck, we can’t even rely on past SCOTUS decisions.
Even in extremely well-defined law like whether LEO’s have valid PC to search someone during a traffic stop, two different judges in the same district will disagree and appeals courts / state supreme courts can rule quite inconsistently.
That’s by definition not just undefined behavior but also non-deterministic results.
I'm serious. Pick any non-trivial issues of law, ask a world leading expert, and you'd very quickly hear the word "probably" somewhere. Less often than "it depends", but you'll hear those words often nonetheless.
If that's "knowable" to you, I guess it's knowable.
The behavior of C code is something that we can, in principle, reduce to semantics in a formal model we know how to describe the behavior of. Now, there's some issues getting there--the specification is more ambiguous than we'd like, and there's definitely certain behaviors that are very challenging to incorporate in a formal model (say, signal handlers). But even something like UB is something that we have good, well-understand models of what exactly it means to hit UB. At the end of the day, whether or not C code is correct, whether or not the compiler is correctly compiling the C code, is a question that has a clearly objective answer.
Law doesn't work like that. Laws are written and interpreted with the understanding that there is flexibility in the mater. If you compute the law and get an absurd result, then people are going to shrug and throw out the absurd result; rather different it is to a compiler where the absurdity is accepted as correct. As a result, there's not really an objective answer to whether or not something is legal, to understanding what will happen in a legal case, like there is to code.
This is partly because the law predates compilers and modern communication. Why should a crime get different sentences? Often because judges are humans and somehow that makes it okay to lock some people up for years longer than others.
And yet the sentencing guidelines are not binding on outcomes, in part because of the necessary flexibility in law. Sometimes you crunch the numbers and you get absurd results (SBF's fraud conviction is a good example I ran through myself), and so you need the flexibility to throw the algorithm out when the algorithm produces wrong results.
https://arxiv.org/pdf/2011.07966.pdf
Most law generally is non-monotonic. (See https://en.wikipedia.org/wiki/Non-monotonic_logic) The French tax code is one of the few exceptions.