-
Notifications
You must be signed in to change notification settings - Fork 645
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
Able to prove two contradictory theorems #4582
Comments
Perhaps I would be better off avoid the negation and forcing myself to prove the theorem in the positive. I went for the negative because I thought it would require less maintenance as I added cases. However, this does not compile, which is good:
|
EDIT: I screwed up. Ignore this stupid comment. In my own moving things back and forth I just screwed up the following code, so of course it compile. 🍳 -> 🤕 -- Okay, I'm really on a roll today. I was able to to break even the positive statement of the proof. This compiles:
|
This final result pretty much ruins Idris for me: I no longer have any sense of when I can trust it. I'm going to start learning Agda instead, I think, but I also see the problem before the Idris community: it is small, it is fringe, it is on the bleeding edge. Brady is trying to build 2.0, while 1.x is gaining traction and yet far from mature and stable. I care about this. I have been trying hard to learn type theory, and not only type theory but how to implement actual languages with it. I would love to get to the place where I could help track down and fix this kind of stuff in Idris, but I don't know. I don't have tons of free time to work on stuff like this, but I do wish I knew how to get to the point where I could meaningfully contribute given the constraints of my poor knowledge and limited time. |
The first one does seem problematic, the coverage checker seems to ignore the fact that there's a parameter which can affect the reduction. Your last example, however, is a valid program: |
@clayrat Thanks so much for your response. I couldn't be more happy to be wrong. If very basic proof by pattern matching is restored that restores Idris to usability for me somewhat: if I at least have a knowledge of where to look out for trouble. When I posted the initial stuff I was pretty careful and cross-checked myself a number of ways (thus the multiplication of different approaches). However apparently I got careless! My implicit trust in Idris having been taken away, I reverted into my number one problem, which is my implicit trust in myself. 👅 There was a version of my code where I had Anyway, glad to be wrong, and thanks for the response! I wish I could ask how one goes about tracking down and finding such a bug in the coverage checker, but I don't think I've even ever got Idris to compile, since my The problem is it seems I need a background in Haskell tooling to start working on this, but in Haskell I have never got beyond toy projects using Stack instead of Cabal (I read about Haskell and look at its libraries constantly, so as I language I understand it reasonably well, but my ability to use the ecosystem is poor). |
@Kazark I've compiled it several times using the scripts at https://github.com/melted/get-idris/, maybe you could find some magic parameters in there that could help? My Haskell knowledge is pretty limited too, I'm afraid. Generally, problems like these is one of the reasons to become self-hosting, hence Blodwen ;) |
@clayrat Thanks, I'll have to give that a shot. |
Trying lots of different things to get Idris building both on Windows and Linux: |
Not going to be able to red-green-refactor this; I don't know enough to know exactly what the error should look like once it's being produced. So, I'll set the test up to pass as it is now, and then try to break the test. Unconventional! |
I'm looking at |
Inlining |
What's the best way to go about understanding this code? Is it just to read it through in detail? I haven't found where I could write unit tests that would help me understand this case. Ideally I would really like to write a unit test that would help me understand which branch of the pattern match the function is going down. I'm struggling to understand what term is under question as the argument to |
Okay, |
Removing the |
Hm, or should I be looking at the |
Or |
Okay, I have a suspicion that the problem is this: |
I see there is some sort of elaborator log by the |
Interestingly, if I make the list empty, it is able to detect that |
Posing the problem in terms of
^ Does not typecheck, saying Refl is a valid case, which is good. Also, I found |
The only real difference between
However, when I match out After playing with many, many variations of this, it seems that the problem is |
It really does have something to do with
|
This also does not compile. Again, though, I am not enlightened.
|
Trying to parse through the logs, I am quite overwhelmed and don't know what to make of them. I am though intrigued that this also exhibits the bug:
This is particularly interesting, because I'm working with stripped down version of the type in this example, that only has |
I'm in way over my head here. Anybody care to throw me a rope? I could use some help. I would like to be of use here and fix this if I can but I'm floundering. |
Thanks for the research.
I’ll take a look at it.
… 6 nov. 2018 kl. 06:40 skrev Keith Pinson ***@***.***>:
I'm in way over my head here. Anybody care to throw me a rope? I could use some help. I would like to be of use here and fix this if I can but I'm floundering.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@melted Thanks so much. Let me know if I can be of use. |
I noticed there are a number of issues around the totality checker and
impossible
, but it is not obvious to me whether this is a dupe with any of them. This example seems simpler than some of what I saw there, and if it is a dupe I may need some guidance from people who understand the guts better than I do in knowing which ones to link it to.The problem is that I am able to prove
Args_str_map_exhaustive
(for allTAction
,lookup
does not fail to find it inStrMap
) with simplyRefl impossible
when asArgs_str_map_not_exhaustive
demonstrates, there is actually a counterexample (there exists aTAction
--Teleport
--which such thatlookup
fails to find it in theStrMap
). When I try to construct the bogus theorem specific toTeleport
(Teleport_in_list
), Idris can see that it is bogus. I am also able to construct the counterexample proof more simply/directly inTeleport_not_in_list
.The following code compiles:
I observed this both in 1.2.0 and 1.3.1.
The text was updated successfully, but these errors were encountered: