<!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>On the Foundation of Isabelle/HOL ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Arve Gengelbach arve.gengelbach@it.uu.se</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Information Technology, Uppsala University</institution>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Interactive theorem provers are used to allow formalisation of mathematical proofs into theories, written in a precise language of definitions and proofs. Such a theory is step-wise extended by constant instance definitions and type definitions and contains proofs of theorems that use these definitions. If at any point a theory is inconsistent, i.e. every formula is deducible, the formalisation effort was futile. We set out to extend the existing foundational work on the model-theoretic and prooftheoretic foundation of such definitional theories, as used in the theorem prover Isabelle/HOL. For this logical system we study semantics that entail completeness and soundness, which are the properties that link the model-theoretic and the proof-theoretic perspectives. We formalize the obtained results in the theorem prover Isabelle/HOL to strengthen the confidence in correctness of our work.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Interactive theorem provers support a user proving theorems in different
logics. Well-known provers are based on higher-order logic or on constructive type
theory. Especially for technical proofs, in addition to pen-and-paper proofs,
theorem provers provide an appealing framework for formalisation. Not only is a
formalisation interesting from a theoretic point of view but it also is
practically applicable: For example Isabelle allows to export code (via so called code
generators [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]) whose behaviour is proven to match the abstract-level
specification by abstract-level theorems. It has been applied for different verification
efforts, exemplarily the verification of the single processor behaviour of the seL4
microkernel [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        All verification efforts are of little use if the theoretical foundation of the
framework is poorly understood. At its core Isabelle/HOL consists of a minimal
theory with a mechanism to extend a theory by definitions of constants and
types. These theories are called definitional theories [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. If both the smallest
theory – called minimal theory – and the extension mechanism are properly
designed the system will disallow that any statement is derivable. For the minimal
theory we require its consistency and the consistency of any theory extension,
i.e. from a theory a proof of False is not possible or equivalently some statements
are not derivable. Furthermore we require theory extension to be proof-theoretic
? The author is expected to graduate from PhD studies in 2020.
conservative (also syntactically conservative ) [12, p. 41], viz. for a theory T and
an extension T 0, any formula in the language of T which is provable from the
extension T 0 is also provable from the smaller theory T . This syntactic
conservativity implies consistency of all theory extensions. An extension by definitions
shall be syntactic, that is defined terms in a formula of an extended theory can
be replaced by their defining terms and regarded as formulas of smaller theories.
This so-called realizability together with syntactic conservativity are summarized
as meta-safe extensions [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>In meta-safe theory extensions, definitions can be unfolded and understood
as syntactic abbreviations. In the context of theorem provers this is
interesting as theorems of meta-safe theory extensions can be expressed and proven
equivalently in a smaller theory for a possible benefit of reduction of complexity.</p>
      <p>Despite regarding a theory and syntactic deducibility of formulae according to
deduction rules, its models and evaluation of formulae in a model offer another
method of study. A model defines what is valid, i.e. what evaluates to True,
especially a model of a theory is a model that at least renders all axioms of the
theory valid. A model of a smaller theory T in a signature can be extended to
a model of a larger theory, with a larger signature such that all valid formulae of
the smaller model are valid in the larger model. This allows us to regard a dual
notion of proof-theoretic conservativity, called model-theoretic conservativity: A
theory extension T T 0 is model-theoretic conservative if each model M for T
can be extended to a model M for T 0 (i.e. M0 models T 0 and M and M0 agree
on the interpretations of terms over the signature ).</p>
      <p>Both the semantic and the syntactic perspective of a deduction system can
be combined: If for a theory any deducible formula implies its validity in any of
the theory’s models, the system is called sound ; the converse is called complete.
In a sound and complete system model-theoretic conservativity implies
prooftheoretic conservativity.</p>
      <p>Isabelle/HOL implements higher-order logic with rank-1-polymorphism and
ad hoc overloading. That is, for a constant several definitions for different
nonoverlapping polymorphic types (i.e. non-unifying types) can be provided. An
example illustrates these features. We define a type lists and constant instances
map, that applies a given function to every item in a given structure, for lists
and for sets. We assume that sets have been defined. Lists shall be defined
inductively as either the empty list [ ] or as x : xs with a head x of type
and a tail xs of type list. We extend this theory by an operation on lists:
map( ! )! list! list. On empty lists this is defined as map(f; [ ]) [ ] and
map(f; x : xs) f (x) : map(f; xs) for non-empty lists. We introduce a constant
instance for sets map( ! )! set! set by defining map(f; A) f (A). By these
definitions lists and sets are not instances of one another and the definitions are
not circular.</p>
      <p>
        A mechanism of theory extension has to prevent overlapping definitions for
the same constant and also prevent the introduction of circular dependencies. An
example [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] illustrates the danger. Let c be a declared polymorphic constant.
Let fTrue; cboolg define a type and then cbool :(8x ; y : x = y ) define
the constant instance. Assume that cbool = True, which by the definition of
is equivalent to fTrueg. The formula 8x ; y : x = y holds (i.e. is
True) as it states that is a singleton, and thus cbool = False. Summarised,
cbool = True , cbool = False proves this theory inconsistent. Note that a declared
constant c can be used prior to definition of any of its instances. In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] the
authors propose a mechanism for extension of definitional theories that disallows
circularities and makes the extension consistent.
      </p>
      <p>
        To achieve a solid theoretical foundation for Isabelle/HOL we investigate if
the definitional mechanism introduced in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] makes theory extension
proof-theoretic and model-theoretic conservative. The HOL system is
not complete with respect to standard semantics by an argument that bases on
Gödels incompleteness theorem [10, Section 2.4.5], which motivates the study of
different semantics that render the system sound and complete.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related work</title>
      <p>
        The documentation of the HOL system logic [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] defines and discusses the
foundation of the HOL deduction system. Exemplary is the proof that the HOL
system possesses a standard model for the extension mechanism: Extension by
type and constant instance specification. Isabelle/HOL extends this mechanism
and allows several definitions of instances for a constant and constants that need
not be defined for all types.
      </p>
      <p>
        Wenzel [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] defines safe extension of theories by constant instances, where
constant instances are defined at once and extensions by type definitions and
constant instance definitions can not be mixed.
      </p>
      <p>
        Obua [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] discovers that checking conservative overloading in a logic HOLCO
is not semi-decidable and furthermore discusses that the term rewriting system
for definitions needs to be terminating for a theory to be consistent. Our initially
given example shows the weak point: Inconsistency can be introduced by the
interplay of type definitions and constant instance definitions, which had not
been considered.
      </p>
      <p>
        Kunčar and Popescu in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] introduce a decidable dependency relation for
