<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>The -calculus Modulo as a Universal Proof Language</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mathieu Boesp ug</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Quentin Carbonneaux</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Olivier Hermant</string-name>
          <email>ohermant@isep.fr</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>INRIA and ENPC</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>McGill University</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
      <fpage>28</fpage>
      <lpage>43</lpage>
      <abstract>
        <p>The -calculus forms one of the vertices in Barendregt's -cube and has been used as the core language for a number of logical frameworks. Following earlier extensions of natural deduction [14], Cousineau and Dowek [11] generalize the de nitional equality of this well studied calculus to an arbitrary congruence generated by rewrite rules, which allows for more faithful encodings of foreign logics. This paper motivates the resulting language, the -calculus modulo, as a universal proof language, capable of expressing proofs from many other systems without losing their computational properties. We further show how to very simply and e ciently check proofs from this language. We have implemented this scheme in a proof checker called Dedukti.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The success of formal methods since the pioneering e orts of the teams around LCF and
Automath, both as tools of practical importance and as objects of intellectual curiosity, has
spawned a bewildering variety of software systems to support them. While the eld has
developed to maturity in academia and has registered some important successes in the industry,
such as in aerospace, mass transit and smart cards to name a few, the full bene t of formal
methods in an industrial setting remains largely untapped. We submit that a lack of standards
and easy interoperability in the eld is one explanation to this state of a airs.</p>
      <p>Indeed, the eld of formal methods has largely passed on the typical trend of other elds
in computer science and engineering as they mature: the shift from systems to data.
Standards have emerged for numbers, texts, images, sounds, videos, structured data, etc. These
standards are not linked to a particular application, but all the applications comply to these
standards, allowing the interoperability of various software, even on heterogeneous networks.
When a community reaches a critical mass, standardization is unavoidable to allow exchange
and collaborative improvements. As long as the use of proof systems was restricted to a small
community, each system could develop its own independent language. But, this is not possible
anymore: the success of proof systems and the widening of their audience put the
interoperability problem to the fore.</p>
      <p>Yet, importing and exporting lumps of proofs from system to system is a thorny issue,
because di erent systems implement di erent formalisms: some are constructive, some are not,
some are predicative, some are not, some are rst-order, some are not, etc. Thus, a standard
must not only be able to de ne the proofs themselves, but also to specify the formalism in which
they are expressed. To de ne such a standard, we propose the -calculus modulo, a simple
but very powerful extension of a well-known and well understood proof language for minimal
rst-order logic that embeds a congruence on types generated by a set of rewrite rules.
1.1</p>
      <sec id="sec-1-1">
        <title>From deep to shallow</title>
        <p>Avoiding the quadratic blowup in the number of adapters necessary between n di erent systems
means introducing one common target for all these adapters. All foreign systems read and
write a single proof format. One might hope to construct a formalism so powerful that other
formalisms form a fragment of this super formalism, but this is infeasible in practice. For
one, di erent formalisms require di erent but incompatible features, such as predicativity or
impredicativity. Moreover, justifying the consistency of such a tower of Babel might not be
quite so easy. Finally, the vast majority of proofs simply would not need the full power o ered
by the formalism, only ever using a small fragment of it.</p>
        <p>
          The alternative is to chose a simple formalism, say rst-order logic, and make other
formalisms the objects of discourse of this simple formalism. This is known as a deep embedding.
One will assert appropriate axioms to introduce these objects of discourse, such as axioms
characterizing the set of formulas, proof objects, validity judgments on proof objects, etc. This
is the approach used by Edinburgh Logical Framework [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ], Twelf [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ], Isabelle [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] and
others.
        </p>
        <p>Proofs, however, are not interesting merely for the validity of the judgment they establish.
It can be desirable to reason about the proofs themselves. Realistic proofs of interesting facts
typically contain detours in the reasoning. These detours often make the proof shorter, though
they will usually be taken to be equivalent in some precise sense to a canonical derivation
that does not contain any detours, or cuts. Eliminating cuts in a proof is a procedure, i.e. a
computation.</p>
        <p>When proofs are objects of discourse, it is convenient to be able to reason about them
modulo elimination of any cuts. Many formalisms, such as the Calculus of Constructions or
the original LF, include a powerful notion of de nitional equality that includes equality modulo
cuts. Hence, identity of two proof objects can be established not by writing tedious reasoning
steps, but rather by an appeal to this rather large de nitional equality, written ( ), which
can be decided by applying the cut elimination procedure. The more powerful the de nitional
equality, the more often derivations may appeal to it, hence the shorter they become.</p>
        <p>Pure Type Systems (PTS), of which the Calculus of Constructions and LF are an instance,
internalize de nitional equality using the following conversion rule:
where s is some PTS dependent sort. Arguing that two objects are equal can be done in only
one derivation step if they are de nitionally equal. The trouble here is that the notion of
de nitional equality is xed once and for all, no matter the objects of discourse du jour. Hence,
a deep embedding of foreign logics treats formulas, judgments and proofs of these logics as
second class citizens | one can always de ne a judgment ( L) on proofs of a foreign logic L,
but given two proofs P; Q in L, one can only justify P L Q using a derivation, not the native
de nitional equality decision procedure.</p>
        <p>In short, deep embeddings destroy the computational behaviour of proofs, because proof
identity can no longer be justi ed computationally. Moreover, in general desirable properties
such as canonicity of values and the existence of empty types are lost due to the presence of
axioms. Many of these axioms uniquely characterize functions on the objects of discourse, for
example as a set of equations. If only we could turn these equations into rewrite rules instead,
we would be able to directly compute the results of applying these functions, rather than having
to systematically prove using derivations that a function application is related to its result.</p>
        <p>The -calculus modulo extends the -calculus, the core calculus of the original LF,
with the ability to de ne one's own rewrite rules. The conversion rule above is modi ed to
take de nitional equality to be an arbitrary congruence, generated by some set of user de ned
rewrite rules R. In the -calculus modulo, we eschew equational axioms and instead turn them
into rewrite rules. Intuitively, because the native de nitional equality is now extensible, when
embedding a foreign logic within the -calculus modulo, we can tune the native de nitional
equality to internalize the foreign de nitional equality. The computational behaviour of proofs
is thus restored. The resulting embeddings are still deep embeddings, but we can introduce
rewrite rules in a systematic way that essentially interpret a deep embedding into another
shallow embeddings.
1.2</p>
      </sec>
      <sec id="sec-1-2">
        <title>Specifying logics</title>
        <p>In the -calculus modulo, a theory is speci ed by a nite set of typed constants and a nite
set of typed rewrite rules. This set of rules de nes the computational behavior of the set of
constants. Encoding proofs of a logical system is achieved by writing a translation function from
proofs of the original logical system to well typed terms of the -calculus modulo extended
by the appropriate constants and rewrite rules. The same translations as the ones de ned for
LF could be reused since LF is a strict subset of the -calculus modulo. However, in this case
no bene t is drawn from the new computational facilities o ered by our framework and the
computational properties of proof objects are lost.</p>
        <p>
          We propose to use shallow embeddings as described above. Not only do proofs enjoy smaller
representations but consistency of theories can be proved with more generic techniques using,
for instance, super-consistency based approaches as described in [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]. Specifying full theories
with rewrite rules only, as opposed to traditional axiomatic encodings, allows to show semantic
properties of the logical system by checking properties on the set of rewrite rules. For example,
if a theory can be expressed in -calculus modulo with a set of rewrite rules R and if the
rewriting modulo R + is well-behaved, then the theory is consistent and constructive proofs
have the disjunction property and the witness property. Moreover, these shallow embeddings
present theories in ways which share a generic notion of cut, rather than a theory speci c notion
of cut.
1.3
        </p>
      </sec>
      <sec id="sec-1-3">
        <title>A new proof checker</title>
        <p>
          To support this language, we propose a new proof-checker called Dedukti. A number of proof
checkers for similar logical frameworks have been proposed, such as Twelf [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ] and LFSC [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ],
alternately aiming for relative simplicity and correctness, or for focusing more on performance
but hopefully also maintaining correctness. LFSC in particular focuses on checking proofs of
very large size or many proofs with respect to a xed signature. Within the design space, we
focus on checking small but computationally intensive proofs, through translations of proofs
into higher order data and into functional programs. We obtain a very simple implementation
to boot, that directly corresponds to the bidirectional typing rules that form its speci cation.
1.4
        </p>
      </sec>
      <sec id="sec-1-4">
        <title>Overview</title>
        <p>
          This paper will rst present the -calculus modulo and motivate its use as a target language
for many other systems (Section 2). We will then describe informally the rationale behind a
purpose built proof-checker we have developped. A companion paper [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] describes in details
the encoding of the calculus of constructions inside the -calculus modulo, as well as practical
results in checking Coq's standard library.
WF
        </p>
        <p>Context</p>
        <p>is well-formed
The -calculus modulo is a familiar formalism | it is a variation on the -calculus, which
under the guise of many names (LF, P , etc), has been used with great success to specify other
formalisms, from logics to programming languages. The -calculus is a simple proof language
for minimal rst-order logic, whose syntax for pre-terms can be given succinctly as follows,
provided we have an in nite set X of variable names:</p>
        <p>
          M; N; A; B ::= x j x:A: M j
x:A: B j M N j Type j Kind
The notation A ! B stands for x:A: B when x does not appear in B. In the tradition of Pure
Type Systems (PTS) [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], we con ate the language of formulas, proofs and sorts (or types, terms
and kinds if we are looking from the other side of Curry-Howard lens) into a single language.
Within the set of pre-terms (or raw terms) we distinguish the set of terms, which are well-typed.
        </p>
        <p>The type system for the -calculus, given in gure 1, does enforce a strati cation between
sublanguages, that of terms, of types and of kinds: terms are typed by a type, types are typed
by a kind and kinds are of type Kind.</p>
        <p>Notice that in general types can be indexed by terms, giving a family of types, and that
one can -abstract not only over terms but also over types. For these two reasons, -redexes
can appear at the level of types and it is convenient to quotient them by -equivalence (written
( )) through the conversion rule. In gure 1, all the contexts are lists of pairs of a variable
name and a type:
;
::=</p>
        <p>j ; x:A
congruence is generated by the -reduction rule alone, while in the
generated by -reduction and the rewrite rules, as presented below.
-calculus modulo it is
Well-typed terms live within a context. One can segregate this context into a global shared
context and a local context. We will write for this global context, which we call a signature
and we assume to be well-formed. The assumptions of a signature are constants.</p>
        <p>A system of rewrite rules is declared over constants of some signature . Each rewrite rule
pertains to one constant of the signature. A typed rewrite rule is a rewrite rule paired with a
typing context that assigns types to all the free variables appearing in the left hand side of
the rule. Both sides of a rewrite rule must be typable with the same type A.
De nition 1 (Rewrite rule). Let be a context. A rewrite rule in is a quadruple l ! ;A r
composed of a context , and three -normal terms l; r; A, such that it is well-typed:
the context ; is well-formed,
and ; ` l : A and ; ` r : A are derivable judgments.</p>
        <p>In order to use the rewrite rule, we must rewrite the instances of the left member by instances
of the right member. Instances are done through typed substitutions.</p>
        <p>De nition 2. Let ;
is said to be of type
Lemma 3. Let and
of type . Then
;
and</p>
        <p>be contexts. A substitution binding the variables declared in
if for any x:T 2 , we can derive ; ` x : T .
be contexts, l ! ;T r be a rewrite rule in and be a substitution</p>
        <p>` l : T and ; ` r : T and we say that l rewrites to r.</p>
        <p>For a context and R a set of rewrite rules in , we let R be the smallest congruence
generated by R. We write ( !) and ( ) (respectively) for the contextual closure and the
smallest congruence generated by -reduction and R.
2.3</p>
      </sec>
      <sec id="sec-1-5">
        <title>How to encode formalisms in the -calculus modulo</title>
        <p>
          The claim of this paper is that the -calculus modulo can serve as a melting pot, capable of
expressing all manner of other type theories. This is in particular the case for all functional
PTS [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. By way of example, let us see how to encode polymorphism ( la System F).
        </p>
        <p>The typing rules of System F are identical to the rules of the -calculus that are presented
in gure 1, except for the rules (prod) and (abs) that become:
(F-prod)
` A : s
`</p>
        <p>; x : A ` B : Type
