Towards B as a High-Level Constraint Modelling Language

Solving the Jobs Puzzle Challenge
  • Michael Leuschel
  • David Schneider
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8477)


We argue that B is a good language to conveniently express a wide range of constraint satisfaction problems. We also show that some problems can be solved quite effectively by the ProB tool. We illustrate our claim on several examples, such as the jobs puzzle - for which we solve the challenge set out by Shapiro. Here we show that the B formalization is both very close to the natural language specification and can still be solved efficiently by ProB. Our approach is particularly interesting when a high assurance of correctness is required. Indeed, compared to other existing approaches and tools, validation and double checking of solutions is available for ProB and formal proof can be applied to establish important properties or provide an unambiguous semantics to the problem specification.


B-method constraint programming logic programming Alloy Kodkod optimization 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abrial, J.-R.: The B-Book. Cambridge University Press (1996)Google Scholar
  2. 2.
    Badeau, F., Doche-Petit, M.: Formal data validation with Event-B. CoRR abs/1210.7039, 2012 (2012) Proceedings of DS-Event-B 2012, KyotoGoogle Scholar
  3. 3.
    Boite, O.: Méthode B et validation des invariants ferroviaires. Master’s thesis, Université Denis Diderot, Mémoire de DEA de logique et fondements de l’informatique (2000)Google Scholar
  4. 4.
    Carlsson, M., Ottosson, G.: An Open-Ended Finite Domain Constraint Solver. In: Glaser, H., Hartel, P., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 191–206. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  5. 5.
    ClearSy. Data Validation & Reverse Engineering, (June 2013)
  6. 6.
    Déharbe, D., Fontaine, P., Guyot, Y., Voisin, L.: SMT solvers for Rodin. In: Derrick, J., Fitzgerald, J., Gnesi, S., Khurshid, S., Leuschel, M., Reeves, S., Riccobene, E. (eds.) ABZ 2012. LNCS, vol. 7316, pp. 194–207. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  7. 7.
    Gent, I.P., Petrie, K.E., Puget, J.-F.: Symmetry in constraint programming. Foundations of Artificial Intelligence 2, 329–376 (2006)CrossRefGoogle Scholar
  8. 8.
    Hansen, D., Leuschel, M.: Translating TLA +  to B for validation with ProB. In: Derrick, J., Gnesi, S., Latella, D., Treharne, H. (eds.) IFM 2012. LNCS, vol. 7321, pp. 24–38. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  9. 9.
    Jackson, D.: Alloy: A lightweight object modelling notation. ACM Transactions on Software Engineering and Methodology 11, 256–290 (2002)CrossRefGoogle Scholar
  10. 10.
    Jackson, E.K., Levendovszky, T., Balasubramanian, D.: Reasoning about metamodeling with formal specifications and automatic proofs. In: Whittle, J., Clark, T., Kühne, T. (eds.) MODELS 2011. LNCS, vol. 6981, pp. 653–667. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  11. 11.
    Lecomte, T., Burdy, L., Leuschel, M.: Formally checking large data sets in the railways. CoRR, abs/1210.6815 (2012) Proceedings of DS-Event-B 2012, KyotoGoogle Scholar
  12. 12.
    Leuschel, M., Falampin, J., Fritz, F., Plagge, D.: Automated property verification for large scale B models with ProB. Formal Asp. Comput. 23(6), 683–709 (2011)CrossRefMathSciNetGoogle Scholar
  13. 13.
    Leuschel, M., Samia, M., Bendisposto, J., Luo, L.: Easy Graphical Animation and Formula Viewing for Teaching B. In: The B Method: from Research to Teaching, pp. 17–32 (2008)Google Scholar
  14. 14.
    Marriott, K., Nethercote, N., Rafeh, R., Stuckey, P.J., de la Banda, M.G., Wallace, M.: The design of the Zinc modelling language. Constraints 13(3), 229–267 (2008)CrossRefzbMATHMathSciNetGoogle Scholar
  15. 15.
    Mccune, W.: Otter 3.3 reference manual (2003)Google Scholar
  16. 16.
    Niemelä, I., Simons, P., Syrjänen, T.: Smodels: A system for answer set programming. CoRR, cs.AI/0003033 (2000)Google Scholar
  17. 17.
    Plagge, D., Leuschel, M.: Validating Z Specifications Using the ProB Animator and Model Checker. In: Davies, J., Gibbons, J. (eds.) IFM 2007. LNCS, vol. 4591, pp. 480–500. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Plagge, D., Leuschel, M.: Validating B,Z and TLA +  using ProB and Kodkod. In: Giannakopoulou, D., Méry, D. (eds.) FM 2012. LNCS, vol. 7436, pp. 372–386. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  19. 19.
    Schwitter, R.: The jobs puzzle: Taking on the challenge via controlled natural language processing. Theory and Practice of Logic Programming 13, 487–501 (2013)CrossRefzbMATHMathSciNetGoogle Scholar
  20. 20.
    Servat, T.: BRAMA: A new graphic animation tool for B models. In: Julliand, J., Kouchnarenko, O. (eds.) B 2007. LNCS, vol. 4355, pp. 274–276. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  21. 21.
    Shapiro, S.C.: The jobs puzzle: A challenge for logical expressibility and automated reasoning. In: AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning (2011)Google Scholar
  22. 22.
    Shapiro, S.C., The SNePS Implementation Group.: SNePS 2.7.1 User’s Manual, Department of Computer Science and Engineering University at Buffalo, The State University of New York (December 2010)Google Scholar
  23. 23.
    Smith, B.M., Petrie, K.E., Gent, I.P.: Models and symmetry breaking for peaceable armies of queens. In: Régin, J.-C., Rueher, M. (eds.) CPAIOR 2004. LNCS, vol. 3011, pp. 271–286. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  24. 24.
    Sterling, L., Shapiro, E.: The Art of Prolog. MIT Press (1986)Google Scholar
  25. 25.
    Torlak, E., Jackson, D.: Kodkod: A relational model finder. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 632–647. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  26. 26.
    Wos, L., Overbeek, R., Lusk, E., Boyle, J.: Automated Reasoning: Introduction and Applications. Prentice-Hall, Englewood Cliffs (1984)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Michael Leuschel
    • 1
  • David Schneider
    • 1
  1. 1.Institut für InformatikUniversität DüsseldorfDüsseldorfGermany

Personalised recommendations