We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Subarray
The current Subarray structure has cryptic field names:
structure Subarray (α : Type u) where as : Array α start : Nat stop : Nat h₁ : start ≤ stop h₂ : stop ≤ as.size
I propose the following alternative with more intuitive field names:
structure Subarray (α : Type u) extends Array α where start : Nat stop : Nat valid : start ≤ stop ∧ stop ≤ toArray.size
I have a potential PR candidate implementing this: https://github.com/fgdorais/lean4/tree/subarray
The text was updated successfully, but these errors were encountered:
An alternative with a simpler validity condition would be:
structure Subarray (α : Type u) extends Array α where start : Nat size : Nat valid : start + size ≤ toArray.size abbrev Subarray.stop (as : Subarray α) : Nat := as.start + as.size
Sorry, something went wrong.
No branches or pull requests
Prerequisites
Description
The current
Subarray
structure has cryptic field names:I propose the following alternative with more intuitive field names:
I have a potential PR candidate implementing this: https://github.com/fgdorais/lean4/tree/subarray
The text was updated successfully, but these errors were encountered: