| ▲ | amavect 2 hours ago | ||||||||||||||||
In constructive logic, a proof of "A or B" consists of a pair (T,P). If T equals 0, then P proves A. If T equals 1, then P proves B. This directly corresponds to tagged union data types in programming. A "Float or Int" consists of a pair (Tag, Union). If Tag equals 0, then Union stores a Float. If Tag equals 1, then Union stores an Int. In classical logic, a proof of "A or not A" requires nothing, a proof out of thin air. Obviously, we want to stick with useful data structures, so we use constructive logic for programming. | |||||||||||||||||
| ▲ | pron an hour ago | parent | next [-] | ||||||||||||||||
> Obviously, we want to stick with useful data structures, so we use constructive logic for programming. I don't know who "we" are, but most proofs of algorithm correctness use classical logic. Also, there's nothing "obvious" about what you said unless you want proof objects, and why you'd want that is far from obvious in itself. | |||||||||||||||||
| |||||||||||||||||
| ▲ | layer8 2 hours ago | parent | prev [-] | ||||||||||||||||
You aren’t giving any justification why proofs should necessarily map to data structures. | |||||||||||||||||
| |||||||||||||||||