Karp: a language for NP reductions

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

In CS theory courses, NP reductions are a notorious source of pain for students and instructors alike. Invariably, students use pen and paper to write down reductions that "work"in many but not all cases. When instructors observe that a student's reduction deviates from the expected one, they have to manually compute a counterexample that exposes the mistake. In other words, NP reductions are subtle yet, most of the time, unimplemented programs. And for a good reason: there exists no language tailored to NP reductions. We introduce Karp, a language for programming and testing NP reductions. Karp combines an array of programming languages techniques: language-oriented programming and macros, solver-aided languages, property testing, higher-order contracts and gradual typing. To validate the correctness of Karp, we prove that its core is well-defined. To validate its pragmatics, we demonstrate that it is expressive and performant enough to handle a diverse set of reduction exercises from a popular algorithms textbook. Finally, we report the results from a preliminary user study with Karp.

Original languageEnglish (US)
Title of host publicationPLDI 2022 - Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation
EditorsRanjit Jhala, Isil Dillig
PublisherAssociation for Computing Machinery
Pages762-776
Number of pages15
ISBN (Electronic)9781450392655
DOIs
StatePublished - Jun 9 2022
Event43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2022 - Virtual, Online, United States
Duration: Jun 13 2022Jun 17 2022

Publication series

NameProceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)

Conference

Conference43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2022
Country/TerritoryUnited States
CityVirtual, Online
Period6/13/226/17/22

Keywords

  • domain-specific language
  • reduction
  • solver-aided program- ming
  • teaching and learning theoretical computer science

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Karp: a language for NP reductions'. Together they form a unique fingerprint.

Cite this