There’s something I used to say that I haven’t repeated in a while and I’m not sure why since I still believe it:
Software is effectively contract law, and if one were solvable the other would be too. The fact that we have so many lawyers, and loopholes are a constant issue is the same reason we have so many programmers and so many bugs.
We cannot nail down what is and isn’t acceptable input, acceptable output, and acceptable intermediate states all at the same time. And that’s what you need for correct software.