Verifying Uniqueness in a Logical Framework

. We present an algorithm for verifying that some speciﬁed arguments of an inductively deﬁned relation in a dependently typed λ - calculus are uniquely determined by some other arguments. We prove it correct and also show how to exploit this uniqueness information in coverage checking, which allows us to verify that a deﬁnition of a function or relation covers all possible cases. In combination, the two algorithms sig-niﬁcantly extend the power of the meta-reasoning facilities of the Twelf implementation of LF.


Introduction
In most logics and type theories, unique existence is not a primitive notion, but defined via existence and equality.For example, we might define ∃!x.A(x) to stand for ∃x.A(x) ∧ ∀y.A(y) ⊃ x = y.Such definitions are usually made in both first-order and higher-order logic, and in both the intuitionistic and the classical case.Expanding unique existence assertions in this manner comes at a price: not only do we duplicate the formula A, but we also introduce two quantifiers and an explicit equality.It is therefore natural to ask if we could derive some benefit for theorem proving by taking unique existence as a primitive.
In this paper we consider an instance of this problem, namely verifying and exploiting uniqueness in a logical framework.We show how to establish uniqueness of certain arguments to type families in the logical framework LF [7] as implemented in the Twelf system [15].We further show how to exploit this uniqueness information to verify meta-theoretic properties of signatures, thereby checking proofs of meta-theorems presented as relations in LF.In particular, we can automatically verify the unique existence of specified output arguments in a relation with respect to some given input arguments.Our algorithm will always terminate, but, since the problem is in general undecidable, will sometimes fail to establish uniqueness even though it holds.
Our algorithm extends prior work on coverage checking [24] and mode checking [18], which in combination with termination checking [16], can verify metatheoretic proofs such as cut elimination [12], the Church-Rosser theorem [19], logical translations [13], or the soundness of Foundational Typed Assembly Language [3,4].The specific motivation for this work came mostly from the latter, in which a significant portion of the development was devoted to tedious but straightforward reasoning about equality.Our algorithms can automate much of that.
We believe that our techniques can be adapted to other systems of constructive type theory to recognize properties of relations.In that direction, the research can be seen as an extension of the work by McBride [11] and Coquand [2], who present procedures for deciding whether a definition by pattern matching of a dependently typed function consists of cases that are exhaustive and mutually exclusive.Here, we permit not only inputs containing abstractions, but also relational specifications, which are pervasive and unavoidable in constructive type theories.Like the prior work on functions, but unlike prior work on coverage checking [19,24], we can also verify uniqueness and unique existence.
The remainder of the paper is organized as follows.In Section 2 we briefly introduce the notation of the LF type theory used throughout.In Section 3 we describe our algorithm for verifying uniqueness of specified arguments to relations, and we prove its correctness in Section 4. In Section 5 we briefly review coverage checking, one of the central algorithms in verifying the correctness of meta-theoretic proofs.In Section 6 we show how to exploit uniqueness information to increase the power of coverage checking.We conclude in Section 7 with some further remarks about related and future work.

The LF Type Theory
We use a standard formulation of the LF type theory [7]; we summarize here only the basic notations.We use a for type families, c for object-level constants, and x for (object-level) variables.We say term to refer to an expression from any of the three levels of kinds, types, and objects.

Kinds
Contexts and substitutions may declare a variable at most once; signatures may declare families and constants at most once.We do not distinguish terms from any of the three levels that differ only in the names of their bound variables.Our notion of definitional equality is βη-conversion, and we tacitly exploit the property that every kind, type, and object has a unique long βη-normal form [1,8] which we call canonical.The relatively simple nature of this definitional equality avoids some thorny issues regarding intensional and extensional equality in constructive type theories [10,9] that would complicate our analysis.We omit type-level λ-abstractions from the syntax since they do not occur in canonical forms.The principal judgments we use are: Since all judgments are standard we only show the last one for typing substitutions which is perhaps less widely known.We write M [θ] and A[θ] for the application of a substitution.
So a substitution Γ ⊢ θ : ∆ maps a term defined over a context ∆ to a term over a context Γ .We write θ 1 • θ 2 for composition of substitutions, so that , and write id Γ for the identity substitution Γ ⊢ id Γ : Γ .As a running example we use natural numbers defined in terms of zero (z) and successor (s), together with relations for inequality (le) and addition (plus). 1he corresponding signature is given in Figure 1.Note that free variables in a declaration are implicitly universally quantified in that declaration; the Twelf implementation will reconstruct these quantifiers and the types of the free variables [15].

