[Software Analysis Lecture 17 - Study Notes] Program Synthesis Program Synthesis

foreword

Creation start time:

As the title, learn about Program Synthesis related knowledge. Reference: Mr. Xiong Yingfei's 2018 "Software Analysis" courseware.

text

program synthesis

Program synthesis is a software analysis problem.
Program synthesis as a search problem.

At present, most program synthesis techniques only deal with expressions, because they can be directly converted into constraints for SMT to solve.

  • Enumeration method: search according to a fixed format
  • Constraint solving method: convert the program search problem as a whole into a constraint solving problem
  • Heuristic search method: use heuristic search
  • Statistical method: use machine learning and other methods to find the program with the highest probability

Enumeration

Expand grammatically:

  • top-down traversal
  • Bottom-up traversal
  • Two-way search: It is required to be able to calculate the strongest post-condition or the weakest pre-condition, usually used for pipeline programs or programs with fixed system states

Determine if the programs are equivalent:

  • It can be judged by the SMT solver, but the coding is cumbersome
  • Judging by predefined rules

CEGIS: Counterexample-Based Optimization

Constraint solving is slower and test execution is faster. Save the counterexamples returned by the constraint solver as test input.

Optimization 1: When verifying, use test verification first.
Optimization 2: When judging equivalence, first use test results to judge

Constraint Solver

Convert the program synthesis problem as a whole into a constraint solving problem, which is solved by the SMT solver.

Component-Based Program Synthesis

insert image description here

heuristic search

insert image description here

Statistics

insert image description here
This is a bit like a Markov chain.

Component-Based Synthesis

reference:

First understand Oracle-guided synthesis:
insert image description here
That's it, it's pretty good. Examples are also easy to understand.

It is through the SMT problem to get the counterexample Counterexample, and then add it to the Specification, so as to continuously strengthen the specification.

Watch this after reading this:

  • [ICSE 13 paper] SemFix: Program repair via semantic analysis

I can probably understand it.

summary

I still learned a lot, and I will add and improve it later.

Creation end time: November 16, 2022 23:42:19

references

Guess you like

Origin blog.csdn.net/weixin_39278265/article/details/127894029