Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup porting notes in TuringMachine #20821

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kim-em
Copy link
Contributor

@kim-em kim-em commented Jan 18, 2025

Many local notations were added during porting. To my eye, they don't improve readability at all, but if others disagree we can do something else. However, if you don't like this PR, please either resolve the porting notes alternately, or at least let me know how you would like it done (possibly just deleting them).

Copy link

PR summary 4881093e37

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ instance : Inhabited (@Λ' Γ Λ)
+ instance : Inhabited (Λ' M)
+ instance [Inhabited Λ] : Inhabited (@Λ' Γ Λ σ)
+ instance Γ'.fintype [DecidableEq K] [Fintype K] [∀ k, Fintype (Γ k)] : Fintype (@Γ' K Γ)
+ instance Γ'.inhabited : Inhabited (@Γ' K Γ)
+ instance Λ'.inhabited [Inhabited Λ] : Inhabited (@Λ' K Γ Λ σ)
++++---- tr
++-- SupportsStmt
++-- stmts
++-- stmts_supportsStmt
++-- stmts_trans
++-- stmts₁
++-- stmts₁_self
++-- stmts₁_supportsStmt_mono
++-- stmts₁_trans
++-- trSupp
++--+- Stmt.inhabited
+-++-- Supports
+-++-- eval
+-++-- init
+-++-- step_supports
+-+- Reaches
+-+- stepAux
+-+-+- Cfg.inhabited
+-+-+- step
+--+ trNormal
+--+-+ trCfg
- instance : Inhabited Λ'₁
- instance : Inhabited Λ'₁₀
- instance [Inhabited Λ] : Inhabited Λ'₁
- instance Γ'.fintype [DecidableEq K] [Fintype K] [∀ k, Fintype (Γ k)] : Fintype Γ'₂₁
- instance Γ'.inhabited : Inhabited Γ'₂₁
- instance Λ'.inhabited [Inhabited Λ] : Inhabited Λ'₂₁

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


Decrease in tech debt: (relative, absolute) = (24.00, 0.01)
Current number Change Type
4594 -24 porting notes

Current commit 4881093e37
Reference commit a4c5ecf11c

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-computability Computability theory (TMs, DFAs, languages, grammars, etc) label Jan 18, 2025
Copy link
Collaborator

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

I think removing most notation is equally readable (but this is me, reading the file for the ~first time).

| 0, f => f Vector.nil
| i + 1, f =>
Stmt.branch (fun a _ ↦ a) (Stmt.move Dir.right <| readAux i fun v ↦ f (true ::ᵥ v))
(Stmt.move Dir.right <| readAux i fun v ↦ f (false ::ᵥ v))

variable {n : ℕ} (enc : Γ → List.Vector Bool n) (dec : List.Vector Bool n → Γ)
variable (n : ℕ) (enc : Γ → List.Vector Bool n) (dec : List.Vector Bool n → Γ)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change? You're making n implicit again, one declaration later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-computability Computability theory (TMs, DFAs, languages, grammars, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants