Semantic code search via equational reasoning

By Varot Premtoon, James Koppel, Armando Solar-Lezama. 2020

52 citations recorded by the source corpus.

We present a new approach to semantic code search based on equational reasoning, and the Yogo tool implementing this approach. Our approach works by considering not only the dataflow graph of a function, but also the dataflow graphs of all equivalent functions reachable via a set of rewrite rules. In doing so, it can recognize an operation even if it uses alternate APIs, is in a different but mathematically-equivalent form, is split apart with temporary variables, or is interleaved with other code. Furthermore, it can recognize when code is an instance of some higher-level concept such as iterating through a file. Because of this, from a single query, Yogo can find equivalent code in multiple languages. Our evaluation further shows the utility of Yogo beyond code search: encoding a buggy pattern as a Yogo query, we found a bug in Oracle’s Graal compiler which had been missed by a hand-written static analyzer designed for that exact kind of bug. Yogo is built on the Cubix multi-language infrastructure, and currently supports Java and Python.

Subfields: Artificial Intelligence, Information Systems, Software, Code Generation & Program Synthesis, Program Analysis & Verification

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Josh Tenenbaum
  2. Tomas Lozano-Perez
  3. Leslie Pack Kaelbling
  4. Armando Solar-Lezama
  5. Maxwell Nye
  6. Ferran Alet
  7. James Koppel
  8. Javier Lopez-Contreras

In Information Systems

  1. Josh Tenenbaum
  2. Maxwell Nye
  3. Armando Solar-Lezama
  4. Zachary Tatlock
  5. Pavel Panchekha
  6. James Koppel
  7. Rishabh Singh
  8. Andrew Cropper

In Software

  1. Armando Solar-Lezama
  2. James Koppel
  3. Josh Tenenbaum
  4. Zachary Tatlock
  5. Maxwell Nye
  6. Rishabh Singh

In Code Generation & Program Synthesis

  1. Josh Tenenbaum
  2. Maxwell Nye
  3. Armando Solar-Lezama
  4. Oliver Flatt
  5. Yisu Remy Wang
  6. Zachary Tatlock
  7. Pavel Panchekha
  8. Chandrakana Nandi

In Program Analysis & Verification

  1. Armando Solar-Lezama
  2. Oliver Flatt
  3. Josh Tenenbaum
  4. Yisu Remy Wang
  5. Zachary Tatlock
  6. Pavel Panchekha
  7. Chandrakana Nandi
  8. Maxwell Nye

Citations in the corpus