<!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>Linking to Compound Conditions in Mizar</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Adam Naumowicz</string-name>
          <email>adamn@math.uwb.edu.pl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Informatics, University of Bia“ystok Konstantego Cio“kowskiego 1M</institution>
          ,
          <addr-line>15-245 Bia“ystok</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The processing and analysis of the Mizar library has been performed using the infrastructure of the University of Bialystok High Performance Computing Center. In the current Mizar language, direct linking to statements formulated as compound conditions is prohibited. This particular language feature has often been considered by the users as an unnecessary disruption of the natural course of proof steps. In this paper, we present an analysis of the linking structure in the current contents of the Mizar Mathematical Library which provides statistical data needed to implement a usability-based solution to this problem and propose corresponding changes in the library.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Using a Weakly-Strict Mizar (WSM) [Nau16, Byl12] parser 3, we have collected some statistical data which
shows the usage of these constructs in the MML version (5.33.1254) distributed together with the current ocial
Mizar version (8.1.04) 4. The table below shows the number of occurences of these language constructs.</p>
      <sec id="sec-1-1">
        <title>Language: construct With conditions: W/o conditions:</title>
        <p>As we can see, some of the constructs are signicantly less frequent than others. Notably, case and suppose
are used only in special kinds of proofs (reasoning per cases) and the use of compound statements in this context
is usually connected with applying denitional expansion [Kor15]. Let us also note that loci declarations and
generalizations both use the same let keyword and so syntactically they are similar (what makes them dierent
is the context, since loci declarations are only available within denitions). In most contexts the case and
suppose constructs can be used interchangeably and most users tend to prefer the more common suppose. The
syntax of choice statements ( consider) and existential assumptions ( given) requires a that phrase, so they
never occur without the conditions part, even if they are followed by a single proposition. In all other cases, a
user might decide to use only the simple forms of the constructs, e.g. a sequence of single assumptions, and never
use compound conditions. And so there are articles in the Mizar library whose authors avoided using compound
conditions completely. However, the compound conditions are in general used quite often in the MML. The
number of conditions used in an article ranges from 0 to 412 (total 94392). If we assume (very roughly) that
each condition is represented by one line of formal text and we compare it to the total number of 2473054 lines
of the WSM representation of all the articles, this gives about 4% of all the text content.</p>
        <p>It is also worth mentioning that the existential assumption is actually a syntactic sugar construct which
replaces an assumption followed by a choice statement - this language feature is rarely used by less experienced
Mizar users who are interested primarily in the correctness of their proofs and not in their brevity or good style.</p>
        <p>Now let us look at the simplest example which demonstrates the underlying linking problem. Here we have
a common choice statement with one chosen constant and two labelled compound conditions potentially related
to this constant, and we want to immediately refer to this statement in the next proof step:
consider x such that A1:
then by references2 ;
and A2:</p>
        <p>by references1 ;
In the original Mizar parser the linking (here using the then keyword) is not allowed, because it is ambiguous
what it should link to. In consequence, the parser marks the second line with the 164: Nothing to link
error message. In fact, the comment might as well say Too many options to link , because in this case there
are four possible interpretations of the linked statement, namely:
1. ex x st</p>
        <p>&amp;
2.
3.
4.</p>
        <p>&amp;</p>
        <p>Although there are cases when option 1. would be useful, usually reasoning in Mizar requires an existentially
quantied statements to be eliminated in order to advance the proof. As for option 2., it would be quite useful for
a small number of compounds. The average number of compounds in the current MML is 1.92, which makes this
option potentially useful for accumulating available facts rather than being very selective in inference statements.
However, there are cases of compound statements in the library composed of as many as 33 propositions 5 and
in this case linking to a conjunction of all these propositions would produce too complicated inferences to be
practically justied. Option 3. seems least useful and would be most misleading for the users, especially if
there were more than two compound propositions involved. This leaves us with option 4., and apparently this
3The parser can be downloaded from a dedicated Git repository: https://github.com/MizarProject/wsm-tools .
4http://mizar.org/
5E.g. the GATE_3 article developing the theory of digital circuits.
is the semantics adopted by two Mizar-inspired systems: Mizar Light for HOL Light developed by F. Wiedijk
[Wie01] as well as Makarius Wenzel’s implementation of the Isabelle/Isar language [Wen02]. Therefore, we
have implemented the fourth option in an experimental Mizar version. Mizar veriers pre-compiled for main
supported software platforms are available for download and further experimentation at the author’s website 6.
There you can also nd an example of a simple set-theoretical Mizar article adapted to this new linking method
(le xboole_0.miz) to demonstrate its usefulness.
3</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Conclusions</title>
      <p>First of all, the proposed enhancement of the Mizar parsing module might be benecial for some Mizar users.
But apparently, the inability of linking to compound statements is also one of the main obstacles that complicate
automatic improving the legibility of natural deduction proofs in Mizar [Pak14] and make lemma selection based
on the close reference principle equivalent to an NP-hard graph problem [Pak15]. So the enhancement might
help advance the research on proof legibility. And nally, Mizar has been widely known for its inuence on other
proof assistant systems and their proof languages - this work is an example that the inuence might as well work
in the other direction.
3.0.1</p>
      <sec id="sec-2-1">
        <title>Acknowledgement</title>
        <p>The processing and analysis of the Mizar library has been performed using the infrastructure of the University
