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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 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.
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.
Atelier-B now uses full WP calculus (private communication from Lilian Burdy).
- 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.
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
Abrial, J.-R.: The B-Book. Cambridge University Press, Cambridge (1996)
Abrial, J.-R.: Modeling in Event-B: System and Software Engineering. Cambridge University Press, Cambridge (2010)
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
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
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
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
Beckert, B., Posegga, J.: leanTAP: Lean tableau-based deduction. J. Autom. Reasoning 15(3), 339–358 (1995)
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
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)
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
ClearSy. Atelier, B.: User and Reference Manuals. Aix-en-Provence, France, 2009. http://www.atelierb.eu/
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
Déharbe, D., Fontaine, P., Guyot, Y., Voisin, L.: Integrating SMT solvers in Rodin. Sci. Comput. Program. 94, 130–143 (2014)
Fitting, M.: leanTAP revisited. J. Log. Comput. 8(1), 33–47 (1998)
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
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
Howe, J.M., King, A.: A pearl on SAT and SMT solving in Prolog. Theor. Comput. Sci. 435, 43–55 (2012)
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)
Knuth, D.: The Art of Computer Programming, vol. 3. Addison-Wesley, Boston (1983)
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
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
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
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)
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
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
Métayer, C., Voisin, L.: The Event-B Mathematical Language (2009). http://wiki.event-b.org/index.php/Event-B_Mathematical_Language
Robbins, E., Howe, J.M., King, A.: Theory propagation and reification. Sci. Comput. Program. 111, 3–22 (2015)
Stärk, R.F.: The theoretical foundations of LPTP (a logic program theorem prover). J. Logic Program. 36(3), 241–269 (1998)
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
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)