News for hackers. Stuff that matters.
Re:Software Verification and Analysis Using Z3 by jdc on Saturday January 30, 2021 @07:03PM (#25974332)
This may be a dumb question, but how do I know that the model is accurate?
Re:Software Verification and Analysis Using Z3 by im_down_w_otp on Saturday January 30, 2021 @07:19PM (#25974434)
The age old problem of verification vs. validation. Verification is about whether or not you built something right. Validation is about whether or not you built the right thing. This article is about using Z3 to pursue the former, the latter is an entirely different issue.
Re:Software Verification and Analysis Using Z3 by ahelwer on Saturday January 30, 2021 @07:39PM (#25974545)
This is, basically, an unsolvable philosophical problem. You are the only one who can bridge the infinite lacuna between the idea in your head and its properties encoded in an actual model. There are all sorts of validity tests you can add to ensure it matches your vision, of course, but any attempt at solving this problem would just look like an even higher-level language.
Re:Software Verification and Analysis Using Z3 by throwawaygh on Saturday January 30, 2021 @08:19PM (#25974782)
This is called validation, and it's much harder epistemically than verification.

Is it possible to check at runtime that the model is accurate?

Do you have a sensible thing to do if the model isn't accurate (e.g., fallback into "failsafe" mode, let an on-call engineer know that an assumption was violated, etc.)?

If yes & yes, well, there's your answer :)

Re:Software Verification and Analysis Using Z3 by 1337_d00dZ on Saturday January 30, 2021 @07:15PM (#25974401)
Do the opposite: generate the program from the model
Re:Software Verification and Analysis Using Z3 by woodruffw on Saturday January 30, 2021 @07:20PM (#25974441)
Which, in turn, requires trusting or proving the soundness of your program generator and only proves that your incorrect original program is exactly as incorrect as the model that verifies it.

Automating the stronger proof (that the model is exactly as correct as the original program, and that the model is correct) hasn't been solved in the general case, to the best of my knowledge.

Re:Software Verification and Analysis Using Z3 by woodruffw on Saturday January 30, 2021 @07:16PM (#25974413)
That's not a dumb question! The accuracy of one's underlying models is an outstanding problem in verification.
Re:Software Verification and Analysis Using Z3 by 0xFFC on Saturday January 30, 2021 @07:30PM (#25974496)
Let me ask another question,

how do we evaluate the accuracy of a model?

Thank you for your time.

Re:Software Verification and Analysis Using Z3 by woodruffw on Saturday January 30, 2021 @07:39PM (#25974543)
Evaluating the accuracy of a model is an unsolved problem with both formal and informal approaches.

Formally: we could ask multiple separate model/proof assistants to generate separate models from the same underlying specification, and then attempt to find discrepancies between their predicted results. This really just punts the responsibility: now we're relying on the accuracy of the abstract specification, rather than the model(s) automatically or manually produced from it. It's also not sound; it just allows us to feel more confident.

Informally: we can have a lot of different people look at the model very closely, and produce test vectors for the model based on human predictions of behavior.

Re:Software Verification and Analysis Using Z3 by 0xFFC on Sunday January 31, 2021 @01:38AM (#25976632)
Thank you. Is there any way to statistically evaluate a model? Something like testing a model.
Re:Software Verification and Analysis Using Z3 by Karrot_Kream on Sunday January 31, 2021 @03:37AM (#25977169)
You could generate a set of random vectors that span the entire input space, exercise the system with those vectors, and publish some sort of "accuracy" (e.g. generate random vectors through i.i.d. uniform R.V.s over the input space, evaluate f(input), and use the successes in a hierarchical binomial distribution). Remember that most of the time we try to verify programs by building a model to model _edge cases_; after all the "happy path" of the program is simple to test. Edge cases are, by their nature, rare occurrences. As a trivial example, think of a boolean function f(x, y) = x & y. f evaluates to 0 for every value of (x, y) except (1, 1). If we were to create a model of this function, f_model = 0, f_model would appear to evaluate similarly to f 75% of the time. With a sufficiently large input state space, it would be quite feasible to hide essential edge cases in very small tail probabilities (e.g. < 99.5%).