Skip to main content
Log in

Mechanical certification of FOLID cyclic proofs

  • Published:
Annals of Mathematics and Artificial Intelligence Aims and scope Submit manuscript

Abstract

Cyclic induction is a powerful reasoning technique that consists in blocking the proof development of certain subgoals already encountered during the proof process. In the setting of first-order logic with inductive definitions and equality (FOLID), cyclic proofs can be built automatically by the Cyclist prover, but their implementations are error-prone and the human validation may be tedious. On the other hand, cyclic induction is not yet integrated into certifying proof environments that support first-order logic and inductive definitions, such as Isabelle and Coq. We propose a solution to check, using Coq, the cyclic proofs produced by E-Cyclist, an extension of Cyclist that implements a more efficient soundness validation method, by using the general Noetherian induction principle integrated into Coq. Our work is based on a methodology for certifying first-order formula-based Noetherian induction proofs, such as those based on implicit induction. The advantages of our approach are threefold: - I) The certification of cyclic FOLID proofs is mechanical. Coq can validate every single step from the E-Cyclist proofs, as well as the induction arguments; also, it helps to identify errors in a very precise way. - II) There is a great potential for automation. The methodology has already been used to automatically convert to Coq scripts implicit induction proofs. - III) Cyclic induction can be directly performed in Coq. Coq functions are provided to manage the induction part.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Data Availability

The datasets generated during and/or analyzed during the current study, in particular, the full Coq specifications and proof scripts, are archived and made available at https://members.loria.fr/SStratulat/files/ECyclist-coq-certification.zip

References

  1. Brotherston, J.: Sequent calculus proof systems for inductive definitions. PhD thesis, University of Edinburgh (2006)

  2. Brotherston, J., Simpson, A.: Sequent calculi for induction and infinite descent. J. Log. Comput. 21(6), 1177–1216 (2011). https://doi.org/10.1093/logcom/exq052

    Article  MathSciNet  MATH  Google Scholar 

  3. Gentzen, G.: Untersuchungen über das logische schließen. I. Mathematische Zeitschrift 39, 176–210 (1935). https://doi.org/10.1007/BF01201353

    Article  MATH  Google Scholar 

  4. Brotherston, J., Gorogiannis, N., Petersen, R.L.: A generic cyclic theorem prover. In: APLAS-10 (10th Asian Symposium on Programming Languages and Systems). LNCS. https://doi.org/10.1007/978-3-642-35182-2_25, vol. 7705, pp 350–367. Springer (2012)

  5. Michel, M.: Complementation is more difficult with automata on infinite words. Technical report CNET (1988)

  6. Stratulat, S.: Cyclic proofs with ordering constraints. In: Schmidt, R.A., Nalon, C. (eds.) TABLEAUX 2017 (26th International Conference on Automated Reasoning with Analytic Tableaux and Related Methods). LNAI. https://doi.org/10.1007/978-3-319-66902-1_19, vol. 10501, pp 311–327. Springer (2017)

  7. Stratulat, S.: Validating back-links of FOLID cyclic pre-proofs. In: Berardi, S., Van Bakel, S. (eds.) CL&C’18 (Seventh International Workshop on Classical Logic and Computation). EPTCS, pp. 39–53. https://doi.org/10.4204/EPTCS.281.4 (2018)

  8. Stratulat, S.: E-Cyclist: Implementation of an efficient validation of FOLID cyclic induction reasoning. In: Kutsia, T. (ed.) 9th International Symposium on Symbolic Computation in Software Science. Electronic Proceedings in Theoretical Computer Science, vol. 342, pp. 129–135. https://doi.org/10.4204/EPTCS.342.11 (2021)

  9. The Coq development team: The Coq Reference Manual. INRIA. INRIA. http://coq.inria.fr/doc (2020)

  10. Stratulat, S.: Mechanically certifying formula-based Noetherian induction reasoning. J. Symb. Comput. 80 Part 1, 209–249 (2017). https://doi.org/10.1016/j.jsc.2016.07.014

    Article  MathSciNet  MATH  Google Scholar 

  11. Stratulat, S.: SPIKE, An automatic theorem prover – revisited. In: SYNASC 2020: Proceedings of the 22nd International Symposium on Symbolic and Numeric Algorithms for Scientific Computing. https://doi.org/10.1109/SYNASC51798.2020.00025, pp 93–96. IEEE Computer Society (2020)

  12. Berardi, S., Tatsuta, M.: Classical system of Martin-Lof’s inductive definitions is not equivalent to cyclic proofs. Logical Methods in Computer Science 15(3). https://doi.org/10.23638/LMCS-15(3:10)2019 (2019)

  13. Henaien, A., Stratulat, S.: Performing implicit induction reasoning with certifying proof environments. In: Bouhoula, A., Ida, T., Kamareddine, F. (eds.) Proceedings Fourth International Symposium on Symbolic Computation in Software Science, Gammarth, Tunisia, 15-17 December 2012. Electronic Proceedings in Theoretical Computer Science, vol. 122, pp. 97–108. https://doi.org/10.4204/EPTCS.122.9 (2013)

  14. Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The size-change principle for program termination. In: POPL ’01: Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. https://doi.org/10.1145/360204.360210, vol. 36, pp 81–92. ACM Press (2001)

  15. Fogarty, S., Vardi, M.Y.: Büchi complementation and size-change termination. In: Kowalewski, S., Philippou, A. (eds.) Tools and Algorithms for the Construction and Analysis of Systems, 15th International Conference, TACAS 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22-29, 2009. Proceedings. Lecture Notes in Computer Science. https://doi.org/10.1007/978-3-642-00768-2_2, vol. 5505, pp 16–30. Springer (2009)

  16. Jones, E., Ong, C. -L., Ramsay, S.J.: Cycleq: an efficient basis for cyclic equational reasoning. In: Jhala, R., Dillig, I. (eds.) PLDI ’22: 43Rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, San Diego, CA, USA, June 13 - 17, 2022, pp. 395–409. ACM. https://doi.org/10.1145/3519939.3523731 (2022)

  17. Wirth, C. -P.: Descente infinie + Deduction. Logic Journal of the IGPL 12(1), 1–96 (2004). https://doi.org/10.1093/jigpal/12.1.1

    Article  MathSciNet  MATH  Google Scholar 

  18. Stratulat, S.: A Unified View of Induction Reasoning for First-Order Logic. In: Voronkov, A. (ed.) Turing-100 (The Alan Turing Centenary Conference). EPic Series, vol. 10, pp. 326–352. Easychair. https://doi.org/10.29007/nsx4 (2012)

  19. Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998). https://doi.org/10.1017/CBO9781139172752

    Book  MATH  Google Scholar 

  20. Contejean, E., Courtieu, P., Forest, J., Pons, O., Urbain, X.: Certification of automated termination proofs. Frontiers of Combining Systems, 148–162. https://doi.org/10.1007/978-3-540-74621-8_10 (2007)

  21. Contejean, E., Paskevich, A., Urbain, X., Courtieu, P., Pons, O., Forest, J.: A3PAT, an approach for certified automated termination proofs. In: Gallagher, J.P., Voigtländer, J. (eds.) PEPM - Proceedings of the 2010 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2010, Madrid, Spain, pp. 63–72. ACM. https://doi.org/10.1145/1706356.1706370 (2010)

  22. Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic. Lecture Notes in Computer Science, vol. 2283. Springer, New York (2002). https://doi.org/10.1007/3-540-45949-9

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sorin Stratulat.

Ethics declarations

Conflict of Interests

The author declares that there are no funding and/or conflicts of interests/competing interests that are relevant to the content of this article.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix : A: The Coq proof of F_0 in the main lemma

intros. simpl. intros. rename H into Hind.

(* instantiate y from Q(x,y) *) inversionH1 as [|z]. - (* Q(x,0) *) rewrite \({\leftarrow }\) H. apply q1. - (* Q(x,s(z)) *) apply q2. split.

(* induction step for Q(x,z) *) -- apply (Hind F_0).

--- simpl. left. trivial.

--- rewrite \({\leftarrow }\) H2. unfold snd. unfold F_4. unfold F_0. rewrite_model. abstract solve_rpo_mul.

--- trivial.

--- trivial. (* instantiate x from P(x) *) --rewrite\({\leftarrow }\) H2 inHind. rewrite \({\leftarrow }\) H2 inH1. clearH2 y. inversionH0 as [|y].

---rewrite\({\leftarrow }\) H2. apply p1.

---applyp2. rewrite\({\leftarrow }\) H3in H0. (* instantiate P(s(y)) *)

inversion H0.

+ apply zero_different_from_succ in H4. contradiction.

+ rewrite H4.

++ assert (Q y yPy). (* induction step for Q y y /∖ P y *)

apply (Hind F_4).

+++ simpl. right. left. trivial.

+++ unfold snd. unfold F_4. unfold F_0. rewrite \({\leftarrow }\) H3. rewrite_model. abstract solve_rpo_mul.

+++ trivial.

+++ trivial.

+++ trivial.

+++ destruct H6. split; trivial. apply q2; trivial. split; trivial.

Appendix : B: The missing proofs from Section ??

1.1 B.1: Proof of Lemma 1

Proof

Let us assume two adjacent rb-paths \(r_{1} \rightarrow b_{1}\) and \(r_{2} \rightarrow b_{2}\) in a cycle such that r2 is the companion of b1, W(r1) >mulW(c(b1)), and W(r2) >mulW(c(b2)). We will try to prove that W(r1) >mulW(c(b2)).

Since the roots/buds are repeated infinitely along the cycle, none of their weights should be empty. If, by contradiction, we assume that a weight is empty, there exists an rb-path \(r\rightarrow b\) in the cycle such that W(r) is empty. But there is no <mul such that W(r) > W(c(b)).