x : A:B : Type
(F-abs) ` A : s ; x`: Ax`:AB:M: T:ypex:A: B ; x : A ` M : B s 2 fType; Kindg
System F is also strati ed into kinds (Type is the only kind), types and terms. For brevity and
to lift any ambiguities, in the following we write ? (resp. 2) for the constant Type (resp. Kind)
of System F. A typical example of term that is typable in System F is the polymorphic identity:</p>
        <p>To encode System F in the -calculus modulo, we introduce four constants. U?; U2, also
called universe constants re ect the types ? and 2 of System F in the -calculus modulo. To
each universe is associated a decoding function " from System F types and function spaces to
the native -calculus modulo types and function spaces.</p>
        <sec id="sec-1-5-1">
          <title>U2 : Type</title>
          <p>U? : Type
"2 : U2 ! Type
"? : U? ! Type
Now we introduce a constant that represents a deep embedding of the -types of System F as
higher order abstract syntax into the -calculus modulo:
Together with rewrite rules extending the decoding function to these System F types:
_ h2;?;?i
_
h?;?;?i
:
:</p>
          <p>X:U2: ("2 X ! U?) ! U?</p>
          <p>X:U?: ("? X ! U?) ! U?
"? ( _ h2;?;?i X Y )
"? ( _ h?;?;?i X Y )
!
!
x:("2 X): "? (Y x)
x:("? X): "? (Y x)
Both rewrite rules have type Type (see De nition 1). They contain the free variables X and Y ,
so they are de ned (respectively) in the contexts:</p>
          <p>X : U2; Y : ("2 X)
X : U? ; Y : ("? X)
! U?
! U?</p>
          <p>
            Cousineau and Dowek [
            <xref ref-type="bibr" rid="ref11">11</xref>
            ] go on to de ne a translation from terms and types of System
F to terms and types using the above constants, and proving conservativity results for this
translation. Since our goal here is didactic, we will only give the example of the translation
of the previous polymorphic identity, that can now be written in our settings as (keeping the
global signature made up of the above constants implicit):
` ( A:("2 ?): x:("? A): x) : "?
_ h2;?;?i ?
h
          </p>
          <p>A : ("2 ?): ( _ h?;?;?i A ( x : ("? A): A))
i
which, after simpli cation of "2 ? in U? and rewriting of the _ h2;?;?i constant gives the term:
`
after -reduction and rewriting of ("2 ?), we get:
and after another step of rewriting of the _ h?;?;?i:
After -reduction and -conversion, we have:
`
a judgment for which one can easily construct a derivation in the -calculus modulo.</p>
          <p>Remark in particular how the use of higher order abstract syntax in the encoding of System
F types a ords us substitution on those types for free. Also, polymorphism has been introduced
in this term, through the constant "? that behave as a lifting from terms to types and from deep
to shallow embeddings: this is clearly allowed by its nonempty computational content. Finally,
conceivably one could along the same lines encode the -calculus into the -calculus modulo
through the same mechanisms described above. This encoding would not be the identity (we
would still have " and \dotted" constants appearing in types).
3
3.1</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>An abstract type checking algorithm</title>
      <sec id="sec-2-1">
        <title>Bidirectional type checking</title>
        <p>
          Dedukti's internal representation of terms is domain-free, as introduced in [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], meaning that
abstractions are not annotated by the type of the variable that they bind. This information
is largely redundant if one adopts a bidirectional typing discipline, a technique going back to
[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Hence, input terms are smaller at no cost to the complexity or size of the type checker.
Bidirectional type systems split the usual type judgments into two forms: checking judgments
and synthesis judgments. Dropping the domains on abstractions means that some terms cannot
have their type readily inferred | these terms can only be checked against a given type, their
type cannot be synthesized.
        </p>
        <p>Contrary to the usual presentation of -calculus as a PTS, given in Section 2, the
bidirectional type system we present in Figure 2 is syntax directed. As such, the choice of rule to
apply at each step of the derivation is entirely determined by the shape of the term that is being
typed. In particular, conversion only happens during a phase change between checking mode
and synthesis mode. The moment at which this phase change is allowed to occur is guided
by the \inputs" to the judgments. As such, the type system presented here is deterministic.
One can therefore readily extract an algorithm from these typing rules: checking rules should
be read as functions taking a context, a term and type as input and answering true or false;
synthesis rules should be read as functions taking a context and term as input and producing
a type as output.
3.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Context-free type checking</title>
        <p>
          One particularly thorny issue when checking dependently typed terms is the treatment of
renaming of variables to ensure that contexts remain well-formed and the implementation of
substitution. In keeping with the spirit of the de Bruijn criterion [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], we strive to obtain an
implementation of a type checker that is as simple and small as possible. In Dedukti, we
have done so using a higher-order abstract representation (HOAS) of terms, which allows us to
piggy-back substitution over terms on the substitution already provided by the implementation
language. In such a setting, abstractions are encoded as functions of the implementation
language. They are therefore opaque structures that cannot be directly analyzed. Functions are
black boxes whose only interface is that they can be applied. In HOAS, it is therefore
necessary to draw the parameter/variable distinction common in presentations of rst-order logic |
variables are always bound and parameters (or eigenvariables) are variables that are free. As
we move under a binding, such as an abstraction, the bound variable becomes a parameter. In
HOAS, this means that we must substitute a piece of data representing a new parameter for the
previously bound variable. In this section we do not address the implementation of a concrete
algorithm (postponed to Section 4) but elaborate a type system that capture the essence of the
way the implementation of Section 4 works.
        </p>
        <p>If in order to proceed to the body of abstractions it is necessary to unfold
implementationlevel functions by feeding them parameters, we might as well feed more than just a parameter
to these functions. We can indeed pass the type of the parameter along with it. In other words,
we substitute a box | a pair of a term and its type | for bound variable as we move between
bindings. We arrive in this way at a context-free type system, so-called because we no longer
need to carry around a typing context in judgments, provided all free variables (parameters) in
terms are always boxed.
3.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Putting it all together</title>
        <p>The resulting type system, bidirectional and context-free, is given in Figure 2. A straightforward
mapping of these rules into a purely functional program is discussed in Section 4. The syntax
over which these rules are de ned is given below.</p>
        <p>In its essence, a proof script consists of a sequence of non-recursive declarations of the form
x : A. Later declarations have earlier declarations in scope. Proof scripts are type checked
following the order of the sequence. Given a term M , checking that this term has some given
type A will rst assume that A has already been type checked, just as the types of constants
appearing in A may be assumed to already be checked when checking A. Therefore adding
premises ensuring that contexts are well-formed to the leaf rules and mixing premises about
types in the deduction rules for term typing as is done in the standard presentation of Section 2
does not accurately re ect how type checking works in practice. In the rules of Figure 2, the
type A in a judgment ` M ( A is assumed to be a proper type or kind.</p>
        <p>For the needs of type checking we can therefore use two distinct representations: one for
the subject of a judgment (to the left of ) or (), underlined,</p>
        <p>M ; N ; A; B ::= x j [y : A] j x: M j
x:A: B j M N j Type
and one for the classi er of a judgment (to the right of ) or (), overlined,
M ; N ; A; B ::= x j y j x: M j
x:A: B j M N j Type j Kind
We reuse the same syntactic elements for both representations. The essential di erence between
the two representations is that in the rst, parameters y are tagged with their type, whereas
in the second parameters are bare. This is because it is not the classi ers that we are type
checking, but only the subjects of typing judgments. The type of a parameter in a classi er
is therefore not needed. We split the in nite set of variables into two disjoint in nite sets of
(bound) variables x on the one hand and parameters y on the other. There is no way of binding
parameters, because they stand in place of free variables.</p>
        <p>In the rules of Figure 2, the judgment ` M ) A reads \the expression N synthesizes type
A" and the judgment ` M ( A reads \the expression M checks against type A". Within
judgments, we omit making the representation explicit through overlining and underlining,
because which representation we mean is evident from the position in a judgment. In some
rules we observe a crossover of subparts of the subject into the classi er and vice versa. In
the (appb) rule, the argument part N crosses over to the right of the synthesis arrow. In the
(absb) rule, the type A appears both in the subject part of a premise, but in the classi er part
` M ) A</p>
        <p>Term M synthesizes type A
(sortb)
` Type ) Kind
(appb)</p>
        <p>` M ) C
` M ( A</p>
        <p>Term M checks against type A
(absb)
(prodb)</p>
        <p>C
!w</p>
        <p>x:A: B
` M N ) fN=xgB
` x: M ( C
`</p>
        <p>x:A: B ( s
` N ) B
` N ( A</p>
        <p>A</p>
        <p>B
C
!w
x:A: B</p>
        <p>` f[y : A]=xgM ( fy=xgB
` A ( Type
` f[y : A]=xgB ( s</p>
        <p>s 2 fType; Kindg
(convb)
(varb)</p>
        <p>` [x : A] ) A
` N ( A
This relation is left-total and right-unique, so that it determines a function from subject
representations to classi er representations. Synthesis rules should be read top-down and checking
rules bottom-up, so we don't need a coercion in the opposite direction.</p>
        <p>In the (absb) and (prodb) rules, the new parameter y introduced in the premises must be
chosen fresh. This condition can always be satis ed since terms are of nite size and the set of
parameters is in nite.</p>
        <p>Example 4. Consider the polymorphic identity as described in section 2. A type derivation
for this term in the b-calculus modulo can be given as follows:
x:("? y1): ("? y1)
!w
x:("? y1): ("? y1)
A: :::
!w</p>
        <p>A: :::
`</p>
        <p>A: x: x (</p>
        <p>` x: x (
A:U?: x:("? A): ("? A)
x:("? y1): ("? y1)
` [y2 : "? y1] ) "? y1
` [y2 : "? y1] ( "? y1
3.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Reduction on types</title>
        <p>The algorithm presented here relies on nding the weak head normal form of types in order to
proceed. This imposes that the set of rewrite rules used to generate the congruence ( ) veri es
a certain number of properties for the algorithm to be deterministic and complete. Notice that
reduction happens only on the classi er parts of a judgment. Reduction hence does not need
to concern itself with dealing with boxes.</p>
        <p>De nition 5 (Weak reduction). Given a set R of rewrite rules, we de ne weak reduction
( !w) as the contextual closure of the union of the usual -rule with R under the reduction
context</p>
        <p>C ::= [] j C M j M C j
x:C: B
Its re exive and transitive closure is written ( !w) and its re exive, transitive and symmetric
closure is written ( w).</p>
        <p>!w
!w Type;
!w Kind.</p>
        <p>De nition 6 (Standardization). A relation on terms, provided it is con uent, is said to be
standardizing if:
1. M x N1 : : : Nn implies M !w x N10 : : : N n0 and N1 N10 ; : : : ; Nn N n0;
2. M x: N implies M !w x: N 0 and N 0 N ;
3. M x:A: B implies M x:A0: B0 and A0 A and B0 B;
4. M Type implies M
5. M Kind implies M</p>
        <p>
          If ( !) is con uent, standardizing and strongly normalizing, then it is su cient to compute
weak head normal forms [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], which are the normal forms of the weak reduction relation de ned
above. The reduction relation ( !w) may in general be non-deterministic | in that case one
can x a speci c reduction strategy. This can also be a way to ensure con uence and strong
normalization.
        </p>
        <p>
          Remark 7. The typing rules of this section are closer to an actual implementation of a type
checker, but a legitimate question to ask is how do we know that they are sound and complete
with respect to the typing rules of Figure 1. Coquand [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] presents essentially the same
algorithm as above (though not context-free) for a simple dependent type theory where Type : Type,
and proves it sound through semantic means. Abel and Altenkirch [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] prove soundness and
partial completeness of a very similar algorithm to that of Coquand through syntactic means. Their
proof relies only on con uence and standardization properties of -reduction and can readily
be adapted to a type system such as the -calculus modulo provided the rewrite rules respect
the same properties. The rst author has formalized soundness and completeness results about
various context-free type systems [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
3.5
        </p>
      </sec>
      <sec id="sec-2-5">
        <title>Rewriting and dependent types</title>
        <p>Rewrite rules can be classi ed according to the head constant to which they pertain. One can
read the set of rewrite rules for one same head constant as clauses of a functional program, the
left hand side of which contains a number of patterns.</p>
        <p>However, contrary to an ordinary functional program, in the presence of dependent types
matching one term might force the shape of another term. This will typically happen when a
constructor forces one of the indexes of the type family in its result type. One simple example
of this situation is the head function on vectors, de ned in the following signature:</p>
        <sec id="sec-2-5-1">
          <title>Nat : Type</title>
          <p>Vector : n : Nat: Type</p>
          <p>Z : Nat
Nil : Vector Z</p>
          <p>
            S : Nat ! Nat
Cons : n:Nat: Nat ! Vector n ! Vector (S n)
The type and the rewrite rule associated to the head function are:
head :
n:Nat: Vector n ! Nat
head fS ng (Cons n h tl)
! h
A non-linear pattern seems to be needed because n appears twice in its left hand side. We
cannot just generalize the rst pattern in this rewrite rule, because then the left hand side
would be ill-typed. A non-linear pattern would mean that we must check that the instances
for the two occurrences of n are convertible. Moreover, in general inductive type families might
be indexed by higher-order terms, meaning that we would need to implement higher-order
matching. However, what we actually want to express is that any instance to the rst pattern
of the rewrite rule above is uniquely determined by a matching instance of the second pattern.
Indeed, matching on the Cons constructor forces the dependent rst argument to head to be
S n. As such, the rst argument to head plays no operational role; it is merely there for the
sake of typing. Following Agda [
            <xref ref-type="bibr" rid="ref22">22</xref>
            ], in Dedukti we support marking parts of the left hand
side of a rule as operationally irrelevant using curly braces | actual arguments are not pattern
matched against these operationally irrelevant parts, hence we can avoid having to implement
full higher-order matching, which carries with it an inherent complexity that we would rather
keep out of a proof checking kernel.
          </p>
          <p>Note that the braces could equally have been placed around the n that is fed as argument
to Cons. The only important property to verify is that one and only one occurrence of n must
not have braces. This occurrence will be the one that binds n.
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>An implementation of the type checking algorithm</title>
      <p>We have by now developed an abstract characterization of a proof checking algorithm. However,
we have not so far been explicit about how to implement substitution on terms, nor have we
discussed how to decide de nitional equality algorithmically. Ideally, whatever implementation
we choose, it should be both simple and e cient. Indeed, encodings in the style of Section 2.3
introduce many more redexes in types than were present in the original input. Moreover,
computing the weak head normal form of some types may require an arbitrarily large number
of reductions, even before any encoding overhead, such as can be the case in proofs by re ection.</p>
      <p>
        Normalization by evaluation (NbE) is one particularly easy to implement normalization
scheme that alternates phases of weak reduction (i.e. evaluation) and rei cation phases (or
readback phases [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]). Weak reduction is signi cantly easier to implement than strong
reduction, which in general requires reduction under binders. Evaluation conveniently side steps
the traditionally vexing issues of substitution such as renaming of variables to avoid capture,
because evaluation only ever involves substituting closed terms for variables1. What's more, if
evaluation is all that is required, we can pick e cient o -the-shelf evaluators for stock functional
programming languages to do the job. These evaluators are invariably much more e cient than
we could feasibly implement ourselves | their implementations have been ne-tuned and well
studied for the bene t of faster functional programs over many years. What's more, we achieve
a better separation of concerns by using o -the-shelf components: we are in the business of
writing type checkers, not evaluators. The size of the trusted base arguably does not decrease
if we are to rely on an existing evaluator, but trust is all the better for it nonetheless, because a
mature o -the-shelf component has likely been stress tested by many more users in many more
settings than any bespoke implementation we can come up with.
      </p>
      <p>1A term may contain parameters but those cannot be captured: there are no binding forms for parameters
in the syntax of terms.
jjxjj = x
jjyjj = VarC y
jj x: M jj = LamC ( x ! jjM jj)
jj x:A: Bjj = PiC jjAjj ( x ! jjBjj)
jjM N jj = app jjM jj jjN jj
jjTypejj = TypeC
jjKindjj = KindC
(a)</p>
      <p>jxj = x
j[y : A]j = BoxT y
j x: M j = LamT ( x ! jM j)
j x:A: Bj = PiT jAj ( x ! jBj)
jM N j = AppT jM j jN j
jTypej = TypeT
(b)</p>
      <p>
        For simplicity, we use an untyped variant of NbE, in the style of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] (see also [
        <xref ref-type="bibr" rid="ref16 ref20 ref9">16, 20, 9</xref>
        ]).
We proceed by translating terms of the -calculus modulo into Haskell programs. Assume
the following datatype of evaluated terms:
data Code = VarC Int j AppC Code Code
j LamC (Code ! Code) j PiC Code (Code ! Code)
j TypeC j KindC
One can view the values of this datatype as code because these values are interesting for their
computational behavior. Translation of terms into values of this type is given in Figure 3.
Because we only ever need to compute with classi ers during type checking, this translation is
de ned over the classi er representation of terms, not the subject representation.
      </p>
      <p>The actual identity of a bound variable is usually quite irrelevant2. What is relevant is to
be able to conveniently substitute another term for all free occurrences of a variable under its
binder. Paramaters are dual, in that we never need to substitute for a parameter, nor do they
have scope since they cannot be bound, but their identity is crucial. During type-checking, we
must be able to ask whether this parameter is the same as this other parameter.</p>
      <p>We therefore map (bound) variables to variables of the target language, allowing us to piggy
back substitution and scope management onto that of the target language. We get substitution
essentially for free. Parameters, on the other hand, are a ground piece of data: a name. Here,
for simplicity, we use integers for names.</p>
      <p>In a similar spirit, we wish to reuse the target language's computational facilities to reduce
terms to normal forms. Therefore applications are mapped to target language applications.
However, our embedding of terms in the target language is not quite shallow, in that functions
and so on are not represented directly as functions of the target language but rather as values of
type Code. This embedding into a monomorphic datatype is essentially an untyped embedding,
thus avoiding the impedence mismatch between the type system of the -calculus modulo
and that of the target language, in our case Haskell. Therefore we must introduce app,
a wrapper function around the native application operation, which essentially decapsulates
functions embedded in values of type Code:</p>
      <p>app :: Code ! Code ! Code
2Indeed this is why formal developments in the presence of binding internalize Barendregt's variable
convention in some form.
app (LamC f ) t = f t
app t1 t2 = AppC t1 t2
If the rst argument of app is a function, then we can proceed with the application. If not, we
are stuck, and the result is a neutral term.</p>
      <p>Deciding the equality between two terms can now be done near structurally:
conv :: Int ! Code ! Code ! Bool
conv n (VarC x ) (VarC x 0) = x x 0
conv n (LamC t ) (LamC t 0) = conv (n + 1) (t (VarC n)) (t 0 (VarC n))
conv n (PiC ty1 ty2) (PiC ty3 ty4) = conv n ty1 ty3 ^</p>
      <p>conv (n + 1) (ty2 (VarC n)) (ty4 (VarC n))
conv n (AppC t1 t2) (AppC t3 t4) = conv n t1 t3 ^ conv n t2 t4
conv n TypeC TypeC = True
conv n KindC KindC = True
conv n = False
Descending under binding structures gives the weak head normal form of their body, which is
computed automatically according to the semantics of the target language. The rst argument
serves as a supply of fresh parameter names; these need only be locally unique so a local supply
is su cient.</p>
      <p>We now have a succinct and yet e cient way of deciding equality of two terms that we
know to be well-typed. The translation of Figure 3 for classi ers isn't appropriate, however,
for subjects of type checking, because contrary to classi ers, subjects are not a priori
welltyped. Therefore, we cannot assume that any kind of normal form exists for subjects, lest we
compromise the decidability of type checking. We therefore introduce an alternative translation
for subjects, where terms are not identi ed modulo any reduction. This translation is given in
part (b) of Figure 3. Note that it is a completely standard mapping of terms to higher order
abstract syntax, into values of following datatype:
data Term = BoxT Code Code j AppT Term Term
j LamT (Term ! Term) j PiT Term (Term ! Term)
j TypeT
One particularly nice feature of this translation is that it di ers from that for classi ers in one
single place: the interpretation of applications.</p>
      <p>In Dedukti, to control the amount of code that we generate, and to avoid writing wasteful
coercions between values of type Term and values of type Code, which we would have to invoke
at every application node in the term that we are checking, we generate a single Haskell source
for a single proof script, containing both the subject translation and classi er translation for
every subterm of the proof script. That is, Term and Code representations are tied together for
every subterm, through a system of pairing (or gluing). This way no coercion is necessary, but
if we performed this gluing naively, it would obviously provoke and explosion in the size of the
generated code. The size would grow exponentially with the tree depth of terms, because we
would be duplicating subtrees at every level.</p>
      <p>
        For this reason, in the actual implementation, we rst transform terms into a linear form,
namely A-normal form. In this form, all subterms are named, so that it becomes possible
to share substructures of translations at every level, hence avoiding any kind of exponential
blowup. The rationale for this translation is similar to that of let-insertion to avoid blowups
during partial evaluation [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. We also perform closure conversion to further improve sharing.
jjxjjpat = x
jjc N1 : : : Nnjjpat = App (: : : (App (Var c) jjN1jjpat) : : :) jjNnjjpat
      </p>
      <p>Both of these standard code transformations can be performed selectively, only for subterms
where both the subject and classi er representations are needed (both forms are need only
when checking applications M N , and then only when the type synthesized for M is of the
form x:A: B where x does occur in B).
If we commit to a particular rewrite strategy, and for convenience we commit to a particular
rewrite strategy that matches the evaluation order of the target language, then we can extend
the scheme given previously to gracefully handle custom rewrite rules. The idea is to read the
rewrite rules for one same head constant as the clauses of a functional program. This is the idea
behind the translation of rewrite rules as functional programs over values of type Code given in
Figure 4. The resulting functional program implements the rewrite rules in exactly the same
way that the app function implements -reduction; if for a given subterm none of the rewrite
rules apply, then the result is a neutral term.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>We have presented in this paper a simple and extensible calculus that works well as a common
format for a large number of other proof systems. The essential di erence with previous
proposals is that through an extensible de nitional equality, the -calculus modulo can act as a
logical framework that respects the computational properties of proofs. We showed how this
calculus can be implemented very succinctly by leveraging existing evaluation technology.</p>
      <p>
        Our approach is rmly grounded in type theory; computation only happens as a result of
checking for convertibility between two types, just as in other type theories. Other recent e orts
for a common proof format, such as the proposal of Miller [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] grounded in proof theory, use
focusing to structure proofs and to formulate customized macro proof rules in terms of some
primitive rules. This framework captures a more general notion of computation than the one
presented here: Miller's is formulated as proof search rather the functional programming centric
approach we present here (our implementation views rewrite rules as inducing a recursive,
pattern matching function). Computations in Miller's framework need not be deterministic and
can indeed backtrack. The cost of this generality is that the proof checker needs to know how
to perform uni cation and backtracking, whereas in our approach the trusted base is arguably
smaller but e ects such as backtracking need to be encoded as a pure functional program, for
example by using a monad [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ].
      </p>
      <p>We have an implementation of a proof checker, Dedukti, which expects the system of
rewrite rules provided by the user to be reasonably well behaved. This proof checker is therefore
only one small piece of the larger puzzle: con dence in the results of this tool are contingent
upon trusting that the provided rewrite rules do not compromise logical consistency, or that
these rewrite rules indeed form a con uent and terminating system. Dedukti only checks
types, it does not check the rewrite rules. Future work will focus providing these other pieces to
support our methodology: tools to (semi-)automatically verify properties about rewrite rules,
for example.</p>
      <p>For given translations, a system of rewrite rules or a schema of rewrite rules need only be
proven to behave properly once, rather than every time for every results of these translations.
However, we could also envisage making the -calculus modulo the core of a full edged proof
environment for end users, in which users can de ne their own domain speci c rewrite rules,
in which case automated certi cation of properties about the resulting system of rewrite rules
becomes essential.</p>
      <p>
        We are currently working on adapting size-based termination techniques [
        <xref ref-type="bibr" rid="ref1 ref25 ref4">1, 25, 4</xref>
        ]. This
would give a general criterion that would work for the rewrite rules that encodes inductive or
coinductive structures. This criterion would be more powerful than purely syntactic criteria
such as Coq's guard condition [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Finally, we currently type check by rst translating proofs and formulas into a functional
program in Haskell, which we compile to native code using the GHC compiler. However,
the compilation process is slow. Its cost is only amortized given proofs with signi cant
computational content and even then, we would rather not have the compiler waste time optimizing
parts of the proof that are computationally completely irrelevant. Other systems such as Coq
and Isabelle ask the user to decide exactly when to use an optimizing compiler and when
to compute using a much more lightweight interpreter. The advantage of our approach is its
simplicity, both for the user and for the implementation. We would like to keep this model,
but to make it scale, we are investigating translating terms to a language that supports \just
in time" compilation, whereby hotspots that are worth compiling to native code are identi ed
at runtime and automatically, still without any intervention from the user.</p>
      <p>A stable release of Dedukti is available at https://www.rocq.inria.fr/deducteam/
Dedukti/index.html, however some of the improvements discussed here (in particular, the
dot patterns of section 3.5) have been integrated only in the development version of Dedukti,
that can be found on Github: https://github.com/mpu/dedukti.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Andreas</given-names>
            <surname>Abel</surname>
          </string-name>
          .
          <article-title>Miniagda: Integrating sized and dependent types</article-title>
          . In Ana Bove, Ekaterina Komendantskaya, and Milad Niqui, editors,
          <source>PAR</source>
          , volume
          <volume>43</volume>
          <source>of EPTCS</source>
          , pages
          <volume>14</volume>
          {
          <fpage>28</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Andreas</given-names>
            <surname>Abel</surname>
          </string-name>
          and
          <string-name>
            <given-names>Thorsten</given-names>
            <surname>Altenkirch</surname>
          </string-name>
          .
          <article-title>A partial type checking algorithm for type: Type</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci.</source>
          ,
          <volume>229</volume>
          (
          <issue>5</issue>
          ):3{
          <fpage>17</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Henk</given-names>
            <surname>Barendregt</surname>
          </string-name>
          .
          <article-title>Introduction to generalized type systems</article-title>
          .
          <source>J. Funct. Program.</source>
          ,
          <volume>1</volume>
          (
          <issue>2</issue>
          ):
          <volume>125</volume>
          {
          <fpage>154</fpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Gilles</given-names>
            <surname>Barthe</surname>
          </string-name>
          , Maria Jo~ao Frade, E. Gimenez, Luis Pinto, and
          <string-name>
            <given-names>Tarmo</given-names>
            <surname>Uustalu</surname>
          </string-name>
          .
          <article-title>Type-based termination of recursive de nitions</article-title>
          .
          <source>Math. Struct. Comp. Sci.</source>
          ,
          <volume>14</volume>
          (
          <issue>1</issue>
          ):
          <volume>97</volume>
          {
          <fpage>141</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Gilles</given-names>
            <surname>Barthe</surname>
          </string-name>
          and
          <article-title>Morten Heine Srensen</article-title>
          .
          <article-title>Domain-free pure type systems</article-title>
          .
          <source>In J. Funct. Program.</source>
          , pages
          <volume>9</volume>
          {
          <fpage>20</fpage>
          . Springer,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>[6] Mathieu Boesp ug. Conversion by evaluation</article-title>
          .
          <source>In Manuel Carro and Ricardo Pen~</source>
          a, editors,
          <source>PADL</source>
          , volume
          <volume>5937</volume>
          <source>of LNCS</source>
          , pages
          <volume>58</volume>
          {
          <fpage>72</fpage>
          . Springer,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <article-title>[7] Mathieu Boesp ug</article-title>
          .
          <article-title>Conception d'un noyau de vri cation de preuves pour le -calcul modulo</article-title>
          .
          <source>PhD thesis</source>
          , Ecole polytechnique,
          <year>January 2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] Mathieu Boesp ug and Guillaume Burel</article-title>
          .
          <article-title>CoqInE: Translating the calculus of inductive constructions into the -calculus modulo</article-title>
          .
          <source>In David Pichardie and Tjark Weber</source>
          , editors,
          <source>PxTP</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Mathieu</surname>
            <given-names>Boesp ug</given-names>
          </string-name>
          , Maxime Denes, and
          <string-name>
            <given-names>Benjamin</given-names>
            <surname>Gregoire</surname>
          </string-name>
          .
          <article-title>Full reduction at full throttle</article-title>
          .
          <source>In Jouannaud and Shao [19]</source>
          , pages
          <fpage>362</fpage>
          {
          <fpage>377</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Thierry</given-names>
            <surname>Coquand</surname>
          </string-name>
          .
          <article-title>An algorithm for type-checking dependent types</article-title>
          .
          <source>Sci. Comput</source>
          . Program.,
          <volume>26</volume>
          (
          <issue>1-3</issue>
          ):
          <volume>167</volume>
          {
          <fpage>177</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Denis</given-names>
            <surname>Cousineau</surname>
          </string-name>
          and
          <string-name>
            <given-names>Gilles</given-names>
            <surname>Dowek</surname>
          </string-name>
          .
          <article-title>Embedding pure type systems in the lambda-pi-calculus modulo</article-title>
          . In Simona Ronchi Della Rocca, editor,
          <source>TLCA</source>
          , volume
          <volume>4583</volume>
          <source>of LNCS</source>
          , pages
          <volume>102</volume>
          {
          <fpage>117</fpage>
          . Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Olivier</given-names>
            <surname>Danvy</surname>
          </string-name>
          .
          <article-title>Pragmatics of type-directed partial evaluation</article-title>
          . In Olivier Danvy, Robert Gluck, and Peter Thiemann, editors,
          <source>Dagstuhl Seminar on Partial Evaluation</source>
          , volume
          <volume>1110</volume>
          <source>of LNCS</source>
          , pages
          <volume>73</volume>
          {
          <fpage>94</fpage>
          . Springer,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>NG De Bruijn</surname>
          </string-name>
          .
          <article-title>A plea for weaker frameworks</article-title>
          .
          <source>In Logical frameworks</source>
          , pages
          <volume>40</volume>
          {
          <fpage>67</fpage>
          . Cambridge University Press,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Gilles</given-names>
            <surname>Dowek</surname>
          </string-name>
          .
          <article-title>Proof normalization for a rst-order formulation of higher-order logic</article-title>
          . In Elsa L. Gunter and Amy P. Felty, editors,
          <source>TPHOLs</source>
          , volume
          <volume>1275</volume>
          <source>of LNCS</source>
          , pages
          <volume>105</volume>
          {
          <fpage>119</fpage>
          . Springer,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Gilles</given-names>
            <surname>Dowek</surname>
          </string-name>
          and
          <string-name>
            <given-names>Olivier</given-names>
            <surname>Hermant</surname>
          </string-name>
          .
          <article-title>A simple proof that super-consistency implies cut-elimination</article-title>
          .
          <source>Notre-Dame Journal of Formal Logic</source>
          ,
          <year>2012</year>
          . to appear.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>Andrzej</given-names>
            <surname>Filinski</surname>
          </string-name>
          and
          <article-title>Henning Korsholm Rohde. A denotational account of untyped normalization by evaluation</article-title>
          . In Igor Walukiewicz, editor,
          <source>FoSSaCS</source>
          , volume
          <volume>2987</volume>
          <source>of LNCS</source>
          , pages
          <volume>167</volume>
          {
          <fpage>181</fpage>
          . Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>B.</given-names>
            <surname>Gregoire</surname>
          </string-name>
          and
          <string-name>
            <given-names>X.</given-names>
            <surname>Leroy</surname>
          </string-name>
          .
          <article-title>A compiled implementation of strong reduction</article-title>
          . In Mitchell Wand and Simon L. Peyton Jones, editors,
          <source>ICFP</source>
          , pages
          <volume>235</volume>
          {
          <fpage>246</fpage>
          . ACM,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Robert</surname>
            <given-names>Harper</given-names>
          </string-name>
          , Furio Honsell, and
          <string-name>
            <given-names>Gordon D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          .
          <article-title>A framework for de ning logics</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>40</volume>
          (
          <issue>1</issue>
          ):
          <volume>143</volume>
          {
          <fpage>184</fpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Jean-Pierre Jouannaud</surname>
          </string-name>
          and Zhong Shao, editors.
          <source>Certi ed Programs and Proofs - First International Conference, CPP</source>
          <year>2011</year>
          , Kenting, Taiwan, December 7-
          <issue>9</issue>
          ,
          <year>2011</year>
          . Proceedings, volume
          <volume>7086</volume>
          <source>of LNCS</source>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>S.</given-names>
            <surname>Lindley</surname>
          </string-name>
          .
          <article-title>Normalisation by evaluation in the compilation of typed functional programming languages</article-title>
          .
          <source>PhD thesis</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>Dale</given-names>
            <surname>Miller</surname>
          </string-name>
          .
          <article-title>A proposal for broad spectrum proof certi cates</article-title>
          .
          <source>In Jouannaud and Shao [19]</source>
          , pages
          <fpage>54</fpage>
          {
          <fpage>69</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>Ulf</given-names>
            <surname>Norell</surname>
          </string-name>
          .
          <article-title>Dependently typed programming in agda</article-title>
          . In Pieter W. M. Koopman, Rinus Plasmeijer, and S. Doaitse Swierstra, editors,
          <source>Advanced Functional Programming</source>
          , volume
          <volume>5832</volume>
          <source>of LNCS</source>
          , pages
          <volume>230</volume>
          {
          <fpage>266</fpage>
          . Springer,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <surname>Lawrence</surname>
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Paulson</surname>
          </string-name>
          . Isabelle:
          <article-title>The next seven hundred theorem provers</article-title>
          . In Ewing L.
          <article-title>Lusk and Ross A</article-title>
          . Overbeek, editors,
          <source>CADE</source>
          , volume
          <volume>310</volume>
          <source>of LNCS</source>
          , pages
          <volume>772</volume>
          {
          <fpage>773</fpage>
          . Springer,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>Frank</given-names>
            <surname>Pfenning</surname>
          </string-name>
          and
          <article-title>Carsten Schurmann. System description: Twelf - a meta-logical framework for deductive systems</article-title>
          . In Harald Ganzinger, editor,
          <source>CADE</source>
          , volume
          <volume>1632</volume>
          <source>of LNCS</source>
          , pages
          <volume>202</volume>
          {
          <fpage>206</fpage>
          . Springer,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>Cody</given-names>
            <surname>Roux</surname>
          </string-name>
          .
          <article-title>Terminaison a base de tailles: Semantique et generalisations</article-title>
          . These de doctorat,
          <source>Universite Henri Poincare | Nancy</source>
          <volume>1</volume>
          ,
          <string-name>
            <surname>April</surname>
          </string-name>
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>Philip</given-names>
            <surname>Wadler</surname>
          </string-name>
          .
          <article-title>How to replace failure by a list of successes: A method for exception handling, backtracking, and pattern matching in lazy functional languages</article-title>
          .
          <source>In FPCA</source>
          , pages
          <volume>113</volume>
          {
          <fpage>128</fpage>
          ,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>Michael</given-names>
            <surname>Zeller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Aaron</given-names>
            <surname>Stump</surname>
          </string-name>
          , and Morgan Deters.
          <article-title>Signature compilation for the edinburgh logical framework</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci.</source>
          ,
          <volume>196</volume>
          :
          <fpage>129</fpage>
          {
          <fpage>135</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>