{"id":{"repo_id":"chapman","oai_identifier":"oai:digitalcommons.chapman.edu:eecs_theses-1003"},"canonical_url":"https://search.dev.ndltd.org/etd/chapman/oai:digitalcommons.chapman.edu:eecs_theses-1003","repository":{"repo_id":"chapman","name":"Chapman University","base_url":"https://digitalcommons.chapman.edu/do/oai/"},"display":{"title":"Compiling Haskell into Lean: A Common Abstract Syntax for Haskell and Interactive Theorem Provers","abstract":"<p>In this work, we introduce a program conversion tool, HS-TO-LEAN, that uses GHC's <em>ghc-lib-parser</em> API to translate Haskell programs into Lean code, which is then validated by the Lean compiler. The repo can be found at https://github.com/holcombet/hs-to-lean/tree/main. The result is a successful compilation of a fragment of Haskell into correct and executable Lean code that users can prove theorems about. We conducted a case study using a heap sort algorithm to support our claim that HS-TO-LEAN produces verifiable Lean code. Our approach is inspired by recent advances in formal verification of Haskell programs in Coq, and we currently restrict our attention to total Haskell.</p> <p>The compiler produces an AST that serves as a common level of abstraction between a fragment of Haskell and Lean. The abstract common fragment promotes translation between languages by simplifying and restructuring GHC's original AST, improving the readability and linearization of the AST.</p> <p>Future work on HS-TO-LEAN will extend the compiler to translate to other interactive theorem provers, including Coq, Agda, and Isabelle, making it portable and accessible to a range of verification efforts and communities. Future work also includes implementing bidirectionality, supporting the translation of Haskell code to a target proof assistant and vice versa. This method will expose an interesting level of abstraction that is applicable to all of the languages involved and produce a more maintainable compiler.</p> <p>These results contribute to the ongoing work in the formalization and verification of mathematics and programming and present a viable approach to unifying the formal systems of different proof assistants.</p>","abstract_html":"&lt;p&gt;In this work, we introduce a program conversion tool, HS-TO-LEAN, that uses GHC&#x27;s &lt;em&gt;ghc-lib-parser&lt;/em&gt; API to translate Haskell programs into Lean code, which is then validated by the Lean compiler. The repo can be found at https://github.com/holcombet/hs-to-lean/tree/main. The result is a successful compilation of a fragment of Haskell into correct and executable Lean code that users can prove theorems about. We conducted a case study using a heap sort algorithm to support our claim that HS-TO-LEAN produces verifiable Lean code. Our approach is inspired by recent advances in formal verification of Haskell programs in Coq, and we currently restrict our attention to total Haskell.&lt;/p&gt; &lt;p&gt;The compiler produces an AST that serves as a common level of abstraction between a fragment of Haskell and Lean. The abstract common fragment promotes translation between languages by simplifying and restructuring GHC&#x27;s original AST, improving the readability and linearization of the AST.&lt;/p&gt; &lt;p&gt;Future work on HS-TO-LEAN will extend the compiler to translate to other interactive theorem provers, including Coq, Agda, and Isabelle, making it portable and accessible to a range of verification efforts and communities. Future work also includes implementing bidirectionality, supporting the translation of Haskell code to a target proof assistant and vice versa. This method will expose an interesting level of abstraction that is applicable to all of the languages involved and produce a more maintainable compiler.&lt;/p&gt; &lt;p&gt;These results contribute to the ongoing work in the formalization and verification of mathematics and programming and present a viable approach to unifying the formal systems of different proof assistants.&lt;/p&gt;","abstract_has_math":false,"creators":["Holcombe, Talitha"],"institution":null,"degree_name":null,"degree_level":"Thesis","degree_discipline":"Electrical Engineering and Computer Science","degree_department":null,"school":null,"contributors":["Dr. Alexander Kurz","Dr. Jonathan Weinberger","Dr. Andrew Moshier"],"advisors":[],"committee_chairs":[],"committee_members":[],"year":2025,"date_issued":"2025-05-01T07:00:00Z","date_published":"2025-05-01T07:00:00Z","updated_at":"2026-07-24T01:38:43Z","subjects":["Lean","formal verification","program verification","Programming Languages and Compilers"],"languages":[],"rights":[],"rights_urls":[],"identifier_entries":[]},"links":{"outbound_url":"https://digitalcommons.chapman.edu/eecs_theses/3","outbound_label":"Repository record","outbound_source":"dc:identifier"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor","label":"Contributor","values":["Dr. Alexander Kurz","Dr. Jonathan Weinberger","Dr. Andrew Moshier"]},{"key":"dc:creator","label":"Author","values":["Holcombe, Talitha"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"thesis:degree_discipline","label":"Discipline","values":["Electrical Engineering and Computer Science"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Thesis"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Lean","formal verification","program verification","Programming Languages and Compilers"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier","label":"Identifier","values":["https://digitalcommons.chapman.edu/eecs_theses/3"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["<p>In this work, we introduce a program conversion tool, HS-TO-LEAN, that uses GHC's <em>ghc-lib-parser</em> API to translate Haskell programs into Lean code, which is then validated by the Lean compiler. The repo can be found at https://github.com/holcombet/hs-to-lean/tree/main. The result is a successful compilation of a fragment of Haskell into correct and executable Lean code that users can prove theorems about. We conducted a case study using a heap sort algorithm to support our claim that HS-TO-LEAN produces verifiable Lean code. Our approach is inspired by recent advances in formal verification of Haskell programs in Coq, and we currently restrict our attention to total Haskell.</p> <p>The compiler produces an AST that serves as a common level of abstraction between a fragment of Haskell and Lean. The abstract common fragment promotes translation between languages by simplifying and restructuring GHC's original AST, improving the readability and linearization of the AST.</p> <p>Future work on HS-TO-LEAN will extend the compiler to translate to other interactive theorem provers, including Coq, Agda, and Isabelle, making it portable and accessible to a range of verification efforts and communities. Future work also includes implementing bidirectionality, supporting the translation of Haskell code to a target proof assistant and vice versa. This method will expose an interesting level of abstraction that is applicable to all of the languages involved and produce a more maintainable compiler.</p> <p>These results contribute to the ongoing work in the formalization and verification of mathematics and programming and present a viable approach to unifying the formal systems of different proof assistants.</p>"]},{"key":"dc:source","label":"Dc Source","values":["T. Holcombe, \"Compiling Haskell into Lean: A common abstract syntax for Haskell and interactive theorem provers,\" M. S. thesis, Chapman University, Orange, CA, 2025. <a href=\"https://doi.org/10.36837/chapman.000644\">https://doi.org/10.36837/chapman.000644</a>"]},{"key":"dc:title","label":"Title","values":["Compiling Haskell into Lean: A Common Abstract Syntax for Haskell and Interactive Theorem Provers"]}]}],"canonical_facts":{"dc:contributor":["Dr. Alexander Kurz","Dr. Jonathan Weinberger","Dr. Andrew Moshier"],"dc:creator":["Holcombe, Talitha"],"dc:description.abstract":["<p>In this work, we introduce a program conversion tool, HS-TO-LEAN, that uses GHC's <em>ghc-lib-parser</em> API to translate Haskell programs into Lean code, which is then validated by the Lean compiler. The repo can be found at https://github.com/holcombet/hs-to-lean/tree/main. The result is a successful compilation of a fragment of Haskell into correct and executable Lean code that users can prove theorems about. We conducted a case study using a heap sort algorithm to support our claim that HS-TO-LEAN produces verifiable Lean code. Our approach is inspired by recent advances in formal verification of Haskell programs in Coq, and we currently restrict our attention to total Haskell.</p> <p>The compiler produces an AST that serves as a common level of abstraction between a fragment of Haskell and Lean. The abstract common fragment promotes translation between languages by simplifying and restructuring GHC's original AST, improving the readability and linearization of the AST.</p> <p>Future work on HS-TO-LEAN will extend the compiler to translate to other interactive theorem provers, including Coq, Agda, and Isabelle, making it portable and accessible to a range of verification efforts and communities. Future work also includes implementing bidirectionality, supporting the translation of Haskell code to a target proof assistant and vice versa. This method will expose an interesting level of abstraction that is applicable to all of the languages involved and produce a more maintainable compiler.</p> <p>These results contribute to the ongoing work in the formalization and verification of mathematics and programming and present a viable approach to unifying the formal systems of different proof assistants.</p>"],"dc:identifier":["https://digitalcommons.chapman.edu/eecs_theses/3"],"dc:source":["T. Holcombe, \"Compiling Haskell into Lean: A common abstract syntax for Haskell and interactive theorem provers,\" M. S. thesis, Chapman University, Orange, CA, 2025. <a href=\"https://doi.org/10.36837/chapman.000644\">https://doi.org/10.36837/chapman.000644</a>"],"dc:subject":["Lean","formal verification","program verification","Programming Languages and Compilers"],"dc:title":["Compiling Haskell into Lean: A Common Abstract Syntax for Haskell and Interactive Theorem Provers"],"thesis:degree_discipline":["Electrical Engineering and Computer Science"],"thesis:degree_level":["Thesis"]},"updated_at":"2026-07-24T01:38:43Z"}