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

Lean Auto fails to translate some type classes #22

Closed
volodeyka opened this issue Apr 4, 2024 · 0 comments · Fixed by #23
Closed

Lean Auto fails to translate some type classes #22

volodeyka opened this issue Apr 4, 2024 · 0 comments · Fixed by #23

Comments

@volodeyka
Copy link

Hey! I was playing with lean auto and found some wired bug involving simple type classes. Lean auto sometimes fails to translate typeclasses which depend on arbitrary types. For instance:

import Auto.Tactic

set_option auto.smt true
set_option auto.smt.trust true
set_option trace.auto.smt.printCommands true
set_option trace.auto.smt.result true

class foo (t : Type) where
  le : t -> t -> Prop

example [foo Nat] (x y : Nat) : foo.le x y := by
  auto -- calls smt solver, but fails to find a proof

example {α : Type} [foo α] (x y : α) : foo.le x y := by
  auto -- fails to translate (and doen't even call the solver) with the following error: 
 /-
 getSexp :: Malformed (prefix of) input (
  ;; universe for smti_1:
  ;;   smti_1!val!1 smti_1!val!0 
  ;; -----------
  ;; definitions for universe elements:
  (declare-fun smti_1!val!1 () smti_1)
  (declare-fun smti_1!val!0 () smti_1)
  ;; cardinality constraint:
  (forall ((x smti_1)) (or (= x smti_1!val!1) (= x smti_1!val!0)))
  ;; -----------
  (define-fun valid_fact_0 () Bool
    (not (smti_3 smti_0 smti_2)))
  (define-fun smti_2 () smti_1
    smti_1!val!1)
  (define-fun smti_0 () smti_1
    smti_1!val!0)
  (define-fun smti_3 ((x!0 smti_1) (x!1 smti_1)) Bool
    false)
)
 -/

Could you help me with this issue? Is it a fundamental limitation or just a bug?

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 a pull request may close this issue.

1 participant