Constraint Satisfaction over Bit-Vectors

  • Laurent D. Michel
  • Pascal Van Hentenryck
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7514)


Reasoning over bit-vectors arises in a variety of applications in verification and cryptography. This paper presents a bit-vector domain for constraint programming and its associated filtering algorithms. The domain supports all the traditional bit operations and correctly models modulo-arithmetic and overflows. The domain implementation uses bit operations of the underlying architecture, avoiding the drawback of a bit-blasting approach that associates a variable with each bit. The filtering algorithms implement either domain consistency on the bit-vector domain or bit consistency, a new consistency notion introduced in this paper. Filtering algorithms for logical and structural constraints typically run in constant time, while arithmetic constraints such as addition run in time linear in the size of the bit-vectors. The paper also discusses how to channel bit-vector variables with an integer variable.


Inference Rule Constraint Programming Structural Constraint Arithmetic Constraint Bitwise Operation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Achterberg, T., Berthold, T., Koch, T., Wolter, K.: Constraint Integer Programming: A New Approach to Integrate CP and MIP. In: Trick, M.A. (ed.) CPAIOR 2008. LNCS, vol. 5015, pp. 6–20. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  2. 2.
    Baray, F., Codognet, P., Díaz, D., Michel, H.: Code-Based Test Generation for Validation of Functional Processor Descriptions. In: Garavel, H., Hatcliff, J. (eds.) TACAS 2003. LNCS, vol. 2619, pp. 569–584. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  3. 3.
    Bardin, S., Herrmann, P.: Structural testing of executables. In: ICST 2008, pp. 22–31. IEEE Computer Society, Washington, DC (2008)Google Scholar
  4. 4.
    Bardin, S., Herrmann, P., Perroud, F.: An Alternative to SAT-Based Approaches for Bit-Vectors. In: Esparza, J., Majumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015, pp. 84–98. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  5. 5.
    Biere, A., Cimatti, A., Clarke, E., Zhu, Y.: Symbolic Model Checking without BDDs. In: Cleaveland, W.R. (ed.) TACAS 1999. LNCS, vol. 1579, pp. 193–207. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  6. 6.
    Bordeaux, L., Hamadi, Y., Quimper, C.-G.: The bit-vector constraint. Technical Report 86, Microsoft Research (2006)Google Scholar
  7. 7.
    Brinkmann, R., Drechsler, R.: RTL-datapath verification using integer linear programming. In: ASP-DAC 2002, pp. 741–746. IEEE Computer Society, Washington, DC (2002)Google Scholar
  8. 8.
    Brummayer, R., Biere, A.: Boolector: An Efficient SMT Solver for Bit-Vectors and Arrays. In: Kowalewski, S., Philippou, A. (eds.) TACAS 2009. LNCS, vol. 5505, pp. 174–177. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  9. 9.
    Brummayer, R., Biere, A., Lonsing, F.: Btor: bit-precise modelling of word-level problems for model checking. In: SMT 2008/BPR 2008, pp. 33–38. ACM, New York (2008)Google Scholar
  10. 10.
    Bruttomesso, R., Cimatti, A., Franzén, A., Griggio, A., Sebastiani, R.: The mathSAT 4 SMT solver. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 299–303. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  11. 11.
    Bryant, R.E., Kroening, D., Ouaknine, J., Seshia, S.A., Strichman, O., Brady, B.: Deciding Bit-Vector Arithmetic with Abstraction. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 358–372. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  12. 12.
    Clarke, E., Kroning, D., Lerda, F.: A Tool for Checking ANSI-C Programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  13. 13.
    Dincbas, M., Van Hentenryck, P., Simonis, H., Aggoun, A., Graf, T., Berthier, F.: The Constraint Logic Programming Language CHIP. In: International Conference on 5th Generation Computer Systems, Tokyo, Japan (December 1988)Google Scholar
  14. 14.
    Ganesh, V., Dill, D.L.: A Decision Procedure for Bit-Vectors and Arrays. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 519–531. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  15. 15.
    Gotlieb, A., Leconte, M., Marre, B.: Constraint solving on modular integers. In: ModRef Worksop, associated to CP 2010, Saint-Andrews, Royaume-Uni (September 2010)Google Scholar
  16. 16.
    Jha, S., Limaye, R., Seshia, S.A.: Beaver: Engineering an Efficient SMT Solver for Bit-Vector Arithmetic. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 668–674. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  17. 17.
    Lecoutre, C., Vion, J.: Enforcing arc consistency using bitwise operations. Constraint Programming Letters (2008)Google Scholar
  18. 18.
    Michel, L., Van Hentenryck, P., Johnson, G.: Cryptanalysis of SHA-1 With Constraint Programming Over Bit-Vectors. In: CP 2012 (submitted, 2012)Google Scholar
  19. 19.
    Ullmann, J.R.: Bit-vector algorithms for binary constraint satisfaction and subgraph isomorphism. J. Exp. Algorithmics 15, 1.6:1.1–1.6:1.64 (2011)Google Scholar
  20. 20.
    Vemuri, R., Kalyanaraman, R.: Generation of design verification tests from behavioral VHDL programs using path enumeration and constraint programming. IEEE Trans. Very Large Scale Integr. Syst. 3(2), 201–214 (1995)CrossRefGoogle Scholar
  21. 21.
    Wille, R., Fey, G., Grobe, D., Eggersgluss, S., Drechsler, R.: Sword: A sat like prover using word level information. In: VLSI - SoC 2007, pp. 88–93 (October 2007)Google Scholar
  22. 22.
    Zeng, Z., Ciesielski, M.J., Rouzeyre, B.: Functional test generation using constraint logic programming. In: VLSI-SOC 2001, pp. 375–387. Kluwer, B.V., Deventer (2002)Google Scholar
  23. 23.
    Zeng, Z., Kalla, P., Ciesielski, M.: Lpsat: a unified approach to RTL satisfiability. In: DATE 2001, pp. 398–402. IEEE Press, Piscataway (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Laurent D. Michel
    • 1
  • Pascal Van Hentenryck
    • 2
  1. 1.University of ConnecticutStorrsUSA
  2. 2.Optimization Research GroupNICTA and The University of MelbourneAustralia

Personalised recommendations