Coinduction in Uniform: Foundations for Corecursive Proof Search with Horn Clauses
Abstract
We establish prooftheoretic, constructive and coalgebraic foundations for proof search in coinductive Horn clause theories. Operational semantics of coinductive Horn clause resolution is cast in terms of coinductive uniform proofs; its constructive content is exposed via soundness relative to an intuitionistic firstorder logic with recursion controlled by the later modality; and soundness of both proof systems is proven relative to a novel coalgebraic description of complete Herbrand models.
Keywords
Horn clause logic Coinduction Uniform proofs Intuitionistic logic Coalgebra Fibrations Löb modality1 Introduction
Horn clause logic is a Turing complete and constructive fragment of firstorder logic, that plays a central role in verification [22], automated theorem proving [52, 53, 57] and type inference. Examples of the latter can be traced from the HindleyMilner type inference algorithm [55, 73], to more recent uses of Horn clauses in Haskell type classes [26, 51] and in refinement types [28, 43]. Its popularity can be attributed to wellunderstood fixed point semantics and an efficient semidecidable resolution procedure for automated proof search.
The need for coinductive semantics of Horn clauses arises in several scenarios: the Horn clause theory may explicitly define a coinductive data structure or a coinductive relation. However, it may also happen that a Horn clause theory, which is not explicitly intended as coinductive, nevertheless gives rise to infinite inference by resolution and has an interesting coinductive model. This commonly happens in type inference. We will illustrate all these cases by means of examples.
Examples of greatest (complete) Herbrand models for Horn clauses \(\gamma _{1}\mathbf{,}\) \(\gamma _{2}\mathbf{,}\) \(\gamma _{3}\mathbf{.}\) The signatures are Open image in new window for the clause \(\gamma _1\) and Open image in new window for the others.
Problem 1. The existing prooftheoretic coinductive interpretations of cycle and loop detection are unclear, incomplete and not uniform. To see this, consider Table 1, which exemplifies three kinds of circular phenomena in Horn clauses: The clause \(\gamma _1\) is the easiest case. Its coinductive models are given by the finite set \(\{ p \, a\}\). On the other extreme is the clause \(\gamma _3\) that, just like \(\kappa _{\mathbf {stream}}\), admits only an infinite formula in its coinductive model. The intermediate case is \(\gamma _2\), which could be interpreted by an infinite set of finite formulae in its greatest Herbrand model, or may admit an infinite formula in its greatest complete Herbrand model. Examples like \(\gamma _1\) appear in Haskell type class resolution [51], and examples like \(\gamma _2\) in its experimental extensions [37]. Cycle detection would only cover computations for \(\gamma _1\), whereas \(\gamma _2\), \(\gamma _3\) require some form of loop detection^{1}. However, CoLP’s loop detection gives confusing results here. It correctly fails to infer \(p\, a\) from \(\gamma _3\) (no unifier for subgoals \(p \, a\) and \(p \, (f \, a)\) exists), but incorrectly fails to infer \(p \, a\) from \(\gamma _2\) (also failing to unify \(p \, a\) and \(p \, (f \, a)\)). The latter failure is misleading bearing in mind that \(p\, a\) is in fact in the coinductive model of \(\gamma _2\). Vice versa, if we interpret the CoLP answer \(x = f \, x\) as a declaration of an infinite term \((f \, f \, \ldots )\) in the model, then CoLP’s answer for \(\gamma _3\) and \(p \, x\) is exactly correct, however the same answer is badly incomplete for the query involving \(p \, x\) and \(\gamma _2\), because \(\gamma _2\) in fact admits other, finite, formulae in its models. And in some applications, e.g. in Haskell type class inference, a finite formula would be the only acceptable answer for any query to \(\gamma _2\).
This set of examples shows that loop detection is too coarse a tool to give an operational semantics to a diversity of coinductive models.
A New Theory of Coinductive Proof Search in Horn Clause Logic
In this paper, we aim to give a principled and general theory that resolves the three problems above. This theory establishes a constructive foundation for coinductive resolution and allows us to give prooftheoretic characterisations of the approaches that have been proposed throughout the literature.
To solve Problem 1, we follow the footsteps of the uniform proofs by Miller et al. [53, 54], who gave a general prooftheoretic account of resolution in firstorder Horn clause logic (fohc) and three extensions: firstorder hereditary Harrop clauses (fohh), higherorder Horn clauses (hohc), and higherorder hereditary Harrop clauses (hohh). In Sect. 3, we extend uniform proofs with a general coinduction proof principle. The resulting framework is called coinductive uniform proofs (CUP). We show how the coinductive extensions of the four logics of Miller et al., which we name cofohc, cofohh, cohohc and cohohh, give a precise prooftheoretic characterisation to the different kinds of coinduction described in the literature. For example, coinductive proofs involving the clauses \(\gamma _1\) and \(\gamma _2\) belong to cofohc and cofohh, respectively. However, proofs involving clauses like \(\gamma _3\) or \(\kappa _{\mathbf {stream}}\) require in addition fixed point terms to express infinite data. These extentions are denoted by Open image in new window , Open image in new window , Open image in new window and Open image in new window .
Section 3 shows that this yields the cube in Fig. 1, where the arrows show the increase in logical strength. The invariant search for regular infinite objects done in CoLP is fully described by the logic Open image in new window , including proofs for clauses like \(\gamma _3\) and \(\kappa _{\mathbf {stream}}\). An important consequence is that CUP is complete for \(\gamma _1\), \(\gamma _2\), and \(\gamma _3\), e.g. \(p \, a\) is provable from \(\gamma _2\) in CUP, but not in CoLP.
In tackling Problem 3, we will find that the irregular proofs, such as those for \(\kappa _{\mathbf {from}}\), can be given in Open image in new window . The stream of successive numbers can be defined as a higherorder fixed point term Open image in new window , and the proposition \(\forall x. \, \mathbf {from}\, x \, (s_\mathrm {fr}\, x)\) is provable in Open image in new window . This requires the use of higherorder syntax, fixed point terms and the goals of universal shape, which become available in the syntax of Hereditary Harrop logic.
In order to solve Problem 2 and to expose the constructive nature of the resulting proof systems, we present in Sect. 4 a coinductive extension of firstorder intuitionistic logic and its sequent calculus. This extension ( Open image in new window ) is based on the socalled later modality (or Löb modality) known from provability logic [16, 71], type theory [8, 58] and domain theory [20]. However, our way of using the later modality to control recursion in firstorder proofs is new and builds on [13, 14]. In the same section we also show that CUP is sound relative to Open image in new window , which gives us a handle on the constructive content of CUP. This yields, among other consequences, a constructive interpretation of CoLP proofs.
Section 5 is dedicated to showing soundness of both coinductive proof systems relative to complete Herbrand models [52]. The construction of these models is carried out by using coalgebras and category theory. This frees us from having to use topological methods and will simplify future extensions of the theory to, e.g., encompass typed logic programming. It also makes it possible to give original and constructive proofs of soundness for both CUP and Open image in new window in Sect. 5. We finish the paper with discussion of related and future work.
Originality of the Contribution
The results of this paper give a comprehensive characterisation of coinductive Horn clause theories from the point of view of proof search (by expressing coinductive proof search and resolution as coinductive uniform proofs), constructive proof theory (via a translation into an intuitionistic sequent calculus), and coalgebraic semantics (via coinductive Herbrand models and constructive soundness results). Several of the presented results have never appeared before: the coinductive extension of uniform proofs; characterisation of coinductive properties of Horn clause theories in higherorder logic with and without fixed point operators; coalgebraic and fibrational view on complete Herbrand models; and soundness of an intuitionistic logic with later modality relative to complete Herbrand models.
2 Preliminaries: Terms and Formulae
In this section, we set up notation and terminology for the rest of the paper. Most of it is standard, and blends together the notation used in [53] and [11].
Definition 1
Definition 2
A term signature \(\varSigma \) is a set of pairs \(c : \tau \), where \(\tau \in \mathbb {T}\), and a predicate signature is a set \(\varPi \) of pairs \(p : \rho \) with \(\rho \in \mathbb {P}\). The elements in \(\varSigma \) and \(\varPi \) are called term symbols and predicate symbols, respectively. Given term and predicate signatures \(\varSigma \) and \(\varPi \), we refer to the pair \((\varSigma , \varPi )\) as signature. Let \(\mathrm {Var}\) be a countable set of variables, the elements of which we denote by \(x, y, \cdots \) We call a finite list \(\varGamma \) of pairs \(x : \tau \) of variables and types a context. The set \(\varLambda _{\varSigma }\) of (welltyped) terms over \(\varSigma \) is the collection of all M with Open image in new window for some context \(\varGamma \) and type \(\tau \in \mathbb {T}\), where Open image in new window is defined inductively in Fig. 2. A term is called closed if Open image in new window , otherwise it is called open. Finally, we let \(\varLambda ^{}_{\varSigma }\) denote the set of all terms M that do not involve Open image in new window .
Definition 3
Let \((\varSigma , \varPi )\) be a signature. We say that \(\varphi \) is a (firstorder) formula in context \(\varGamma \), if \(\varGamma \Vdash \varphi \) is inductively derivable from the rules in Fig. 3.
Definition 4
We will use in the following that the above calculus features subject reduction and confluence, cf. [61]: if Open image in new window and \(M \equiv N\), then Open image in new window ; and \(M \equiv N\) iff there is a term P, such that Open image in new window and Open image in new window .
The order of a type \(\tau \in \mathbb {T}\) is given as usual by Open image in new window and Open image in new window . If Open image in new window , then the arity of \(\tau \) is given by Open image in new window and Open image in new window . A signature \(\varSigma \) is called firstorder, if for all \(f : \tau \in \varSigma \) we have Open image in new window . We let the arity of f then be Open image in new window and denote it by Open image in new window .
Definition 5
The set of guarded base terms over a firstorder signature \(\varSigma \) is given by the following typedriven rules.
Note that an important aspect of guarded terms is that no free variable occurs under a Open image in new window operator. Guarded base terms should be seen as specific fixed point terms that we will be able to unfold into potentially infinite trees. Guarded terms close guarded base terms under operations of the simply typed \(\lambda \)calculus.
Example 6
Let us provide a few examples that illustrate (firstorder) guarded terms. We use the firstorder signature Open image in new window .
 1.
Let Open image in new window be the function that computes the streams of numerals starting at the given argument. It is easy to show that Open image in new window and so \(s_\mathrm {fr}\; 0 \in \varLambda ^{G,1}_{\varSigma }\).
 2.
For the same signature \(\varSigma \) we also have Open image in new window . Thus \(x \in \varLambda ^{G,1}_{\varSigma }(x : \iota )\) and \(s \; x \in \varLambda ^{G,1}_{\varSigma }(x : \iota )\).
 3.
We have Open image in new window , but \((x \; 0) \not \in \varLambda ^{G,1}_{\varSigma }(x : \iota \rightarrow \iota )\).
The purpose of guarded terms is that these are productive, that is, we can reduce them to a term that either has a function symbol at the root or is just a variable. In other words, guarded terms have head normal forms: We say that a term M is in head normal form, if Open image in new window for some \(f \in \varSigma \) or if \(M = x\) for some variable x. The following lemma is a technical result that is needed to show in Lemma 8 that all guarded terms have a head normal form.
Lemma 7
Let M and N be guarded base terms with Open image in new window and Open image in new window . Then Open image in new window is a guarded base term with Open image in new window .
Lemma 8
If M is a firstorder guarded term with \(M \in \varLambda ^{G,1}_{\varSigma }(\varGamma )\), then M reduces to a unique head normal form. This means that either (i) there is a unique \(f \in \varSigma \) and terms Open image in new window with Open image in new window and Open image in new window , and for all L if Open image in new window , then Open image in new window ; or (ii) Open image in new window for some \(x : \iota \in \varGamma \).
We end this section by introducing the notion of an atom and refinements thereof. This will enable us to define the different logics and thereby to analyse the strength of coinduction hypotheses, which we promised in the introduction.
Definition 9

firstorder atom, if p and all the terms \(M_i\) are firstorder;

guarded atom, if all terms \(M_i\) are guarded; and

simple atom, if all terms \(M_i\) are nonrecursive, that is, are in \(\varLambda ^{}_{\varSigma }\).
Firstorder, guarded and simple atoms are denoted by \(\mathrm {At}_1\), Open image in new window and Open image in new window . We denote conjunctions of these predicates by Open image in new window and Open image in new window .
Note that the restriction for \(\mathrm {At}^g_{\omega }\) only applies to fixed point terms. Hence, any formula that contains terms without Open image in new window is already in Open image in new window and Open image in new window . Since these notions are rather subtle, we give a few examples
Example 10
We list three examples of firstorder atoms.
 1.
For \(x : \iota \) we have \(\mathbf {stream}\; x \in \mathrm {At}_1\), but there are also “garbage” formulae like “ Open image in new window ” in \(\mathrm {At}_1\). Examples of atoms that are not firstorder are \(p \; M\), where \(p : (\iota \rightarrow \iota ) \rightarrow o\) or Open image in new window .
 2.
Our running example “\(\mathbf {from}\; 0 \; (s_\mathrm {fr}\; 0)\)” is a firstorder guarded atom in \(\mathrm {At}_1^g\).
 3.
