Skip to main content
QUICK REVIEW

[論文レビュー] Logical Relations as Types: Proof-Relevant Parametricity for Program Modules

Jonathan Sterling, Robert Harper|arXiv (Cornell University)|Oct 16, 2020
Logic, programming, and type systemsComputer Science参考文献 142被引用数 22
ひとこと要約

本稿は、プログラムモジュールを基本的構成要素として扱い、静的計算と動的計算のフェーズ区別をモダリティで符号化する、合成的型理論的枠組みModTTを導入する。『パラメトリシティ構造』を用いた証明関連のパラメトリシティ理論を提示する——これは、プログラムの類縁関係に関する非自明な証拠を追跡する論理関係の一般化であり、計算的効果を伴うモジュールおよび生成的性をもつ抽象定理を簡素化し、型理論的に根拠をもつものとする。

ABSTRACT

The theory of program modules is of interest to language designers not only for its practical importance to programming, but also because it lies at the nexus of three fundamental concerns in language design: the phase distinction, computational effects, and type abstraction. We contribute a fresh "synthetic" take on program modules that treats modules as the fundamental constructs, in which the usual suspects of prior module calculi (kinds, constructors, dynamic programs) are rendered as derived notions in terms of a modal type-theoretic account of the phase distinction. We simplify the account of type abstraction (embodied in the generativity of module functors) through a lax modality that encapsulates computational effects. Our main result is a (significant) proof-relevant and phase-sensitive generalization of the Reynolds abstraction theorem for a calculus of program modules, based on a new kind of logical relation called a parametricity structure. Parametricity structures generalize the proof-irrelevant relations of classical parametricity to proof-relevant families, where there may be non-trivial evidence witnessing the relatedness of two programs -- simplifying the metatheory of strong sums over the collection of types, for although there can be no "relation classifying relations", one easily accommodates a "family classifying small families". Using the insight that logical relations/parametricity is itself a form of phase distinction between the syntactic and the semantic, we contribute a new synthetic approach to phase separated parametricity based on the slogan "logical relations as types", iterating our modal account of the phase distinction. Then, to construct a simulation between two implementations of an abstract type, one simply programs a third implementation whose type component carries the representation invariant.

研究の動機と目的

  • フェーズ区別、計算的効果、型抽象化を統合する、合成的で型理論的なプログラムモジュールの基礎を提供すること。
  • プロジェクト性のような任意的でない概念を置き換え、自然に生成的性を強制する、laxモダリティを用いたモジュールファンクターにおける生成的性のモデル化。
  • パラメトリシティ構造を用いてモジュールの証明関連パラメトリシティを形式化し、古典的レインボルド型抽象定理を一般化すること。
  • 論理的関係を型として扱うことで、『論理的関係を型として』、反復的かつ高階の推論を可能にするフェーズ区別としてパラメトリシティ自体をモデル化すること。

提案手法

  • フェーズ分離をモデル化するため、(構文的, 意味的) および (静的, 動的) の2組の補完的モダリティを持つ、依存型理論であるModTTを導入する。
  • 計算的効果をカプセル化し、モジュールファンクターにおける生成的性を強制するlaxモダリティ(3)を用い、プロジェクト性を派生的概念として置き換える。
  • パラメトリシティ構造を、プログラム間の関係の証明関連族として定義し、古典的パラメトリシティにおける証明無視関係を一般化する。
  • トポス理論的アーティングリーディング構成を用いて、パラメトリシティ構造の依存型理論を公理化する。
  • 型に表現不変性を担う第三の実装をプログラミングすることで、モジュール実装間のシミュレーションを構築する。
  • モダリティによるフェーズ区別を反復することで、構文的レベルと意味的レベルの間の高階パラメトリシティをモデル化する。

実験結果

リサーチクエスチョン

  • RQ1プログラミング言語におけるフェーズ区別は、どのようにモダリティ型理論を用いて合成的に形式化できるか?
  • RQ2プロジェクト性のような任意的でない概念を用いずに、モジュールファンクターにおける生成的性と計算的効果をどのように捉えることができるか?
  • RQ3強力な和集合と型抽象化をサポートする型理論的枠組みにおいて、証明関連パラメトリシティを形式化できるか?
  • RQ4論理的関係を型として扱うことで、パラメトリシティの均一的かつ合成的記述を可能にするにはどうすればよいか?
  • RQ5モダリティは、モジュールシステムにおける抽象化、効果、フェーズ区別を統合するために果たす役割は何か?

主な発見

  • 本稿は、プログラムの類縁関係が非自明な証拠によって裏付けられる、レインボルドの抽象定理の証明関連一般化を確立する。
  • モジュールファンクターにおける生成的性は、自然に型σ ⇒ 3τの関数としてモデル化され、プロジェクト性の必要性がなくなる。ここで3はlaxモダリティである。
  • パラメトリシティ構造は、プログラム同等性に関する推論の型理論的基盤を提供し、小さな家族を分類する家族をサポートする。
  • 証明関連族を用いることで、『関係を分類する関係』を必要としないことで、強力な和集合のメタ理論が簡素化される。
  • この枠組みは、Coq や Agda などの証明支援ツールに適した標準的な型理論的推論を用いてパラメトリシティ定理を形式化可能である。
  • 著者らは、フェーズ区別を反復可能であり、論理的関係自体が構文的レベルと意味的レベルの間のフェーズ区別としてモデル化可能であることを示している。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。