
Gradual C0: Symbolic Execution for Gradual Verification
JENNA DIVINCENZO, Purdue University, USA
IAN MCCORMACK, Carnegie Mellon University, USA
HEMANT GOUNI, Carnegie Mellon University, USA
JACOB GORENBURG, Haverford College, USA
JAN-PAUL RAMOS-DÁVILA, Cornell University, USA
MONA ZHANG, Columbia University, USA
CONRAD ZIMMERMAN, Brown University, USA
JOSHUA SUNSHINE, Carnegie Mellon University, USA
ÉRIC TANTER, University of Chile, Chile
JONATHAN ALDRICH, Carnegie Mellon University, USA
Current static verication techniques such as separation logic support a wide range of programs. However,
such techniques only support complete and detailed specications, which places an undue burden on users.
To solve this problem, prior work proposed gradual verication, which handles complete, partial, or missing
specications by soundly combining static and dynamic checking. Gradual verication has also been extended
to programs that manipulate recursive, mutable data structures on the heap. Unfortunately, this extension
does not reward users with decreased dynamic checking as specications are rened. In fact, all properties
are checked dynamically regardless of any static guarantees. Additionally, no full-edged implementation of
gradual verication exists so far, which prevents studying its performance and applicability in practice.
We present Gradual C0, the rst practicable gradual verier for recursive heap data structures, which targets
C0, a safe subset of C designed for education. Static veriers supporting separation logic or implicit dynamic
frames use symbolic execution for reasoning; so Gradual C0, which extends one such verier, adopts symbolic
execution at its core instead of the weakest liberal precondition approach used in prior work. Our approach
addresses technical challenges related to symbolic execution with imprecise specications, heap ownership,
and branching in both program statements and specication formulas. We also deal with challenges related
to minimizing insertion of dynamic checks and extensibility to other programming languages beyond C0.
Finally, we provide the rst empirical performance evaluation of a gradual verier, and found that on average,
Gradual C0 decreases run-time overhead between 11-34% compared to the fully-dynamic approach used in
prior work. Further, the worst-case scenarios for performance are predictable and avoidable. This work paves
the way towards evaluating gradual verication at scale.
CCS Concepts: •Theory of computation
→
Logic and verication;Automated reasoning;Hoare logic;
Separation logic.
1 INTRODUCTION
Separation logic [Reynolds 2002] supports the modular static verication of heap-manipulating
programs. Its variant Implicit dynamic frames (IDF) [Smans et al
.
2009] and extension with recursive
∗
This material is based upon work supported by a Google PhD Fellowship award and the National Science Foundation under
Grant Nos. CCF-1901033, DGE1745016, and DGE2140739. É. Tanter is partially funded by the ANID FONDECYT Regular
Project 1190058 and the Millennium Science Initiative Program: code ICN17_002. Any opinions, ndings, and conclusions
or recommendations expressed in this material are those of the authors and do not necessarily reect the views of the
National Science Foundation, Google, ANID, or the Millennium Science Initiative.
Authors’ addresses: Jenna DiVincenzo, Purdue University, USA, jennad@purdue.edu; Ian McCormack, Carnegie Mellon
University, USA, icmccorm@cs.cmu.edu; Hemant Gouni, Carnegie Mellon University, USA, hsgouni@cs.cmu.edu; Jacob
Gorenburg, Haverford College, USA, jgorenburg@haverford.edu; Jan-Paul Ramos-Dávila, Cornell University, USA, jvr34@
cornell.edu; Mona Zhang, Columbia University, USA, mz2781@columbia.edu; Conrad Zimmerman, Brown University, USA,
conrad_zimmerman@brown.edu; Joshua Sunshine, Carnegie Mellon University, USA, sunshine@cs.cmu.edu; Éric Tanter,
University of Chile, Chile, etanter@dcc.uchile.cl; Jonathan Aldrich, Carnegie Mellon University, USA, jonathan.aldrich@cs.
cmu.edu.
arXiv:2210.02428v3 [cs.LO] 19 Jan 2024