4 ms·
How does a program go from TLA+ spec to code that can be executed, and verify that they both do the same thing? Is this a manual (and therefore, subject to hum
by zdw 6y ago
How does a program go from TLA+ spec to code that can be executed, and verify that they both do the same thing?
Is this a manual (and therefore, subject to human error) process, or do tools exist for automating it?
- k__ 6y agoIt's a manual process, but I read there are tools that try to automate it. But as far as I understood it, if you know TLA+ and the target language well, it's like writing an article from a good outline.
- jlouis 6y agoFor TLA it's manual. For other systems, like Coq for instance, you can extract to another language. (Also important are that systems in this space are different. What something like Coq is good for is completely different to what TLA+ is good for. Another idea in the same vein is property-based-testing. Here the concrete code is tested by invoking random test examples, so you are testing the actual code/implementation. But this also means you can't use typical tricks of model checkers where they can regard whole classes of inputs the "same" in a test).
- dmos62 6y agoThink of writing a TLA+ spec as structured thinking with error checking. It helps create a correct algorithm. Having your code implement the algorirthm correctly is a different problem. There was a Racket language that actually syntesized programs from specs (e.g. go from spec of a sorting algo to its implementation automatically), but I forget what it's called. Fun to play around with.
- Jtsummers 6y agoI've seen a couple things on using Racket for code synthesis. My google search revealed Rosette, which wasn't what I was thinking of. The other work may have been in Scheme, using minikanren, but my Google Fu seems weak this morning. https://docs.racket-lang.org/rosette-guide/index.html https://docs.racket-lang.org/rosette-guide/index.html
- hwayne 6y agoFun fact: Emina Torlak also wrote Kodkod, the constraint solver used to convert Alloy specs into SAT problems. She's pretty cool!