Abstract
Satisfiability Modulo Theories techniques can check if a formula is satisfiable. In many cases, not only the qualitative judgment (satisfiable or not) but also the quantitative judgment (the dimension and size of the solution space) are of practical interest. For instance, the volume of path condition formula reflects the probability of the corresponding program path being taken. However, existing algorithms are not practical because they only work for small instances. Given a formula with Boolean structures, its volume is typically obtained by first decomposing it to a series of conjunctions (of linear constraints) with disjoint solution spaces and then accumulating the volume of each one. For the former step, we propose a BDD-based search algorithm which sharply reduces the number of conjunctions. For the latter one, we propose a Monte-Carlo integration with a ray-based sampling strategy, which approximates the volume efficiently and accurately. Furthermore, degenerate solution spaces, which are not considered by other algorithms, could be handled properly by ours. Experimental results show that our method can handle formulas with up to 20 variables, which will cover many practical cases in software engineering
Similar content being viewed by others
Notes
Since linear constraints are by default conjuncted, we use “linear constraints” short for “a conjunction of linear constraints” if no ambiguity is caused.
This is done by checking whether the maximal and minimal value of s are both 0. The technique is similar to that used for implicit equation detection, which will be introduced later in Section 4.3.
The reason is that their algorithm contains constants such as 801, 1600 in nested loops. It takes hundreds of seconds to solve a 3-dimensional case.
References
Akers, S.B.: Binary decision diagrams. IEEE Trans. Comput. 100(6), 509–516 (1978)
Athreya, K.: Unit ball in high dimensions. Resonance 13(4), 334–342 (2008)
Avis, D.: Computational experience with the reverse search vertex enumeration algorithm. Optim. Methods Softw. 10(2), 107–124 (1998)
Avis, D.: A revised implementation of the reverse search vertex enumeration algorithm. In: Polytopescombinatorics and Computation, pp. 177–198. Springer (2000)
Ball, T., Larus, J.R.: Branch prediction for free. In: Proceedings of PLDI’93, pp. 300–313. ACM, New York (1993)
Barrett, C., Sebastiani, R., Seshia, S.A., Tinelli, C.: Satisfiability modulo theories. Handb. Satisfiability 185, 825–885 (2009)
Barrett, C., Tinelli, C.: CVC3. In: Computer Aided Verification, pp. 298–302. Springer (2007)
Büeler, B., Enge, A., Fukuda, K.: Exact volume computation for polytopes: a practical study. In: Polytopes-Combinatorics and Computation, pp. 131–154. Springer (2000)
Buse, R. P., Weimer, W.: The road not taken: estimating path execution frequency statically. In: Proceedings of ICSE’09, pp. 144–154. IEEE Computer Society (2009)
Dantzig, G. B.: Linear Programming and Extensions. Princeton university press (1998)
De Moura, L., Bjørner, N.: Z3: An efficient SMT solver. In: Tools and Algorithms for the Construction and Analysis of Systems, pp. 337–340. Springer (2008)
Dutertre, B., De Moura, L.: A fast linear-arithmetic solver for DPLL(T). In: Proceedings of CAV’06, pp. 81–94. Springer (2006)
Dutertre, B., De Moura, L.: The yices SMT solver. Tool paper at http://yices.csl.sri.com/tool-paper.pdf, 2, 2, (2006)
Dyer, M., Frieze, A., Kannan, R.: A random polynomial-time algorithm for approximating the volume of convex bodies. JACM 38(1), 1–17 (1991)
Dyer, M.E., Frieze, A.M.: On the complexity of computing the volume of a polyhedron. SIAM J. Comput. 17(5), 967–974 (1988)
Grötschel, M., Lovász, L., Schrijver, A.: Geometric Algorithms and Combinatorial Optimization. Springer (1988). http://eudml.org/doc/204187
Huang, J., Darwiche, A.: Using DPLL for efficient OBDD construction. In: Theory and Applications of Satisfiability Testing, pp. 157–172. Springer (2005)
Kannan, R., Lovász, L., Simonovits, M.: Random walks and an O ∗(n 5) volume algorithm for convex bodies. Random Struct. Algoritm. 11(1), 1–50 (1997)
King, J.C.: Symbolic execution and program testing. Commun. ACM 19(7), 385–394 (1976)
Liu, S., Zhang, J.: Program analysis: from qualitative analysis to quantitative analysis (nier track). In: Proceedings of ICSE’11, pp. 956–959. IEEE (2011)
Liu, S., Zhang, J., Zhu, B.: Volume computation using a direct monte carlo method. In: Computing and Combinatorics, pp. 198–209. Springer (2007)
Lovász, L., Simonovits, M.: Random walks in a convex body and an improved volume algorithm. Random Struct. Algoritm. 4(4), 359–412 (1993)
Lovász, L., Vempala, S.: Simulated annealing in convex bodies and an O ∗(n 4) volume algorithm. J. Comput. Syst. Sci. 72(2), 392–417 (2006)
Ma, F., Liu, S., Zhang, J.: Volume computation for boolean combination of linear arithmetic constraints. In: Proceedings of CADE’09, pp. 453–468. Springer (2009)
Marsaglia, G.: Choosing a point from the surface of a sphere. Ann. Math. Stat. 43(2), 645–646 (1972)
Necula, G. C.: Proof-Carrying Code. Design and Implementation. Springer (2002)
Nelson, C. G.: Techniques for program verification. XEROX Research Center (1981)
Nieuwenhuis, R., Oliveras, A., Tinelli, C.: Solving SAT and SAT modulo theories: From an abstract Davis–Putnam–Logemann–Loveland procedure to DPLL(T). JACM 53(6), 937–977 (2006)
Păsăreanu, C.S., Visser, W.: A survey of new trends in symbolic execution for software testing and analysis. Softw. Tools Technol. Transfer 11(4), 339–353 (2009)
Poulding, S., Clark, J.A.: Efficient software verification: Statistical testing using automated search. IEEE Trans. Softw. Eng. 36(6), 763–777 (2010)
Smale, S.: On the average number of steps of the simplex method of linear programming. Math. Program. 27(3), 241–262 (1983)
Wei, W., Selman, B.: A new approach to model counting. In: Theory and Applications of Satisfiability Testing, pp. 324–339. Springer (2005)
Acknowledgments
I would like to thank Feifei Ma, a coauthor of the related work [24], for the insightful suggestions. I benefited from discussing with her when carrying out this work.
Author information
Authors and Affiliations
Corresponding author
Additional information
This work was supported by the Chinese National 973 Plan under grant No. 2010CB328003, the NSF of China under grants No. 11326070, 61272001, 60903030, 91218302, the Chinese National Key Technology R&D Program under grant No. SQ2012BAJY4052, the Tsinghua University Initiative Scientific Research Program, and the Importation and Development of High-Caliber Talents Project of Beijing Municipal Institutions under grant No. YETP0167
Rights and permissions
About this article
Cite this article
Zhou, M., He, F., Song, X. et al. Estimating the Volume of Solution Space for Satisfiability Modulo Linear Real Arithmetic. Theory Comput Syst 56, 347–371 (2015). https://doi.org/10.1007/s00224-014-9553-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-014-9553-9