Hostname: page-component-77f85d65b8-lfk5g Total loading time: 0 Render date: 2026-04-19T00:56:30.298Z Has data issue: false hasContentIssue false

Checking equivalence in a non-strict language

Part of: OOPSLA 22

Published online by Cambridge University Press:  15 September 2025

JOHN CHARLES KOLESAR
Affiliation:
Yale University, New Haven, CT06520, USA (e-mail: john.kolesar@yale.edu)
RUZICA PISKAC
Affiliation:
Yale University, New Haven, CT06520, USA (e-mail: ruzica.piskac@yale.edu)
WILLIAM TRIEST HALLAHAN
Affiliation:
Binghamton University, Binghamton, NY13902, USA (e-mail: whallahan@binghamton.edu)
Rights & Permissions [Opens in a new window]

Abstract

Program equivalence checking is the task of confirming that two programs have the same behavior on corresponding inputs. We develop a calculus based on symbolic execution and coinduction to check the equivalence of programs in a non-strict functional language. Additionally, we show that our calculus can be used to derive counterexamples for pairs of inequivalent programs, including counterexamples that arise from non-termination. We describe a fully automated approach for finding both equivalence proofs and counterexamples. Our implementation, nebula, proves equivalences of programs written in Haskell. We demonstrate nebula’s practical effectiveness at both proving equivalence and producing counterexamples automatically by applying nebula to existing benchmark properties.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Fig. 1: Subtraction for natural numbers.

Figure 1

Fig. 2: Zeno Theorem 33.

Figure 2

Fig. 3: Overview of how nebula proves . Gray arrows denote symbolic execution, and blue arrows denote coinduction.

Figure 3

Fig. 4: Zeno Theorem 1.

Figure 4

Fig. 5: Overview of how nebula proves . Gray arrows denote symbolic execution, blue arrows denote coinduction, and orange dashed arrows denote lemma generation or usage.

Figure 5

Fig. 6: The language considered by nebula.

Figure 6

Fig. 7: Reduction rules.

Figure 7

Fig. 8: Zeno Theorem 23.

Figure 8

Fig. 9: Approximation definition.

Figure 9

Fig. 10: Syntactic equivalence and equivalence based on splitting SWHNF expressions.

Figure 10

Fig. 11: Reduction equivalence rules.

Figure 11

Fig. 12: Unguarded and guarded coinduction.

Figure 12

Fig. 13: Proof rules for lemmas.

Figure 13

Fig. 14: An unsound use of lemmas that causes coinduction to prove incorrectly that a terminating program and a non-terminating program are equivalent.

Figure 14

Fig. 15: Counterexample rules.

Figure 15

Fig. 16: The function and Zeno Theorem 4.

Figure 16

Fig. 17: Computable approximation.

Figure 17

Algorithm 1: Verification algorithm without lemmas.

Figure 18

Fig. 18: Symbolic store synchronization.

Figure 19

Fig. 19: Rules for lemma introduction.

Figure 20

Fig. 20: Evaluation for symbolic functions.

Figure 21

Fig. 21: Zeno Theorem 43.

Figure 22

Fig. 22: The and functions.

Figure 23

Table 1: Evaluation results.

Figure 24

Fig. 23: The function.

Figure 25

Fig. 24: The function and Zeno Theorem 52.

Figure 26

Fig. 25: Modified Zeno Theorem 4.

Supplementary material: File

Charles Kolesar et al. supplementary material 1

Charles Kolesar et al. supplementary material
Download Charles Kolesar et al. supplementary material 1(File)
File 847.6 KB
Supplementary material: File

Charles Kolesar et al. supplementary material 2

Charles Kolesar et al. supplementary material
Download Charles Kolesar et al. supplementary material 2(File)
File 612 Bytes
Submit a response

Discussions

No Discussions have been published for this article.