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

Regression in latest nightly #51

Open
david-christiansen opened this issue Sep 30, 2024 · 0 comments
Open

Regression in latest nightly #51

david-christiansen opened this issue Sep 30, 2024 · 0 comments

Comments

@david-christiansen
Copy link
Collaborator

The following code from a blog post isn't working in the latest nightly:

def search {α} (f : Nat → Option α) (start : Nat) (to : Nat) : Option α :=
  match f start with
  | .some x => .some x
  | .none =>
    if start < to then
      search f (start + 1) to
    else
      .none
termination_by to - start

theorem search_const_none {α} (start to : Nat) :
    search (α := α) (fun _ => .none) start to = .none := by
  unfold search
  split
  · exact search_const_none (start + 1) to
  · rfl
termination_by to - start

The highlighting code says that the recursive occurrence of search_const_none isn't present in the environment, and some printf-debugging shows that this is indeed the case when we use the environment saved in the context info in the info tree.

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

No branches or pull requests

1 participant