Abstract
Binary Decision Diagrams (BDDs) are compact data structures used to efficiently store and process boolean functions. BDDs have many uses, from system design to model checking to efficiently storing context information for context-sensitive analysis. The use of BDDs in verification and program analysis has been facilitated by the recent emergence of many open source BDD libraries. The correctness of BDD-based system design and verification hinges upon the correctness of the BDD library implementations, and the correct use of these libraries. Surprisingly, for a technology so prevalent in system design and formal verification, there has been little research effort on formally verifying the correctness of BDD library implementations or their use. For BDD libraries that do perform some correctness checks, these are mostly confined to runtime assertion checking, which slows down BDD operations and might still be unable to reveal errors until deployment. To address these issues and take a step toward provably correct, yet efficient, BDD-handling code, we propose a formal system called Bddl to describe, reason about, and prove the correctness of BDD operations. Bddl extends lambda calculus with support for BDD operations (e.g., creation, manipulation), expressing BDD structural properties (e.g., canonicity, proper ordering), and BDD semantics (e.g., sets, relations). Bddl uses a type system based on refinement types to statically check BDD manipulation. We have proved our system correct using a small-step semantics and standard notions of progress and preservation. Bddl is the first attempt to provide a well-defined syntax and semantics to BDD operations; we show how it could prevent bugs and semantic errors in the implementation and use of three mature DD libraries.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Other kinds of decision diagrams operate on integers and reals to encode algebraic, arithmetic, and relational functions. Decision diagrams have been employed in areas as diverse as optimization [2], electronic design [24], VLSI CAD [5], Genetics (gene expression analysis [25], data-mining DNA subsequences) [15], NASA safety operations [20], and reliability [23].
- 2.
To eliminate ambiguity and prevent a potential incorrect use of functions that support both forms of encoding [1], some libraries do not leave this choice to the user.
References
Miner, A., et al.: MEDDLY: multi-terminal and Edge-valued Decision Diagram LibrarY. https://meddly.sourceforge.io/
Bergman, D., Cire, A.A., van Hoeve, W.J., Hooker, J.: Decision Diagrams for Optimization. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-42849-9
Bernasconi, A., Ciriani, V.: Index-resilient zero-suppressed bdds: definition and operations. ACM Trans. Des. Autom. Electron. Syst. 21(4), 1–27 (2016)
Bernasconi, A., Ciriani, V., Lago, L.: On the error resilience of ordered binary decision diagrams. Theor. Comput. Sci. 595, 11–33 (2015)
Bryant, R.: On the complexity of VLSI implementations and graph representations of Boolean functions with application to integer multiplication. IEEE Trans. Comput. 40(2), 205–213 (1991)
Drechsler, R.: Verifying integrity of decision diagrams. Integr. 32(1–2), 61–75 (2002)
Somenzi, F.: CUDD: CU Decision Diagram Package. https://github.com/ivmai/cudd
Freeman, T., Pfenning, F.: Refinement types for ML, pp. 268–277. PLDI 1991, Association for Computing Machinery, New York, NY, USA (1991)
Ciardo, G., Miner, A.S.: SMART: Stochastic model-checking analyzer for reliability and timing. https://asminer.github.io/smart/
Giorgino, M., Strecker, M.: Correctness of pointer manipulating algorithms illustrated by a verified BDD construction. In: Giannakopoulou, D., Méry, D. (eds.) FM 2012. LNCS, vol. 7436, pp. 202–216. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32759-9_18
Groen, F., Smidts, C., Mosleh, A., Swaminathan, S.: Qras - the quantitative risk assessment system. In: Annual Reliability and Maintainability Symposium. 2002 Proceedings (Cat. No.02CH37318), pp. 349–355 (2002)
Whaley, J.: JavaBDD. http://javabdd.sourceforge.net/
Kawaguchi, M., Rondon, P., Jhala, R.: Type-based data structure verification, pp. 304–315. PLDI 2009 (2009)
Lembachar, Y., Rusich, R., Neamtiu, I., Ciardo, G.: BDDL: a type system for binary decision diagrams. Technical Report, Department of Computer Science, NJIT, May 2022. https://web.njit.edu/~ineamtiu/pubs/bddl-tr.pdf
Loekito, E., Bailey, J., Pei, J.: A binary decision diagram based approach for mining frequent subsequences. Knowl. Inf. Syst. 24(2), 235–268 (2010)
Ortner, V., Schirmer, N.: Verification of BDD normalization. In: Hurd, J., Melham, T. (eds.) Theorem Proving in Higher Order Logics, pp. 261–277 (2005)
Ortner, V., Schirmer, N.: Bdd normalisation. Archive of Formal Proofs, Febuary 2008. https://isa-afp.org/entries/BDD.html, Formal proof development
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Rondon, P.M., Kawaguchi, M., Jhala, R.: Liquid types, pp. 159–169. PLDI 2008, June 2008
Siminiceanu, R.I., Ciardo, G.: Formal verification of the Nasa runway safety monitor. Int. J. Softw. Tools Technol. Transf. 9(1), 63–76 (2007)
Stanković, S., Astola, J.: Xml framework for various types of decision diagrams for discrete functions. IEICE Trans. 90-D, 1731–1740 (2007)
Whaley, J., Lam, M.S.: Cloning-based context-sensitive pointer alias analysis using binary decision diagrams, PLDI 2004, pp. 131–144 (2004)
Xing, L., Amari, S.V.: Binary Decision Diagrams and Extensions for System Reliability Analysis. Wiley, Hoboken (2015)
Yanushkevich, S.N., Miller, D.M., Shmerko, V.P., Stankovic, R.S.: Decision Diagram Techniques for Micro- and Nanoelectronic Design Handbook (2006)
Yoon, S., De Micheli, G.: An application of zero-suppressed binary decision diagrams to clustering analysis of DNA microarray data, EMBC 2004, pp. 2925–2928 (2004)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Lembachar, Y., Rusich, R., Neamtiu, I., Ciardo, G. (2022). Bddl: A Type System for Binary Decision Diagrams. In: Kovács, L., Meinke, K. (eds) Tests and Proofs. TAP 2022. Lecture Notes in Computer Science, vol 13361. Springer, Cham. https://doi.org/10.1007/978-3-031-09827-7_3
Download citation
DOI: https://doi.org/10.1007/978-3-031-09827-7_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-09826-0
Online ISBN: 978-3-031-09827-7
eBook Packages: Computer ScienceComputer Science (R0)