|
|
|
|
|
by rramadass
4 days ago
|
|
Your boss was not quite right. There is a "Correctness-by-Construction" approach to programming which allows one to severely restrict the state space of a program from the beginning such that every statement/block/function only operates on a much smaller "valid" set of program sub-states. This is using classical logic via predicates as explained by Hoare Triples, Dijkstra's wp-calculus, Morgan's refinement calculus and later Meyer's Design-by-Contract. To do deductive verification statically, the basic idea is to group all computation paths (i.e. sequence of state transitions) over the entire program state space into a much smaller set of logical constraints (aka verification conditions) which is then handed off to a SAT/SMT solver to be proved/disproved. An alternative is constructive logic using types and lambda calculus as pointed out by a sibling commentator. There have been lots of systems which have been formally proved/verified to various extents/levels as can be seen in Industrial-Strength Formal Methods in Practice by Hinchey/Bowen and many other similar books. |
|
- ignoring how programs are written, they are usually compiled and linked, which introduces states unknown to the original programmer,
- ignoring how they are compiled, they are executed in environments with variability, including temporal; I remember tracing a problem related to a longer trace on one of the paths of the PCB, and materially different outcomes depending on which trace the signal happen to travel on (it was a high-frequency P-I-D controller, but for whatever reason the microcontroller could transmit the same signal on one or the other path). The particular bug was traced with a oscilloscope, by a graybeard, not algebra.
The way I see it, in order to get verifiability to actual programs, one would need to cover the state space of the entire system - algo, compiled binaries, operating system, hardware, and the weather on the other side of the planet for a good measure.
I am not an expert in the area, in any way - just a regular software dude. Appreciate all the responses in this thread!