Abstract: We propose an automated method for checking the validity of a formula of HFL(Z), a higher-order logic with fixpoint operators and integers. Combined with Kobayashi et al.'s reduction from higher-order program verification to HFL(Z) validity checking, our method yields a fully automated, uniform verification method for arbitrary temporal properties of higher-order functional programs expressible in the modal mu-calculus, including termination, non-termination, fair termination, fair non-termination, and also branching-time properties. We have implemented our method and obtained promising experimental results.
The Landscape of Higher-Order Verification
Verifying the correctness of software is notoriously difficult, especially for "higher-order" programs—those where functions can be passed as arguments or returned as results, common in languages like OCaml, Haskell, or Rust. Traditionally, different types of properties required specialized tools: one for safety (does the program ever crash?), another for termination (does it eventually stop?), and yet another for liveness (does something good eventually happen?).
Recent research demonstrated that all these problems can be translated into a single mathematical framework: Higher-order Fixpoint Logic with integers (HFL(Z)). As shown in Table 1, HFL(Z) occupies a unique position by supporting both higher-order constructs and the combination of least ($\mu$) and greatest ($\nu$) fixpoints.
While tools existed for specific subsets of HFL(Z), such as $\nu$HFL(Z) or first-order Constrained Horn Clauses (CHCs), an automated solver for the full logic—capable of handling the interplay between least fixpoints (used for liveness/termination) and greatest fixpoints (used for safety)—was previously missing. This paper introduces MuHFL, the first tool to fill this gap.
The MuHFL Verification Loop
The authors propose a "sound but incomplete" method to check HFL(Z) validity. Since the general problem is undecidable, the approach relies on an iterative approximation and refinement strategy.
As illustrated in Figure 1, the process follows these key technical pillars:
- Approximation via $\nu$HFL(Z): Least fixpoints ($\mu$) are difficult to verify because they require proving that a recursion eventually "bottoms out." MuHFL under-approximates these by replacing them with greatest fixpoints ($\nu$) equipped with an integer "step counter." If the formula is valid for a finite number of steps, it is valid for the least fixpoint.
- Iterative Refinement: The tool begins with a simple linear bound for the step counter. If the backend solver fails to prove validity, MuHFL automatically increases the coefficients to search for a more precise bound.
- Higher-Order Argument Augmentation: To bound the recursion of a function passed as a parameter, the tool "augments" the function with an extra integer argument that carries information about its own complexity or "rank."
- Type-Based Optimization: To prevent the solver from being overwhelmed, a tagged type system identifies exactly where these extra parameters are necessary and where they are redundant.
Key Results and Insights
The implementation was evaluated against specialized state-of-the-art tools across 87 instances involving termination, non-termination, and fair-termination for OCaml programs.
- Overall Performance: MuHFL solved 73 out of 87 instances, significantly outperforming the combination of all previous specialized tools, which solved only 53.
- Higher-Order Superiority: On specialized "higher-order" variations of these benchmarks (where integer values are converted into functional closures), MuHFL solved 18 instances compared to just 2 by previous tools.
- Uniformity: The results demonstrate that a robust HFL(Z) solver acts as a "universal backend," allowing a single tool to verify complex branching-time properties (like CTL) that previously required manual proof in assistants like Coq.
Limitations and Future Work
Despite its success, MuHFL relies on an existing $\nu$HFL(Z) backend (ReTHFL). If the backend struggles with complex logical structures, MuHFL may time out. Furthermore, the current refinement process only considers linear combinations of variables; programs with highly non-linear recursion, such as the Ackermann function, remain a challenge. Future work may involve more sophisticated heuristics or machine learning to optimize the refinement loop.
Summary updated