Why can't programs be proven?

前端 未结 30 2499
礼貌的吻别
礼貌的吻别 2020-12-22 17:06

Why can\'t a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and

30条回答
  •  没有蜡笔的小新
    2020-12-22 18:03

    They can. I spent many, many hours as a college freshman doing program correctness proofs.

    The reason it's not practical on a macro scale is that writing a proof of a program tends to be a lot harder than writing the program. Also, programmers today tend to build systems, not write functions or programs.

    On a micro scale, I sometimes do it mentally for individual functions, and tend to organize my code to make them easy to verify.

    There's a famous article about the space shuttle software. They do proofs, or something equivalent. It's incredibly costly and time-consuming. That level of verification may be necessary for them, but for any kind of consumer or commercial software company, with current techniques, you'll get your lunch eaten by a competitor who delivers a 99.9% solution at 1% of the cost. Nobody's going to pay $5000 for an MS Office that's marginally more stable.

提交回复
热议问题