|
|
|
|
|
by peter_d_sherman
1248 days ago
|
|
You might wish to have a look at "Propositions as Types" by Philip Wadler (thanks rbonvall, for the link!) -- at 21:30 (1290 seconds) into the video: https://youtu.be/IOiZatlZtGU?t=1290 "Evaluation corresponds exactly to simplification of proofs..." (The rest of the video, both before and after this statement, contain more context...) That being said, I agree with you that languages which are used primarily for theorem proving (AKA, "proof assistants") -- are usually not as applicable to as broad a range of programming paradigms and problems as most general purpose computer programming languages are... |
|
Wadler says there:
"Evaluation [of simply typed lambda calculus!] corresponds exactly to simplification of proofs…"
If you didn't get that context you actually missed the whole talk.
You really need to understand: "Programs as proves" is only a thing in languages with strongly normalizing type-systems. This implies that the language is pure and does not contain general recursion.
In a language with mutation (which is obviously not pure) you can destroy any "prove" by just writing to a variable, e.g. switching a single bit in the case of a boolean value.
Terms can be obviously only proves if it's not possible to change a term ("prove") form true to false (or the other way around) at will! Once some term is determined as having some type it may not change any more. This rules out obviously any language with mutation or I/O.
That's why you can't write applications in Agda, or mathematical proves in Haskell. (In the general case; you could do both with "tricks"; but those are indeed tricks).