|
|
|
|
|
by smaudet
1526 days ago
|
|
> You still write the tests in standard Ruby and synthesized code should satisfy the logic as checked by the tests. I think its important that the code still be user-modifiable: Take this function, y = 2 * x. Write a test, which proves for all real numbers, that y = 2 * x. Can't do it, can you? Tests can't fully specify code - this effort is doomed to be incomplete. |
|
Tests by definition do not prove any for all property. They just check on correctness on concrete values. Formal properties are great for proving properties on values, i.e., for your example one could easily write a logical formula and hand it off to a SMT solver for synthesis and there is enough prior work on that.
> Tests can't fully specify code - this effort is doomed to be incomplete.
RbSyn addresses a different problem: it is difficult to formally specify the behavior of an application in a high-level language that handles HTTP requests, accesses the database. Incompleteness of tests are an advantage here--it allows the specification to be tractable (these are tests programmers would have written anyway), while constraining the search space enough for the synthesizer to give a solution. In practice, it turns out these tests are good enough to synthesize methods from a lot of production grade Ruby on Rails web apps (https://arxiv.org/abs/2102.13183).