Skip to main content

On Combining Algebraic Specifications with First-Order Logic via Athena

  • Conference paper
  • First Online:
Book cover Algebraic Modeling of Topological and Computational Structures and Applications (AlModTopCom 2015)

Abstract

We present a verification framework developed by researchers of the National Technical University of Athens as part of the Research Project Thalis “Algebraic Modeling of Topological and Computational Structures and Applications”. The proposed framework combines two different specification and theorem-proving systems, in order to facilitate the modeling and analysis of critical software systems. On the one hand, the CafeOBJ algebraic specification language offers executable, composable specifications, and insightful information about the proofs of desired invariant properties. On the other hand, Athena, an interactive theorem-proving system, provides automation and soundness guarantees for its results, as well as detailed structured proofs. Although having conducted complicated case studies (references to which are provided in the paper), here we focus on explaining the steps of the proposed hybrid methodology as clearly as possible, through an illustrative example of a simple mutual exclusion protocol.

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

Access this chapter

Institutional subscriptions

Notes

  1. 1.

    \(R_S\) is the type denoting the set of all reachable states wrt S. Also Sys denotes \(R_S\) but not Y if the constructor-based logic is adopted, which is the current logic underlying the OTS/CafeOBJ method [13].

  2. 2.

    For the full proof we refer readers to Appendix 5.

  3. 3.

    Clearly, if neither of these hold, i.e., if \(i = k\) and \(j = k\), then we could also have \(i = j\), contradicting our hypothesis.

References

  1. Diaconescu, R., Futatsugi, K., Ogata, K.: CafeOBJ: Logical foundations and methodologies. Comput. Inform. 22, 257–283 (2003)

    MathSciNet  MATH  Google Scholar 

  2. Clavel, M., Durn, F., Eker, S., Lincoln, P., Mart-Oliet, N., Meseguer, J., Quesada, J.: Maude: specification and programming in rewriting logic. Maude System documentation (1999)

    Google Scholar 

  3. Mossakowski, T., Haxthausen, A.E., Sannella, D., Tarlecki, A.: Casl the Common Algebraic Specification Language. In: Logics of Specification Languages. Part of the series Monographs in Theoretical Computer Science pp. 241–298 (2008)

    Google Scholar 

  4. Nipkow, T.: Programming and Proving in Isabelle/HOL. Technical Report (2014)

    Google Scholar 

  5. Autexier, S., Mossakowski, T.: Integrating HOL-CASL into the development graph manager MAYA. Frontiers of combining systems. Lect. Notes Comput. Sci. 2309, 2–17 (2002)

    Article  MATH  Google Scholar 

  6. Codescu, M., Horozal, F., Kohlhase, M., Mossakowski, T., Rabe, F., Sojakova, K.: Towards Logical Frameworks in the Heterogeneous Tool Set Hets. In Till Mossakowski, Hans-Jrg Kreowski (eds.), Recent Trends in Algebraic Development Techniques, 20th International Workshop, WADT 2010, vol. 7137, 139–159, Lecture Notes in Computer Science. Springer, Berlin (2010)

    Google Scholar 

  7. Arkoudas, K.: Athena, proofcentral.org, (2004)

    Google Scholar 

  8. CafeOBJ Algrebraic Specification and Verification. https://cafeobj.org/

  9. CafeOBJ@NTUA blog. https://cafeobjntua.wordpress.com/2016/05/26/on-combining-algebraic-specications-with-first-order-logic-via-athena/

  10. Smith, M., Klarlund, N.: Verification of a Sliding Window Protocol Using IOA and MONA. Research Report RR-3959, INRIA (2000)

    Google Scholar 

  11. Goguen, J., Malcolm, G.: A hidden agenda. Technical Report No. CS97-538, Ed.: University of California at San Diego (1997)

    Google Scholar 

  12. Ogata, K., Futatsugi, K.: Compositionally writing proof scores of invariants in the OTS/CafeOBJ method. J. Univers. Comput. Sci. 19(6), 771–804 (2013)

    Google Scholar 

  13. Futatsugi, K., Gaina, D., Ogata, K.: Principles of proof scores in CafeOBJ. Theor. Comput. Sci. 464, 90112 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  14. Gaina, D., Lucano, D., Ogata, K., Futatsugi, K.: On automation of OTS/CafeOBJ method. In: Specification, Algebra, and Software, LNCS 8373, 578–602 (2014)

    Google Scholar 

  15. Ogata, K., Futatsugi, K.: Proof scores in the OTS/cafeOBJ method. In Proceedings of the Conference on Formal Methods for Open Object-Based Distributed Systems, vol. 2884 170–184 (2003)

    Google Scholar 

  16. Arkoudas, K., Musser, D.: Fundamental Proof Methods in Computer Science. MIT Press (2017)

    Google Scholar 

  17. Musser, D.: Understanding Athena Proofs

    Google Scholar 

  18. Vampire, Web page. www.vprover.org/

  19. Spass, Web page. www.spass-prover.org/

  20. Algebraic modeling of topological and computational structures (AlModTopCom). http://www.math.ntua.gr/~sofia/ThalisSite/publications.html

  21. Ouranos, I., Ogata, K., Stefaneas, P.: TESLA Source Authentication Protocol Verification Experiment in the Timed OTS/CafeOBJ Method: Experiences and Lessons Learned. IEICE Trans. 97(5), 1160–1170 (2014)

    Google Scholar 

Download references

Acknowledgements

This research has been co-financed by the European Union (European Social Fund ESF) and Greek national funds through the Operational Program “Education and Lifelong Learning” of the National Strategic Reference Framework (NSRF) - Research Funding Program: THALIS. The authors would like to acknowledge the insightful feedback provided by Dr. Konstantine Arkoudas. The authors would also like to warmly thank Prof. Dr. Sofia Lambropoulou, Project Coordinator of the Research Project Thalis “Algebraic Modeling of Topological and Computational Structures and Applications” for their excellent collaboration.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Katerina Ksystra .