definitional theories of HOL and thereby define well-formed definitional theories.
The type substitutive transitive closure of the dependency relation of these
theories is terminating, i.e. does not contain cycles. To ease the understanding we
give a simplified definition: A term and either a constant instance or a type are
in the type substitutive closure of the dependency relation #+, if the definition
of the constant instance or type is necessary to evaluate the term. In addition
they prove consistency of these theories by new semantics.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] each definitional HOL theory is proven syntactically consistent. In
a purely syntactic manner definitions can be understood as abbreviations and
thus unfolded in the introduced deduction system HOLC. The system adds type
comprehensions to translate type definitions from Isabelle/HOL into HOLC and
get consistency of Isabelle/HOL by a consistency result in HOLC.
      </p>
      <p>
        In a draft [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] the authors prove the syntactic conservativity of definitional
theories as extensions of the minimal theory MIN. Constant instances get translated
to their respective instance of the definitional term and the types are replaced
in a more complex manner. This conservativity result implies consistency of any
theory, by the consistency of the minimal theory.
      </p>
      <p>Andrews introduces a formulation of higher-order logic Q0 (also known as
simple type theory) [1, Chapter 5], that introduces the logical operators as
constants based on equality and has one deduction rule for substitution of equal
terms. The system Q0 is sound and complete for a non-standard semantics, that
is for types and the domain of interpretation of functions D ! is relaxed
such that it can be a proper subset of all possible values D ! D . In contrast
to HOL, Q0 does not support polymorphic constant definitions.</p>
      <p>
        Geuvers and Nederpelt [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and Geuvers [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] discuss properties of Calculus of
Constructions extended C with definitions and primitive notions. This flavour
of typed lambda calculus with definitions, called D0 allows non-polymorphic
definitions that are acyclic by design. Similarly to the intend in Isabelle/HOL,
definitions in D0 are abbreviations, i.e. syntactical and can be unfolded. An
extension D additionally introduces primitive definitions, i.e. axioms. The authors
discuss properties relating to conservativity and realizability, e.g. [9, Lem 10.4.1],[3,
Lem 3.10, Lem 3.18]. The developed framework is very general and as examples
for the expressiveness different logics are encoded in D [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and they give further
evolved examples. Feasibility and decidability play an important role as D is
based on type theory.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Proposed solution</title>
      <p>
        We propose a generalisation of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] that equates to a notion of model-theoretic
conservativity of an arbitrary extension of well-formed definitional theories. As
initially discussed, model-theoretic implies proof-theoretic conservativity if
soundness and completeness holds for the deduction system. We investigate whether
semantics based on the ideas of [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] are sound and complete, especially the
relaxation of the requirement on domains of functions. We expect the soundness
result to be straight-forward, as opposed to the completeness proof, that we
intend to approach by constructing a model for a consistent set of formulae [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Thus, we obtain an – opposed to [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] – relative proof-theoretic conservativity from
the model-theoretic result by completeness and soundness of the proof-system.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Preliminary work</title>
      <p>We have worked on model-theoretic conservativity that is based on a
nonstandard model definition and we have proven the following statement.</p>
      <p>Let D be a well-formed definitional theory with a model M. Let
D0 be a well-formed definitional theory that extends D. Then
there exists a model M0 of D0, such that M and M0 agree on
the interpretations of all terms that do not contain any instances
of the terms defined by S(D0; D).</p>
      <p>The mentioned theory S(D0; D) is the biggest subset of D0 such that each of the
defining terms in that set transitively uses an instance of the definitions that
were added through the extension by D0 n D. The theories D0 n D and S(D0; D)
are equal if the terms added to D to obtain D0 do not change the interpretation
of the terms defined in D.</p>
      <p>
        Our result [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] extends and generalises [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], as model-theoretic conservativity
implies the consistency of definitional theories. Furthermore, we are working on
the completeness proof that makes the proof-system complete with respect to
non-standard semantics.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Expected contributions</title>
      <p>We expect to contribute to the understanding of higher-order logic as
implemented in Isabelle/HOL by
– the earlier sketched result on model-theoretic conservativity,
– a soundness and a completeness result with respect to non-standard
semantics together with proof-theoretic conservativity (implied by the
modeltheoretic conservativity), and
– formalisations in Isabelle/HOL of the two expected theoretic contributions.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Plan for evaluation and validation</title>
      <p>As typical for theoretic work, our results are validated by the scientific
community, e.g. by peer review. Furthermore we want to validate all obtained abstract
level pen-and-paper proofs by a theorem prover. The formalisation additionally
strengthens the results of a pen-and-paper proof and can reveal mistakes.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Current status</title>
      <p>The work on model-theoretic conservativity is accepted for publication. Until
the end of this year we intend to complete the work on the soundness and
completeness proof, so that it can become part of the author’s licentiate thesis.
The formalisation is foreseen in 2018 for the time after the licentiate. Being at
an early stage in the PhD studies with planned graduation in 2020, the plan is
subject to changes.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>P. B.</given-names>
            <surname>Andrews</surname>
          </string-name>
          .
          <article-title>An Introduction to Mathematical Logic and Type Theory: To Truth through Proof</article-title>
          . Number 27 in Applied logic series. Kluwer Academic Publishers, Dordrecht ; Boston, 2nd ed edition,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Gengelbach</surname>
          </string-name>
          and
          <string-name>
            <given-names>T.</given-names>
            <surname>Weber</surname>
          </string-name>
          .
          <article-title>Model-theoretic Conservative Extension of Definitional Theories</article-title>
          . Draft.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>H.</given-names>
            <surname>Geuvers</surname>
          </string-name>
          .
          <article-title>Properties of a Lambda Calculus with Definitions</article-title>
          .
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>F.</given-names>
            <surname>Haftmann</surname>
          </string-name>
          and
          <string-name>
            <given-names>T.</given-names>
            <surname>Nipkow</surname>
          </string-name>
          .
          <article-title>Code Generation via Higher-Order Rewrite Systems</article-title>
          . In SpringerLink, pages
          <fpage>103</fpage>
          -
          <lpage>117</lpage>
          . Springer, Berlin, Heidelberg, Apr.
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>G.</given-names>
            <surname>Klein</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Andronick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Elphinstone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Heiser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Cock</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Derrin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Elkaduwe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Engelhardt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kolanski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Norrish</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Sewell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Tuch</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Winwood</surname>
          </string-name>
          . seL4:
          <article-title>Formal Verification of an Operating-system Kernel</article-title>
          .
          <source>Commun. ACM</source>
          ,
          <volume>53</volume>
          (
          <issue>6</issue>
          ):
          <fpage>107</fpage>
          -
          <lpage>115</lpage>
          ,
          <year>June 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>O.</given-names>
            <surname>Kunčar</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Popescu</surname>
          </string-name>
          .
          <article-title>A Consistent Foundation for Isabelle/HOL</article-title>
          . In C. Urban and
          <string-name>
            <surname>X</surname>
          </string-name>
          . Zhang, editors,
          <source>Interactive Theorem Proving, number 9236 in Lecture Notes in Computer Science</source>
          , pages
          <fpage>234</fpage>
          -
          <lpage>252</lpage>
          . Springer International Publishing, Aug.
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>O.</given-names>
            <surname>Kunčar</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Popescu</surname>
          </string-name>
          .
          <article-title>Comprehending Isabelle/HOL's Consistency</article-title>
          . In H. Yang, editor,
          <source>Programming Languages and Systems - 26th European Symposium on Programming, ESOP</source>
          <year>2017</year>
          ,
          <article-title>Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017</article-title>
          , Uppsala, Sweden,
          <source>April 22-29</source>
          ,
          <year>2017</year>
          , Proceedings, volume
          <volume>10201</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>724</fpage>
          -
          <lpage>749</lpage>
          . Springer,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>O.</given-names>
            <surname>Kunčar</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Popescu</surname>
          </string-name>
          .
          <article-title>Safety and Conservativity of Definitions in HOL and Isabelle/HOL</article-title>
          .
          <source>Technical report</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>R. P.</given-names>
            <surname>Nederpelt</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Geuvers</surname>
          </string-name>
          .
          <source>Type Theory and Formal Proof: An Introduction</source>
          . Cambridge University Press, Cambridge ; New York,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>M.</given-names>
            <surname>Norrish</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Slind. The HOL System</surname>
          </string-name>
          <string-name>
            <surname>LOGIC</surname>
          </string-name>
          ,
          <year>Nov</year>
          .
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>S.</given-names>
            <surname>Obua</surname>
          </string-name>
          .
          <article-title>Checking Conservativity of Overloaded Definitions in Higher-Order Logic</article-title>
          .
          <source>In Term Rewriting and Applications</source>
          , pages
          <fpage>212</fpage>
          -
          <lpage>226</lpage>
          . Springer Berlin Heidelberg, Aug.
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>J. R. Shoenfield. Mathematical</given-names>
            <surname>Logic. A.K. Peters</surname>
          </string-name>
          , Natick, Mass,
          <year>1967</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. M. Wenzel.
          <article-title>Type classes and overloading in higher-order logic</article-title>
          . In E. L.
          <article-title>Gunter and A</article-title>
          . Felty, editors,
          <source>Theorem Proving in Higher Order Logics, number 1275 in Lecture Notes in Computer Science</source>
          , pages
          <fpage>307</fpage>
          -
          <lpage>322</lpage>
          . Springer Berlin Heidelberg, Aug.
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>