Formal Methods Considered Obscure
[Note: In the following sections, by "Nobody", I mean lessthan 1% of proffessional programmers.]
Why programmers don't use formal methods
- Nobody has ever seen a formal proof of a program, much less
one that they still understood an hour later.
- Nobody writes specifications in the same languages in which
they write code.
- Even important proponents of Formal Methods think it is
"too difficult" to do detailed formal proofs of large
projects.
- You have to understand complex state spaces, and use complicated
notation to use Formal Methods.
- Programmers are not adequately trained to use Formal Methods.
- Tools to assist developers do not exist, or are not readily
available.
- Nobody knows how much time it would save them.
- They believe the Church-Turing thesis means you cannot write
a total-correctness-proof checker.
- Publish proofs in well-known programming languages
- Develop specification notations in well-known programming
languages
- Build some large projects that are formally specified
and verified.
- Publish good descriptions of how proofs and programs are actually
derived.
- Most programmers passed Geometry and Triginometry in High
School. This demonstrates the sort of facility in equational
logic needed for correctness proofs. However, providing
some curriculum in using these techniques is needed as well,
since most current texts in the field (_Scientific Programming_
etc.) use obscure, custom-built programming languages.
- Provide open source tools for checking proofs, validating
specifications, etc.
- Educate people on the time-sucking-abyss of the run-break-fix cycle.
Do studies of developing similar applications between groups
who use formal methods approaches and those who do not.
- Explain that the Church-Turing thesis does not
prevent you writing a total-correctness-proof checker.As you may recall, Church-Turing construction of a contradiction works
when the program/turing-machine in question attempts to partition
the set of programs into- programs which terminate on all inputs
- programs which do not terminate on all inputs
and then modify that partitioning-program to make a contradiction.If instead our program/turing-machine partitions programs into:
- programs which we know terminate on all inputs
- programs which we do not know whether they terminate or not.
the contradiction does not arise, even when the partitioner falls (as we would hope it would) into the first set. If you modify it by adding an infinite loop at the termination point, it will no longer adhere to the proof checking rules, and you have then moved it into the set of things whose termination status is unknown; however saying we don't know if something terminates does not lead to a contradiction.
- programs which terminate on all inputs
Synergy
It turns out that several items, above, are interrelated. If we provide a formally specified and verified library of software which is used to build tools for specifying and building aproof checking and specification validation suite, using literate programming techniques to make our specification, implemntation, and verification clear, we accomplish most of these fixes.
If we build up class notes for a training program to teach the notation and practices to programmers, we achieve more of them.
If we then study people's programming proficiency and reliability when they do and don't use these techniques, we achive all of them.
