feat(Computability): Framework for encoding arbitrary types on Turing machines
维护者通常 1 天内回复
@Digger-Rockwell 已经在做这个了。
开始于 2026年11月18日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 领域
- compilers
调研方向
从 Cslib/Computability/Turing/SingleTapeTM.lean 中的第一个 TODO 开始,并阅读现有的 TimeComputable 和 PolyTimeComputable 定义。当引入 TapeEncodable 以及 encode、decode 和往返正确性,并添加平凡的 List Symbol 实例后,阶段 1 即完成。
由索引模型根据 Issue 内容生成。
描述
Description:
This issue addresses the first TODO in Cslib/Computability/Turing/SingleTapeTM.lean:
"Encoding of types in lists to represent computations on arbitrary types."
Currently, TimeComputable and PolyTimeComputable are restricted to functions of type List Symbol → List Symbol. To expand this to standard computable functions (e.g., over Nat, Bool, pairs, and eventually Rat for Computable Analysis), we need a standardized way to represent arbitrary types on the TM tape.
Proposed Architecture
I propose introducing a TapeEncodable typeclass that bundles the encoding function, the decoding function, and the proof of round-trip correctness:
class TapeEncodable (α : Type) (Symbol : Type) where
encode : α → List Symbol
decode : List Symbol → Option α
decode_encode_eq : ∀ (a : α), decode (encode a) = some a
Implementation Plan
I would like to break this into a few manageable PRs:
-
Phase 1 (This week): Introduce the TapeEncodable typeclass and provide the trivial instance for List Symbol.
-
Phase 2: Provide basic instances (e.g., for Bool, Nat, and α × β).
-
Phase 3: Generalize TimeComputable and PolyTimeComputable to accept arbitrary types α and β given [TapeEncodable α Symbol] and [TapeEncodable β Symbol].
I will start with PR 1.
- 主要语言
- Lean
- 星标
- 847
- 派生
- 234
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 49
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
leanprover/cslib 的其他 Issue
-
`listFullBeta_cons_r` should rename to `listFullBeta_concat_r`可能已有人在做 @lengyijun 于 135 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
leanprover/cslib#784 ·
维护者通常 1 天内回复
-
logic
难度 1/5 1 小时以内 新手友好度 72/100
leanprover/cslib#74 ·
维护者通常 1 天内回复
-
dependency-incompatibility
难度 3/5 半天 新手友好度 45/100
leanprover/cslib#1271 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
leanprover/cslib#1262 ·
维护者通常 1 天内回复
-
BetaAt.appR doesn't require LC N, weakening BetaAt.lc_r, not consistent with FullBeta可能已有人在做 @Digger-Rockwell 于 5 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
leanprover/cslib#1243 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
clang:frontend clang:openmp crash
难度 2/5 1-3 小时 新手友好度 62/100
llvm/llvm-project#245442 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
-
module: exir
难度 2/5 1-3 小时 新手友好度 66/100
pytorch/executorch#25620 ·
维护者通常 1 天内回复
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolve未关闭area:stdlib effort:S impact:low parity type:bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复