Editor information

Editors and Affiliations

Appendices

Appendix A

Here we present the CafeOBJ specification of the mutex system.

figure w

Appendix B

The declaration of an invariant property in CafeOBJ terms and the definition of the induction schema, are shown below:

figure x

The definition of the corresponding invariant in Athena is presented here (the induction schema is automatically defined in Athena).

figure y

The proof score of the desired invariant property in CafeOBJ, for the initial state and when a transition, called enter(s,k), is applied can be seen below:

figure z

The corresponding proof skeleton in Athena can be defined as follows.

figure aa

Finally, the following proof scores present a case splitting in CafeOBJ. In the first case we assume that at(s,k) = cs while the second proof score assumes its symmetrical case, i.e. (at(s,k) = cs) = false.

figure ab

The same case splitting can be defined in Athena terms as follows:

figure ac

Appendix C

A detailed structured Athena proof of the (strengthened) goal for our example is shown below.

Theorem 19.1

For all states \(s'\) and processes i and j, if i and j are in their critical sections in \(s'\), then \(i = j\) and \(s'\) is locked. \(\blacksquare \)

Proof

By structural induction on \(s'\). When \(s'\) is the initial state the result is trivial because the antecedent is false, as all processes are in their remainder sections initially. Suppose now that \(s'\) is of the form (k enter s). Pick any processes i and j and assume both are in their critical sections in \(s'\). We then need to show that \(i = j\) and that \(s' = (\)k\( \textit{enter} \)s) is locked. The inductive hypothesis here is:

$$ \begin{aligned} i \,at\, s = cs \, \& \,j\, at \,s\, = cs==> i = j\, \& \,locked\, s \end{aligned}$$
(19.1)

We distinguish two cases:

  1. 1.

    Case 1: k is enabled at s. Then (k at \(s'\) = cs)and (locked \(s'\)) follow from the enter axioms. Thus, we only need to show \(i = j\). By contradiction, suppose that \(i \ne j\). Then either \(i \ne k\) or \(j \ne k\).Footnote 3 So assume first that \(i \ne k\) (the reasoning for the case \(j \ne k\) is symmetric). Then, from the enter axioms and the assumption that k is enabled at s, we conclude i at \(s'\) = i at s, hence i at s = cs. Now applying the inductive hypothesis to the above assumption, we conclude (locked s). However, that contradicts the assumption that k is enabled at s, as that assumption means that s is not locked.

  2. 2.

    Case 2: k is not enabled at s. In that case, by the enter axioms, we get

    $$ (k \,enter\, s = s)$$

    i.e., \(s' = s\), and the result now follows directly from the inductive hypothesis.

Finally, suppose that \(s'\) is of the form (k exit s). Again pick any processes i and j and assume both are in their critical sections in \(s'\). We again need to show that \(i = j\) and that \(s' = (\)k\( \textit{exit} \)s) is locked. The inductive hypothesis here is the same as before, (19.1). We distinguish two cases again, depending on whether or not the effective condition of the exit transition holds:

  1. 1.

    Case 1: (k at s = cs). We proceed by contradiction. First, by applying the inductive hypothesis to the conjunction of (k at s = cs) with itself, we obtain (locked s). Also, by the exit axioms, we get

    $$ k \,at\, s' = (k \, exit\, s) = rs$$

    i.e.,

    $$\begin{aligned} k\, at \,s' = rs. \end{aligned}$$
    (19.2)

    The exit axioms also imply that \(s'\) is not locked. We can now conclude that

    $$\begin{aligned} i \ne k \end{aligned}$$
    (19.3)

    because otherwise, if \(i = k\), the assumption that i is in cs in state \(s'\) would contradict (19.2). Hence, by the exit axioms, we get

    $$\begin{aligned} i\, at\, s' = i\, at \,s. \end{aligned}$$
    (19.4)

    Therefore, from (19.4) and the assumption that i is in cs in \(s'\), we get i at s = cs. But now applying the inductive hypothesis to i at s = cs and to (k at s = cs) yields \(i = k\), contradicting (19.3).

  2. 2.

    Case 2: (k at s \(\ne \) cs). In that case the exit axioms give (k exit s = s, i.e., \(s' = s\), and the result follows directly from the inductive hypothesis.

The above informal proof can be formulated in Athena at the same level of abstraction and with the exact same structure. Moreover, the proof colloquialism “the reasoning for that case is symmetric” that appears in the enter transition can be directly accommodated by abstracting the symmetric reasoning into a method and then applying that method to multiple instances. Likewise, the treatment of enter and exit is symmetric when their effective conditions are violated, in which case the result follows directly from the inductive hypothesis, and this commonality too can be easily factored out into a general method. The entire proof, along with these two methods, can be seen below. Note that the proof doesn’t use external theorem provers. Instead, it uses Athena’s own library chain method, which allows for limited proof search. The chain method extends the readability benefits of equational chains into arbitrary implication chains.

figure ad

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ksystra, K., Triantafyllou, N., Stefaneas, P. (2017). On Combining Algebraic Specifications with First-Order Logic via Athena. In: Lambropoulou, S., Theodorou, D., Stefaneas, P., Kauffman, L. (eds) Algebraic Modeling of Topological and Computational Structures and Applications. AlModTopCom 2015. Springer Proceedings in Mathematics & Statistics, vol 219. Springer, Cham. https://doi.org/10.1007/978-3-319-68103-0_19

Download citation

Publish with us

Policies and ethics