Abstract
This work presents a novel approach for synthesizing numerical program sketches using lifted (family-based) static program analysis. In particular, our approach leverages a lifted static analysis based on abstract interpretation, which is used for analyzing program families with numerical features. It takes as input the common code base, which encodes all variants of a program family, and produces precise results for all variants in a single analysis run. The elements of the underlying lifted analysis domain are decision trees, in which decision nodes are labeled with linear constraints defined over numerical features and leaf nodes belong to a given single-program analysis domain.
We encode a program sketch as a program family such that holes correspond to numerical features and all possible sketch realizations correspond to variants in the program family. Then, we preform a lifted analysis of the family, so that only those variants that satisfy all assertions under all possible inputs represent correct realizations of holes in the sketch.
We have implemented an experimental program synthesizer for resolving C sketches. It is based on a lifted static analyzer for \(\texttt {\#if}\)-based C program families, which uses the numerical domains from the APRON library. An evaluation yields promising results. Moreover, our approach provides speedups in some cases against the popular sketching tool Sketch and can solve some numerical benchmarks that Sketch cannot handle.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
Since any \(k \in \mathbb {K}\) is a valuation function, we have that either \(k \models \theta \) holds or \(k \not \models \theta \) (which is equivalent to \(k \models \lnot \theta \)) holds, for any \(\theta \in \textit{FeatExp}(\mathbb {F})\).
References
Alur, R., et al.: Syntax-guided synthesis. In: Formal Methods in Computer-Aided Design, FMCAD 2013, pp. 1–8. IEEE (2013)
Apel, S., Batory, D.S., Kästner, C., Saake, G.: Feature-Oriented Software Product Lines - Concepts and Implementation. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37521-7
Apel, S., von Rhein, A., Wendler, P., Größlinger, A., Beyer, D.: Strategies for product-line verification: case studies and experiments. In: 35th International Conference on Software Engineering, ICSE 2013, pp. 482–491 (2013)
Bradley, A.R., Manna, Z., Sipma, H.B.: The Polyranking principle. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1349–1361. Springer, Heidelberg (2005). https://doi.org/10.1007/11523468_109
Češka, M., Dehnert, C., Jansen, N., Junges, S., Katoen, J.-P.: Model repair revamped. In: Bartocci, E., Cleaveland, R., Grosu, R., Sokolsky, O. (eds.) From Reactive Systems to Cyber-Physical Systems. LNCS, vol. 11500, pp. 107–125. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-31514-6_7
Chen, J., Cousot, P.: A binary decision tree abstract domain Functor. In: Blazy, S., Jensen, T. (eds.) SAS 2015. LNCS, vol. 9291, pp. 36–53. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-48288-9_3
Clements, P., Northrop, L.: Software Product Lines: Practices and Patterns. Addison-Wesley, Boston (2001)
Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Conference Record of the Fourth ACM Symposium on POPL, pp. 238–252. ACM (1977)
Cousot, P., Cousot, R., Mauborgne, L.: A scalable segmented decision tree abstract domain. In: Manna, Z., Peled, D.A. (eds.) Time for Verification. LNCS, vol. 6200, pp. 72–95. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13754-9_5
Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Conference Record of the Fifth Annual ACM Symposium on POPL 1978, pp. 84–96. ACM Press (1978)
Dimovski, A.S.: Lifted static analysis using a binary decision diagram abstract domain. In: Proceedings of the 18th ACM SIGPLAN International Conference on GPCE 2019, pp. 102–114. ACM (2019)
Dimovski, A.S.: On calculating assertion probabilities for program families. Prilozi Contributions Sec. Nat. Math. Biotech. Sci, MASA 41(1), 13–23 (2020)
Dimovski, A.S., Apel, S., Legay, A.: A decision tree lifted domain for analyzing program families with numerical features. In: FASE 2021. LNCS, vol. 12649, pp. 67–86. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-71500-7_4
Dimovski, A.S., Brabrand, C., Wasowski, A.: Variability abstractions: trading precision for speed in family-based analyses. In: 29th European Conference on Object-Oriented Programming, ECOOP 2015. LIPIcs, vol. 37, pp 247–270. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2015)
Dimovski, A.S., Brabrand, C., Wąsowski, A.: Finding suitable variability abstractions for family-based analysis. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 217–234. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_14
Dimovski, A.S., Brabrand, C., Wasowski, A.: Finding suitable variability abstractions for lifted analysis. Formal Aspect Comput. 31(2), 231–259 (2019). https://doi.org/10.1007/s00165-019-00479-y
Hunsen, C., et al.: Preprocessor-based variability in open-source and industrial software systems: an empirical study. Empirical Softw. Eng. 21(2), 449–482 (2015). https://doi.org/10.1007/s10664-015-9360-1
Iosif-Lazar, A.F., Melo, J., Dimovski, A.S., Brabrand, C., Wasowski, A.: Effective analysis of C programs by rewriting variability. Art Sci. Eng. Program. 1(1), 1 (2017)
Jeannet, B., Miné, A.: Apron: a library of numerical abstract domains for static analysis. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 661–667. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02658-4_52
Midtgaard, J., Dimovski, A.S., Brabrand, C., Wasowski, A.: Systematic derivation of correct variability-aware program analyses. Sci. Comput. Program. 105, 145–170 (2015)
Parnas, D.L.: On the design and development of program families. IEEE Trans. Softw. Eng. 2(1), 1–9 (1976)
Singh, G., Püschel, M., Vechev, M.T.: Making numerical program analysis fast. In: Proceedings of the 36th ACM SIGPLAN Conference on PLDI 2015, pp. 303–313. ACM (2015)
Solar-Lezama, A.: Program sketching. STTT 15(5–6), 475–495 (2013)
Solar-Lezama, A., Rabbah, R.M., Bodík, R., Ebcioglu, K.: Programming by sketching for bit-streaming programs. In: Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation, pp. 281–294. ACM (2005)
Urban, C.: FuncTion: an abstract domain Functor for termination. In: Baier, C., Tinelli, C. (eds.) TACAS 2015. LNCS, vol. 9035, pp. 464–466. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46681-0_46
Caterina Urban: Static analysis by abstract interpretation of functional temporal properties of programs. Ph.D. thesis, École Normale Supérieure, Paris, France (2015)
Urban, C., Miné, A.: A decision tree abstract domain for proving conditional termination. In: Müller-Olm, M., Seidl, H. (eds.) SAS 2014. LNCS, vol. 8723, pp. 302–318. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10936-7_19
von Rhein, A., Liebig, J., Janker, A., Kästner, C., Apel, S.: Variability-aware static analysis at scale: an empirical study. ACM Trans. Softw. Eng. Methodol. 27(4), 181–1833 (2018)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Dimovski, A.S., Apel, S., Legay, A. (2021). Program Sketching Using Lifted Analysis for Numerical Program Families. In: Dutle, A., Moscato, M.M., Titolo, L., Muñoz, C.A., Perez, I. (eds) NASA Formal Methods. NFM 2021. Lecture Notes in Computer Science(), vol 12673. Springer, Cham. https://doi.org/10.1007/978-3-030-76384-8_7
Download citation
DOI: https://doi.org/10.1007/978-3-030-76384-8_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-76383-1
Online ISBN: 978-3-030-76384-8
eBook Packages: Computer ScienceComputer Science (R0)