Skip to main content

Fast and Effective Well-Definedness Checking

  • Conference paper
  • First Online:
Integrated Formal Methods (IFM 2020)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12546))

Included in the following conference series:

Abstract

Well-Definedness is important for many formal methods. In B and Event-B it ensures that certain kinds of errors (e.g., division by 0) cannot appear and that proof rules based on two-valued logic are sound. For validation tools such as ProB, well-definedness is important for constraint solving. B and Event-B establish well-definedness by generating dedicated proof obligations (POs). Unfortunately, the standard provers are not always very good at discharging them. In this paper, we present a new integrated technique to simultaneously generate and discharge well-definedness POs. The implementation contains a dedicated rule-based prover written in Prolog supporting B, Event-B and extensions thereof for data validation. We show that the generation and discharging is significantly faster than existing implementations in rodin and Atelier-B and that a large number of POs are automatically discharged. The POs are fine-grained enough to provide precise source code feedback, and allow inspection of problematic POs within various editors.

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

Access this chapter

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

Institutional subscriptions

Notes

  1. 1.

    Taken from https://en.wikipedia.org/wiki/Brouwer?Hilbert_controversy.

  2. 2.

    [12] discusses combining power of \(\mathcal{D}\) with the efficiency of \(\mathcal{L}\), but is not used in practice as far as we know. It seems to require one to establish the truth or falsity of individual formulas, which may not be easily feasible in practice.

  3. 3.

    For modulo -3 mod 2 = −1 is well-defined and true in Event-B, but is not well-defined in classical B. But this is not due to a difference in the WD condition, but due to the fact that -3 mod 2 is parsed as -(3 mod 2) in rodin and (-3) mod 2 in Atelier-B. The rodin handbook requires modulo arguments to be non-negative, which is correct; [26] is in error.

  4. 4.

    Atelier-B now uses full WP calculus (private communication from Lilian Burdy).

  5. 5.

    See FiniteRan.java in org.eventb.internal.core.seqprover.eventbExtensions at https://sourceforge.net/p/rodin-b-sharp/rodincore. A lot of other proof rules are more compact, though.

  6. 6.

    The missing occurs check in Prolog is not an issue, because we use the ground representation for the B formulas, and hence any variable in a proof rule is always instantiated to a ground term.

References

  1. Abrial, J.-R.: The B-Book. Cambridge University Press, Cambridge (1996)

    Book  Google Scholar 

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

    Book  Google Scholar 

  3. Abrial, J.-R., Butler, M., Hallerstede, S., Voisin, L.: An open extensible tool environment for Event-B. In: Liu, Z., He, J. (eds.) ICFEM 2006. LNCS, vol. 4260, pp. 588–605. Springer, Heidelberg (2006). https://doi.org/10.1007/11901433_32

    Chapter  Google Scholar 

  4. Abrial, J.-R., Cansell, D., Métayer, C.: Specification of the automatic prover P3. In Proceedings AVoCS 2010 and the Rodin User and Developer Workshop, September 2010. https://wiki.event-b.org/images/Rodin2010-sld-abrial.pdf

  5. Abrial, J.-R., Mussat, L.: On using conditional definitions in formal theories. In: Bert, D., Bowen, J.P., Henson, M.C., Robinson, K. (eds.) ZB 2002. LNCS, vol. 2272, pp. 242–269. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45648-1_13

    Chapter  MATH  Google Scholar 

  6. Balland, E., Brauner, P., Kopetz, R., Moreau, P.-E., Reilles, A.: Tom: piggybacking rewriting on Java. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 36–47. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73449-9_5

    Chapter  Google Scholar 

  7. Beckert, B., Posegga, J.: leanTAP: Lean tableau-based deduction. J. Autom. Reasoning 15(3), 339–358 (1995)

    Article  Google Scholar 

  8. Behm, P., Burdy, L., Meynadier, J.-M.: Well defined B. In: Bert, D. (ed.) B 1998. LNCS, vol. 1393, pp. 29–45. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0053354

    Chapter  Google Scholar 

  9. Berezin, S., Barrett, C., Shikanian, I., Chechik, M., Gurfinkel, A., Dill, D.L.: A practical approach to partial functions in CVC lite. Electron. Notes Theor. Comput. Sci. 125(3), 13–23 (2005)

    Article  Google Scholar 

  10. Butler, M., Maamria, I.: Practical theory extension in Event-B. In: Liu, Z., Woodcock, J., Zhu, H. (eds.) Theories of Programming and Formal Methods. LNCS, vol. 8051, pp. 67–81. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39698-4_5

    Chapter  Google Scholar 

  11. ClearSy. Atelier, B.: User and Reference Manuals. Aix-en-Provence, France, 2009. http://www.atelierb.eu/

  12. Darvas, Á., Mehta, F., Rudich, A.: Efficient well-definedness checking. In: Armando, A., Baumgartner, P., Dowek, G. (eds.) IJCAR 2008. LNCS (LNAI), vol. 5195, pp. 100–115. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-71070-7_8

    Chapter  Google Scholar 

  13. Déharbe, D., Fontaine, P., Guyot, Y., Voisin, L.: Integrating SMT solvers in Rodin. Sci. Comput. Program. 94, 130–143 (2014)

    Article  Google Scholar 

  14. Fitting, M.: leanTAP revisited. J. Log. Comput. 8(1), 33–47 (1998)

    Article  MathSciNet  Google Scholar 

  15. Frisch, A.M., Stuckey, P.J.: The proper treatment of undefinedness in constraint languages. In: Gent, I.P. (ed.) CP 2009. LNCS, vol. 5732, pp. 367–382. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04244-7_30

    Chapter  Google Scholar 

  16. 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 

  17. Howe, J.M., King, A.: A pearl on SAT and SMT solving in Prolog. Theor. Comput. Sci. 435, 43–55 (2012)

    Article  MathSciNet  Google Scholar 

  18. Hsiang, J., Kirchner, H., Lescanne, P., Rusinowitch, M.: The term rewriting approach to automated theorem proving. J. Log. Program. 14(1&2), 71–99 (1992)

    Article  MathSciNet  Google Scholar 

  19. Knuth, D.: The Art of Computer Programming, vol. 3. Addison-Wesley, Boston (1983)

    Google Scholar 

  20. Kosmatov, N., Marché, C., Moy, Y., Signoles, J.: Static versus dynamic verification in Why3, Frama-C and SPARK 2014. In: Margaria, T., Steffen, B. (eds.) ISoLA 2016. LNCS, vol. 9952, pp. 461–478. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47166-2_32

    Chapter  Google Scholar 

  21. Krings, S., Bendisposto, J., Leuschel, M.: From failure to proof: the ProB disprover for B and Event-B. In: Calinescu, R., Rumpe, B. (eds.) SEFM 2015. LNCS, vol. 9276, pp. 199–214. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-22969-0_15

    Chapter  Google Scholar 

  22. Krings, S., Leuschel, M.: SMT solvers for validation of B and Event-B models. In: Ábrahám, E., Huisman, M. (eds.) IFM 2016. LNCS, vol. 9681, pp. 361–375. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33693-0_23

    Chapter  Google Scholar 

  23. Lecomte, T., Burdy, L., Leuschel, M.: Formally checking large data sets in the railways. Proceedings of DS-Event-B 2012, Kyoto. CoRR, abs/1210.6815 (2012)

    Google Scholar 

  24. Leuschel, M., Börger, E.: A compact encoding of sequential ASMs in Event-B. In: Butler, M., Schewe, K.-D., Mashkoor, A., Biro, M. (eds.) ABZ 2016. LNCS, vol. 9675, pp. 119–134. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33600-8_7

    Chapter  Google Scholar 

  25. Mehta, F.: A practical approach to partiality – a proof based approach. In: Liu, S., Maibaum, T., Araki, K. (eds.) ICFEM 2008. LNCS, vol. 5256, pp. 238–257. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-88194-0_16

    Chapter  Google Scholar 

  26. Métayer, C., Voisin, L.: The Event-B Mathematical Language (2009). http://wiki.event-b.org/index.php/Event-B_Mathematical_Language

  27. Robbins, E., Howe, J.M., King, A.: Theory propagation and reification. Sci. Comput. Program. 111, 3–22 (2015)

    Article  Google Scholar 

  28. Stärk, R.F.: The theoretical foundations of LPTP (a logic program theorem prover). J. Logic Program. 36(3), 241–269 (1998)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

Big thanks go to Philipp Körner for scripts for extracting benchmark specification list, Thierry Lecomte for writing the sum Logic Solver example, Sebastian Stock for the VSCode integration and David Geleßus for the ProB2-UI integration. I wish to thank Jean-Raymond Abrial, Lilian Burdy, Michael Butler, Stefan Hallerstede and Laurent Voisin for useful feedback, Atelier-B and rodin implementation details and pointers to related research. In particular Laurent Voisin provided many useful hints and corrections. Finally, the anonymous referees of iFM provided very useful feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Michael Leuschel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Leuschel, M. (2020). Fast and Effective Well-Definedness Checking. In: Dongol, B., Troubitsyna, E. (eds) Integrated Formal Methods. IFM 2020. Lecture Notes in Computer Science(), vol 12546. Springer, Cham. https://doi.org/10.1007/978-3-030-63461-2_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-63461-2_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-63460-5

  • Online ISBN: 978-3-030-63461-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics