Skip to main content

From Software Specifications to Constraint Programming

  • Conference paper
  • First Online:
  • 707 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10886))

Abstract

Non-deterministic specifications play a central role in the use of formal methods for software development. Such specifications can be more readable, but hard to execute efficiently due to the usually large search space. Constraint programming offers advanced algorithms and heuristics for solving certain non-deterministic models. Unfortunately, this requires writing models in a form suitable for efficient solving where the readability typically required from a specification is lost. Tools like ProB attempt to bridge this gap by translating high-level first-order predicate logic specifications into formal models suitable for constraint solving. In this paper we study potential improvements to this methodology by (1) using refinement to transform specifications into models suitable for efficient solving, (2) translating first-order predicates directly into the OscaR framework and (3) using different kinds of solvers as a back end. Formal verification by proof ensures the correctness of the solution of the model with respect to the specification.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    The term \(p \mapsto q\) denotes the pair with first component p and second component q.

  2. 2.

    Private communication with Pierre Schaus.

References

  1. Abrial, J.R.: Modeling in Event-B – System and Software Engineering. Cambridge University Press, Cambridge (2010)

    Book  Google Scholar 

  2. Back, R.J., von Wright, J.: Refinement Calculus: A Systematic Introduction. Springer, New York (1998). https://doi.org/10.1007/978-1-4612-1674-2

    Book  MATH  Google Scholar 

  3. Bruen, A., Dixon, R.: The n-queens problem. Discrete Math. 12(4), 393–395 (1975)

    Article  MathSciNet  Google Scholar 

  4. Couto, L.D., Foster, S., Payne, R.J.: Towards verification of constituent systems through automated proof. CoRR abs/1404.7792 (2014)

    Google Scholar 

  5. Dick, A.J.J., Krause, P.J., Cozens, J.: Computer aided transformation of Z into prolog. In: Nicholls, J.E. (ed.) Z User Workshop. Workshops in Computing, pp. 71–85. Springer, London (1990). https://doi.org/10.1007/978-1-4471-3877-8_5

    Chapter  Google Scholar 

  6. Fuchs, N.E.: Specifications are (preferably) executable. Softw. Eng. J. 7(5), 323–334 (1992)

    Article  Google Scholar 

  7. Gomes, C.P., Selman, B., Kautz, H.A.: Boosting combinatorial search through randomization. In: Mostow, J., Rich, C. (eds.) AAAI, pp. 431–437. AAAI Press/MIT Press (1998)

    Google Scholar 

  8. Hallerstede, S., Leuschel, M.: Constraint-based deadlock checking of high-level specifications. TPLP 11(4–5), 767–782 (2011)

    MathSciNet  Google Scholar 

  9. Hansen, D., Schneider, D., Leuschel, M.: Using B and ProB for data validation projects. In: Butler, M., Schewe, K.-D., Mashkoor, A., Biro, M. (eds.) ABZ 2016. LNCS, vol. 9675, pp. 167–182. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33600-8_10

    Chapter  Google Scholar 

  10. Hayes, I., Jones, C.B.: Specifications are not (necessarily) executable. Softw. Eng. J. 4(6), 330–338 (1989)

    Article  Google Scholar 

  11. Hehner, E.C.R.: A Practical Theory of Programming. Springer, New York (1993). https://doi.org/10.1007/978-1-4419-8596-5

    Book  MATH  Google Scholar 

  12. Hentenryck, P.V., Michel, L.: Constraint-Based Local Search. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  13. van Hoeve, W.J.: The all different constraint: a survey. arXiv cs/0105015 (2001)

    Google Scholar 

  14. Jones, C.B.: Systematic Software Development Using VDM. Prentice Hall, Englewood Cliffs (1990)

    MATH  Google Scholar 

  15. Kans, A., Hayton, C.: Using ABC to prototype VDM specifications. SIGPLAN Not. 29(1), 27–36 (1994)

    Article  Google Scholar 

  16. Krings, S., Leuschel, M., Körner, P., Hallerstede, S., Hasanagić, M.: Three is a crowd: SAT, SMT and CLP on a chessboard. In: Calimeri, F., Hamlen, K., Leone, N. (eds.) PADL 2018. LNCS, vol. 10702, pp. 63–79. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-73305-0_5

    Chapter  Google Scholar 

  17. Leuschel, M., Butler, M.J.: ProB: an automated analysis toolset for the B method. STTT 10(2), 185–203 (2008)

    Article  Google Scholar 

  18. Leuschel, M., Schneider, D.: Towards B as a high-level constraint modelling language – solving the jobs puzzle challenge. In: Ameur, Y.A., Schewe, K.D. (eds.) ABZ 2014. LNCS, vol. 8477, pp. 101–116. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-43652-3_8

    Chapter  Google Scholar 

  19. Morgan, C.C.: Programming From Specifications, 2nd edn. Prentice Hall, Englewood Cliffs (1994)

    MATH  Google Scholar 

  20. Nipkow, T., Wenzel, M., Paulson, L.C. (eds.): Isabelle/HOL: A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45949-9

    Book  MATH  Google Scholar 

  21. Odersky, M., al.: An Overview of the Scala Programming Language. Technical report. IC/2004/64, EPFL, Lausanne, Switzerland (2004)

    Google Scholar 

  22. OscaR Team: OscaR: Scala in OR (2012). bitbucket.org/oscarlib

  23. Pelletier, F.J.: Seventy-five problems for testing automatic theorem provers. J. Autom. Reason. 2, 191–216 (1986)

    Article  MathSciNet  Google Scholar 

  24. de Roever, W.P., Engelhardt, K.: Data Refinement: Model-oriented Proof Theories and their Comparison, vol. 46. Cambridge University Press, Cambridge (1998)

    Book  Google Scholar 

  25. Schmalz, M.: Term rewriting in logics of partial functions. In: Qin, S., Qiu, Z. (eds.) ICFEM 2011. LNCS, vol. 6991, pp. 633–650. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-24559-6_42

    Chapter  Google Scholar 

  26. Schneider, D., Leuschel, M., Witt, T.: Model-based problem solving for university timetable validation and improvement. In: Bjørner, N., de Boer, F. (eds.) FM 2015. LNCS, vol. 9109, pp. 487–495. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19249-9_30

    Chapter  Google Scholar 

  27. Silva, J.P.M., Sakallah, K.A.: GRASP: a search algorithm for propositional satisfiability. IEEE Trans. Comput. 48(5), 506–521 (1999)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

The work presented here is partially supported by the INTO-CPS project funded by the European Commission’s Horizon 2020 programme under grant agreement number 664047.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Stefan Hallerstede .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hallerstede, S., Hasanagić, M., Krings, S., Larsen, P.G., Leuschel, M. (2018). From Software Specifications to Constraint Programming. In: Johnsen, E., Schaefer, I. (eds) Software Engineering and Formal Methods. SEFM 2018. Lecture Notes in Computer Science(), vol 10886. Springer, Cham. https://doi.org/10.1007/978-3-319-92970-5_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-92970-5_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-92969-9

  • Online ISBN: 978-3-319-92970-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics