DOI QR코드

DOI QR Code

예제로부터 명령형 프로그램을 합성하는 방법

Synthesizing Imperative Programs from Examples

  • 투고 : 2017.05.16
  • 심사 : 2017.07.14
  • 발행 : 2017.09.15

초록

본 논문에서는 주어진 입 출력 예제로부터 명령형 프로그램을 합성하는 방법을 제시한다. 프로그램 합성기의 입력으로 (1) 입 출력 예제, (2) 불완전한 프로그램, (3) 사용될 변수 및 정수가 주어지면, 합성기는 주어진 입 출력 예제를 모두 만족하는 완성된 프로그램을 출력한다. 기본 알고리즘은 정답 프로그램을 찾을 때까지, 가능한 모든 프로그램을 나열하는 것이다(enumerative search). 이 경우 탐색 공간이 매우 크므로 오랜 시간이 걸린다는 문제점이 있다. 시간을 효과적으로 단축하기 위한 우리의 방법은, 코드 최적화 기법을 이용해 문법은 다르지만 같은 의미의 프로그램들을 확인함으로써, 불필요한 중복탐색을 피하는 것이다. 20개의 입문자 교육용 프로그래밍 문제들을 대상으로 합성 알고리즘 성능을 평가한 결과, 우리의 방법이 기본 탐색 알고리즘의 성능을 약 10배 향상시킴을 확인하였다.

In this paper, we present a method for synthesizing imperative programs from input-output examples. Given (1) a set of input-output examples, (2) an incomplete program, and (3) variables and integer constants to be used, the synthesizer outputs a complete program that satisfies all of the given examples. The basic synthesis algorithm enumerates all possible candidate programs until the solution program is found (enumerative search). However, it is too slow for practical use due to the huge search space. To accelerate the search speed, our approach uses code optimization and avoids unnecessary search for the programs that are syntactically different but semantically equivalent. We have evaluated our synthesis algorithm on 20 introductory programming problems, and the results show that our method improves the speed of the basic algorithm by 10x on average.

키워드

과제정보

연구 과제 주관 기관 : 국방과학연구소

참고문헌

  1. G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer, "How to make ad hoc proof automation less ad hoc," ICFP, pp. 163-175, 2011.
  2. B. Blanchet, Formal Models and Techniques for Analyzing Security Protocols (chapter 9), pp. 86-111, IOS Press, Netherlands, 2011.
  3. T. Lau, P. Domingos, and D.-S. Weld, "Learning programs from traces using version space algebra," K-CAP, pp. 36-43, 2003.
  4. S. Srivastava, S. Gulwani, and J.-S. Foster, "From program verification to program synthesis," POPL, pp. 313-326, 2010.