The formulae in \(\mathrm {At}_1^s\) may not contain recursion and higherorder features. However, the atoms of Horn clauses in a logic program fit in here.
3 Coinductive Uniform Proofs
This section introduces the eight logics of the coinductive uniform proof framework announced and motivated in the introduction. The major difference of uniform proofs with, say, a sequent calculus is the “uniformity” property, which means that the choice of the application of each proof rule is deterministic and all proofs are in normal form (cut free). This subsumes the operational semantics of resolution, in which the proof search is always goal directed. Hence, the main challenge, that we set out to solve in this section, is to extend the uniform proof framework with coinduction, while preserving this valuable operational property.
We begin by introducing the different goal formulae and definite clauses that determine the logics that were presented in the cube for coinductive uniform proofs in the introduction. These clauses and formulae correspond directly to those of the original work on uniform proofs [53] with the only difference being that we need to distinguish atoms with and without fixed point terms. The general idea is that goal formulae (Gformulae) occur on the right of a sequent, thus are the goal to be proved. Definite clauses (Dformulae), on the other hand, are selected from the context as assumptions. This will become clear once we introduce the proof system for coinductive uniform proofs.
Definition 11
D and Gformulae for coinductive uniform proofs.
The sets of definite clauses (Dformulae) and goals (Gformulae) of the four logics Open image in new window , \(\textit{cofohh}\), \(\textit{cohohc}\), \(\textit{cohohh}\) are the wellformed formulae of the corresponding shapes defined in Table 2. For the variations Open image in new window etc. of these logics with fixed point terms, we replace upper index “s” with “g” everywhere in Table 2. A Dformula of the shape Open image in new window is called Hformula or Horn clause if \(A_k \in \mathrm {At}_1^s\), and \(H^g\)formula if \(A_k \in \mathrm {At}_1^g\). Finally, a logic program (or program) P is a set of Hformulae. Note that any set of Dformulae in fohc can be transformed into an intuitionistically equivalent set of Hformulae [53].
We are now ready to introduce the coinductive uniform proofs. Such proofs are composed of two parts: an outer coinduction that has to be at the root of a proof tree, and the usual the usual uniform proofs by Miller et al. [54]. The latter are restated in Fig. 4. Of special notice is the rule \(\textsc {decide}\) that mimics the operational behaviour of resolution in logic programming, by choosing a clause D from the given program to resolve against. The coinduction is started by the rule cofix in Fig. 5. Our proof system mimics the typical recursion with a guard condition found in coinductive programs and proofs [5, 8, 19, 31, 40]. This guardedness condition is formalised by applying the guarding modality \({\langle \_\rangle }\) on the formula being proven by coinduction and the proof rules that allow us to distribute the guard over certain logical connectives, see Fig. 5. The guarding modality may be discharged only if the guarded goal was resolved against a clause in the initial program or any hypothesis, except for the coinduction hypotheses. This is reflected in the rule Open image in new window , where we may only pick a clause from P, and is in contrast to the rule \(\textsc {decide}\), in which we can pick any hypothesis. The proof may only terminate with the \(\textsc {initial}\) step if the goal is no longer guarded.
Note that the Open image in new window rule introduces a goal as a new hypothesis. Hence, we have to require that this goal is also a definite clause. Since coinduction hypotheses play such an important role, they deserve a separate definition.
Definition 12
Given a language L from Table 2, a formula \(\varphi \) is a Open image in new window of L if \(\varphi \) simultaneously is a D and a Gformula of L.
Note that the Open image in new window of cofohc and cofohh can be transformed into equivalent H or \(H^g\)formulae, since any Open image in new window is a Dformula.
Definition 13
Let P and \(\varDelta \) be finite sets of, respectively, definite clauses and Open image in new window , over the signature \(\varSigma \), and suppose that G is a goal and \(\varphi \) is a Open image in new window . A sequent is either a uniform provability sequent of the form Open image in new window or Open image in new window as defined in Fig. 4, or it is a coinductive uniform provability sequent of the form Open image in new window as defined in Fig. 5. Let L be a language from Table 2. We say that \(\varphi \) is coinductively provable in L, if P is a set of Dformulae in L, \(\varphi \) is a Open image in new window in L and Open image in new window holds.
The logics we have introduced impose different syntactic restrictions on D and Gformulae, and will therefore admit coinduction goals of different strength. This ability to explicitly use stronger coinduction hypotheses within a goaldirected search was missing in CoLP, for example. And it allows us to account for different coinductive properties of Horn clauses as described in the introduction. We finish this section by illustrating this strengthening.
The first example is one for the logic cofohc, in which we illustrate the framework on the problem of type class resolution.
Example 14
Trying to prove \(\mathbf {eq}\; (s \; \mathrm {i})\) by using \(\mathbf {eq}\; (s \; \mathrm {i})\) directly as a coinduction hypothesis is deemed to fail, as the coinductive proof search is irregular and this coinduction hypothesis would not be applicable in any guarded context. But it is possible to prove \(\mathbf {eq}\; (s \; \mathrm {i})\) as a corollary of another theorem: \(\forall x. \,(\mathbf {eq}\; x) \rightarrow \mathbf {eq}\; (s \; x)\). Using this formula as coinduction hypothesis leads to a successful proof, which we omit here. From this more general goal, we can derive the original goal by instantiating the quantifier with \(\mathrm {i}\) and eliminating the implication with \(\kappa _{\mathrm {i}}\). This second derivation is sound with respect to the models, as we show in Theorem 34.
We encounter \(\gamma _2\) from Table 1 in a similar situation: To prove \(p \, a\), we first have to prove \(\forall x. \,p \ x\) in cofohh, and then obtain \(p \ a\) as a corollary by appealing to Theorem 34. The next example shows that we can cover all cases in Table 1 by providing a proof in Open image in new window that involves irregular recursive terms.
Example 15
Recall the clause \(\forall x \; y. \, \mathbf {from}\; (s\; x) \; y \rightarrow \mathbf {from}\; x \; (\mathrm {scons}\; x \; y)\) that we named \(\kappa _{\mathbf {from}}\) in the introduction. Proving \(\exists y. \, \mathbf {from}\; 0 \; y\) is again not possible directly. Instead, we can use the term Open image in new window from Example 6 and prove \(\forall x. \, \mathbf {from}\; x \; (s_\mathrm {fr}\; x)\) coinductively, as shown in Fig. 7. This formula gives a coinduction hypothesis of sufficient generality. Note that the correct coinduction hypothesis now requires the fixed point definition of an infinite stream of successive numbers and universal quantification in the goal. Hence the need for the richer language of Open image in new window . From this more general goal we can derive our initial goal \(\exists \ y. \mathbf {from}\; 0 \; y\) by instantiating y with \(s_\mathrm {fr}\; 0\).
There are examples of coinductive proofs that require a fixed point definition of an infinite stream, but do not require the syntax of higherorder terms or hereditary Harrop formulae. Such proofs can be performed in the Open image in new window logic. A good example is a proof that the stream of zeros satisfies the Horn clause theory defining the predicate \(\mathbf {stream}\) in the introduction. The goal \((\mathbf {stream}\ s_{0})\), with Open image in new window can be proven directly by coinduction. Similarly, one can type selfapplication with the infinite type Open image in new window for some given type b. The proof for Open image in new window is then in Open image in new window . Finally, the clause \(\gamma _3\) is also in this group. More generally, circular unifiers obtained from CoLP’s [41] loop detection yield immediately guarded fixed point terms, and thus CoLP corresponds to coinductive proofs in the logic Open image in new window . A general discussion of Horn clause theories that describe infinite objects was given in [48], where the above logic programs were identified as being productive.
4 Coinductive Uniform Proofs and Intuitionistic Logic
In the last section, we introduced the framework of coinductive uniform proofs, which gives an operational account to proofs for coinductively interpreted logic programs. Having this framework at hand, we need to position it in the existing ecosystem of logical systems. The goal of this section is to prove that coinductive uniform proofs are in fact constructive. We show this by first introducing an extension of intuitionistic firstorder logic that allows us to deal with recursive proofs for coinductive predicates. Afterwards, we show that coinductive uniform proofs are sound relative to this logic by means of a proof tree translation. The modeltheoretic soundness proofs for both logics will be provided in Sect. 5.
Formally, the logic Open image in new window is given by the following definition.
Definition 16
The rules in Fig. 8 are the usual rules for intuitionistic firstorder logic and should come at no surprise. More interesting are the rules in Fig. 9, where the rule Open image in new window introduces recursion into the proof system. Furthermore, the rule Open image in new window allows us to to distribute the later modality over implication, and consequently over conjunction and universal quantification. This is essential in the translation in Theorem 18 below. Finally, the rule Open image in new window gives us the possibility to proceed without any recursion, if necessary.
Note that so far it is not possible to use the assumption Open image in new window introduced in the Open image in new window rule. The idea is that the formulae of a logic program provide us the obligations that we have to prove, possibly by recursion, in order to prove a coinductive predicate. This is cast in the following definition.
Definition 17
Given an \(H^g\)formula \(\varphi \) of the shape Open image in new window , we define its guarding Open image in new window to be Open image in new window . For a logic program P, we define its guarding Open image in new window by guarding each formula in P.
The translation given in Definition 17 of a logic program into formulae that admit recursion corresponds unfolding a coinductive predicate, cf. [14]. We show now how to transform a coinductive uniform proof tree into a proof tree in Open image in new window , such that the recursion and guarding mechanisms in both logics match up.
Theorem 18
If P is a logic program over a firstorder signature \(\varSigma \) and the sequent Open image in new window is provable in Open image in new window , then Open image in new window is provable in Open image in new window .
To prove this theorem, one uses that each coinductive uniform proof tree starts with an initial tree that has an application of the Open image in new window rule at the root and that eliminates the guard by using the rules in Fig. 5. At the leaves of this tree, one finds proof trees that proceed only by means of the rules in Fig. 4. The initial tree is then translated into a proof tree in Open image in new window that starts with an application of the Open image in new window rule, which corresponds to the Open image in new window rule, and that simultaneously transforms the coinduction hypothesis and applies introduction rules for conjunctions etc. This ensures that we can match the coinduction hypothesis with the guarded formulae of the program P.
The results of this section show that it is irrelevant whether the guarding modality is used on the right (CUPstyle) or on the left ( Open image in new window style), as the former can be translated into the latter. However, CUP uses the guarding on the right to preserve proof uniformity, whereas Open image in new window extends a general sequent calculus. Thus, to obtain the reverse translation, we would have to have an admissible cut rule in CUP. The main ingredient to such a cut rule is the ability to prove several coinductive statements simultaneously. This is possible in CUP by proving the conjunction of these statements. Unfortunately, we cannot eliminate such a conjunction into one of its components, since this would require nondeterministic guessing in the proof construction, which in turn breaks uniformity. Thus, we leave a solution of this problem for future work.
5 Herbrand Models and Soundness
In Sect. 4 we showed that coinductive uniform proofs are sound relative to the intuitionistic logic Open image in new window . This gives us a handle on the constructive nature of coinductive uniform proofs. Since Open image in new window is a nonstandard logic, we still need to provide semantics for that logic. We do this by interpreting in Sect. 5.4 the formulae of Open image in new window over the wellknown (complete) Herbrand models and prove the soundness of the accompanying proof system with respect to these models. Although we obtain soundness of coinductive uniform proofs over Herbrand models from this, this proof is indirect and does not give a lot of information about the models captured by the different calculi cofohc etc. For this reason, we will give in Sect. 5.3 a direct soundness proof for coinductive uniform proofs. We also obtain coinduction invariants from this proof for each of the calculi, which allows us to describe their proof strength.
5.1 Coinductive Herbrand Models and Semantics of Terms
Before we come to the soundness proofs, we introduce in this section (complete) Herbrand models by using the terminology of final coalgebras. We then utilise this description to give operational and denotational semantics to guarded terms. These semantics show that guarded terms allow the description and computation of potentially infinite trees.
The coalgebraic approach has been proven very successful both in logic and programming [1, 75, 76]. We will only require very little category theoretical vocabulary and assume that the reader is familiar with the category \(\mathbf {Set}\) of sets and functions, and functors, see for example [12, 25, 50]. The terminology of algebras and coalgebras [4, 47, 64, 65] is given by the following definition.
Definition 19
A coalgebra for a functor \(F :\mathbf {Set}\rightarrow \mathbf {Set}\) is a map \(c :X \rightarrow FX\). Given coalgebras \(d : Y \rightarrow FY\) and \(c :X \rightarrow FX\), we say that a map \(h : Y \rightarrow X\) is a homomorphism \(d \rightarrow c\) if \(Fh \mathbin {\circ }d = c \mathbin {\circ }h\). We call a coalgebra \(c :X \rightarrow FX\) final, if for every coalgebra d there is a unique homomorphism \(h :d \rightarrow c\). We will refer to h as the coinductive extension of d.
The idea of (complete) Herbrand models is that a set of Horn clauses determines for each predicate symbol a set of potentially infinite terms. Such terms are (potentially infinite) trees, whose nodes are labelled by function symbols and whose branching is given by the arity of these function symbols. To be able to deal with open terms, we will allow such trees to have leaves labelled by variables. Such trees are a final coalgebra for a functor determined by the signature.
Definition 20
To make sense of the following definition, we note that we can view \(\varPi \) as a signature and we thus obtain its extension Open image in new window . Moreover, we note that the final coalgebra of Open image in new window exists because Open image in new window is a polynomial functor.
Definition 21
Let Open image in new window be a firstorder signature. The coterms over \(\varSigma \) are the final coalgebra Open image in new window . For brevity, we denote the coterms with no variables, i.e. \(\varSigma ^{\infty }(\emptyset )\), by Open image in new window , and call it the (complete) Herbrand universe and its elements ground coterms. Finally, we let the (complete) Herbrand base \(\mathcal {B}^{\infty }\) be the set Open image in new window .
Lemma 22
 1.
