gpt4 book ai didi

haskell - 如何对二进制 lambda 演算的输出建模?

转载 作者:行者123 更新时间:2023-12-02 03:16:50 24 4
gpt4 key购买 nike

我正在尝试为 John Tromp's binary lambda calculus 编写一个解释器

我已经编写了代码来执行以下操作:

  1. 将二进制输入解析为表示常规无类型 lambda 演算的某种数据结构
  2. Beta-减少这个词

然后会发生什么?

  • 如何解释“输出”?
  • 是输出
    • a) 通过相同的编码将生成的术语翻译回二进制,
    • 或 b) 由假终止 bool 值列表编码的比特流?
  • (如果输出没有形成这样的列表会怎样?)

还是我误解了 BLC 的工作原理?

最佳答案

我建议使用 http://www.ioccc.org/2012/tromp/hint.html作为您的主要引用。维基百科页面可能还不错,但他在 BLC 上的原始笔记相当不错。

关于输入输出的话题,他是这样说的:

More specifically, it defines a universal machine, which, from an input stream of bits, parses the binary encoding of a lambda calculus term, applies that to the remainder of input (translated to a lazy list of booleans, which have a standard representation in lambda calculus), and translates the evaluated result back into a stream of bits to be output.

关于haskell - 如何对二进制 lambda 演算的输出建模?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36489313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com