Skip to main content
QUICK REVIEW

[論文レビュー] Initial Semantics for higher-order typed syntax in Coq

Benedikt Ahrens, Julianna Zsidó|arXiv (Cornell University)|Dec 5, 2010
Logic, programming, and type systems参考文献 32被引用数 6
ひとこと要約

この論文は、依存型とモナドを用いてCoqで形式化された、高階的で型付きの構文と変数束縛を備えた初期の意味論枠組みを提示する。型付きの記述子によって生成される構文が、表現の圏における初期対象であることが確立されており、圏論を用いた抽象構文の普遍的特徴付けを提供するとともに、Coqの型理論による機械検証可能な正しさを実現する。

ABSTRACT

Initial Semantics aims at characterizing the syntax associated to a signature as the initial object of some category. We present an initial semantics result for typed higher-order syntax together with its formalization in the Coq proof assistant. The main theorem was first proved on paper in the second author's PhD thesis in 2010, and verified formally shortly afterwards. To a simply-typed binding signature S over a fixed set T of object types we associate a category called the category of representations of S. We show that this category has an initial object Sigma(S). From its construction it will be clear that the object Sigma(S) merits the name abstract syntax associated to S. Our theorem is implemented and proved correct in the proof assistant Coq through heavy use of dependent types. The approach through monads gives rise to an implementation of syntax where both terms and variables are intrinsically typed, i.e. where the object types are reflected in the meta-level types. This article is to be seen as a research article rather than about the formalization of a classical mathematical result. The nature of our theorem - involving lengthy, technical proofs and complicated algebraic structures - makes it particularly interesting for formal verification. Our goal is to promote the use of computer theorem provers as research tools, and, accordingly, a new way of publishing mathematical results: a parallel description of a theorem and its formalization should allow the verification of correct transcription of definitions and statements into the proof assistant, and straightforward but technical proofs should be well-hidden in a digital library. We argue that Coq's rich type theory, combined with its various features such as implicit arguments, allows a particularly readable formalization and is hence well-suited for communicating mathematics.

研究の動機と目的

  • 依存型付きの構文と変数束縛を備えた型付き抽象構文の圏論的特徴付けを初期性を用いて行う。
  • この特徴付けを、依存型と高度な型機能を用いてCoq証明支援システムで形式化する。
  • Coqが型理論および圏論における複雑な数学的構成の検証に適した研究ツールであることを示す。
  • 形式的Coq実装と並行して非形式的な定理を公開する、新しい数学出版のモデルを促進する。
  • Coqの型システムを用いて対象の型をメタレベルの型に反映させることで、効率的で内在的に型付けされた項表現を可能にする。

提案手法

  • 固定された対象型の集合 T に対して、単純型付き束縛記述子 S の表現の圏を構成する。
  • 自由変数をパラメータとする帰納型としての構文 Σ(S) を定義し、S のアリティに一致するコンストラクタを持つ。
  • 集合のファミリー上のモナドを用いて構文をモデル化し、項と変数が内在的に型付けされることを保証する。
  • Σ(S) が表現の圏における初期対象であることを証明する。これは、任意の他の表現への一意な準同型が存在することを意味する。
  • Coqの特徴——暗黙の引数、型クラス、コercion——を活用して、非形式的数学に近く、読みやすく保守可能な形式化を達成する。
  • 半自動証明技法と証明再利用を用いて、証明サイズを約900行から約600行に削減し、保守性を向上させる。

実験結果

リサーチクエスチョン

  • RQ1証明支援システムを用いて、高階的で型付きの構文と変数束縛を備えた初期意味論を形式的に確立できるか?
  • RQ2Coqのような依存型付き設定において、項と変数の内在的型付けをどのように達成できるか?
  • RQ3Coqの型理論と証明自動化は、複雑な圏論的構成の形式化をどの程度支援できるか?
  • RQ4複雑な代数的構造と依存型を含む普遍的性質を形式化する際の実用的課題は何か?
  • RQ5形式化をどのようにならべて、拡張性(例えば、還元関係や型翻訳の追加)をサポートできるか?

主な発見

  • 型付き記述子 S に関連する構文 Σ(S) が、S の表現の圏における初期対象であることが証明され、抽象構文の普遍的特徴付けが得られた。
  • Coqにおける形式化は、約400行の仕様と約600行の証明から構成され、証明自動化と再利用により証明サイズが33%削減された。
  • Coqにおける依存型の使用により、内在的に型付けされた項と変数が可能となり、余分な型注釈の必要性が排除された。
  • 形式化により、コンストラクタがモナド上のモジュールの準同型として構造的に表現されることを検証し、構文の代数的アプローチを裏付けた。
  • 異なる対象型を持つ言語間の翻訳などの一般化が可能であるが、これは型の等価性とキャストの問題を引き起こす。
  • 集合上のモナドを順序付き集合上の相対モナドに置き換えることで、還元関係の追加が可能となり、この設定でも初期性の結果が保たれた。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。