A Formal Foundation for Symbolic Evaluation with Merging
Reusable symbolic evaluators are a key building block of solver-aided verification and synthesis tools. A reusable evaluator reduces the semantics of all paths in a program to logical constraints, and a client tool uses these constraints to formulate a satisfiability query that is discharged with SAT or SMT solvers. The correctness of the evaluator is critical to the soundness of the tool and the domain properties it aims to guarantee. Yet so far, the trust in these evaluators has been based on an ad-hoc foundation of testing and manual reasoning.
This paper presents the first formal framework for reasoning about the behavior of reusable symbolic evaluators. We develop a new symbolic semantics for these evaluators that incorporates state merging. Symbolic evaluators use state merging to avoid path explosion and generate compact encodings. To accommodate a wide range of implementations, our semantics is parameterized by a symbolic factory, which abstracts away the details of merging and creation of symbolic values. The semantics targets a rich language that extends Core Scheme with assumptions and assertions, and thus supports branching, loops, and (first-class) procedures. The semantics is designed to support reusability, by guaranteeing two key properties: legality of the generated symbolic states, and the reducibility of symbolic evaluation to concrete evaluation. Legality makes it simpler for client tools to formulate queries, and reducibility enables testing of client tools on concrete inputs. We use the Lean theorem prover to mechanize our symbolic semantics, prove that it is sound and complete with respect to the concrete semantics, and prove that it guarantees legality and reducibility.
To demonstrate the generality of our semantics, we develop Leanette, a reference evaluator written in Lean, and Rosette*, an optimized evaluator written in Racket. We prove Leanette correct with respect to the semantics, and validate Rosette* against Leanette via solver-aided differential testing. To demonstrate the practicality of our approach, we port 16 published verification and synthesis tools from Rosette to Rosette*. Rosette is an existing reusable evaluator that implements the classic merging semantics, adopted from bounded model checking. Rosette* replaces the semantic core of Rosette but keeps its optimized symbolic factory. Our results show that Rosette* matches the performance of Rosette across a wide range of benchmarks, while providing a cleaner interface that simplifies the implementation of client tools.
Thu 20 JanDisplayed time zone: Eastern Time (US & Canada) change
13:30 - 14:45
Dynamic AnalysisPOPL at Salon III
Chair(s): Armando Solar-Lezama Massachusetts Institute of Technology
|A Formal Foundation for Symbolic Evaluation with MergingRemote|
Sorawee Porncharoenwase University of Washington, Luke Nelson University of Washington, Xi Wang University of Washington, Emina Torlak University of WashingtonDOI Media Attached
|Logarithm and Program TestingInPerson|
Kuen-Bang Hou (Favonia) University of Minnesota, Zhuyang Wang University of MinnesotaDOI Media Attached
|Profile Inference RevisitedRemote|
Wenlei He Facebook, Julián Mestre Facebook; University of Sydney, Sergey Pupyrev , Lei Wang Facebook, Hongtao Yu FacebookDOI Media Attached