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

Any better way to work around Higher order input? error in the SMT mode? #30

Open
zqy1018 opened this issue Sep 19, 2024 · 0 comments
Open

Comments

@zqy1018
Copy link

zqy1018 commented Sep 19, 2024

Hi! I recently started experimenting with lean-auto, primarily to explore its support for SMT solvers. However, I frequently encounter errors ending with Higher order input?, which are not always very informative and require manual debugging.

For instance, in the artificial example below, I initially could not locate the issue, but later realized that since f2 is a function, the entire term a could be considered higher-order.

set_option auto.smt true
set_option auto.smt.trust true

structure A where
  f1 : List Nat
  f2 : Nat → List Nat

example : ∀ (a : A) (n : Nat),
  a.f1.length < n → a.f1.length ≤ n :=
  by
    intros a n
    -- `auto` here reports `lamSort2STermAux :: Unexpected error. Higher order input?`
    -- tried on Lean 4.9.0 and 4.11.0
    sorry

On the other hand, it seems that some techniques, like term substitution using generalize, could potentially address this problem.

-- attempt again
example : ∀ (a : A) (n : Nat),
  a.f1.length < n → a.f1.length ≤ n :=
  by
    intros a n
    generalize a.f1 = ff
    auto  -- now it works!

However I am not entirely sure if this is a reliable solution. I would like to know if there is any plan to address these types of issues.

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