Skip to content

feat: query model for single tape TM#416

Draft
Shreyas4991 wants to merge 38 commits intoleanprover:mainfrom
Shreyas4991:TM_Lang
Draft

feat: query model for single tape TM#416
Shreyas4991 wants to merge 38 commits intoleanprover:mainfrom
Shreyas4991:TM_Lang

Conversation

@Shreyas4991
Copy link
Contributor

@Shreyas4991 Shreyas4991 commented Mar 11, 2026

Draft PR to explore the design of a monadic language for single tape TMs. Multi tape TMs will be similar.

Depends on #372

@Shreyas4991
Copy link
Contributor Author

Things todo:

  1. Squash commits
  2. Discuss cost function.

Comment on lines +54 to +55
/-- `writeCells` is a set of cells that were previously unwritten -/
writeCells : ℕ
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the type, it's not a set of cells. Based on the definition below it appears to be more like the maximum amount of cells without counting the input length

Copy link
Contributor Author

@Shreyas4991 Shreyas4991 Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. As discussed in the Zulip thread, the current TM formulation doesn't have a notion of tape indices. So I am trying to short circuit the process by only counting non-input cells. Of course this also ends up counting output cells of the tape. This is what I hope will be different in a multi tape setting, with distinct work tapes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so the docstring should reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will do. Fwiw any design suggestions are welcome. The PR is still a WIP.

@tannerduve
Copy link
Contributor

tannerduve commented Mar 13, 2026

Screenshot 2026-03-13 at 12 16 10 AM

you should base this onto your #372 branch instead of main so that the diff shows what you've added since then

@Shreyas4991
Copy link
Contributor Author

Screenshot 2026-03-13 at 12 16 10 AM

you should base this onto your #372 branch instead of main so that the diff shows what you've added since then

I branched this off the branch of #372

@tannerduve
Copy link
Contributor

Screenshot 2026-03-13 at 12 16 10 AM you should base this onto your #372 branch instead of main so that the diff shows what you've added since then

I branched this off the branch of #372

yes but specifically on GitHub on this PR you should also set the base branch, since currently it is showing the diff compared to main. click the pencil icon next to the title of the PR, then click the dropdown menu where it says leanprover:main and then switch to the branch #372 is on. GitHub defaults the base branch to main even if in your repo it is based on another branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants