Abstract
Both complete definition of functions by equations and determinism (i.e., evaluation to a unique result), are fundamental correctness properties of equational programs. But for expressive functional languages supporting conditional equations, types and subtypes and rewriting modulo axioms, proof methods for verifying such properties under general conditions are currently quite limited. This work proposes a hierarchical proof methodology where both properties are simultaneously verified in a hierarchical manner under termination assumptions.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
If \(B = B_{0} \uplus U\), with \(B_{0}\) associativity and/or commutativity axioms, and U identity axioms, the B-preregularity notion can be broadened by requiring only that: (i) \(\varSigma \) is \(B_{0}\)-preregular in the standard sense that \( ls (u\rho )= ls (v\rho )\) for all \(u=v \in B_{0}\) and substitutions \(\rho \); and (ii) the axioms U oriented as rules \(\vec {U}\) are sort-decreasing in the sense explained below.
- 2.
Furthermore, for any f that is commutative we always assume a top typing \(f: s\; s \rightarrow s_{0}\) with all other typings of the form \(f: s'\; s' \rightarrow s'_{0}\), with \(s \le s'\), \( s_{0} \le s'_{0}\). Regarding the absence of unit element axioms, they are precisely the equations U, that will be used as rules \(\vec {U}\) (see, e.g., Example 1). The point is that, for both confluence and termination purposes, if \(\vec {\mathcal {G}}\) has axioms \(B \uplus U\), with B associative and/or commutative axioms and U unit element axioms, then the axioms U can be eliminated by turning them into rules \(\vec {U}\) thanks to the semantics-preserving theory transformation \(\vec {\mathcal {G}} \mapsto \vec {\mathcal {G}}_{U}\) defined in [10], so that the axioms of the semantically equivalent \(\vec {\mathcal {G}}_{U}\) are just B. Therefore, Our results apply as well to theories \(\vec {\mathcal {G}}\) with axioms \(B \uplus U\) such that \(\vec {\mathcal {G}}_{U}\) has the properties (i)–(vi) listed in what follows.
- 3.
Since axioms B are primarily used to specify constructor data structures, in actual practice, limiting axioms for defined symbols to just commutativity is a mild restriction. Furthermore, this restriction can be removed a posteriori in the following sense. After \(\vec {\mathcal {E}}\) has been shown ground convergent and sufficiently complete, if we can prove by inductive theorem proving that the initial algebra \(T_{\mathcal {E}}\) does satisfy additional associativity and/or commutativity axioms for some binary \(f \in \varDelta \), then we can add to \(\vec {\mathcal {E}}\): (a) those extra axioms for f, and (b) the A-, resp. AC-extensions (see [40]) of the rules \(\vec {E}_{f}\) in the sense of (iv) below (to ensure B-coherence). One can then show that the theory thus extended is also ground convergent and sufficiently complete if its rules remain operationally terminating modulo the extended axioms. For example, in the MULTISET-ALGEBRA module of Example 1, we can prove the associativity and commutativity of the intersection operator \(\_\cap \_\) as inductive theorems and then add those properties as axioms of \(\_\cap \_\) (the AC-extensions of \(\vec {E}_{\cap }\) do not need to be added explicitly: they are added automatically by Maude).
- 4.
For a detailed definition of CCPs in an order-sorted setting see [11].
- 5.
The ground joinability of the CCP \(\varphi \Rightarrow t = t'\) is normally stated as the joinability \(t\alpha \downarrow t' \alpha \) for all ground substitution \(\alpha \) such that \(\mathcal {E}_{0} \vdash \varphi \alpha \). However, since, by ground convergence and sufficient completeness of \(\vec {\mathcal {E}}_{0}\) and the sort of all variables being in S, any such \(\alpha \) can be normalized to a ground constructor substitution \(\alpha !_{\vec {\mathcal {E}}_{0}}\), it can easily be shown that the CCP is ground joinable iff the property \(t \downarrow t' \mid \varphi \) holds.
References
Aoto, T., Toyama, Y.: Ground confluence prover based on rewriting induction. In: 1st International Conference on Formal Structures for Computation and Deduction, FSCD 2016. LIPIcs, vol. 52, pp. 33:1–33:12. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2016)
Aoto, T., Yoshida, J., Toyama, Y.: Proving confluence of term rewriting systems automatically. In: Treinen, R. (ed.) RTA 2009. LNCS, vol. 5595, pp. 93–102. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02348-4_7
Becker, K.: Proving ground confluence and inductive validity in constructor based equational specifications. In: Gaudel, M.-C., Jouannaud, J.-P. (eds.) CAAP 1993. LNCS, vol. 668, pp. 46–60. Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-56610-4_55
Bouhoula, A.: Simultaneous checking of completeness and ground confluence for algebraic specifications. ACM Trans. Comput. Log. 10(3), 20:1–20:33 (2009)
Bouhoula, A., Jouannaud, J.P.: Automata-driven automated induction. Inf. Comput. 169(1), 1–22 (2001)
Bouhoula, A., Rusinowitch, M.: Implicit induction in conditional theories. J. Autom. Reason. 14(2), 189–235 (1995). https://doi.org/10.1007/BF00881856
Clavel, M., et al.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71999-1
Comon, H.: Sufficient completeness, term rewriting systems and “anti-unification’’. In: Siekmann, J.H. (ed.) CADE 1986. LNCS, vol. 230, pp. 128–140. Springer, Heidelberg (1986). https://doi.org/10.1007/3-540-16780-3_85
Dershowitz, N., Jouannaud, J.P.: Rewrite systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, pp. 243–320. North-Holland (1990)
Durán, F., Lucas, S., Meseguer, J.: Termination modulo combinations of equational theories. In: Ghilardi, S., Sebastiani, R. (eds.) FroCoS 2009. LNCS (LNAI), vol. 5749, pp. 246–262. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04222-5_15
Durán, F., Meseguer, J.: On the Church-Rosser and coherence properties of conditional order-sorted rewrite theories. J. Algebraic Log. Program. 81, 816–850 (2012)
Durán, F., Meseguer, J., Rocha, C.: Ground confluence of order-sorted conditional specifications modulo axioms. J. Log. Algebraic Methods Program. 111, 100513 (2020)
Escobar, S., Sasse, R., Meseguer, J.: Folding variant narrowing and optimal variant termination. J. Algebraic Log. Program. 81, 898–928 (2012)
Fribourg, L.: A strong restriction of the inductive completion procedure. J. Symb. Comput. 8(3), 253–276 (1989)
Futatsugi, K., Diaconescu, R.: CafeOBJ Report. World Scientific, Singapore (1998)
Ganzinger, H.: Ground term confluence in parametric conditional equational specifications. In: Brandenburg, F.J., Vidal-Naquet, G., Wirsing, M. (eds.) STACS 1987. LNCS, vol. 247, pp. 286–298. Springer, Heidelberg (1987). https://doi.org/10.1007/BFb0039613
Göbel, R.: Ground confluence. In: Lescanne, P. (ed.) RTA 1987. LNCS, vol. 256, pp. 156–167. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-17220-3_14
Goguen, J., Meseguer, J.: Order-sorted algebra I: equational deduction for multiple inheritance, overloading, exceptions and partial operations. Theoret. Comput. Sci. 105, 217–273 (1992)
Goguen, J., Winkler, T., Meseguer, J., Futatsugi, K., Jouannaud, J.P.: Introducing OBJ. In: Software Engineering with OBJ: Algebraic Specification in Action, pp. 3–167. Kluwer (2000)
Gutiérrez, R., Meseguer, J., Skeirik, S.: The Maude termination assistant. In: Pre-proceedings of WRLA (2018)
Gutiérrez, R., Meseguer, J., Rocha, C.: Order-sorted equality enrichments modulo axioms. Sci. Comput. Program. 99, 235–261 (2015)
Guttag, J.V., Horning, J.J.: The algebraic specification of abstract data types. Acta Inform. 10, 27–52 (1978)
Hendrix, J., Clavel, M., Meseguer, J.: A sufficient completeness reasoning tool for partial specifications. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 165–174. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-32033-3_13
Hendrix, J., Meseguer, J.: On the completeness of context-sensitive order-sorted specifications. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 229–245. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73449-9_18
Hendrix, J., Meseguer, J., Ohsaki, H.: A sufficient completeness checker for linear order-sorted specifications modulo axioms. In: Furbach, U., Shankar, N. (eds.) IJCAR 2006. LNCS (LNAI), vol. 4130, pp. 151–155. Springer, Heidelberg (2006). https://doi.org/10.1007/11814771_14
Hirokawa, N., Klein, D.: Saigawa: a confluence tool. In: Proceedings of 1st International Workshop on Confluence (IWC 2012), p. 57 (2011). http://cl-informatik.uibk.ac.at/iwc/iwc2012.pdf
Jouannaud, J.P., Kounalis, E.: Automatic proofs by induction in theories without constructors. Inf. Comput. 82(1), 1–33 (1989)
Kapur, D., Narendran, P., Otto, F.: On ground-confluence of term rewriting systems. Inf. Comput. 86(1), 14–31 (1990)
Kapur, D., Narendran, P., Rosenkrantz, D.J., Zhang, H.: Sufficient-completeness, ground-reducibility and their complexity. Int. J. Biometeorol. 36(4), 311–350 (1991). https://doi.org/10.1007/BF01212959
Kikuchi, K., Aoto, T.: Simple derivation systems for proving sufficient completeness of non-terminating term rewriting systems. In: 41st IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2021. LIPIcs, vol. 213, pp. 49:1–49:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021)
Kirchner, C.: Order-sorted equational unification. Technical report 954. INRIA Lorraine & LORIA, Nancy, France, December 1988
Lucas, S., Meseguer, J.: Normal forms and normal theories in conditional rewriting. J. Log. Algebr. Meth. Program. 85(1), 67–97 (2016)
Meseguer, J.: Checking sufficient completeness by inductive theorem proving. In: In: Bae, K. (ed.) WRLA 2022. LNCS, vol. 13252, pp. 171–190. Springer, Cham (2022)
Meseguer, J., Skeirik, S.: Inductive reasoning with equality predicates, contextual rewriting and variant-based simplification. In: Escobar, S., Martí-Oliet, N. (eds.) WRLA 2020. LNCS, vol. 12328, pp. 114–135. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-63595-4_7
Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theoret. Comput. Sci. 96(1), 73–155 (1992)
Meseguer, J.: Membership algebra as a logical framework for equational specification. In: Presicce, F.P. (ed.) WADT 1997. LNCS, vol. 1376, pp. 18–61. Springer, Heidelberg (1998). https://doi.org/10.1007/3-540-64299-4_26
Meseguer, J.: Variant-based satisfiability in initial algebras. Sci. Comput. Program. 154, 3–41 (2018)
Meseguer, J., Skeirik, S.: Equational formulas and pattern operations in initial order-sorted algebras. Formal Aspects Comput. 29(3), 423–452 (2017). https://doi.org/10.1007/s00165-017-0415-5
Nakamura, M., Ogata, K., Futatsugi, K.: Incremental proofs of termination, confluence and sufficient completeness of OBJ specifications. In: Iida, S., Meseguer, J., Ogata, K. (eds.) Specification, Algebra, and Software. LNCS, vol. 8373, pp. 92–109. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54624-2_5
Peterson, G.E., Stickel, M.E.: Complete sets of reductions for some equational theories. J. Assoc. Comput. Mach. 28(2), 233–264 (1981)
Plaisted, D.A.: A logic for conditional term rewriting systems. In: Kaplan, S., Jouannaud, J.-P. (eds.) CTRS 1987. LNCS, vol. 308, pp. 212–227. Springer, Heidelberg (1988). https://doi.org/10.1007/3-540-19242-5_16
Shiraishi, T., Kikuchi, K., Aoto, T.: A proof method for local sufficient completeness of term rewriting systems. In: Cerone, A., Ölveczky, P.C. (eds.) ICTAC 2021. LNCS, vol. 12819, pp. 386–404. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-85315-0_22
Sternagel, T., Middeldorp, A.: Conditional confluence (system description). In: Dowek, G. (ed.) RTA 2014. LNCS, vol. 8560, pp. 456–465. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08918-8_31
Thiel, J.J.: Stop losing sleep over incomplete data type specification. In: Kennedy, K. (ed.) Proceedings of Eleventh Symposium on Principles of Programming Languages. Association for Computing Machinery (1984)
Zankl, H., Felgenhauer, B., Middeldorp, A.: CSI – a confluence tool. In: Bjørner, N., Sofronie-Stokkermans, V. (eds.) CADE 2011. LNCS (LNAI), vol. 6803, pp. 499–505. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22438-6_38
Zhang, H., Remy, J.-L.: Contextual rewriting. In: Jouannaud, J.-P. (ed.) RTA 1985. LNCS, vol. 202, pp. 46–62. Springer, Heidelberg (1985). https://doi.org/10.1007/3-540-15976-2_2
Acknowledgements
We cordially thank the anonymous referees for their very helpful suggestions, that have helped us improve the manuscript.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
A Proofs
A Proofs
Proof of the Soundness Theorem 2
Proof
For each inference rule we must show that if the premises of the rule hold, then the conclusion follows. We do so for each inference rule. Recall that in all applications, i.e., to prove either a ground joinability or a ground reducibility property in \(\vec {\mathcal {E}}^{\varDelta }\), the meaning of \(p \mid \varphi \) holding is that it does so for all its ground constructor substitutions \(\rho \) such that \(\varphi \rho \) holds in \(\vec {\mathcal {E}}_{0}\).
Shared Inference Rules. Except for rule GN, all these rules correspond to equivalences. That is, the premises hold iff the conclusion does. Let us consider each inference rule.
-
NA. For any ground constructor substitution \(\rho \), at position p in \(\varphi \) the term \(f(\vec {v} \rho )\) has constructor term arguments. Therefore, by sufficient completeness of \(\vec {\mathcal {E}}_{0}\), there is a rewrite rule in \(\vec {E}_{0_{f}}\), say rule [i] whose lefthand side \(f(\vec {u}_{i})\) is B-matched by \(f(\vec {v} \rho )\) with a ground constructor substitution \(\gamma \), i.e., \(f(\vec {v}) \rho =_{B} f(u_{i})\gamma \), and whose condition instance \(\varGamma _{i} \gamma \) holds in \(\vec {\mathcal {E}}_{0}\). Therefore, we can rewrite \(f(\vec {v} \rho )\) to the instance \(r_{i} \gamma \) of its righthand side. Therefore, there is a B-unifier \(\alpha _{i,j}\) of the equation \(f(\vec {v}) = f(u_{i})\) and a ground constructor substitution \(\delta \) such that \(\rho \uplus \gamma = \alpha _{i,j} \delta \). Therefore \(\varphi \rho \) holds in \(\vec {\mathcal {E}}_{0}\) iff \((\varGamma _{i} \cup \varphi [r_{i}]_{p}) \alpha _{i,j} \delta \) does, and of course \(u \rho =_{B} u \alpha _{i,j} \delta \). In brief, the equivalence summarizes symbolically (by narrowing) all the possible ways in which all ground constructor instances of condition \(\varphi \) can be rewritten in one step at position p.
-
UN. If \((\varphi \wedge \psi ) \rho \) holds in \(\vec {\mathcal {E}}_{0}\), then \(\psi \rho \) does, i.e., \(\rho \) is a \(U \cup E_{0} \cup B_{0}\)-unifier of \(\psi \). Therefore, there must be a \(U \cup E_{0} \cup B_{0}\)-unifier \(\theta \) of \(\psi \) and a ground constructor substitution \(\gamma \) such that \(\rho =_{U \cup E_{0} \cup B_{0}} \theta \gamma \). The equivalence follows naturally from this fact.
-
ES. The main result about equality predicates in [21] is that for any Boolean formula \(\varphi \) and ground constructor substitution \(\rho \), \(\varphi \rho \) holds in ground convergent \(\vec {\mathcal {E}}_{0}\) iff \(\varphi !_{\mathcal {E}_{0}^{=}} \rho \) does. In particular, this equivalence holds when \(\varphi \) is a conjunction of equalities.
-
CA. The equivalence follows from the definition of a generating set for the sort s of x, since for any ground constructor substitution \(\rho \), \(\rho (x)\) must be such that \(\rho (x) =_{B} v_{i} \gamma \) for some \(v_{i}\) in such a set and ground constructor substitution \(\gamma \).
-
SP. The equivalence between the premises and the conclusion follows from the semantic equivalence \(T_{\varSigma _{0}/E_{0} \cup B_{0}} \models \varphi \Leftrightarrow \bigvee _{i \in I} \psi _{i} \wedge \varphi \), plus the Boolean equivalence \((A \vee B) \Rightarrow C \equiv (A \Rightarrow C) \wedge (B \Rightarrow C)\).
-
GN. This is the only shared rule tat is not an equivalence, i.e., where the premise implies the consequence but need not be equivalent to it. The property \(p' \rho \) must hold (i.e., \(p' \rho \)’s ground reducibility, or \(p' \rho \)’s ground joinability, depending on p) whenever \(\psi \rho \) does. In particular, if \(\varphi \gamma \) holds, then \(\psi \theta \gamma \) does, and therefore \(p' \theta \gamma \) does. That is, \(p' \theta \mid \varphi \) holds. But \(p' \theta =_{B} p\). The result then follows from the fact that for either ground reducibility or ground joinability properties \(q,q'\) such that \(q =_{B} q'\), \(q \mid \varphi \) holds iff \(q' \mid \varphi \) does. This follows in either case from the assumption that the rules \(\vec {U} \cup \vec {E}\) are strictly B-coherent.
-
\(\emptyset \). Since no ground substitution can satisfy \(\bot \), \(u \mid \bot \) holds trivially.
Ground Joinability Inference System. The proof of the constrained version of the ground confluence inference rules in [12] follows easily from that of the unconstrained inference rules in [12]. The soundness of rule JN holds trivially from the very notion of joinability. A proof of soundness for the CR inference rule can be found in [11].
Ground Reducibility Inference System. The only inference rule is RW. Suppose that \(\psi \rho \) holds in \(\vec {\mathcal {E}}_{0}\). Then, \(\varGamma \theta \rho \) does; and by the rule’s assumptions \(f(\vec {v}) \rho \) is reducible, as desired.
This finishes the proof of the Soundness Theorem.\(\Box \)
Proof of Theorem 1
Proof
First of all, note that, considering \(T_{\varSigma }(X)\) and \(T_{\varSigma ^{\varDelta }}(X)\) as sets, i.e., disregarding sorts, we have an inclusion \(T_{\varSigma }(X) \subseteq T_{\varSigma ^{\varDelta }}(X)\). Also, for each \(s \in S\) we have a set equality \(T_{\varSigma _{0},s}(X) = T_{\varSigma ^{\varDelta },s}(X)\). In particular, \(T_{\varSigma } \subseteq T_{\varSigma ^{\varDelta }}\), and \(T_{\varSigma _{0},s} = T_{\varSigma ^{\varDelta },s}\) for each \(s \in S\).
Second, \(\vec {\mathcal {E}}\) and \(\vec {\mathcal {E}}^{\varDelta }\) have the exact same CCP’s. To begin with, in both cases the rules not in \(\vec {\mathcal {E}}_{0}\) are the same, namely \(\vec {E}_{\varDelta }\). Furthermore, in both cases, the only CCP’s that do not come from \(\vec {\mathcal {E}}_{0}\) can be of only two kinds: (i) between a unit rule in \(\vec {U}\) and a rule in \(\vec {E}_{f}\) for some \(f \in \varDelta \), where the unit rule’s lefthand side unifies with a constructor subterm of the lefthand side of one of f’s constructor arguments; or (ii) between two, not necessarily different, rules in \(\vec {E}_{f}\) for some \(f \in \varDelta \). In case (i), the unifier generating the CCP must be a constructor unifier so that the resulting CCP is the same in both \(\vec {\mathcal {E}}\) and \(\vec {\mathcal {E}}^{\varDelta }\), and its condition is a \(\varSigma _{0}\)-condition. In case (ii), the CCP comes from two—not necessarily different, but variable-renamed if \(i = j\) to ensure disjoint variables—rules \([i]: f(\vec {u_{i}}) \rightarrow r_{i} \;\; if \;\; \varGamma _{i}\) and \([j]: f(\vec {u_{j}}) \rightarrow r_{j} \;\; if \;\; \varGamma _{j}\) and its associated order-sorted unifier (in either \(\vec {\mathcal {E}}\) or \(\vec {\mathcal {E}}^{\varDelta }\)) solves the equation \(f(\vec {u_{i}})=f(\vec {u_{j}})\). We claim that the order-sorted unifiers of the equation \(f(\vec {u_{i}})=f(\vec {u_{j}})\) are the same in \(\vec {\mathcal {E}}\) and in \(\vec {\mathcal {E}}^{\varDelta }\). Recall that, by assumption, \(B_{f}\) is either empty or a commutativity axiom. If \(B_{f} = \emptyset \), then \(\alpha \) is a unifier of \(f(\vec {u_{i}})=f(\vec {u_{j}})\) iff it is a unifier of the system of equations \(u_{i,1}=u_{j,1} \wedge \ldots \wedge u_{i,k}=u_{j,k}\), where k is the number of arguments of f. If f is commutative, the only difference is that in \(\vec {\mathcal {E}}\) the axiom \(f(x_{1},x_{2})=f(x_{2},x_{1})\) is such that \(x_{1},x_{2}\) have sort s for \(f: s \; s \rightarrow s_{0}\) the maximal typing of f, whereas in \(\vec {\mathcal {E}}^{\varDelta }\) \(x_{1},x_{2}\) have kind [s]. This, however, makes no difference, since, by the Decomposition inference rule for a commutative symbol of order-sorted unification (see [31] and [7] §15.1), \(\alpha \) is a unifier of \(f(u_{i,1},u_{i,2})=f(u_{j,1},u_{j,2})\) iff it is a unifier of the disjunction of systems of equations \((u_{i,1}=u_{j,1} \wedge u_{i,2}=u_{j,2}) \vee (u_{i,1}=u_{j,2} \wedge u_{i,2}=u_{j,1})\). Therefore, the CCPs are the same and the unifiers are constructor unifiers, so that the CCP’s condition is a \(\varSigma _{0}\)-condition.
Third, for ground terms we have proper inclusions of rewrite relations,
The first inclusion is proper because there are terms in \( T_{\varSigma }{\setminus } T_{\varSigma _{0}}\) that can be rewritten with \(\rightarrow _{\vec {\mathcal {E}}^{\varDelta }}\). The second inclusion is proper because, by the definition of \(\varSigma ^{\varDelta }\), a rule in the theory \(\vec {\mathcal {E}}_{\varDelta }\), say, \([i]: f(\vec {u_{i}}) \rightarrow r_{i} \;\; if \;\; \varGamma _{i}\), can, only be enabled to rewrite a term \(f(\vec {v})\) if the terms \(\vec {v}\) are \(\varSigma _{0}\)-terms. That is, \(\rightarrow _{\vec {\mathcal {E}}^{\varDelta }}\) performs rewritings exactly like \(\rightarrow _{\vec {\mathcal {E}}}\), but only in a “weakly innermost” manner (“weakly” because the \(\varSigma _{0}\)-terms \(\vec {v}\) need not be constructors).
Fourth, for any \(t \in T_{\varSigma }\), \(t !_{\vec {\mathcal {E}}^{\varDelta }}\) is a constructor term. Suppose not, i.e., there is a \(t \in T_{\varSigma }\) such that \(t!_{\vec {\mathcal {E}}^{\varDelta }}\) is not a constructor term. But since we have an inclusion of rewrite relations \(\rightarrow _{\vec {\mathcal {E}}_{0}} \; \subset \; \rightarrow _{\vec {\mathcal {E}}^{\varDelta }}\) and \(\vec {\mathcal {E}}_{0}\) is sufficiently complete, this means that \(t!_{\vec {\mathcal {E}}^{\varDelta }}\) must contain a subterm of minimal size of the form \(f(\vec {v})\) with \(f \in \varDelta \) and the terms \(\vec {v}\) constructor terms. But this is impossible, since all such terms have been proved \(\vec {\mathcal {E}}^{\varDelta }\)-reducible.
Fifth, for any \(t \in T_{\varSigma }\), if \(t \rightarrow ^{*}_{\vec {\mathcal {E}}}v\) and v is in \(\vec {\mathcal {E}}\)-canonical form, then v is a constructor term. This follows from the containments of rewrite relations \(\rightarrow _{\vec {\mathcal {E}}_{0}} \; \subset \; \rightarrow _{\vec {\mathcal {E}}^{\varDelta }} \; \subset \; \rightarrow _{\vec {\mathcal {E}}}\), the fourth property above, and the sufficient completeness of \(\vec {\mathcal {E}}_{0}\).
Finally, we are now ready to prove that \(\vec {\mathcal {E}}\) is ground convergent. Note that, by the fifth property above, \(\vec {\mathcal {E}}\) is then also sufficiently complete with respect to \(\varOmega \). Since we have the containment of ground rewrite relations \(\rightarrow _{\vec {\mathcal {E}}^{\varDelta }} \; \subset \; \rightarrow _{\vec {\mathcal {E}}}\), the ground convergence of \(\vec {\mathcal {E}}\) will follow from the fourth and fifth properties above if we can prove that for each \(t \in T_{\varSigma }\) and each ground constructor term v such that \(t \rightarrow ^{*}_{\vec {\mathcal {E}}}v\) we have \(v =_{B} t!_{\vec {\mathcal {E}}^{\varDelta }}\).
Lemma 1
For each \(t \in T_{\varSigma }\), if \(t \rightarrow ^{*}_{\vec {\mathcal {E}}}u\) and u is a constructor term, then \(u =_{B_{\varOmega }} t !_{\vec {\mathcal {E}}^{\varDelta }}\).
Proof
Suppose not. Let us choose a term \(t \in T_{\varSigma }\) such that: (i) \(t \rightarrow ^{*}_{\vec {\mathcal {E}}} u\), u is a constructor term, and \(u \not =_{B_{\varOmega }} t !_{\vec {\mathcal {E}}^{\varDelta }}\), and (ii) for \(\succ \) the RPO order modulo proving \(\vec {\mathcal {E}}\) operationally terminating, t is a minimal element among the set of terms in \(T_{\varSigma }\) such that (i) holds. This can only happen if t is not a constructor term. Therefore, we have \(t \rightarrow _{\vec {\mathcal {E}}} t' \rightarrow ^{*}_{\vec {\mathcal {E}}} u\). Note that \(t \succ t'\). Therefore, by the minimality assumption for t, we must have \(u =_{B_{\varOmega }} t' !_{\vec {\mathcal {E}}^{\varDelta }}\). Let us now consider the one-step rewrite \(t \rightarrow _{\vec {\mathcal {E}}} t'\). This means that there is a rule \(f(\vec {u}) \rightarrow r \;\; if \;\; \varGamma \) in \(\vec {U} \cup \vec {E}\) with the \(\vec {u}\) constructor terms (rules in \(\vec {U}\), though unconditional, also have this form), a ground substitution \(\alpha \) and a term position p such that \(t|_{p} =_{B} f(\vec {u}) \alpha \), \(\varGamma \alpha \) holds in \(\vec {\mathcal {E}}\), and \(t' = t[r \alpha ]_{p}\). Since \(\succ \) is a B-compatible RPO order and all rules are assumed \(\succ \)-operationally-terminating, for each equality \(w = w'\) in \(\varGamma \) we must have \(t \succ w \alpha , w' \alpha \). Therefore, by the minimality hypothesis on t, we must have \((w \alpha )!_{\vec {\mathcal {E}}^{\varDelta }} =_{B_{\varOmega }} (w \alpha )!_{\vec {\mathcal {E}}} =_{B_{\varOmega }} (w' \alpha )!_{\vec {\mathcal {E}}} =_{B_{\varOmega }} (w' \alpha ) !_{\vec {\mathcal {E}}^{\varDelta }}\), so that \(\varGamma \alpha \) also holds in \(\vec {\mathcal {E}}^{\varDelta }\) and, for the same reason, \(\varGamma \rho \) holds in \(\vec {\mathcal {E}}^{\varDelta }\) for the constructor substitution \(\rho = \alpha !_{\vec {\mathcal {E}}^{\varDelta }}\) obtained by normalizing each \(\alpha (x)\) with x in the domain of \(\alpha \). Therefore, we have a rewrite \( t[f(\vec {u}) \rho ]_{p} \rightarrow _{\vec {\mathcal {E}}^{\varDelta }} t[r \rho ]_{p}\). Furthermore, \(t =_{B} t[f(\vec {u}) \alpha ]_{p}\), and we have rewrite sequences \(t[f(\vec {u}) \alpha ]_{p}\rightarrow ^{*}_{\vec {\mathcal {E}}^{\varDelta }} t[f(\vec {u}) \rho ]_{p}\), and \(t[r \alpha ]_{p}\rightarrow ^{*}_{\vec {\mathcal {E}}^{\varDelta }} t[r \rho ]_{p}\), and since \(t \succ t' = t[r \alpha ]_{p}\), we must have \(u =_{B_{\varOmega }} t[r \rho ]_{p}!_{\vec {\mathcal {E}}^{\varDelta }}\). In summary, we have the sequence of rewrites in \(\vec {\mathcal {E}}^{\varDelta }\),
with \(u =_{B_{\varOmega }} t[r \rho ]_{p}!_{\vec {\mathcal {E}}^{\varDelta }}\). But by \(t =_{B} t[f(\vec {u}) \alpha ]_{p}\) and the convergence of \(\vec {\mathcal {E}}^{\varDelta }\) we also must have \(t !_{\vec {\mathcal {E}}^{\varDelta }} =_{B_{\varOmega }} t[r \rho ]_{p}!_{\vec {\mathcal {E}}^{\varDelta }} =_{B_{\varOmega }} u\), contradicting the assumption \(u \not =_{B_{\varOmega }} t !_{\vec {\mathcal {E}}^{\varDelta }}\), as desired.\(\Box \)
This finishes the proof of Theorem 1.\(\Box \)
Rights and permissions
Copyright information
© 2022 Springer Nature Switzerland AG
About this paper
Cite this paper
Meseguer, J., Skeirik, S. (2022). On Ground Convergence and Completeness of Conditional Equational Program Hierarchies. In: Bae, K. (eds) Rewriting Logic and Its Applications. WRLA 2022. Lecture Notes in Computer Science, vol 13252. Springer, Cham. https://doi.org/10.1007/978-3-031-12441-9_10
Download citation
DOI: https://doi.org/10.1007/978-3-031-12441-9_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-12440-2
Online ISBN: 978-3-031-12441-9
eBook Packages: Computer ScienceComputer Science (R0)