<!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>
      <journal-title-group>
        <journal-title>Xiv:</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Proving: Analyzing and Improving the Isabelle Archive of Formal Proofs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Fabian Huch</string-name>
          <email>huch@in.tum.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Technische Universität München</institution>
          ,
          <addr-line>Boltzmannstraße 3, 85748 Garching</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2104</year>
      </pub-date>
      <volume>01052</volume>
      <abstract>
        <p>The Isabelle Archive of Formal Proofs has grown to a significant size in the past years. It makes up for an impressive body of research, which enables a number of statistical approaches to various aspects in theorem proving, and has not yet been utilized exhaustively. However, the growing size also poses some challenges to address: Material becomes increasingly harder to find, reusability and ease of understanding become more important. This thesis abstract summarizes my research plans on those topics and briefly touches on preliminary results, which indicate that the node in-degree of the dependency graph of the archive follows a scale-free distribution.</p>
      </abstract>
      <kwd-group>
        <kwd>theorem proving</kwd>
        <kwd>software engineering</kwd>
        <kwd>complex networks</kwd>
        <kwd>proof mining</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Isabelle is an interactive theorem prover [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] with a large collection of formalized material, the
Archive of Formal Proofs (AFP). At the time of writing, the AFP consists of nearly three million
lines of code, and more than 167 000 lemmas have been proven in its close to 600 diferent
entries [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        The entities defined by those theories and their relationships can be described as a dependency
graph (sometimes also referred to as General Dependency Network [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]). For software systems,
dependency graphs have been found to exhibit certain structural properties. For instance, their
in-degree (  ) distribution is often
      </p>
      <p>scale-free, i.e. it follows some power law Pr(  ) ∝  
in contrast to random graphs where each possible edge is present with a fixed probability
− [4],
(Erdős–Rény model). Graphs with such topological properties are called complex networks,
which have been studied in the context of real-world graphs from many diferent areas [ 5]. In
contrast to research focused on object-oriented characteristics (e.g., classes and inheritance),
structural analysis on dependency graphs of software systems can be transferred to the field of
formal theories more directly.</p>
      <p>Another important application of this dependency network is proof automation. Data mining
methods to extract patterns from graphs have been extensively studied, for instance frequent
itemset mining to find subsets of nodes that frequently occur together [ 6, 7]. The AFP provides
https://www21.in.tum.de/home/~huch (F. Huch)
enough data to enable pattern mining for proofs as well as evaluate the efectiveness of derived
automation.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>Regarding the AFP, empirical analysis has already been done by Blanchette et al. in [8]. They
measured the AFP size and authorship distribution and how those evolved over time, computed
the session graph, proof depths, and compared proof size to definition size and statement
complexity (by number of clauses). Moreover, they benchmarked how many theorems sledgehammer
could solve on a representative test suite. This research provides a good baseline of empirical
data; I plan to follow up on it by analyzing the underlying GDN of AFP theories, which can
possibly yield some deeper results.</p>
      <p>Very recently, usability of the AFP has also gotten some attention. Two diferent search
engines for theory contents were introduced: The FindFacts search by Huch and Krauss in [9],
and the concept-oriented SErAPIS engine by Stathopoulos et al. in [10]. Additionally, MacKenzie
et al. evaluated usability of the AFP webpage in [11] and built the prototype for a re-design.</p>
      <p>Complex networks for software systems were first introduced by Myers in [4]. In [12],
Zimmermann and Nagappan measured the correlation between software defects and a
comprehensive list of network metrics; Šubelj and Bajec later surveyed quality indicators, and
performed package prediction by clustering on the network [13]. While there is no concern
about defects in theorem proving due to the nature of the field, my aim is to transfer some of
those findings to formal theories in order to detect structural problems that impair reusability
and readability.</p>
      <p>For proof automation, the idea of learning from existing material has been around for some
time. In Isabelle, Duncan derived tactics from proofs script sequences using Markov models and
genetic programming with the goal of full automatization in [14], which was successful for less
complex lemmas. More recently, Nawaz et al. used high utility itemset mining on a syntactic
level to discover patterns in proofs scripts of PVS [15]. In contrast, I aim to extract patterns
from the more fine-grained theorem dependency graph. This also makes it possible to utilize
structured Isar proofs in the pattern extraction.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Research Topics</title>
      <p>In the following, my research plans are separated into concrete questions and topics that involve
engineering tasks.</p>
      <sec id="sec-3-1">
        <title>3.1. Research Questions</title>
        <p>RQ1: Do theory dependency networks follow the topological patterns typically found in
complex networks?
RQ2: Which metrics are relevant quality indicators for formal theories? Can they expose
structural problems?
RQ3: Is it possible to detect elements that need to be refactored? Can theory- and
sessionstructure be predicted to generate refactoring recommendations?
RQ4: How can visualization be helpful to better understand the structure of formalizations?
RQ5: Which patterns can we learn from theorem networks? Can they be used to improve
automation?</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Further Topics</title>
        <p>There are several aspects I want to improve on in the AFP. By introducing digital object
identifiers, entries can be much better referenced. Identifiers could potentially even be assigned
to individual concepts of an entry, though creating such a mapping poses lots of challenges.
Moreover, introducing more fields for entries, such as subject classification and links to
(print)publications, can help organizing the AFP in the future. Finally, the AFP website needs to be
improved for better usability – there is already a prototype (as discussed in section 2), which
still needs to be integrated.</p>
        <p>Currently, the AFP does not allow proofs by s o r r y (which are admitted with the help of an
oracle [16]). However, it is often desirable to have what is sometimes referred to as Formal
Abstract [17]: a formalization of results from literature without rigorous proofs. To that end, I
want do add a proof by reference mechanism, which weakly checks references and allows such
proofs to be added to the AFP in a separate, less trusted, session group.</p>
        <p>In Isabelle, I plan to integrate the FindFacts search into the prover IDE (and add support for
type-classes and locales), as well as tooling for clone detection and advanced IDE functionality
such as structural search and replace.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Preliminary Results</title>
      <p>The dependency graph of Isabelle and the AFP (release 2021) consists of approximately 2.1 ⋅ 106
nodes and 2.5 ⋅ 108 directed edges (when considering all types of entities and relationships).
Figure 1 shows the in-degree distribution of that graph. For   &gt; 2, it is clearly linear on the
log-log scale; this indicates a power-law distribution, which is typical for scale-free networks
[5]. The individual AFP components show similar characteristics; this illustrates why complex
network science is relevant to the topic.
10−1
10−2
) 10−3

(
r
P 10−4
10−5
10−6
100
101
102
104
105</p>
      <p>106
103


[4] C. R. Myers, Software systems as complex networks: Structure, function, and evolvability
of software collaboration graphs, Phys. Rev. E 68 (2003) 046116. doi: 1 0 . 1 1 0 3 / P h y s R e v E . 6 8 .
in complex networks, Complexity 8 (2002) 20–33. doi:1 0 . 1 0 0 2 / c p l x . 1 0 0 5 5 .
[12] T. Zimmermann, N. Nagappan, Predicting defects using network analysis on dependency
graphs, in: Proceedings of the 30th International Conference on Software Engineering,
ICSE ’08, Association for Computing Machinery, New York, NY, USA, 2008, p. 531–540.
[13] L. Šubelj, M. Bajec, Software systems through complex networks science: Review, analysis
and applications, in: Proceedings of the First International Workshop on Software Mining,
SoftwareMining ’12, Association for Computing Machinery, New York, NY, USA, 2012, p.
9–16. doi:1 0 . 1 1 4 5 / 2 3 8 4 4 1 6 . 2 3 8 4 4 1 8 .
[14] H. Duncan, The Use of Data-Mining for the Automatic Formation of Tactics, Ph.D. thesis,</p>
      <p>University of Edinburgh, 2007.
[15] M. S. Nawaz, P. Fournier-Viger, J. Zhang, Proof Learning in PVS with Utility Pattern</p>
      <p>Mining, IEEE Access 8 (2020) 119806–119818. doi:1 0 . 1 1 0 9 / A C C E S S . 2 0 2 0 . 3 0 0 4 1 9 9 .
[16] M. Wenzel, et al., The Isabelle/Isar reference manual, Technische Universität München,
2021.
[17] T. Hales, Big conjectures, in: Computer-aided mathematical proof, 2017.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Paulson</surname>
          </string-name>
          ,
          <article-title>Isabelle: The next seven hundred theorem provers</article-title>
          , in: E. Lusk, R. Overbeek (Eds.),
          <source>9th International Conference on Automated Deduction</source>
          , Springer Berlin Heidelberg, Berlin, Heidelberg,
          <year>1988</year>
          , pp.
          <fpage>772</fpage>
          -
          <lpage>773</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2] Archive of Formal Proofs, Statistics,
          <year>2021</year>
          . URL: https://www.isa-afp.org/statistics.html.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Savic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ivanovic</surname>
          </string-name>
          ,
          <article-title>Graph clustering evaluation metrics as software metrics</article-title>
          , in: Z. Budimac, T. G. Grbac (Eds.),
          <source>Proceedings of the 3rd Workshop on Software Quality Analysis, Monitoring, Improvement and Applications (SQAMIA</source>
          <year>2014</year>
          ), Lovran, Croatia,
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>