Uniqueness Mode Checking
Logical frameworks that support higher-order abstract syntax, such as LF or hereditary Harrop formulas, are based on a simply typed or dependently typed λ-calculus.Function spaces in such a calculus are purposely impoverished in order to support the use of meta-language functions to represent object language abstractions and hypothetical proofs: too many such functions would invalidate the judgments-as-types or judgments-as-propositions methodology.In particular, these frameworks prohibit function definitions by cases or by primitive recursion.Adding such functions appears to require modal types or an explicit stratification of the type theory [5,23,20,21]; related approaches are still a subject of current research (see, for example, [25,22]).
The traditional and practically tested approach is to represent more complex functions as either type families or relations, depending on whether the framework is a type theory or a logic. 2 In many cases relational representations of functions are sufficient, but there are also many instances where meta-reasoning requires us to know that relations do indeed represent (possibly partial) functions.We can encode this property by defining explicit equality relations.For example, if we need to know that the relation plus is actually a function of its first two arguments, we can define eq : nat → nat → type.refl : eq X X.
We then have to prove: " There are two difficulties with this approach: the first is simply that equality predicates need to be threaded through many judgments, and various rather trivial and tedious properties need to be proved about them.The second is that this methodology interferes with dependent typing because the equality between Y and Y ′ in the example above cannot be exploited by type-checking, since eq is just a user-declared relation.
As uses of the meta-reasoning capabilities of the logical framework become increasingly complex [3,4], intrinsic support for recognizing and exploiting relations that are indeed functions is becoming more and more important.There are two distinct, interconnected problems to be solved.The first is to verify that particular relations are partial functions.The second is to exploit this information to verify that the same or other relations are total.
In this section we address the former: how can we automatically verify that particular relations are partial functions of some of their inputs.This is a stricter version of mode checking familiar from logic programming.There, we designate some arguments to a relation as inputs and others as outputs.The property we verify with mode checking is that if the inputs are given as ground terms, and proof search succeeds, then the outputs will also be ground terms [18].The sharpened version requires in addition that if proof search succeeds, then some designated outputs are uniquely determined.We refer to this process as uniqueness mode checking.
In our applications we actually need to exploit a slightly stronger property: if the designated input arguments to a relation are given as ground terms, then designated output arguments must be ground and uniquely determined, independent of the proof search strategy.In other words, our analysis must be based on a non-deterministically complete proof search strategy, rather than depth-first logic program execution (which is incomplete).
We use terminology from logic programming in the description of our algorithm below.
For the sake of simplicity we restrict the relations for which we verify uniqueness to consist of Horn clauses, which means the relations we analyze are inductively defined.However, the domains of quantification in the clauses are still arbitrary LF terms, which may be dependently typed and of arbitrary order.
In our syntax for the Horn fragment, we refer to a constant declaration that is to be analyzed as a clause.We group dependently occurring arguments into a quantifier prefix ΠΓ and the non-dependent arguments into a conjunction of subgoals G.We call the atomic type Q the head of a clause c : ΠΓ.G → Q.We sometimes refer to a term with free variables that are subject to unification as a pattern.All constructors for type families a appearing at the head of an atomic goal in a program must also be part of the program and satisfy the Horn clause restrictions.
Atomic Goals Q : In the implementation, we do not make this restriction and instead analyze arbitrary LF signatures, enriched with world declarations [19].A description and correctness proof of this extension is the subject of current research and beyond the scope of this paper.
Mode declarations.In order to verify mode properties of relations, we specify each argument of a relation to be either an input (+), an output (-), a unique output (-1), or unmoded (*).Intuitively, the declarations are tied to a nondeterministic proof search semantics and express: If all input (+) arguments to a predicate are ground when it is invoked, and search succeeds, then all output arguments are ground (-).Moreover, in all successful proofs, corresponding unique outputs (-1) must not only be ground, but equal.Unmoded arguments remain unconstrained.
Mode information for a type family a is reflected in the functions ins(a), outs(a), and uouts(a), returning the sets of indices for the input arguments, output arguments, and unique output arguments respectively.
In our example, the following declarations would be correct: The first one expresses that if a goal of the form le M Y for a ground term M succeeds, then Y must also be ground.The second one expresses that every successful search for a proof of plus M 1 M 2 Y with ground M 1 and M 2 yields the same term N for Y .In other words, plus represents a partial function from its first two arguments to its third argument.The second declaration yields ins(plus) = {1, 2}, outs(plus) = { }, and uouts(plus) = {3}.
Our algorithm for uniqueness mode checking verifies two properties: disjointness of input arguments and uniqueness of output arguments.

