-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pantograph Error Cases Report #53
Comments
As for the |
Can you explain what is supposed to happen in case 2? The first one is probably a Python problem |
@Purewhite2019 thm = """theorem amc12_2000_p15 (f : ℂ → ℂ) (h₀ : ∀ x, f (x / 3) = x ^ 2 + x + 1)
(h₁ : Fintype (f ⁻¹' {7})) : (∑ y in (f ⁻¹' {7}).toFinset, y / 3) = -1 / 9 := sorry
"""
unit = server.load_sorry(thm)[0]
Traceback (most recent call last):
File "/home/cubelab/workspace/Lean/PyPantograph/pantograph/server.py", line 133, in run
obj = json.loads(line)
File "/home/cubelab/miniconda3/envs/p2g/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/cubelab/miniconda3/envs/p2g/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/cubelab/miniconda3/envs/p2g/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) More precisely, it might be caused by the
The same applies to the second one. Note that these cases work fine in the Lean Server. import Mathlib
import Aesop
theorem mathd_numbertheory_552
(f g h : ℕ+ → ℕ)
(h₀ : ∀ x, f x = 12 * x + 7)
(h₁ : ∀ x, g x = 5 * x + 2)
(h₂ : ∀ x, h x = Nat.gcd (f x) (g x))
(h₃ : Fintype (Set.range h)) :
(∑ k in (Set.range h).toFinset, k) = 12 := sorry
theorem amc12_2000_p15 (f : ℂ → ℂ) (h₀ : ∀ x, f (x / 3) = x ^ 2 + x + 1)
(h₁ : Fintype (f ⁻¹' {7})) : (∑ y in (f ⁻¹' {7}).toFinset, y / 3) = -1 / 9 := sorry |
Understood. This does seem rather strange as I've come across several similar issues that were due to json errors and were resolved by setting I was able to successfully reproduce the error you mentioned. Below is a more detailed error backtrace:
As the error message suggests, commenting out this line can address the aforementioned I'm still not certain why this assertion fails. Perhaps @lenianiva could conduct a more in-depth inspection. |
If this is a problem with Lean's json system we'll have to wait until the upstream is fixed |
I can't reproduce the error cases listed here on the upstream head for some reason. Maybe I accidentally fixed it or maybe there's something else going on.
|
You can check the github action here . Or run |
This fixes one of the statements: theorem mathd_algebra_31 (x : NNReal) (u : ℕ → NNReal) (h₀ : ∀ n, u (n + 1) = NNReal.sqrt (x + u n))
(h₁ : Filter.Tendsto u Filter.atTop (𝓝 9)) : 9 = NNReal.sqrt (x + 9) := by sorry
I have tested it in repl and it works. |
Exactly. Indeed, this solution was initially designed for the Lean REPL. |
so that fixes all the issues? |
Does this still occur? I could not trigger it by feeding this into the Pantograph repl:
and it outputs
which is successful. I've been chasing down this mysterious bug for days and I could not reproduce it. |
Please try this
When using
Maybe it originates from the distinct behavior of the |
Would it be an acceptable solution to remove most of the drafting features ( |
I've removed the over-eager assertion failure on the upstream branch here: https://git.leni.sh/aniva/Pantograph/pulls/158 Moving forward, I will probably deprecate tactic-based drafting in example : ... := by
have a : A := sorry
sorry you can write example : ... := sorry and use the new draft tactic with this draft by
have a : A := sorry
sorry which is more robust, and allows for recursive drafting. |
Environment setup
Error cases
JSONDecodeError for some cases
A minimized Case
Unsolved goalsThe remaining goal state:
Lean Server Result
The Lean server response can be check here
The text was updated successfully, but these errors were encountered: