feat(Computability): Framework for encoding arbitrary types on Turing machines

Đang mở
#590 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Digger-Rockwell đang làm issue này rồi.

Từ ngày 18/11/2026.

  • #5 của @Digger-Rockwell — đang mở
  • #1249 của @Digger-Rockwell — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu với TODO đầu tiên trong Cslib/Computability/Turing/SingleTapeTM.lean và đọc các định nghĩa TimeComputable và PolyTimeComputable hiện có. Giai đoạn 1 hoàn tất khi TapeEncodable được giới thiệu cùng với encode, decode và tính đúng đắn của round-trip, cộng thêm instance List Symbol tầm thường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Lean
Star
847
Fork
234
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
49

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của leanprover/cslib

Tất cả issue của leanprover/cslib

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.