首页> 外文期刊>Journal of Functional Programming >Every bit counts: The binary representation of typed data and programs
【24h】

Every bit counts: The binary representation of typed data and programs

机译:每一位都很重要:类型化数据和程序的二进制表示

获取原文
获取原文并翻译 | 示例

摘要

We show how the binary encoding and decoding of typed data and typed programs can be understood, programmed and verified with the help of question-answer games. The encoding of a value is determined by the yeso answers to a sequence of questions about that value; conversely, decoding is the interpretation of binary data as answers to the same question scheme. We introduce a general framework for writing and verifying game-based codecs. We present games in Haskell for structured, recursive, polymorphic and indexed types, building up to a representation of well-typed terms in the simply-typed λ-calculus with polymorphic constants. The framework makes novel use of isomorphisms between types in the definition of games. The definition of isomorphisms together with additional simple properties make it easy to prove that codecs derived from games never encode two distinct values using the same code, never decode two codes to the same value and interpret any bit sequence as a valid code for a value or as a prefix of a valid code. Formal properties of the framework have been proved using the Coq proof assistant.
机译:我们展示了如何借助问答游戏来理解,编程和验证打字数据和打字程序的二进制编码和解码。值的编码取决于对有关该值的一系列问题的是/否答案;相反,解码是将二进制数据解释为对同一问题方案的答案。我们介绍了一个用于编写和验证基于游戏的编解码器的通用框架。我们在Haskell中介绍针对结构化,递归,多态和索引类型的游戏,以具有多态常数的简单类型λ微积分中的良好类型项的表示为基础。该框架在游戏定义中新颖地利用了类型之间的同构。同构的定义以及其他简单属性,可以轻松证明源自游戏的编解码器永远不会使用同一代码来编码两个不同的值,永远不会将两个代码解码为相同的值,也不会将任何位序列解释为某个值的有效代码,或者作为有效代码的前缀。框架的形式属性已使用Coq证明助手进行了证明。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号