DEV Community

Discussion on: Types as propositions, programs as proofs

Collapse
 
gypsydave5 profile image
David Wickes

interesting fact: humans get a lot better at logic when you formulate it as a cheater-detection problem

I laughed hard!

The compiler will check that your proof is correct (you have no compiler errors).

Do you need a compiler to do this, or can it be done with a separate program where no compiler exists for the language?

Collapse
 
drbearhands profile image
DrBearhands

There are proof checkers. I'm not familiar with them though. I believe Coq does something similar.

Could you do this for an interpreted language? Sure, but strongly typed, functionally pure languages are generally compiled. (if I'm not mistaken, you'd be losing out on a virtually free speedup by not compiling).

Collapse
 
8uurg profile image
8uurg

Agda and Coq are both languages that also forbid infinite loops and thus have type systems that allow you to prove logical statements (via the Curry-Howard correspondence) about your programs.

It is cool to know your program has certain properties for all inputs by proving it, but also very time consuming :)