Kodkod: A Relational Model Finder

  • Emina Torlak
  • Daniel Jackson
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4424)


The key design challenges in the construction of a SAT-based relational model finder are described, and novel techniques are proposed to address them. An efficient model finder must have a mechanism for specifying partial solutions, an effective symmetry detection and breaking scheme, and an economical translation from relational to boolean logic. These desiderata are addressed with three new techniques: a symmetry detection algorithm that works in the presence of partial solutions, a sparse-matrix representation of relations, and a compact representation of boolean formulas inspired by boolean expression diagrams and reduced boolean circuits. The presented techniques have been implemented and evaluated, with promising results.


Boolean Logic Transitive Closure Conjunctive Normal Form Boolean Formula Alloy Analyzer 
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.


  1. 1.
    Jackson, D., Shlyakhter, I., Sridharan, M.: A micromodularity mechanism. In: ESEC/SIGSOFT FSE, pp. 62–73 (2001)Google Scholar
  2. 2.
    Jackson, D., Vaziri, M.: Checking Properties of Heap-Manipulating Procedures with a Constraint Solver. In: Garavel, H., Hatcliff, J. (eds.) ETAPS 2003 and TACAS 2003. LNCS, vol. 2619, pp. 505–520. Springer, Heidelberg (2003)Google Scholar
  3. 3.
    Taghdiri, M.: Inferring specifications to detect errors in code. In: ASE, pp. 144–153 (2004)Google Scholar
  4. 4.
    Khurshid, S., Marinov, D.: TestEra: Specification-based testing of java programs using sat. ASE 11(4), 403–434 (2004)Google Scholar
  5. 5.
    Dennis, G., Chang, F., Jackson, D.: Modular verification of code. In: ISSTA, Portland, Maine (2006)Google Scholar
  6. 6.
    Yeung, V.: Declarative configuration applied to course scheduling. Master’s thesis, Massachusetts Institute of Technology, Cambridge, MA (2006)Google Scholar
  7. 7.
    Claessen, K., Sörensson, N.: New techniques that improve MACE-style finite model finding. In: CADE-19 Workshop on Model Computation, Miami, FL (2003)Google Scholar
  8. 8.
    McCune, W.: A Davis-Putnam program and its application to finite first-order model search: quasigroup existence problem. Technical report, ANL (1994)Google Scholar
  9. 9.
    Sutcliffe, G., Suttner, C.: The TPTP Problem Library: CNF Release v1.2.1. Journal of Automated Reasoning 21(2), 177–203 (1998)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Edwards, J., et al.: Faster constraint solving with subtypes. In: ISSTA ’04, pp. 232–242. ACM Press, New York (2004)CrossRefGoogle Scholar
  11. 11.
    Andersen, H.R., Hulgaard, H.: Boolean expression diagrams. In: LICS, Warsaw, Poland (1997)Google Scholar
  12. 12.
    Abdulla, P.A., Bjesse, P., Eén, N.: Symbolic reachability analysis based on sat-solvers. In: Schwartzbach, M.I., Graf, S. (eds.) ETAPS 2000 and TACAS 2000. LNCS, vol. 1785, pp. 411–425. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  13. 13.
    Torlak, E., Dennis, G.: Kodkod for Alloy users. In: First ACM Alloy Workshop, Portland, Oregon (2006)Google Scholar
  14. 14.
    Fujita, M., Slaney, J., Bennett, F.: Automating generation of some results in finite algebra. In: 13th IJCAI, Chambéry, France (1993)Google Scholar
  15. 15.
    Jackson, D.: Automating first order relational logic. In: FSE, San Diego, CA (2000)Google Scholar
  16. 16.
    Jackson, D., Jha, S., Damon, C.A.: Isomorph-free model enumeration: a new method for checking relational specifications. ACM TPLS 20(2), 302–343 (1998)CrossRefGoogle Scholar
  17. 17.
    Slaney, J.K.: Finder: Finite domain enumerator - system description. In: Bundy, A. (ed.) CADE 1994. LNCS, vol. 814, pp. 798–801. Springer, Heidelberg (1994)Google Scholar
  18. 18.
    Zhang, J.: The generation and application of finite models. PhD thesis, Institute of Software, Academia Sinica, Beijing (1994)Google Scholar
  19. 19.
    Zhang, J., Zhang, H.: SEM: a system for enumerating models. In: IJCAI95, Montreal (1995)Google Scholar
  20. 20.
    Jackson, D., Damon, C.A.: Elements of style: analyzing a software design feature with a counterexample detector. TOSEM, 484–495 (1996)Google Scholar
  21. 21.
    Ng, Y.C.: A Nitpick specification of IPv6. Senior Honors thesis, Computer Science Department, Carnegie Mellon University (1997)Google Scholar
  22. 22.
    Khurshid, S., Jackson, D.: Exploring the design of an intentional naming scheme with an automatic constraint analyzer. In: ASE, pp. 13–22 (2000)Google Scholar
  23. 23.
    Dennis, G., et al.: Automating commutativity analysis at the design level. In: ISSTA, pp. 165–174 (2004)Google Scholar
  24. 24.
    Narain, S.: Network configuration management via model finding. In: ACM Workshop On Self-Managed Systems, Newport Beach, CA (2004)Google Scholar
  25. 25.
    O’Keefe, R.: The Craft of Prolog. Logic Programming. MIT Press, Cambridge (1990)Google Scholar
  26. 26.
    Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge (2004)Google Scholar
  27. 27.
    Crawford, J., et al.: Symmetry-breaking predicates for search problems. In: KR’96, pp. 148–159. Morgan Kaufmann, San Francisco (1996)Google Scholar
  28. 28.
    Shlyakhter, I.: Generating effective symmetry breaking predicates for search problems. Electronic Notes in Discrete Mathematics 9 (2001)Google Scholar
  29. 29.
    Eén, N., Sörensson, N.: Translating pseudo-boolean constraints into SAT. In: SBMC, vol. 2, pp. 1–26 (2006)Google Scholar
  30. 30.
    Malik, S., Fu, Z., Mahajan, Y.S.: Zchaff2004: An Efficient SAT Solver. In: H. Hoos, H., Mitchell, D.G. (eds.) SAT 2004. LNCS, vol. 3542, pp. 360–375. Springer, Heidelberg (2005)Google Scholar
  31. 31.
    Eén, N., Sörensson, N.: An extensible SAT-solver. In: Giunchiglia, E., Tacchella, A. (eds.) SAT 2003. LNCS, vol. 2919, pp. 502–518. Springer, Heidelberg (2004)Google Scholar
  32. 32.
    Shlyakhter, I.: Declarative Symbolic Pure Logic Model Checking. PhD thesis, Massachusetts Institute of Technology, Cambridge, MA (2005)Google Scholar
  33. 33.
    Sabharwal, A.: SymChaff: A structure-aware satisfiability solver. In: 20th National Conference on Artificial Intelligence (AAAI), Pittsburgh, PA, Pittsburgh, PA, pp. 467–474 (2005)Google Scholar
  34. 34.
    Armstrong, M.A.: Groups and Symmetry. Springer, New York (1988)zbMATHGoogle Scholar
  35. 35.
    Torlak, E., Jackson, D.: The design of a relational engine. Technical Report MIT-CSAIL-TR-2006-068, MIT (2006)Google Scholar
  36. 36.
    Babai, L., Kantor, W.M., Luks, E.M.: Computational complexity and the classification of finite simple groups. In: IEEE SFCS, pp. 162–171. IEEE CSP, Los Alamitos (1983)Google Scholar
  37. 37.
    Shlyakhter, I., et al.: Exploiting subformula sharing in automatic analysis of quantified formulas. In: SAT, Portofino, Italy (2003)Google Scholar
  38. 38.
    Dijkstra, E.W.: Cooperating sequential processes. In: Genuys, F. (ed.) Programming Languages, pp. 43–112. Academic Press, New York (1968)Google Scholar
  39. 39.
    Chang, E.J.H., Roberts, R.: An improved algorithm for decentralized extrema-finding in circular configurations of processes. Commun. ACM 22(5), 281–283 (1979)zbMATHCrossRefGoogle Scholar
  40. 40.
    Ramananandro, T.: The Mondex case study with Alloy (2006),
  41. 41.
    Goldberg, E., Novikov, Y.: BerkMin: A fast and robust SAT solver. In: Design Automation and Test in Europe, pp. 142–149 (2002)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Emina Torlak
    • 1
  • Daniel Jackson
    • 1
  1. 1.MIT Computer Science and Artificial Intelligence Laboratory 

Personalised recommendations