<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/ericczhao/" title="Eric Zhao" uri="https://mustardfox.org/ericczhao/" display-uri="ericczhao" type="local">Eric Zhao</fr:link>
      </fr:author>
      <fr:author>
        <fr:link href="/raefmaroof/" title="Raef Maroof" uri="https://mustardfox.org/raefmaroof/" display-uri="raefmaroof" type="local">Raef Maroof</fr:link>
      </fr:author>
      <fr:author>
        <fr:link href="/ananddukkipati/" title="Anand Dukkipati" uri="https://mustardfox.org/ananddukkipati/" display-uri="ananddukkipati" type="local">Anand Dukkipati</fr:link>
      </fr:author>
      <fr:author>
        <fr:link href="/andrewblinn/" title="Andrew Blinn" uri="https://mustardfox.org/andrewblinn/" display-uri="andrewblinn" type="local">Andrew Blinn</fr:link>
      </fr:author>
      <fr:author>
        <fr:link href="/zhiyipan/" title="Zhiyi Pan" uri="https://mustardfox.org/zhiyipan/" display-uri="zhiyipan" type="local">Zhiyi Pan</fr:link>
      </fr:author>
      <fr:author>
        <fr:link href="/cyrusomar/" title="Cyrus Omar" uri="https://mustardfox.org/cyrusomar/" display-uri="cyrusomar" type="local">Cyrus Omar</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2023</fr:year>
    </fr:date>
    <fr:date>
      <fr:year>2022</fr:year>
    </fr:date>
    <fr:uri>https://mustardfox.org/zzhaoe-000B/</fr:uri>
    <fr:display-uri>zzhaoe-000B</fr:display-uri>
    <fr:route>/zzhaoe-000B/</fr:route>
    <fr:title text="Total Type Error Localization and Recovery with Holes (Agda)">Total Type Error Localization and Recovery with Holes (Agda)</fr:title>
    <fr:taxon>software</fr:taxon>
    <fr:meta name="doi">10.5281/zenodo.10129703</fr:meta>
    <fr:meta name="venue">
      <fr:link href="/popl-2024/" title="POPL 2024" uri="https://mustardfox.org/popl-2024/" display-uri="popl-2024" type="local">POPL 2024</fr:link>
    </fr:meta>
    <fr:meta name="github">hazelgrove/error-localization-agda</fr:meta>
    <fr:meta name="bibtex"><![CDATA[@software{zhao_2023,
  title = {Artifact for Total Type Error Localization and Recovery with Holes},
  url = {https://doi.org/10.5281/zenodo.10129703},
  version = {1.0},
  publisher = {Zenodo},
  author = {Zhao, Eric and Maroof, Raef and Dukkipati, Anand and Blinn, Andrew and Pan, Zhiyi and Omar, Cyrus},
  date = {2023-11},
  doi = {10.5281/zenodo.10129703},
}]]></fr:meta>
  </fr:frontmatter>
  <fr:mainmatter>
    <html:p>An Agda mechanization of the marked lambda calculus, a judgmental framework for bidirectional type error localization and recovery described in "<fr:link href="/zhao-et-al-2024/" title="Total Type Error Localization and Recovery with Holes" uri="https://mustardfox.org/zhao-et-al-2024/" display-uri="zhao-et-al-2024" type="local">Total Type Error Localization and Recovery with Holes</fr:link>".</html:p>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2024</fr:year>
              <fr:month>1</fr:month>
              <fr:day>14</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2024</fr:year>
              <fr:month>1</fr:month>
              <fr:day>20</fr:day>
            </fr:date>
            <fr:uri>https://mustardfox.org/popl-2024/</fr:uri>
            <fr:display-uri>popl-2024</fr:display-uri>
            <fr:route>/popl-2024/</fr:route>
            <fr:title text="POPL 2024">POPL 2024</fr:title>
            <fr:taxon>venue</fr:taxon>
            <fr:meta name="homepage">https://popl24.sigplan.org</fr:meta>
            <fr:meta name="venue">London, United Kingdom</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/ericczhao/" title="Eric Zhao" uri="https://mustardfox.org/ericczhao/" display-uri="ericczhao" type="local">Eric Zhao</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/raefmaroof/" title="Raef Maroof" uri="https://mustardfox.org/raefmaroof/" display-uri="raefmaroof" type="local">Raef Maroof</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/ananddukkipati/" title="Anand Dukkipati" uri="https://mustardfox.org/ananddukkipati/" display-uri="ananddukkipati" type="local">Anand Dukkipati</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/andrewblinn/" title="Andrew Blinn" uri="https://mustardfox.org/andrewblinn/" display-uri="andrewblinn" type="local">Andrew Blinn</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/zhiyipan/" title="Zhiyi Pan" uri="https://mustardfox.org/zhiyipan/" display-uri="zhiyipan" type="local">Zhiyi Pan</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/cyrusomar/" title="Cyrus Omar" uri="https://mustardfox.org/cyrusomar/" display-uri="cyrusomar" type="local">Cyrus Omar</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
              <fr:month>1</fr:month>
              <fr:day>5</fr:day>
            </fr:date>
            <fr:uri>https://mustardfox.org/zhao-et-al-2024/</fr:uri>
            <fr:display-uri>zhao-et-al-2024</fr:display-uri>
            <fr:route>/zhao-et-al-2024/</fr:route>
            <fr:title text="Total Type Error Localization and Recovery with Holes">Total Type Error Localization and Recovery with Holes</fr:title>
            <fr:taxon>reference</fr:taxon>
            <fr:meta name="doi">10.1145/3632910</fr:meta>
            <fr:meta name="venue">
              <fr:link href="/popl-2024/" title="POPL 2024" uri="https://mustardfox.org/popl-2024/" display-uri="popl-2024" type="local">POPL 2024</fr:link>
            </fr:meta>
            <fr:meta name="pdf">/bafkrmig6uouiljzl7bd2hsdvybslotw4hme5ee2wrptjxfu243y2zskscu.pdf</fr:meta>
            <fr:meta name="slides">/bafkrmicqbx7k3zk2yw3wouzg7xccmly4fj422zl2ixpx5uozuxrmpswnrm.pdf</fr:meta>
            <fr:meta name="artifact">zzhaoe-000B</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{zhao2024,
  title={Total Type Error Localization and Recovery with Holes},
  volume={8},
  issn={2475-1421},
  doi={10.1145/3632910},
  number={POPL},
  journal={Proceedings of the ACM on Programming Languages},
  author={Zhao, Eric and Maroof, Raef and Dukkipati, Anand and Blinn, Andrew and Pan, Zhiyi and Omar, Cyrus},
  year={2024},
  month={Jan},
  pages={2041–2068},
  language={en}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/ericczhao/" title="Eric Zhao" uri="https://mustardfox.org/ericczhao/" display-uri="ericczhao" type="local">Eric Zhao</fr:link>
                  </fr:author>
                  <fr:author>
                    <fr:link href="/raefmaroof/" title="Raef Maroof" uri="https://mustardfox.org/raefmaroof/" display-uri="raefmaroof" type="local">Raef Maroof</fr:link>
                  </fr:author>
                  <fr:author>
                    <fr:link href="/ananddukkipati/" title="Anand Dukkipati" uri="https://mustardfox.org/ananddukkipati/" display-uri="ananddukkipati" type="local">Anand Dukkipati</fr:link>
                  </fr:author>
                  <fr:author>
                    <fr:link href="/andrewblinn/" title="Andrew Blinn" uri="https://mustardfox.org/andrewblinn/" display-uri="andrewblinn" type="local">Andrew Blinn</fr:link>
                  </fr:author>
                  <fr:author>
                    <fr:link href="/zhiyipan/" title="Zhiyi Pan" uri="https://mustardfox.org/zhiyipan/" display-uri="zhiyipan" type="local">Zhiyi Pan</fr:link>
                  </fr:author>
                  <fr:author>
                    <fr:link href="/cyrusomar/" title="Cyrus Omar" uri="https://mustardfox.org/cyrusomar/" display-uri="cyrusomar" type="local">Cyrus Omar</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2024</fr:year>
                  <fr:month>1</fr:month>
                  <fr:day>5</fr:day>
                </fr:date>
                <fr:title text="abstract">abstract</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Type systems typically only define the conditions under which an expression is well-typed, leaving ill-typed expressions formally meaningless. This approach is insufficient as the basis for language servers driving modern programming environments, which are expected to recover from simultaneously localized errors and continue to provide a variety of downstream semantic services. This paper addresses this problem, contributing the first comprehensive formal account of total type error localization and recovery: the marked lambda calculus. In particular, we define a gradual type system for expressions with marked errors, which operate as non-empty holes, together with a total procedure for marking arbitrary unmarked expressions. We mechanize the metatheory of the marked lambda calculus in Agda and implement it, scaled up, as the new basis for <fr:link href="/zzhaoe-000A/" title="Hazel" uri="https://mustardfox.org/zzhaoe-000A/" display-uri="zzhaoe-000A" type="local">Hazel</fr:link>, a full-scale live functional programming environment with, uniquely, no meaningless editor states.</html:p>
                <html:p>The marked lambda calculus is bidirectionally typed, so localization decisions are systematically predictable based on a local flow of typing information. Constraint-based type inference can bring more distant information to bear in discovering inconsistencies but this notoriously complicates error localization. We approach this problem by deploying constraint solving as a type-hole-filling layer atop this gradual bidirectionally typed core. Errors arising from inconsistent unification constraints are localized exclusively to type and expression holes, i.e. the system identifies unfillable holes using a system of traced provenances, rather than localized in an ad hoc manner to particular expressions. The user can then interactively shift these errors to particular downstream expressions by selecting from suggested partially consistent type hole fillings, which returns control back to the bidirectional system. We implement this type hole inference system in <fr:link href="/zzhaoe-000A/" title="Hazel" uri="https://mustardfox.org/zzhaoe-000A/" display-uri="zzhaoe-000A" type="local">Hazel</fr:link>.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
