Skip to main content
QUICK REVIEW

[Paper Review] Verifying Safety of Functional Programs with Rosette/Unbound

Dmitry Mordvinov, Grigory Fedyukovich|arXiv (Cornell University)|Apr 15, 2017
Formal Methods in VerificationComputer Science6 references7 citations
TL;DR

Rosette/Unbound is the first verifier for Racket that uses constrained Horn clause (CHC) solving to automatically synthesize inductive invariants for functional programs, enabling verification of higher-order, recursive, and multi-pass list-processing programs over unbounded data streams. It supports symbolic execution, symbolic merging of states, and a novel synchronization mechanism for multiple iterators over the same list, allowing verification of complex safety properties such as the minimal element of a sorted list being its head.

ABSTRACT

The goal of unbounded program verification is to discover an inductive invariant that safely over-approximates all possible program behaviors. Functional languages featuring higher order and recursive functions become more popular due to the domain-specific needs of big data analytics, web, and security. We present Rosette/Unbound, the first program verifier for Racket exploiting the automated constrained Horn solver on its backend. One of the key features of Rosette/Unbound is the ability to synchronize recursive computations over the same inputs allowing to verify programs that iterate over unbounded data streams multiple times. Rosette/Unbound is successfully evaluated on a set of non-trivial recursive and higher order functional programs.

Motivation & Objective

  • To enable automated verification of functional programs in Racket with unbounded data streams and complex recursive behaviors.
  • To address the challenge of verifying programs that iterate over lists multiple times, which existing tools struggle with due to lack of synchronization between iterators.
  • To integrate constrained Horn clause solving into a functional programming verification pipeline, enabling fully automated synthesis of inductive invariants.
  • To support higher-order functions, mutations, and global state within a symbolic execution framework that preserves precision and scalability.

Proposed method

  • Symbolic execution of Racket programs with state merging at control flow joins to preserve path information.
  • Encoding program behavior into a system of constrained Horn clauses (CHCs), where each function is represented by a fresh relation symbol.
  • Using a symbolic call graph to track function dependencies and generate CHC implications that capture control flow and data dependencies.
  • Introducing a synchronization mechanism that aligns multiple list iterators over the same symbolic list, ensuring they access elements at the same time via shared symbolic heads.
  • Translating verification conditions into CHC systems with preconditions and postconditions, and solving them using external solvers like Spacer3 or Z3.
  • Supporting global state and mutations by extending relation symbols with state parameters, enabling reasoning about mutable variables in functional programs.

Experimental results

Research questions

  • RQ1Can a functional program verifier effectively handle recursive and higher-order programs with unbounded data streams?
  • RQ2How can multiple passes over the same symbolic list be synchronized to ensure consistent reasoning across iterators?
  • RQ3Can constrained Horn clause solving be effectively integrated into a symbolic execution framework for functional languages to automate invariant synthesis?
  • RQ4What is the scalability and correctness of such a system on non-trivial functional programs with complex data manipulations?

Key findings

  • Rosette/Unbound successfully verified all 30 of its own benchmarks, including higher-order and multi-pass list-processing programs, with an average solving time of 0.115 seconds.
  • The tool outperformed MoCHi on safe programs, proving correctness for all 12 of its verified benchmarks, while MoCHi succeeded in only 1 out of 12 due to timeouts or internal errors.
  • For buggy programs, MoCHi found counterexamples in 9 out of 12 cases, but Rosette/Unbound’s ability to verify safety properties was not compromised by this.
  • The synchronization mechanism enabled verification of properties like the head of a sorted list being its minimal element, which requires consistent access across multiple iterators.
  • The system demonstrated compatibility with bounded reasoning while extending to unbounded symbolic lists, a capability missing in Rosette and other prior tools.
  • The integration of CHC solving via Spacer3 and Z3 enabled scalable and precise verification, with no false positives reported in the evaluation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.