For all of you who may be invested in Ethereum , you should pay close attention to what is said in this lecture while keep in mind that Etherume is Turing complete.
https://www.youtube.com/watch?v=Utggm7cuGbo&feature=youtu.be Let us assume that we have a contract and I wish to ask – what will happen.
Do I need to live through this contract to see what happens with it, or, can I know in advance, what will be it's outcomes.
Godel proved that if a language is rich enough to describe the arithmetics, it is complete, and can prove all the correct statements, and it can also prove all the incorrect statements, as we have just shown. If we have a language that is consistent, and can not prove statements that are incorrect, then it can not prove all statements, it is incomplete, can describe only part of the realities, not all of them.
And so, the world of mathematics, logics and philosophy where in crisis and did not know what to do in order not to be self contradictive. In the 70's till mid 80's came Martin Löf. He formalized a system for the foundations of mathematics. A logical system, that can not be called logics, because it is different. This system is consistent. I can not contradict myself with this system, and therefore, when I have a proof, I can rely on it. If I have a proof for a statement, it means that is it correct, because we can not prove incorrect statements in a consistent language.
And so, Martin Löf presented logics that is today viewed as the new basis for mathematics. It went that far as to be called the new foundation of mathematics. With this logic we can determine if a statement is true or false, including by a computer. Of course, it took time since the 80's to understand what it is all about, and until they verified Martin Löf is indeed correct. Slowly, programming languages were developed to use this trick. For example, we can mention Agda, or Idris.
In these languages we can write code, and ask what the code does, and even receive a mathematically proven answer with all the steps that led to the result. I can rely on that proof and know that it is impossible to prove an incorrect statement.
On the other hand, in Turing complete languages, which are most of the languages that are used today for programming, people do not know the concept of proof on code because it is simply not possible. In order to know if a code works, it is needed to run it. to live through it and see if it works.