of Bialystok High Performance Computing Center.</p>
        <p>6http://mizar.uwb.edu.pl/~softadm/linking</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [Ban15]
          <string-name>
            <given-names>G.</given-names>
            <surname>Bancerek</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>Byli«ski,</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Grabowski</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . Korni“owicz,
          <string-name>
            <given-names>R.</given-names>
            <surname>Matuszewski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Naumowicz</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.</surname>
          </string-name>
          <article-title>P¡k, J</article-title>
          . Urban, Mizar:
          <article-title>State-of-the-art and beyond</article-title>
          , in: M.
          <string-name>
            <surname>Kerber</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Carette</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Kaliszyk</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Rabe</surname>
          </string-name>
          , V. Sorge (Eds.), Intelligent Computer Mathematics International Conference, CICM 2015, Washington, DC, USA, July
          <volume>1317</volume>
          ,
          <year>2015</year>
          , Proceedings, Vol.
          <volume>9150</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2015</year>
          , pp.
          <fpage>261279</fpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>319</fpage>
          -20615-8_
          <fpage>17</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [Gra15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Grabowski</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          <article-title>Korni“owicz, A. Naumowicz, Four decades of Mizar</article-title>
          ,
          <source>Journal of Automated Reasoning</source>
          <volume>55</volume>
          (
          <issue>3</issue>
          ) (
          <year>2015</year>
          )
          <article-title>191198</article-title>
          . doi:
          <volume>10</volume>
          .1007/s10817-015-9345-1.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [Cai04]
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Cairns</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gow</surname>
          </string-name>
          ,
          <article-title>Using and parsing the Mizar language</article-title>
          ,
          <source>Electr. Notes Theor. Comput. Sci</source>
          .
          <volume>93</volume>
          (
          <year>2004</year>
          )
          <article-title>6069</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.entcs.
          <year>2003</year>
          .
          <volume>12</volume>
          .028.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [Nau16]
          <string-name>
            <given-names>A.</given-names>
            <surname>Naumowicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Piliszek</surname>
          </string-name>
          ,
          <article-title>Accessing the Mizar library with a Weakly Strict Mizar parser</article-title>
          , in: Intelligent Computer Mathematics - 9th International Conference, CICM 2016, Bialystok, Poland,
          <source>July 25-29</source>
          ,
          <year>2016</year>
          , Proceedings,
          <year>2016</year>
          , pp.
          <fpage>7782</fpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>319</fpage>
          -42547-
          <issue>4</issue>
          _
          <fpage>6</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [Byl12]
          <string-name>
            <given-names>C.</given-names>
            <surname>Bylinski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Alama</surname>
          </string-name>
          , New developments in parsing Mizar, in: J.
          <string-name>
            <surname>Jeuring</surname>
            ,
            <given-names>J. A.</given-names>
          </string-name>
          <string-name>
            <surname>Campbell</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Carette</surname>
            ,
            <given-names>G. D.</given-names>
          </string-name>
          <string-name>
            <surname>Reis</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Sojka</surname>
          </string-name>
          , M. Wenzel, V. Sorge (Eds.),
          <source>Intelligent Computer Mathematics - 11th International Conference, AISC</source>
          <year>2012</year>
          , 19th Symposium,
          <year>Calculemus 2012</year>
          , 5th International Workshop,
          <string-name>
            <surname>DML</surname>
          </string-name>
          <year>2012</year>
          , 11th International Conference, MKM 2012,
          <article-title>Systems and Projects, Held as Part of CICM 2012, Bremen</article-title>
          , Germany, July 8-
          <issue>13</issue>
          ,
          <year>2012</year>
          . Proceedings, Vol.
          <volume>7362</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2012</year>
          , pp.
          <fpage>427431</fpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>642</fpage>
          -31374-5_
          <fpage>30</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [Kor15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Korni</surname>
          </string-name>
          <article-title>“owicz, Denitional expansions in Mizar</article-title>
          ,
          <source>Journal of Automated Reasoning</source>
          <volume>55</volume>
          (
          <issue>3</issue>
          ) (
          <year>2015</year>
          )
          <fpage>257</fpage>
          268. doi:
          <volume>10</volume>
          .1007/s10817-015-9331-7.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [Wie01]
          <string-name>
            <given-names>F.</given-names>
            <surname>Wiedijk</surname>
          </string-name>
          ,
          <article-title>Mizar light for HOL light</article-title>
          , in: Theorem Proving in Higher Order Logics, 14th International Conference, TPHOLs
          <year>2001</year>
          , Edinburgh, Scotland, UK, September 3-
          <issue>6</issue>
          ,
          <year>2001</year>
          , Proceedings,
          <year>2001</year>
          , pp.
          <fpage>378394</fpage>
          . doi:
          <volume>10</volume>
          .1007/3-540-44755-5_
          <fpage>26</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>[Wen02] M. Wenzel</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Wiedijk</surname>
          </string-name>
          ,
          <article-title>A comparison of Mizar and Isar</article-title>
          ,
          <source>J. Autom. Reasoning</source>
          <volume>29</volume>
          (
          <issue>3-4</issue>
          ) (
          <year>2002</year>
          )
          <article-title>389411</article-title>
          . doi:
          <volume>10</volume>
          .1023/A:
          <fpage>1021935419355</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>[Pak14] K. P</surname>
          </string-name>
          <article-title>¡k, Improving legibility of natural deduction proofs is not trivial</article-title>
          ,
          <source>Logical Methods in Computer Science</source>
          <volume>10</volume>
          (
          <issue>3</issue>
          ) (
          <year>2014</year>
          )
          <article-title>130</article-title>
          . doi:
          <volume>10</volume>
          .2168/LMCS-
          <volume>10</volume>
          (
          <issue>3</issue>
          :23)
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>[Pak15] K. P</surname>
          </string-name>
          <article-title>¡k, Improving legibility of formal proofs based on the close reference principle is NP-hard</article-title>
          ,
          <source>Journal of Automated Reasoning</source>
          <volume>55</volume>
          (
          <issue>3</issue>
          ) (
          <year>2015</year>
          )
          <article-title>295306</article-title>
          . doi:
          <volume>10</volume>
          .1007/s10817-015-9337-1.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>