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

Aperta
#590 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Digger-Rockwell ci sta già lavorando.

Dal 18/11/2026.

  • #5 di @Digger-Rockwell — aperta
  • #1249 di @Digger-Rockwell — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Ambito
compilers

Direzione di ricerca

Inizia dal primo TODO in Cslib/Computability/Turing/SingleTapeTM.lean e leggi le definizioni esistenti di TimeComputable e PolyTimeComputable. La fase 1 è completata quando viene introdotto TapeEncodable con encode, decode e la correttezza del round-trip, oltre alla semplice istanza di List Symbol.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Lean
Stelle
847
Fork
234
Merge medio
2g 21h
PR unite (30g)
49

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di leanprover/cslib

Tutte le issue di leanprover/cslib

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.