Parf: Adaptive Parameter Refining for Abstract Interpretation

Zhongyi Wang, Linyu Yang, Mingshuai Chen, Yixuan Bu, Zhiyang Li, Qiuye Wang, Shengchao Qin, Xiao Yi, Jianwei Yin

Abstract

Static analysis through abstract interpretation is a cornerstone of software verification, providing sound guarantees against program errors. However, its practical utility is often hampered by a high rate of false alarms, which require tedious manual parameter tuning to mitigate. This paper presents Parf (Adaptive Parameter Refining), a fully automated framework that models tool parameters as random variables on mathematical lattices. By iteratively refining probability distributions through a Sample-Analyze-Refine loop, Parf discovers high-precision configurations that significantly reduce false alarms. Experimental results on the Frama-C OSCS benchmark show that Parf achieves superior precision in 91.9% of cases, often outperforming human experts in half the time.

1. Introduction

Static analysis tools based on abstract interpretation are designed to be sound—they aim to identify all potential bugs of a certain class, such as buffer overflows or null pointer dereferences. However, this soundness often comes at the cost of precision, leading to "false alarms" (false positives). To reduce these alarms, users must navigate a complex space of analysis parameters, including loop unrolling depths, abstract domain selections, and function call handling strategies.

Currently, tuning these parameters is a "black art" reserved for experts. The search space is frequently massive or infinite, and the relationship between parameter values and analysis performance is non-linear. If precision is set too low, the tool produces too much noise; if set too high, the analysis may fail to terminate within a reasonable time budget. Parf addresses this challenge by automating the search for optimal configurations.

2. The Parf Framework

Parf treats the static analyzer as a black box, requiring no knowledge of its internal implementation. It operates through a continuous loop of sampling, analysis, and refinement.

2.1 Latticed Parameter Spaces

The fundamental innovation of Parf is the formalization of parameter spaces as complete lattices. In abstract interpretation, lattices are used to represent program states; Parf applies this mathematical rigor to the configuration of the analyzer itself. This approach leverages the property of monotonicity: the assumption that moving "up" the lattice (increasing a parameter's complexity or precision) generally leads to higher precision and fewer false alarms.

2.2 Probabilistic Modeling and Sampling

Parf models the joint parameter space as a random vector. To balance exploration and exploitation, each parameter is represented by a combination of two variables:

  • Base Variable: Retains successful settings from previous iterations to ensure the tool does not lose ground on precision.
  • Delta Variable: Explores new areas of the parameter space to find even better configurations.

2.3 The Sample-Analyze-Refine Loop

The framework follows an iterative process:

  1. Sample: Generate parameter configurations based on current probability distributions.
  2. Analyze: Run the static analyzer in parallel using the sampled configurations.
  3. Refine: Update the distributions based on the results.

This refinement is both incremental and adaptive. Parf updates the "base" distribution to lock in improvements. Simultaneously, it calculates a scaling factor based on the success rate of the analyses. If many analyses time out, Parf "shrinks" its exploration scope to more conservative settings; if analyses finish quickly, it "extends" the scope to seek higher precision.

3. Experimental Evaluation

The authors evaluated Parf using two major benchmarks: the Frama-C OSCS (Open Source Case Study), comprising 37 real-world C projects (e.g., gzip, hiredis), and the SV-COMP 2022 "NoOverflows" category. While primarily tested with the Frama-C/Eva analyzer, the framework was also integrated with the Mopsa analyzer to test its generality.

4. Key Results

Parf demonstrated significant improvements over both default settings and manual expert tuning:

  • Precision: On the OSCS benchmark, Parf identified the configuration with the fewest false alarms in 34 out of 37 programs (91.9%).
  • Expert Comparison: Parf was the exclusive winner (the only strategy to find the best result) in 32.4% of cases. In contrast, a standard "Expert" strategy—manually increasing precision levels—won exclusively in only 2.7% of cases.
  • Efficiency: Parf is significantly faster than automated expert-mimicking strategies, finding high-precision settings in an average of 1315 seconds compared to 2340 seconds for the expert baseline.
  • Generality: When applied to Mopsa, Parf improved performance on 96.3% of tested repositories compared to default configurations.

5. Limitations and Future Work

Despite its success, Parf has areas for improvement. Currently, it treats parameters as independent variables, ignoring potential stochastic dependencies where one parameter's effectiveness depends on another. Furthermore, as a black-box approach, it does not utilize source code features to seed its initial search. Future work aims to incorporate syntactic analysis (e.g., loop counts or call graphs) and move toward "function-level refining," allowing for heterogeneous precision settings across different parts of a program.

6. Conclusion

Parf provides a mathematically grounded, automated solution to the long-standing problem of parameter tuning in static analysis. By combining lattice theory with adaptive probabilistic modeling, it enables users to achieve high-precision results without the need for exhaustive manual intervention or deep expert knowledge.

Summary updated

BibTeX
@inproceedings{wang2024parf,
  author = {Zhongyi Wang and Linyu Yang and Mingshuai Chen and Yixuan Bu and Zhiyang Li and Qiuye Wang and Shengchao Qin and Xiao Yi and Jianwei Yin},
  title = {{Parf: Adaptive Parameter Refining for Abstract Interpretation}},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695487},
}
Figure