if \(M \equiv N\), then \([\![M]\!]_1 = [\![N]\!]_1\), and
 2.
for all M, if Open image in new window then Open image in new window , and if Open image in new window then Open image in new window .
Proof
(sketch). By Lemma 8, we can define a coalgebra on the quotient of guarded terms by convertibility Open image in new window with Open image in new window and \(c[M] = x\) if Open image in new window . This yields a homomorphism \(h :{\varLambda ^{G,1}_{\varSigma }(\varGamma )}/\!{\scriptstyle \equiv } \rightarrow \varSigma ^{\infty }(\varGamma )\) and we can define \([\![]\!]_1 = h \mathbin {\circ }[]\). The rest follows from uniqueness of h.
5.2 Interpretation of Basic Intuitionistic FirstOrder Formulae
In this section, we give an interpretation of the formulae in Definition 3, in which we restrict ourselves to guarded terms. This interpretation will be relative to models in the complete Herbrand universe. Since we later extend these models to Kripke models to be able to handle the later modality, we formulate these models already now in the language of fibrations [17, 46].
Definition 23
Let \(p :\mathbf {E}\rightarrow \mathbf {B}\) be a functor. Given an object \(I \in \mathbf {B}\), the fibre \(\mathbf {E}_I\) above I is the category of objects \(A \in \mathbf {E}\) with \(p(A) = I\) and morphisms \(f :A \rightarrow B\) with \(p(f) = \mathrm {id}_I\). The functor p is a (split) fibration if for every morphism \(u :I \rightarrow J\) in \(\mathbf {B}\) there is functor \(u^{*} :\mathbf {E}_J \rightarrow \mathbf {E}_I\), such that \(\mathrm {id}_I^{*} = \mathrm {Id}_{\mathbf {E}_I}\) and \((v \mathbin {\circ }u)^{*} = u^{*} \mathbin {\circ }v^{*}\). We call \(u^{*}\) the reindexing along u.
Let us now expose the logical structure of the predicate fibration. This will allow us to conveniently interpret firstorder formulae over this fibration, but it comes at the cost of having to introduce a good amount of category theoretical language. However, doing so will pay off in Sect. 5.4, where we will construct another fibration out of the predicate fibration. We can then use category theoretical results to show that this new fibration admits the same logical structure and allows the interpretation of the later modality.
The first notion we need is that of fibred products, coproducts and exponents, which will allow us to interpret conjunction, disjunction and implication.
Definition 24
A fibration \(p :\mathbf {E}\rightarrow \mathbf {B}\) has fibred finite products \((\mathbf {1}, \times )\), if each fibre \(\mathbf {E}_I\) has finite products \((\mathbf {1}_I, \times _I)\) and these are preserved by reindexing: for all \(f :I \rightarrow J\), we have \(f^{*}(\mathbf {1}_J) = \mathbf {1}_I\) and \(f^{*}(A \times _J B) = f^{*}(A) \times _I f^{*}(B)\). Fibred finite coproducts and exponents are defined analogously.
The fibration \(\mathbb {P}\) is a socalled firstorder fibration, which allows us to interpret firstorder logic, see [46, Def. 4.2.1].
Definition 25

\(\mathbf {B}\) has finite products and the fibres of p are preorders;

p has fibred finite products \((\top , \wedge )\) and coproducts \((\bot , \vee )\) that distribute;

p has fibred exponents \(\rightarrow \); and

