Abstract
Pushdown systems (PDSs) are well-understood as abstract models of recursive sequential programs, and weighted pushdown systems (WPDSs) are a general framework for solving certain meet-over-all-path problems in program analysis. Conditional WPDSs (CWPDSs) further extend WPDSs to enhance expressiveness by guarding each transition with a regular language over the stack. While CWPDSs have wide applications, traditional offline algorithms that translate them to WPDSs can cause an exponential blow-up of the system. This paper presents an on-the-fly model checking algorithm for CWPDSs that synchronizes computing machineries on-demand while computing post-images of regular configurations. Preliminary experiments on an HTML5 parser specification show that the on-the-fly algorithm drastically outperforms the offline algorithm in both space and time efficiency.
The Problem: Exponential Blow-up in Offline Analysis
In modern program analysis, modeling features like stack-based access control or object-oriented heap abstractions requires the expressiveness of Conditional Weighted Pushdown Systems (CWPDSs). In a CWPDS, a transition rule is only applicable if the current stack content belongs to a specific regular language, acting as a guard.
The standard "offline" approach to model checking CWPDSs involves a pre-processing step where the underlying PDS is synchronized with the finite state automata (FSA) representing these regular conditions. This synchronization effectively creates a product automaton. As the number of conditions grows, the size of this product automaton increases exponentially.
This "exponential blow-up" often makes the resulting WPDS too large to process, even for systems with a modest number of conditions. In practical scenarios, the offline algorithm often hits a performance "cliff," failing due to memory exhaustion as soon as the number of conditions exceeds a very small threshold.
The Solution: On-The-Fly Synchronization
To overcome this bottleneck, the authors propose an on-the-fly algorithm. Instead of pre-calculating the entire synchronized state space, the algorithm interleaves the reachability analysis (saturation) with the condition checking.
The core idea is "lazy" synchronization: the algorithm only explores and synchronizes the parts of the condition automata that are actually reached during the search for reachable program states. This approach exploits the inherent sparsity of real-world program models, where only a small fraction of the theoretically possible states are ever visited.
The algorithm follows a four-step pipeline:
- Initial Automaton Construction: Representing the starting configurations.
- On-The-Fly Saturation: Computing post-images while checking regular conditions on-demand.
- Target Intersection: Building an automaton for target configurations.
- MOVP Computation: Calculating the Meet-Over-All-Path (MOVP) value to determine reachability and weights.
Experimental Validation
The algorithm was evaluated using a large-scale model of the HTML5 parser specification, which contains nearly 20,000 pushdown transitions. The researchers compared the on-the-fly approach against the traditional offline method by varying the number of regular conditions from 2 up to 118.
The results showed a dramatic performance gap. While the offline algorithm failed completely once the number of conditions exceeded five, the on-the-fly algorithm handled 118 conditions with ease, completing the analysis in under four minutes using roughly 7.4 GB of RAM. This demonstrates that the on-the-fly approach makes the analysis of complex, real-world specifications computationally feasible.
Conclusion
By moving from an offline translation to an on-the-fly synchronization strategy, this work provides a scalable solution for model checking CWPDSs. This advancement opens the door for more sophisticated analyses of recursive programs with complex stack-dependent constraints, particularly in the domains of security and object-oriented program verification.
Summary updated