Bonsai: Synthesis-Based Reasoning for Type Systems

08/01/2017
by   Kartik Chandra, et al.
0

We describe algorithms for symbolic reasoning about executable models of type systems, supporting three queries intended for designers of type systems. First, we check for type soundness bugs and synthesize a counterexample program if such a bug is found. Second, we compare two versions of a type system, synthesizing a program accepted by one but rejected by the other. Third, we minimize the size of synthesized counterexample programs. These algorithms symbolically evaluate typecheckers and interpreters, producing formulas that characterize the set of programs that fail or succeed in the typechecker and the interpreter. However, symbolically evaluating interpreters poses efficiency challenges, which are caused by having to merge execution paths of the various possible input programs. Our main contribution is the Bonsai tree, a novel symbolic representation of programs and program states which addresses these challenges. Bonsai trees encode complex syntactic information in terms of logical constraints, enabling more efficient merging. We implement these algorithms in the Bonsai tool, an assistant for type system designers. We perform case studies on how Bonsai helps test and explore a variety of type systems. Bonsai efficiently synthesizes counterexamples for soundness bugs that have been inaccessible to automatic tools, and is the first automated tool to find a counterexample for the recently discovered Scala soundness bug SI-9633.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/14/2022

HyperPUT: Generating Synthetic Faulty Programs to Challenge Bug-Finding Tools

As research in automatically detecting bugs grows and produces new techn...
research
05/28/2019

Deep Learning for Bug-Localization in Student Programs

Providing feedback is an integral part of teaching. Most open online cou...
research
08/23/2022

Evaluating Synthetic Bugs

Fuzz testing has been used to find bugs in programs since the 1990s, but...
research
07/13/2023

Ill-Typed Programs Don't Evaluate

We introduce two-sided type systems, which are a particular kind of sequ...
research
06/03/2020

Detecting and Understanding Real-World Differential Performance Bugs in Machine Learning Libraries

Programming errors that degrade the performance of systems are widesprea...
research
04/20/2023

Finding Bug-Inducing Program Environments

Some bugs cannot be exposed by program inputs, but only by certain progr...
research
04/23/2020

BOLD: An Ontology-based Log Debugger for C Programs

The different activities related to debugging such as program instrument...

Please sign up or login with your details

Forgot password? Click here to reset