We show that there should be a trace along the path [r1,…,b1,r2,…,b2]. Since W(c(b2)) is not empty, let l3W(c(b2)). By the definition of <mul, there exists an IAA l2W(r2) such that l2 > l3 or l2 = l3. Similar reasoning can be applied to l2 as we have done for l3 to conclude that there is l1W(r1) such that l1 > l2 or l1 = l2. Hence, the trace is l1,…,l2,l2,…,l3.

Finally, we check whether W(r1) >mulW(c(b2)). As previously, for each IAA l3W(c(b2)) there is an IAA l2W(r2) such that l2 > l3 or l2 = l3, and an IAA l1W(r1) such that l1 > l2 or l1 = l2. We perform a case analysis on the comparison results between l2 and l3, as well as l1 and l2:

  • if l2 > l3 and l1 > l2, then l1 > l3;

  • if l2 > l3 and l1 = l2, then l1 > l3;

  • if l2 = l3 and l1 > l2, then l1 > l3;

  • if l2 = l3 and l1 = l2, then l1 = l3.

We show that W(r1) >mulW(c(b2)) when there is at least one l3W(c(b2)) for which there exists l1W(r1) such that l1 > l3. After the pairwise deletion of equal IAAs from W(r1) and W(c(b2)), resulting W(r1) and W(c(b2)), we have that l3W(c(b2)), l1W(r1) and l1 > l3. By the definition of >mul, we have that W(r1) >mulW(c(b2)), because the same reasoning can be done for any other IAA from W(c(b2)) as for l3.

If for all l3W(c(b2)), there exists l1W(r1) such that l3 = l1, then there exists l2W(r2) such that l1 = l2 and l2 = l3. Since W(r2) >mulW(c(b2)), after the pairwise deletion of equal IAAs from W(r2) and W(c(b2)), resulting W(r2) and W(c(b2)), we have that W(c(b2)) is empty and W(r2) is not empty. Similarly, since W(r1) >mulW(c(b1)), we have that W(c(b1)) is empty and W(r1) is not empty. We conclude that after the pairwise deletion of equal IAAs from W(r1) and W(c(b2)), resulting W(r1) and W(c(b2)), we have that W(c(b2)) is empty and W(r1) is not empty. Hence W(r1) >mulW(c(b2)), as required. □

1.2 B.2: Proof of Theorem 1

Proof

Let be a pre-proof whose normalized pre-proof is denoted by \(\mathcal {P}\) and for which every rb-path \(r\rightarrow b\) belonging to a cycle satisfies W(r) >mulW(c(b)). Let also p0 be an infinite path in \(\mathcal {P}\). Let p be the infinite path from \(\mathcal {P}\) built from p0 by duplicating the nodes as shown during the normalization process from Section ??. By construction, the path p is built starting from some point only from the concatenations of rb-paths from cycles from \(\mathcal {P}\). Since the number of roots is finite in \(\mathcal {P}\), there is a root r in p that occurs infinitely often in p. Hence, there is an infinite sub-path p of p of the form [r,…,r,…] which can be represented as the infinite concatenation of finite sub-paths [r,…,b], where r is the companion of b and r occurs only once in each sub-path. Each such sub-path is built from a finite number of concatenations of rb-paths of the form [r1,…,b1] for which W(r1) >mulW(c(b1)). Since <mul is transitive, by Lemma 1, we have that W(r) >mulW(c(b)) for each sub-path [r,…,r,…,b]. Since W(r) is not empty, for the same reasons as presented in the proof of Lemma 1, there is a trace following \(p^{\prime }\).

By contradiction, we assume that the number of progress points in all the traces along \(p^{\prime }\) is finite. Since the cardinality of the weights for each root of the trace along \(p^{\prime }\) is finite, there is a sub-path [r,…,b] defined as above whose traces have no progress points and satisfies W(r) >mulW(c(b)). After the pairwise deletion of equal IAAs from W(r) and W(c(b)), to get W(r) and W(c(b)), we perform a case analysis by considering whether W(c(b)) is empty or not.

  • W(c(b)) is not empty. By the definition of >mul, there is an IAA lW(c(b)) for which there is an IAA \(l^{\prime }\in W(r)'\) such that \(l^{\prime }>l\). Hence, the trace leading \(l^{\prime }\) to l has at least one progress point. Contradiction.

  • W(c(b)) is empty. By similar reasoning as given in the proof of Lemma 1, the cardinality of W(r) is greater than that of W(c(b)). But W(r) = W(c(b)) because r is the companion of b. Contradiction, again.

Since there is a trace along \(p^{\prime }\) that has an infinite number of progress points, p has also an infinitely progressing trace starting from some point. On the other hand, p0 can be built from p by deleting the extra nodes added during the normalization process, so it has an infinitely progressing trace starting from some point.

We conclude that \(\mathcal {P}\) satisfies the global trace condition. □

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Stratulat, S. Mechanical certification of FOLID cyclic proofs. Ann Math Artif Intell 91, 651–673 (2023). https://doi.org/10.1007/s10472-023-09832-7

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10472-023-09832-7

Keywords

Mathematics Subject Classification (2010)

Navigation