Bonsai: Synthesis-Based Reasoning for Type Systems

by   Kartik Chandra, et al.

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.



There are no comments yet.


page 1

page 2

page 3

page 4


Deep Learning for Bug-Localization in Student Programs

Providing feedback is an integral part of teaching. Most open online cou...

Benchmarking Symbolic Execution Using Constraint Problems – Initial Results

Symbolic execution is a powerful technique for bug finding and program t...

Effects of Hints on Debugging Scratch Programs: An Empirical Study with Primary School Teachers in Training

Bugs in learners' programs are often the result of fundamental misconcep...

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

Programming errors that degrade the performance of systems are widesprea...

Automated Customized Bug-Benchmark Generation

We introduce Bug-Injector, a system that automatically creates benchmark...

NetRep: Automatic Repair for Network Programs

Debugging imperative network programs is a challenging task for develope...

BOLD: An Ontology-based Log Debugger for C Programs

The different activities related to debugging such as program instrument...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.