Disjointness of inputs.
For a given relation with some uniqueness modes on its output arguments, we verify that no two clause heads unify on their input arguments.This entails that any goal with ground input arguments unifies with no more than one clause head.As an example, consider the relation plus from Figure 1 with mode plus +X1 +X2 -1Y.Uniqueness mode checking verifies that plus z X and plus (s X 1 ) X 2 do not have a unifier.This is easy because z and s in the first argument clash.We use the algorithm in [6] which will always terminate, but may sometimes generate constraints that cannot be solved.In that case, uniqueness mode checking will fail.
Strictness.Because we can make the assumption that input arguments are ground, what is most relevant to our analysis is not full unification, but higherorder dependently typed matching.Schürmann [19] has shown that each variable in a higher-order matching problem that has at least one strict occurrence has a unique, ground solution.An occurrence of a variable is strict if it is applied to distinct bound variables and it is not in an argument to another unification variable (see [14] for a more formal definition).
Strictness is central in our analysis to conclude that if matching a pattern against a ground term succeeds, variables with at least one strict occurrence in the pattern are guaranteed to be ground.In our specific situation, we actually employ unification of two types a M 1 . . .M n .= a N 1 . . .N n where certain subproblems (for example, M i .= N i for i ∈ ins(a)) are known to be matching problems.
Checking uniqueness of outputs.Uniqueness of outputs is verified by an abstract non-deterministic logic programming interpreter with left-to-right subgoal selection 3 .The domain used is the space of abstract substitutions with elements unknown (u), ground (g), and unique (q) for each variable x where u carries no information and q the most information.Note that in order for a variable to be unique (q) it must also be ground.Variables of unknown status (u) may become known as ground (g) or unique (q) during analysis in the following situations: -An unknown variable that occurs in a strict position in an input argument of the clause head becomes known to be unique.
if all variables in outputs of Q are at least g Fig. 2. Judgments on abstract substitutions -An unknown variable becomes known to be ground if it occurs in a strict position in the output of a subgoal all of whose inputs are known to be ground or unique.-An unknown or ground variable becomes known to be unique if it occurs in a strict position in a unique output of a subgoal all of whose inputs are known to be unique.
We next describe in detail the uniqueness mode checking for the Horn clause fragment of LF.The checker relies on two sets of judgments on abstract substitutions, which provide reliable, though approximate, information about the actual substitution at any point during search for a proof of a goal.The corresponding non-deterministic search strategy is explained in Section 4.

Abstract objects
µ The first set of judgments have the form Ψ ⊢ Q m > Ψ ′ where Ψ is an abstract substitution with known information, Q is an atomic predicate a M 1 . . .M n , m indicates which arguments to a are analyzed, and Ψ ′ is the result of the analysis of Q.Both Ψ and Ψ ′ will be defined on the free variables in Q.Moreover, Ψ ′ will always contain the same or more information than Ψ .
The second set of judgments Ψ ⊢ Q m hold if Q satisfies a property specified by m given the information in Ψ .Again, if Γ ⊢ Q : type, then Ψ will be defined on the variables in Γ .The various forms of these judgments are given in Figure 2.
The judgments on abstract substitutions are employed by the uniqueness mode checker, which is itself based on two judgments: ⊢ c : ΠΓ.G → P for checking clauses in the program, and Ψ ⊢ G > Ψ ′ for analyzing goals G, where Ψ ′ may contain more information than Ψ and both Ψ and Ψ ′ are defined on the free variables of G.
The mode checker is defined by the inference rules of Figure 3.We view these rules as an algorithm for mode checking by assuming Ψ and G to be given, and constructing Ψ ′ such that Ψ ⊢ G > Ψ ′ , searching for derivations of the premises from first to last.We write Ψ (Γ ) for the abstract context corresponding to the (concrete) context Γ , where each variable is marked as unknown (u).
Definition 1 (Mode correct programs).Given a program P, we write P(a) for the set of clauses in P with a as head.We say P is mode-correct if Fig. 3. Uniqueness mode checking 1.For every type family a in P, if a is declared to have unique outputs, then for any two distinct c 1 : and Q 2 are not unifiable on their inputs.2. For every constant c declared in P, we have ⊢ c : ΠΓ.G → P Part (2) of the definition requires each predicate to have a mode declaration, but we may default this to consider all arguments unmoded (*) if none is given.
As an example, consider once again the plus predicate from Figure 1 with mode plus +X1 +X2 -1Y.We have to check clauses plus z and plus s.We present the derivations in linear style, eliding arguments to predicates that are ignored in any particular judgments.

Correctness of Uniqueness Mode Checking
We next define a non-deterministic operational semantics for the Horn fragment and show that uniqueness mode checking approximates it.The judgment has the form θ |= G > θ ′ , where θ and θ ′ are substitutions for the free variables in goal G.We think of θ and goal G as given and construct a derivation and substitution θ ′ .The semantics is given by the system of Figure 4.In the first rule, σ and θ 1 represent substitutions that unify P and Q[θ 0 ].The fact that these substitutions may not be computable, or that they may not be most general, does not concern us here, since uniqueness mode checking guarantees that any unifier must ground all variables in Γ that have a strict occurrence in the input arguments of P , provided the input arguments of Q[θ 0 ] are ground.Definition 2 (Approximation).We define when an abstract substitution approximates a set of substitutions as follows: Given an abstract substitution Ψ : Γ and a set Θ of substitutions Γ ′ i ⊢ θ i : Γ , we say Ψ approximates Θ (Ψ ≺ Θ) if for every x in the domain of Ψ 1. if Ψ (x) = g then for all θ i ∈ Θ, θ i (x) is ground, and 2. if Ψ (x) = q then for some ground term M and all θ i ∈ Θ, θ i (x) = M .Lemma 1 (Soundness of uniqueness mode checking).Let P be a modecorrect program, G a goal, Ψ : Γ an abstract substitution such that Ψ ⊢ G > Ψ ′ , and Θ a set of substitutions.
Proof.We let D be the set of all derivations of θ |= G > ρ for all θ ∈ Θ.We show by induction on pairs (d, d ′ ) of derivations in D, where d, d ′ are arbitrary the lemma follows for the whole set.
The only nontrivial case is that of an atomic goal Q where the mode checking derivation for Q has the form (unique output variables of Q are mapped to q) The two derivations d and d ′ have the form , so the approximation relation is satisfied for the input variables of Q.
For the output variables, there are two subcases: either there is uniqueness information for the type family of Q, so that only one clause head can match Q, or there is no uniqueness information.
For the first subcase P = P ′ and G = G ′ .We use the mode correctness of the program to obtain the subgoal mode check , where Ψ ′ 2 enforces the mode annotations for the input and output variables of Then θ out and θ ′ out satisfy the mode annotations for the output variables of Q, as required.
For the second subcase the reasoning is similar, but there are no output uniqueness requirements and more than one clause head can match Q. 2 Lemma 2 (Completeness of non-deterministic search).Given ∆ ⊢ Q : type.If Q contains only ground terms in its input positions, and there is a substitution θ and term M such that Proof.The proof is standard, using induction on the structure of M , exploiting the non-deterministic nature of the operational semantics to guess the right clauses and unifying substitutions. 2

Coverage
Coverage checking is the problem of deciding whether any closed term of a given type is an instance of at least one of a given set of patterns.Our work on exploiting uniqueness information in coverage checking is motivated by its application to proof assistants and proof checkers, where it can be used to check that all possible cases in the definition of a function or relation are covered.The coverage problem and an approximation algorithm for coverage checking in LF are described in [24], extending prior work by Coquand [2] and McBride [11].More precisely, a coverage problem is given by a coverage goal and a set of patterns.In our setting it is sufficient to consider coverage goals that are types with free variables ∆ ⊢ A : type; it is straightforward to translate general coverage goals to this form.Definition 3 (Immediate Coverage).We say a coverage goal ∆ ⊢ A : type is immediately covered by a collection of patterns ∆ i ⊢ A i : type if there is an i and a substitution ∆ ⊢ σ i : Coverage requires immediate coverage of every ground instance of a goal.Definition 4 (Coverage).We say ∆ ⊢ A : type is covered by a collection of patterns ∆ i ⊢ A i : type if every ground instance • ⊢ A[τ ] : type for • ⊢ τ : ∆ is immediately covered by the collection ∆ i ⊢ A i : type.
As an example, consider again the plus predicate from Figure 1.We have already shown that the output of plus, if it exists, is unique.In order to show that plus is a total function of its first two arguments, we need to show that it always terminates (which is easy-see [18,16]), and that the inputs cover all cases.For the latter requirement, we transform the signature into coverage patterns by eliding the outputs: The coverage goal: In this example, the goal is covered by the two patterns since every ground instance of the goal plus M 1 M 2 will be an instance of one of the two patterns.However, the goal is not immediately covered because Y 1 clashes with z in the first pattern and s in the second.
When a goal ∆ ⊢ A : type is not immediately covered by any pattern, the algorithm makes use of an operation called splitting, which produces a set of new coverage goals by partially instantiating free variables in ∆.Each of the resulting goals is covered if and only if the original goal is covered.Intuitively, splitting works by selecting a variable u in ∆, and instantiating it to all possible top-level structures based on its type.
In the example, the clashes of Y 1 with z and s suggest splitting of Y 1 , which yields two new coverage goals These are immediately covered by the first and second pattern, respectively, but in general many splitting operations may be necessary.
The process of repeated splitting of variables in goals that are not yet covered immediately will eventually terminate according to the algorithm in [24], namely when the failed attempts to immediately cover a goal no longer suggest any promising candidates for splitting.Unfortunately, this algorithm is by necessity incomplete, since coverage is in general an undecidable property.Sometimes, this is due to a variable x:B in a coverage goal which has no ground instances, in which case the goal is vacuously covered.Sometimes, however, the coverage checker reaches a situation where several terms must be equal in order to obtain immediate coverage.It is in these situations that uniqueness information can help, as we explain in the next section.

Uniqueness in Coverage
We begin with an example that demonstrates failure of coverage due to the absence of uniqueness information.
Given type families for natural numbers, addition, and ordering, a proof that addition of equals preserves ordering can be encoded as the relation preserv in Figure 5.Note that, as before, free variables are implicitly quantified on each clause.Moreover, arguments to type families whose quantifiers were omitted earlier (as, for example, ΠX:nat in the clause le refl : leXX) are also omitted, and determined by type reconstruction as in the Twelf implementation [15].
In order to verify that preserv constitutes a meta-theoretic proof, we need to verify that for all inputs S 1 : plus X 1 X 3 Y , S 2 : plus X 2 X 3 Y ′ , and L : le X 1 X 2 there exists an output L ′ : le Y Y ′ which witnesses that The initial coverage goal has the form This fails, and after one step of splitting on the variable L we obtain two cases, the second of which is seen to be covered by the preserv s clause after one further splitting step, while the first has the form The clause preserv refl does not immediately cover this case, because the types of the two variable S 1 and S 2 in this clause are the same, namely plus X 1 X 3 Y .This is because the use of reflexivity for inequality in the third and fourth arguments of the clause requires X 1 = X 2 and Y = Y ′ .Our extended coverage checker will allow us to show automatically that this case is covered by exploiting the uniqueness information for plus.
We first define the situations in which uniqueness information may potentially be helpful, depending on the outcome of a unification problem.We then show how to exploit the result of unification to specialize a coverage goal.
Definition 5 (Specializing a coverage goal).Given a mode-correct program P containing a type family a with unique outputs, and a coverage goal ∆ ⊢ A : type, uniqueness specialization for a may be applicable if 1. ∆ contains distinct assumptions x 1 : a M 1 . . .M n and x 2 : a N 1 . . .N n , and 2. for all i ∈ ins(a), M i = N i , and 3. for some k ∈ uouts(a), M k = N k .
To specialize the goal, attempt simultaneous higher-order unification of M k with N k for all k ∈ uouts(a).If a most general pattern unifier (mgu) for this problem exists, write it as ∆ ′ ⊢ σ : ∆, and generate a new specialized goal ∆ ′ ⊢ A[σ] : type.
There are three possible outcomes of the given higher-order unification problem, with the algorithm in [6]: (1) it may yield an mgu, in which case the specialized coverage goal is equivalent to the original one but has fewer variables, (2) it may fail, in which case the original goal is vacuously covered (that is, it has no ground instances), or (3) the algorithm may report remaining constraints, in which case this specialization is not applicable.Assertions (1) and ( 2) are corollaries of the next two lemmas.
Lemma 3. If uniqueness information for a type family a is potentially applicable to a coverage goal g = ∆ ⊢ A : type, but no unifier exists, then there are no ground instances of g (and thus g is vacuously covered by any set of patterns).
Proof.Assume we had a substitution • ⊢ θ : ∆ (so that A[θ] is ground).Using the notation from Definition 5, we have M i = N i for all i ∈ ins(a) and therefore Proof.As in the proof of the preceding lemma, assume • ⊢ θ : ∆ (so that A[θ] is ground).Again we have M i = N i for all i ∈ ins(a) and therefore for some θ 1 and θ 2 .From Lemma 1 we now know that for all k ∈ uouts(a), We return to the coverage checking problem for the type family of Figure 5.As observed above, without uniqueness information for plus it cannot be seen that all cases are covered.The failed coverage goal is ⊢ preserv S 1 S 2 le refl .
Exploiting uniqueness information for plus, we have the unification problem Y .= Y ′ , with mgu Y /Y ′ , yielding the new goal X 1 :nat, X 3 :nat, Y:nat, S 1 :plus X 1 X 3 Y, S 2 :plus X 1 X 3 Y.
Since S 1 and S 2 have the same type, the new goal is immediately covered by the clause preserv refl, completing the check of the original coverage goal.

Conclusion
We have described an algorithm for verifying uniqueness of specified output arguments of a relation, given specified input arguments.We have also shown how to exploit this information in coverage checking, which, together with termination checking, can guarantee the existence of output arguments when given some inputs.We can therefore also verify unique existence, by separately verifying existence and uniqueness.While our algorithms can easily be seen to terminate, they are by necessity incomplete, since both uniqueness and coverage with respect to ground terms are undecidable in our setting of LF.
The uniqueness mode checker of Section 3 has been fully implemented as described.In fact, it allows arbitrary signatures, rather than just Horn clauses at the top level, although our critical correctness proof for Lemma 1 has not yet been extended to the more general case.We expect to employ a combination of the ideas from [18] and [19] to extend the current proof.In practice, we have found the behavior of the uniqueness checker to be predictable and the error messages upon failure to be generally helpful.
We are considering three further extensions to the uniqueness mode checker, each of which is relatively straightforward from the theoretical side.The first is to generalize left-to-right subgoal selection to be instead non-deterministic.This would allow verification of uniqueness for more signatures that were not intended to be executed with Twelf's operational semantics.The second would be to check that proof terms (and not just output arguments) will be ground or ground and unique.That would enable additional goal specialization in coverage checking.The third is to integrate the idea of factoring [17] in which overlapping clauses are permitted as long as they can be seen to be (always!)disjoint on the result of some subgoal.
In terms of implementation, we have not yet extended the coverage checker implementation in Twelf to take advantage of uniqueness information.Since specialization always reduces the complexity of the coverage goal when applicable, we propose an eager strategy, comparing inputs of type families having some unique outputs whenever possible.Since terms in the context tend to be rather small, we do not expect this to have any significant impact on overall performance.
Finally, we would like to redo the theory of foundational proof-carrying code [3,4] taking advantage of uniqueness modes to obtain a concrete measure of the improvements in proof size in a large-scale example.We expect that most uses of explicit equality predicates and the associated proofs of functionality can be eliminated in favor of uniqueness mode checking and extended coverage checking.As a small proof of concept, we have successfully uniqueness-checked four type families in the theory, amounting to about 150 lines of Twelf code in which the use of functional arguments is pervasive.Combined with coverage checking, these checks might eliminate perhaps 250 lines of proof.

Fig. 1 .
Fig. 1.Natural numbers with ordering and addition

2 Lemma 4 .
Since the empty abstract substitution approximates the empty substitution, we know by Lemma 1 that for all k ∈ uouts(a),M k [θ] = N k [θ].But this is impossible since for at least one k ∈ uouts(a), M k and N k were non-unifiable.Let g = ∆ ⊢ A : type be a coverage goal, and P a mode-correct program with uniqueness information for a potentially applicable to g.If an mgu ∆ ′ ⊢ σ : ∆ exists and leads to coverage goal ∆ ′ ⊢ A[σ] : type, then every ground instance A[θ] of A is equal to a ground instance of A[σ].