p has existential and universal quantifiers \(\exists _{I,J} \dashv \pi _{I,J}^{*} \dashv \forall _{I,J}\) for all projections \(\pi _{I,J} :I \times J \rightarrow I\).
A firstorder \(\lambda \)fibration is a firstorder fibration with Cartesian closed base \(\mathbf {B}\).
The semantics of types and contexts are given inductively in the Cartesian closed category \(\mathbf {Set}\), where the base type \(\iota \) is interpreted as coterms, as follows.
Lemma 26
The mapping Open image in new window is a welldefined function from guarded terms to functions, such that Open image in new window implies Open image in new window .
Since \(\mathbb {P}:\mathbf {Pred}\rightarrow \mathbf {Set}\) is a firstorder fibration, we can interpret inductively all logical connectives of the formulae from Definition 3 in this fibration. The only case that is missing is the base case of predicate symbols. Their interpretation will be given over a Herbrand model that is constructed as the largest fixed point of an operator over all predicate interpretations in the Herbrand base. Both the operator and the fixed point are the subjects of the following definition.
Definition 27
Lemma 28
The mapping Open image in new window is a welldefined function from formulae to predicates, such that \(\varGamma \Vdash \varphi \) implies Open image in new window or, equivalently, Open image in new window .
This concludes the semantics of types, terms and formulae. We now turn to show that coinductive uniform proofs are sound for this interpretation.
5.3 Soundness of Coinductive Uniform Proofs for Herbrand Models
In this section, we give a direct proof of soundness for the coinductive uniform proof system from Sect. 3. Later, we will obtain another soundness result by combining the proof translation from Theorem 18 with the soundness of Open image in new window (Theorems 39 and 42). The purpose of giving a direct soundness proof for uniform proofs is that it allows the extraction of a coinduction invariant, see Lemma 32.
The main idea is as follows. Given a formula \(\varphi \) and a uniform proof \(\pi \) for Open image in new window , we construct an interpretation \(I \in \mathcal {I}\) that validates \(\varphi \), i.e. Open image in new window , and that is contained in the complete Herbrand model Open image in new window . Combining these two facts, we obtain that Open image in new window , and thus the soundness of uniform proofs.
To show that the constructed interpretation I is contained in Open image in new window , we use the usual coinduction proof principle, as it is given in the following definition.
Definition 29
An invariant for \(K \in \mathcal {I}\) is a set \(I \in \mathcal {I}\), such that \(K \subseteq I\) and I is a Open image in new window invariant, that is, Open image in new window . If K has an invariant, then Open image in new window .
Thus, our goal is now to construct an interpretation together with an invariant. This invariant will essentially collect and iterate all the substitutions that appear in a proof. For this we need the ability to compose substitutions of coterms, which we derive from the monad [5] \((\varSigma ^{\infty }, \eta , \mu )\) with \(\mu :\varSigma ^{\infty }\varSigma ^{\infty } \Rightarrow \varSigma ^{\infty }\).
Definition 30
The notions in the following definition will allow us to easily organise and iterate the substitutions that occur in a uniform proof.
Definition 31
Lemma 32
Once we have Lemma 32 the following soundness theorem is easily proven.
Theorem 33
If \(\varphi \) is an \(H^g\)formula and Open image in new window , then Open image in new window .
Finally, we show that extending logic programs with coinductively proven lemmas is sound. This follows easily by coinduction.
Theorem 34
Let \(\varphi \) be an \(H^g\)formula of the shape Open image in new window , such that, for all substitutions \(\theta \) if Open image in new window , then Open image in new window . Then Open image in new window implies Open image in new window , that is, Open image in new window is a conservative extension of P with respect to the Herbrand model.
As a corollary we obtain that, if there is a proof for Open image in new window , then a proof for Open image in new window is sound with respect to Open image in new window . Indeed, by Theorem 34 we have that Open image in new window and by Theorem 33 that Open image in new window is sound with respect to Open image in new window . Thus, the proof of Open image in new window is also sound with respect to Open image in new window . We use this property implicitly in our running examples, and refer the reader to [15, 49] for proofs, further examples and discussion.
5.4 Soundness of Open image in new window over Herbrand Models
Note that there is a (full) embedding \(K :\mathbf {Pred}\rightarrow \overline{\mathbf {Pred}}\) that is given by \(K(X, P) = (X, \overline{P})\) with \(\overline{P}_\alpha = P\). One can show [14] that \(\overline{\mathbb {P}}\) is again a firstorder fibration and that it models the later modality, as in the following theorem.
Theorem 35
Lemma 36
The mapping Open image in new window is a welldefined map from formulae in Open image in new window to sequences of predicates, such that \(\varGamma \Vdash \varphi \) implies Open image in new window .
Lemma 37
All rules of Open image in new window are sound with respect to the interpretation Open image in new window of formulae in \(\overline{\mathbf {Pred}}\), that is, if Open image in new window , then Open image in new window . In particular, Open image in new window implies Open image in new window .
The following lemma shows that the guarding of a set of formulae is valid in the chain model that they generate.
Lemma 38
If \(\varphi \) is an Hformula in P, then Open image in new window .
Combining this with soundness from Lemma 37, we obtain that provability in Open image in new window relative to a logic program P is sound for the model of P.
Theorem 39
For all logic programs P, if Open image in new window then Open image in new window .
The final result of this section is to show that the descending chain model, which we used to interpret formulae of Open image in new window , is sound and complete for the fixed point model, which we used to interpret the formulae of coinductive uniform proofs. This will be proved in Theorem 42 below. The easiest way to prove this result is by establishing a functor \(\overline{\mathbf {Pred}} \rightarrow \mathbf {Pred}\) that maps the chain Open image in new window to the model Open image in new window , and that preserves and reflects truth of firstorder formulae (Proposition 41). We will phrase the preservation of truth of firstorder formulae by a functor by appealing to the following notion of fibrations maps, cf. [46, Def. 4.3.1].
Definition 40
Let \(p :\mathbf {E}\rightarrow \mathbf {B}\) and \(q :\mathbf {D} \rightarrow \mathbf {A}\) be fibrations. A fibration map \(p \rightarrow q\) is a pair \((F :\mathbf {E}\rightarrow \mathbf {D}, G :\mathbf {B}\rightarrow \mathbf {A})\) of functors, s.t. \(q \mathbin {\circ }F = G \mathbin {\circ }p\) and F preserves Cartesian morphisms: if \(f :X \rightarrow Y\) in \(\mathbf {E}\) is Cartesian over p(f), then F(f) is Cartesian over G(p(f)). (F, G) is a map of firstorder (\(\lambda \) )fibrations, if p and q are firstorder (\(\lambda \))fibrations, and F and G preserve this structure.
Proposition 41
\(L :\overline{\mathbf {Pred}} \rightarrow \mathbf {Pred}\), as defined above, is a map of firstorder fibrations. Furthermore, L is rightadjoint to the embedding \(K :\mathbf {Pred}\rightarrow \overline{\mathbf {Pred}}\). Finally, for each \(p \in \varPi \) and \(u \in \overline{\mathbf {Pred}}_{\mathcal {B}^{\infty }}\), we have Open image in new window .
We get from Proposition 41 soundness and completeness of Open image in new window for Herbrand models. More precisely, if \(\varphi \) is a formula of plain firstorder logic ( Open image in new window free), then its interpretation in the coinductive Herbrand model is true if and only if its interpretation over the chain approximation of the Herbrand model is true.
Theorem 42
If \(\varphi \) is Open image in new window free (Definition 3) then Open image in new window if and only if Open image in new window .
Proof
(sketch). First, one shows for all Open image in new window free formulae \(\varphi \) that Open image in new window by induction on \(\varphi \) and using Proposition 41. Using this identity and \(K \dashv L\), the result is then obtained from the following adjoint correspondence.
6 Conclusion, Related Work and the Future
In this paper, we provided a comprehensive theory of resolution in coinductive Hornclause theories and coinductive logic programs. This theory comprises of a uniform proof system that features a form of guarded recursion and that provides operational semantics for proofs of coinductive predicates. Further, we showed how to translate proofs in this system into proofs for an extension of intuitionistic FOL with guarded recursion, and we provided sound semantics for both proof systems in terms of coinductive Herbrand models. The Herbrand models and semantics were thereby presented in a modern style that utilises coalgebras and fibrations to provide a conceptual view on the semantics.
Related Work. It may be surprising that automated proof search for coinductive predicates in firstorder logic does not have a coherent and comprehensive theory, even after three decades [3, 60], despite all the attention that it received as programming [2, 29, 42, 44] and proof [33, 35, 39, 40, 45, 59, 64, 65, 66, 67] method. The work that comes close to algorithmic proof search is the system CIRC [63], but it cannot handle general coinductive predicates and corecursive programming. Inductive and coinductive data types are also being added to SMT solvers [24, 62]. However, both CIRC and SMT solving are inherently based on classical logic and are therefore not suited to situations where proof objects are relevant, like programming, type class inference or (dependent) type theory. Moreover, the proposed solutions, just like those in [41, 69] can only deal with regular data, while our approach also works for irregular data, as we saw in the \(\mathbf {from}\)example.
This paper subsumes Haskell type class inference [37, 51] and exposes that the inference presented in those papers corresponds to coinductive proofs in \(\textit{cofohc}\) and \(\textit{cohohh}\). Given that the proof systems proposed in this paper are constructive and that uniform proofs provide proofs (type inhabitants) in normal form, we could give a propositionsastypes interpretation to all eight coinductive uniform proof systems. This was done for \(\textit{cofohc}\) and \(\textit{cohohh}\) in [37], but we leave the remaining cube from the introduction for future work.
Future Work. There are several directions that we wish to pursue in the future. First, we know that CUP is incomplete for the presented models, as it is intuitionistic and it lacks an admissible cut rule. The first can be solved by moving to Kripke/Bethmodels, as done by Clouston and Goré [30] for the propositional part of Open image in new window . However, the admissible cut rule is more delicate. To obtain such a rule one has to be able to prove several propositions simultaneously by coinduction, as discussed at the end of Sect. 4. In general, completeness of recursive proof systems depends largely on the theory they are applied to, see [70] and [18]. However, techniques from cyclic proof systems [27, 68] may help. We also aim to extend our ideas to other situations like higherorder Horn clauses [28, 43] and interactive proof assistants [7, 10, 23, 31], typed logic programming, and logic programming that mix inductive and coinductive predicates.
Footnotes
 1.
We follow the standard terminology of [74] and say that two formulae F and G form a cycle if \(F = G\), and a loop if \(F[\theta ] = G[\theta ]\) for some (possibly circular) unifier \(\theta \).
 2.
Technically, the quantifiers should also fulfil the BeckChevalley and Frobenius conditions, and the fibration should admit equality. Since these are fulfilled in all our models and we do not need equality, we will not discuss them here.
Notes
Acknowledgements
We would like to thank Damien Pous and the anonymous reviewers for their valuable feedback.
References
 1.Abbott, M., Altenkirch, T., Ghani, N.: Containers: constructing strictly positive types. TCS 342(1), 3–27 (2005). https://doi.org/10.1016/j.tcs.2005.06.002MathSciNetCrossRefzbMATHGoogle Scholar
 2.Abel, A., Pientka, B., Thibodeau, D., Setzer, A.: Copatterns: programming infinite structures by observations. In: POPL 2013, pp. 27–38 (2013). https://doi.org/10.1145/2429069.2429075
 3.Aczel, P.: Nonwellfounded sets. Center for the Study of Language and Information, Stanford University (1988)Google Scholar
 4.Aczel, P.: Algebras and coalgebras. In: Backhouse, R., Crole, R., Gibbons, J. (eds.) Algebraic and Coalgebraic Methods in the Mathematics of Program Construction. LNCS, vol. 2297, pp. 79–88. Springer, Heidelberg (2002). https://doi.org/10.1007/3540477977_3CrossRefGoogle Scholar
 5.Aczel, P., Adámek, J., Milius, S., Velebil, J.: Infinite trees and completely iterative theories: a coalgebraic view. TCS 300(1–3), 1–45 (2003). https://doi.org/10.1016/S03043975(02)007284MathSciNetCrossRefzbMATHGoogle Scholar
 6.Adámek, J.: On final coalgebras of continuous functors. Theor. Comput. Sci. 294(1/2), 3–29 (2003). https://doi.org/10.1016/S03043975(01)002407MathSciNetCrossRefzbMATHGoogle Scholar
 7.P.L. group on Agda: Agda Documentation. Technical report, Chalmers and Gothenburg University (2015). http://wiki.portal.chalmers.se/agda/, version 2.4.2.5
 8.Appel, A.W., Melliès, P.A., Richards, C.D., Vouillon, J.: A very modal model of a modern, major, general type system. In: POPL, pp. 109–122. ACM (2007). https://doi.org/10.1145/1190216.1190235
 9.Atkey, R., McBride, C.: Productive coprogramming with guarded recursion. In: ICFP, pp. 197–208. ACM (2013). https://doi.org/10.1145/2500365.2500597
 10.Baelde, D., et al.: Abella: a system for reasoning about relational specifications. J. Formaliz. Reason. 7(2), 1–89 (2014). https://doi.org/10.6092/issn.19725787/4650MathSciNetCrossRefGoogle Scholar
 11.Barendregt, H., Dekkers, W., Statman, R.: Lambda Calculus with Types. Cambridge University Press, Cambridge (2013)CrossRefGoogle Scholar
 12.Barr, M., Wells, C.: Category Theory for Computing Science. Prentice Hall International Series in Computer Science, 2nd edn. Prentice Hall, Upper Saddle River (1995). http://www.tac.mta.ca/tac/reprints/articles/22/tr22abs.htmlzbMATHGoogle Scholar
 13.Basold, H.: Mixed inductivecoinductive reasoning: types, programs and logic. Ph.D. thesis, Radboud University Nijmegen (2018). http://hdl.handle.net/2066/190323
 14.Basold, H.: Breaking the Loop: Recursive Proofs for Coinductive Predicates in Fibrations. ArXiv eprints, February 2018. https://arxiv.org/abs/1802.07143
 15.Basold, H., Komendantskaya, E., Li, Y.: Coinduction in uniform: foundations for corecursive proof search with horn clauses. Extended version of this paper. CoRR abs/1811.07644 (2018). http://arxiv.org/abs/1811.07644
 16.Beklemishev, L.D.: Parameter free induction and provably total computable functions. TCS 224(1–2), 13–33 (1999). https://doi.org/10.1016/S03043975(98)003053MathSciNetCrossRefzbMATHGoogle Scholar
 17.Bénabou, J.: Fibered categories and the foundations of naive category theory. J. Symb. Logic 50(1), 10–37 (1985). https://doi.org/10.2307/2273784MathSciNetCrossRefzbMATHGoogle Scholar
 18.Berardi, S., Tatsuta, M.: Classical system of MartinLöf’s inductive definitions is not equivalent to cyclic proof system. In: Esparza, J., Murawski, A.S. (eds.) FoSSaCS 2017. LNCS, vol. 10203, pp. 301–317. Springer, Heidelberg (2017). https://doi.org/10.1007/9783662544587_18CrossRefzbMATHGoogle Scholar
 19.Birkedal, L., Møgelberg, R.E.: Intensional type theory with guarded recursive types qua fixed points on universes. In: LICS, pp. 213–222. IEEE Computer Society (2013). https://doi.org/10.1109/LICS.2013.27
 20.Birkedal, L., Møgelberg, R.E., Schwinghammer, J., Støvring, K.: First steps in synthetic guarded domain theory: stepindexing in the topos of trees. In: Proceedings of LICS 2011, pp. 55–64. IEEE Computer Society (2011). https://doi.org/10.1109/LICS.2011.16
 21.Bizjak, A., Grathwohl, H.B., Clouston, R., Møgelberg, R.E., Birkedal, L.: Guarded dependent type theory with coinductive types. In: Jacobs, B., Löding, C. (eds.) FoSSaCS 2016. LNCS, vol. 9634, pp. 20–35. Springer, Heidelberg (2016). https://doi.org/10.1007/9783662496305_2. https://arxiv.org/abs/1601.01586CrossRefGoogle Scholar
 22.Bjørner, N., Gurfinkel, A., McMillan, K., Rybalchenko, A.: Horn clause solvers for program verification. In: Beklemishev, L.D., Blass, A., Dershowitz, N., Finkbeiner, B., Schulte, W. (eds.) Fields of Logic and Computation II. LNCS, vol. 9300, pp. 24–51. Springer, Cham (2015). https://doi.org/10.1007/9783319235349_2CrossRefGoogle Scholar
 23.Blanchette, J.C., Meier, F., Popescu, A., Traytel, D.: Foundational nonuniform (co)datatypes for HigherOrder Logic. In: LICS 2017, pp. 1–12. IEEE Computer Society (2017). https://doi.org/10.1109/LICS.2017.8005071
 24.Blanchette, J.C., Peltier, N., Robillard, S.: Superposition with datatypes and codatatypes. In: Galmiche, D., Schulz, S., Sebastiani, R. (eds.) IJCAR 2018. LNCS (LNAI), vol. 10900, pp. 370–387. Springer, Cham (2018). https://doi.org/10.1007/9783319942056_25CrossRefGoogle Scholar
 25.Borceux, F.: Handbook of Categorical Algebra. Basic Category Theory, vol. 1. Cambridge University Press, Cambridge (2008)zbMATHGoogle Scholar
 26.Bottu, G., Karachalias, G., Schrijvers, T., Oliveira, B.C.D.S., Wadler, P.: Quantified class constraints. In: Haskell Symposium, pp. 148–161. ACM (2017). https://doi.org/10.1145/3122955.3122967
 27.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/exq052MathSciNetCrossRefzbMATHGoogle Scholar
 28.Burn, T.C., Ong, C.L., Ramsay, S.J.: Higherorder constrained horn clauses for verification. PACMPL 2(POPL), 11:1–11:28 (2018). https://doi.org/10.1145/3158099CrossRefGoogle Scholar
 29.Capretta, V.: General Recursion via Coinductive Types. Log. Methods Comput. Sci. 1(2), July 2005. https://doi.org/10.2168/LMCS1(2:1)2005
 30.Clouston, R., Goré, R.: Sequent calculus in the topos of trees. In: Pitts, A. (ed.) FoSSaCS 2015. LNCS, vol. 9034, pp. 133–147. Springer, Heidelberg (2015). https://doi.org/10.1007/9783662466780_9CrossRefzbMATHGoogle Scholar
 31.Coquand, T.: Infinite objects in type theory. In: Barendregt, H., Nipkow, T. (eds.) TYPES 1993. LNCS, vol. 806, pp. 62–78. Springer, Heidelberg (1994). https://doi.org/10.1007/3540580859_72CrossRefGoogle Scholar
 32.Cousot, P., Cousot, R.: Constructive versions of Tarski’s fixed point theorems. Pac. J. Math. 82(1), 43–57 (1979). http://projecteuclid.org/euclid.pjm/1102785059MathSciNetCrossRefGoogle Scholar
 33.Dax, C., Hofmann, M., Lange, M.: A proof system for the linear time \({\mu }\)calculus. In: ArunKumar, S., Garg, N. (eds.) FSTTCS 2006. LNCS, vol. 4337, pp. 273–284. Springer, Heidelberg (2006). https://doi.org/10.1007/11944836_26CrossRefGoogle Scholar
 34.van Emden, M., Kowalski, R.: The semantics of predicate logic as a programming language. J. Assoc. Comput. Mach. 23, 733–742 (1976). https://doi.org/10.1145/321978.321991MathSciNetCrossRefzbMATHGoogle Scholar
 35.Endrullis, J., Hansen, H.H., Hendriks, D., Polonsky, A., Silva, A.: A coinductive framework for infinitary rewriting and equational reasoning. In: RTA 2015, pp. 143–159 (2015). https://doi.org/10.4230/LIPIcs.RTA.2015.143
 36.Farka, F., Komendantskaya, E., Hammond, K.: Coinductive soundness of corecursive type class resolution. In: Hermenegildo, M.V., LopezGarcia, P. (eds.) LOPSTR 2016. LNCS, vol. 10184, pp. 311–327. Springer, Cham (2017). https://doi.org/10.1007/9783319631394_18CrossRefGoogle Scholar
 37.Fu, P., Komendantskaya, E., Schrijvers, T., Pond, A.: Proof relevant corecursive resolution. In: Kiselyov, O., King, A. (eds.) FLOPS 2016. LNCS, vol. 9613, pp. 126–143. Springer, Cham (2016). https://doi.org/10.1007/9783319296043_9CrossRefGoogle Scholar
 38.Gambino, N., Kock, J.: Polynomial functors and polynomial monads. Math. Proc. Cambridge Phil. Soc. 154(1), 153–192 (2013). https://doi.org/10.1017/S0305004112000394MathSciNetCrossRefzbMATHGoogle Scholar
 39.Giesl, J., et al.: Analyzing program termination and complexity automatically with AProVE. J. Autom. Reason. 58(1), 3–31 (2017). https://doi.org/10.1007/s108170169388yMathSciNetCrossRefzbMATHGoogle Scholar
 40.Giménez, E.: Structural recursive definitions in type theory. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, pp. 397–408. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055070CrossRefGoogle Scholar
 41.Gupta, G., Bansal, A., Min, R., Simon, L., Mallya, A.: Coinductive logic programming and its applications. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 27–44. Springer, Heidelberg (2007). https://doi.org/10.1007/9783540746102_4CrossRefzbMATHGoogle Scholar
 42.Hagino, T.: A typed lambda calculus with categorical type constructors. In: Pitt, D.H., Poigné, A., Rydeheard, D.E. (eds.) Category Theory and Computer Science. LNCS, vol. 283, pp. 140–157. Springer, Heidelberg (1987). https://doi.org/10.1007/3540185089_24CrossRefGoogle Scholar
 43.Hashimoto, K., Unno, H.: Refinement type inference via horn constraint optimization. In: Blazy, S., Jensen, T. (eds.) SAS 2015. LNCS, vol. 9291, pp. 199–216. Springer, Heidelberg (2015). https://doi.org/10.1007/9783662482889_12CrossRefGoogle Scholar
 44.Howard, B.T.: Inductive, coinductive, and pointed types. In: Harper, R., Wexelblat, R.L. (eds.) Proceedings of ICFP 1996, pp. 102–109. ACM (1996). https://doi.org/10.1145/232627.232640
 45.Hur, C.K., Neis, G., Dreyer, D., Vafeiadis, V.: The power of parameterization in coinductive proof. In: Proceedings of POPL 2013, pp. 193–206. ACM (2013). https://doi.org/10.1145/2429069.2429093
 46.Jacobs, B.: Categorical Logic and Type Theory. Studies in Logic and the Foundations of Mathematics, vol. 141. North Holland, Amsterdam (1999)zbMATHGoogle Scholar
 47.Jacobs, B.: Introduction to Coalgebra: Towards Mathematics of States and Observation. Cambridge Tracts in Theoretical Computer Science, vol. 59. Cambridge University Press, Cambridge (2016). https://doi.org/10.1017/CBO9781316823187. http://www.cs.ru.nl/B.Jacobs/CLG/JacobsCoalgebraIntro.pdfCrossRefzbMATHGoogle Scholar
 48.Komendantskaya, E., Li, Y.: Productive corecursion in logic programming. J. TPLP (ICLP 2017 postproc.) 17(5–6), 906–923 (2017). https://doi.org/10.1017/S147106841700028XMathSciNetCrossRefzbMATHGoogle Scholar
 49.Komendantskaya, E., Li, Y.: Towards coinductive theory exploration in horn clause logic: Position paper. In: Kahsai, T., Vidal, G. (eds.) Proceedings 5th Workshop on Horn Clauses for Verification and Synthesis, HCVS 2018, Oxford, UK, 13th July 2018, vol. 278, pp. 27–33 (2018). https://doi.org/10.4204/EPTCS.278.5
 50.Lambek, J., Scott, P.J.: Introduction to HigherOrder Categorical Logic. Cambridge University Press, Cambridge (1988)zbMATHGoogle Scholar
 51.Lämmel, R., Peyton Jones, S.L.: Scrap your boilerplate with class: extensible generic functions. In: ICFP 2005, pp. 204–215. ACM (2005). https://doi.org/10.1145/1086365.1086391
 52.Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Heidelberg (1987). https://doi.org/10.1007/9783642831898CrossRefzbMATHGoogle Scholar
 53.Miller, D., Nadathur, G.: Programming with Higherorder logic. Cambridge University Press, Cambridge (2012)CrossRefGoogle Scholar
 54.Miller, D., Nadathur, G., Pfenning, F., Scedrov, A.: Uniform proofs as a foundation for logic programming. Ann. Pure Appl. Logic 51(1–2), 125–157 (1991). https://doi.org/10.1016/01680072(91)90068WMathSciNetCrossRefzbMATHGoogle Scholar
 55.Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348–375 (1978). https://doi.org/10.1016/00220000(78)900144MathSciNetCrossRefzbMATHGoogle Scholar
 56.Møgelberg, R.E.: A type theory for productive coprogramming via guarded recursion. In: CSLLICS, pp. 71:1–71:10. ACM (2014). https://doi.org/10.1145/2603088.2603132
 57.Nadathur, G., Mitchell, D.J.: System description: Teyjus—a compiler and abstract machine based implementation of \(\lambda \)Prolog. CADE16. LNCS (LNAI), vol. 1632, pp. 287–291. Springer, Heidelberg (1999). https://doi.org/10.1007/3540486607_25CrossRefGoogle Scholar
 58.Nakano, H.: A modality for recursion. In: LICS, pp. 255–266. IEEE Computer Society (2000). https://doi.org/10.1109/LICS.2000.855774
 59.Niwinski, D., Walukiewicz, I.: Games for the \(\mu \)Calculus. TCS 163(1&2), 99–116 (1996). https://doi.org/10.1016/03043975(95)001360MathSciNetCrossRefzbMATHGoogle Scholar
 60.Park, D.: Concurrency and automata on infinite sequences. In: Deussen, P. (ed.) GITCS 1981. LNCS, vol. 104, pp. 167–183. Springer, Heidelberg (1981). https://doi.org/10.1007/BFb0017309CrossRefGoogle Scholar
 61.Plotkin, G.D.: LCF considered as a programming language. Theor. Comput. Sci. 5(3), 223–255 (1977). https://doi.org/10.1016/03043975(77)900445MathSciNetCrossRefzbMATHGoogle Scholar
 62.Reynolds, A., Kuncak, V.: Induction for SMT solvers. In: D’Souza, D., Lal, A., Larsen, K.G. (eds.) VMCAI 2015. LNCS, vol. 8931, pp. 80–98. Springer, Heidelberg (2015). https://doi.org/10.1007/9783662460818_5CrossRefGoogle Scholar
 63.Roşu, G., Lucanu, D.: Circular coinduction: a proof theoretical foundation. In: Kurz, A., Lenisa, M., Tarlecki, A. (eds.) CALCO 2009. LNCS, vol. 5728, pp. 127–144. Springer, Heidelberg (2009). https://doi.org/10.1007/9783642037412_10CrossRefGoogle Scholar
 64.Rutten, J.: Universal coalgebra: a theory of systems. TCS 249(1), 3–80 (2000). https://doi.org/10.1016/S03043975(00)000566MathSciNetCrossRefzbMATHGoogle Scholar
 65.Sangiorgi, D.: Introduction to Bisimulation and Coinduction. Cambridge University Press, New York (2011)CrossRefGoogle Scholar
 66.Santocanale, L.: A calculus of circular proofs and its categorical semantics. In: Nielsen, M., Engberg, U. (eds.) FoSSaCS 2002. LNCS, vol. 2303, pp. 357–371. Springer, Heidelberg (2002). https://doi.org/10.1007/3540459316_25CrossRefzbMATHGoogle Scholar
 67.Santocanale, L.: \(\mu \)bicomplete categories and parity games. RAIRO  ITA 36(2), 195–227 (2002). https://doi.org/10.1051/ita:2002010MathSciNetCrossRefzbMATHGoogle Scholar
 68.Shamkanov, D.S.: Circular proofs for the GödelLöb provability logic. Math. Notes 96(3), 575–585 (2014). https://doi.org/10.1134/S0001434614090326MathSciNetCrossRefzbMATHGoogle Scholar
 69.Simon, L., Bansal, A., Mallya, A., Gupta, G.: Cologic programming: extending logic programming with coinduction. In: Arge, L., Cachin, C., Jurdziński, T., Tarlecki, A. (eds.) ICALP 2007. LNCS, vol. 4596, pp. 472–483. Springer, Heidelberg (2007). https://doi.org/10.1007/9783540734208_42CrossRefzbMATHGoogle Scholar
 70.Simpson, A.: Cyclic arithmetic is equivalent to Peano arithmetic. In: Esparza, J., Murawski, A.S. (eds.) FoSSaCS 2017. LNCS, vol. 10203, pp. 283–300. Springer, Heidelberg (2017). https://doi.org/10.1007/9783662544587_17CrossRefGoogle Scholar
 71.Smoryński, C.: SelfReference and Modal Logic. Universitext. Springer, New York (1985). https://doi.org/10.1007/9781461386018CrossRefzbMATHGoogle Scholar
 72.Solovay, R.M.: Provability interpretations of modal logic. Israel J. Math. 25(3), 287–304 (1976). https://doi.org/10.1007/BF02757006MathSciNetCrossRefzbMATHGoogle Scholar
 73.Sulzmann, M., Stuckey, P.J.: HM(X) type inference is CLP(X) solving. J. Funct. Program. 18(2), 251–283 (2008). https://doi.org/10.1017/S0956796807006569MathSciNetCrossRefzbMATHGoogle Scholar
 74.Terese: Term Rewriting Systems. Cambridge University Press, Cambridge (2003)Google Scholar
 75.Turner, D.A.: Elementary strong functional programming. In: Hartel, P.H., Plasmeijer, R. (eds.) FPLE 1995. LNCS, vol. 1022, pp. 1–13. Springer, Heidelberg (1995). https://doi.org/10.1007/3540606750_35CrossRefGoogle Scholar
 76.van den Berg, B., de Marchi, F.: Nonwellfounded trees in categories. Ann. Pure Appl. Logic 146(1), 40–59 (2007). https://doi.org/10.1016/j.apal.2006.12.001MathSciNetCrossRefzbMATHGoogle Scholar
 77.Worrell, J.: On the final sequence of a finitary set functor. Theor. Comput. Sci. 338(1–3), 184–199 (2005). https://doi.org/10.1016/j.tcs.2004.12.009MathSciNetCrossRefzbMATHGoogle Scholar
Copyright information
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.