-
Notifications
You must be signed in to change notification settings - Fork 27
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
About Lemmas and other questions #99
Comments
Dear Hafizh, thank you very much for pointing these out; your reports are
invaluable!
(Don't close this issue till I've fixed it).
The / [len xs] is a "termination metric". Unfortunately, much of that work
was done
after the tutorial so we haven't had a chance to work it in. However, you
can learn
about it from the blog posts, e.g. here:
https://ucsd-progsys.github.io/liquidhaskell-blog/tags/termination.html
…On Sun, Jun 7, 2020 at 2:37 AM Hafizh Afkar Makmur ***@***.***> wrote:
I find myself unable to understand how to use lemmas as is explained in
Chapter 10. Is there any other illustrative example available to show how
to use it? Do I really need to delve deep into the mathematical proof to
understand it? Also Chapter 10 page is completely uncompilable because
there are some missing imports that can't be fixed by user because the
editor also don't recognize import.
In chapter 8 there is a code {-@ go :: UList a -> xs:[a] -> UList a /
[len xs] @-} in nub. What does / here means? I found no other uses of it
in Haskell except as a dividing operator, which I don't think is used here
that way. I also can delete / [len xs] and it will still compile well.
But I'm afraid that it turns out to be an important component to solve some
problems. Also I don't really understand what ok in matFromList is
supposed to do. What is the condition so that the input list can be
rejected entirely? Is the tail supposed to be ignored like implied in xss@
(xs:_)? Because the implementation that I have thought needs to use tail
xss eventually.
In Chapter 12 there are two "Exercise: (Insertion):". Maybe the second one
should be "Exercise: (Deletion):"? Also In Figure 12.5 The most left
triangle should be 'll' instead of 'lr'. Also there are a lot of "--FIX ME"
in the last exercises. Is it intended and is the content an "answer key"
for the undefined measure? And what is the difference between inline and
measure?
Also I find that the error messages when dealing with set measures can be
really incomprehensible, especially compared to errors only related to
lists. I wonder how it can be done better....
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/ucsd-progsys/liquidhaskell-tutorial/issues/99__;!!Mih3wA!RB8UgVN4wNRmAH4hr-GOFqZ-v4aT98bFZb09KeBmoUJGi64_hrnLI_4uHahHUUAG$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OFAGMXUZF52Y47HEUTRVNNVDANCNFSM4NXARVWQ__;!!Mih3wA!RB8UgVN4wNRmAH4hr-GOFqZ-v4aT98bFZb09KeBmoUJGi64_hrnLI_4uHaUsXy5p$>
.
|
Thank you very much! That blog is a very invaluable resource that I can ever find for this tutorial. Right now I'm skimming those articles to augment my understanding of LH. I think Abstract and Bounded Refinement Types would made a very good tutorial for next chapters. For now I think I've found in that blog the solution for most of the problems I ask in prior question just like problem about
and instead just remake the function from zero resulting in this
which I think is more elegant for me, but I still like to know the intended solution using that template. Unfortunately I am still stumped in the lemma problem, hence the 3 problems in Chapter 8 ( Once again thank you @ranjitjhala ! May your work prosper and this software be better and better. |
I find myself unable to understand how to use lemmas as is explained in Chapter 10. Is there any other illustrative example available to show how to use it? Do I really need to delve deep into the mathematical proof to understand it? Also Chapter 10 page is completely uncompilable because there are some missing imports that can't be fixed by user because the editor also don't recognize
import
.In chapter 8 there is a code
{-@ go :: UList a -> xs:[a] -> UList a / [len xs] @-}
innub
. What does/
here means? I found no other uses of it in Haskell except as a dividing operator, which I don't think is used here that way. I also can delete/ [len xs]
and it will still compile well. But I'm afraid that it turns out to be an important component to solve some problems. Also I don't really understand whatok
inmatFromList
is supposed to do. What is the condition so that the input list can be rejected entirely? Is the tail supposed to be ignored like implied inxss@(xs:_)
? Because the implementation that I have thought needs to usetail xss
eventually.In Chapter 12 there are two "Exercise: (Insertion):". Maybe the second one should be "Exercise: (Deletion):"? Also In Figure 12.5 The most left triangle should be 'll' instead of 'lr'. Also there are a lot of "--FIX ME" in the last exercises. Is it intended and is the content an "answer key" for the undefined measure? And what is the difference between
inline
andmeasure
?Also I find that the error messages when dealing with set measures can be really incomprehensible, especially compared to errors only related to lists. I wonder how it can be done better....
The text was updated successfully, but these errors were encountered: