Closed ethanfrey closed 7 years ago
It is not due to a z3 error. No decreasing parameter
means it does not know how to prover termination of insert
.
Can you add the --no-termination
flag?
Not sure about the cvc4
error.
Okay, that seems to have solved it:
# liquid --smtsolver=z3 --notermination datatypes.hs
LiquidHaskell Copyright 2009-15 Regents of the University of California. All Rights Reserved.
**** DONE: A-Normalization ****************************************************
**** DONE: Extracted Core using GHC *******************************************
**** DONE: Transformed Core ***************************************************
**** DONE: Uniqify & Rename ***************************************************
Done solving.
RESULT: Safe
**** DONE: annotate ***********************************************************
**** RESULT: SAFE **************************************************************
Okay, then I guess I will just stick with z3 for now. Those other errors really scared me. If you have a chance to reproduce them, or prove it works for you, it would be great.
Looking forward to exploring more. Thanks for the quick response!
As a note to anyone who sees this. Just add these lines to the top of the .hs file to be checked. At least this fixed my issues with z3. Not sure about the other smt libs...
{-@ LIQUID "--short-names" @-}
{-@ LIQUID "--no-termination" @-}
{-@ LIQUID "--scrape-used-imports" @-}
Hi @ethanfrey -- yes the broader problem is that there is some "boilerplate" code (like the pragmas above) that I omitted (is not visible in) the tutorial PDF but is in the Haskell source. Perhaps I can add a "NOTE" in the tutorial saying the above.
@nikivazou -- several folks have been puzzled by the 'termination error'. We can easily do the following: create a numeric code for each error 1
,2
,3
,... etc. and then have a FAQ that
folks can look up to get some initial help?
Sure, or we can just change the text "No decreasing parameter" to "Termination error: cannot prove termination, either give a termination hint or run liquid with "--no-termination"".
Yes that's an immediate fix ...!
On Sat, Apr 22, 2017 at 1:39 AM Niki Vazou notifications@github.com wrote:
Sure, or we can just change the text "No decreasing parameter" to "Termination error: cannot prove termination, either give a termination hint or run liquid with "--no-termination"".
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ucsd-progsys/liquidhaskell/issues/990#issuecomment-296294263, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkuOFthHwZa5eGzzJ4MFzBXP-gHaMW7ks5ryQ0FgaJpZM4NDb3Q .
First, I want to say that I am quite new to haskell and smt solvers, but heard of this project and it seems a very amazing way to do proofs on production code at minimal cost. I am going through the tutorial and it all makes sense, but I have spent quite a while debugging some issues.
First, the last release on hackage is 0.6.0.0 from almost a year ago, and the syntax is different from the tutorial, (like Prop v for Bool) so I checked out the develop branch and compiled from source with stack. No problem there. (Commit 72422e9 if that matters)
I get most code working, but now and then I am hitting my head, and I think there may be an issue with the setup. I took a minimal snippet from chapter 5 (datatypes) here. Unfortunately the issue with the
Here is a minimal snippet taken from the tutorial that is supposed to work.
When I run the solver with z3, I get the following error:
This is all on OSX Sierra (10.12.3)
Then I figured, it might be due to poor z3 support. Okay, I went ahead and installed the stable version of cvc4, and more problems. (devel versions even worse):
Then I went for the development version:
And mathsat didn't work either:
Is there some trick to getting this all to work? Or is OSX just not supported? I hope I am just being stupid, but it would be great if there was a write up on how to do this all, since I think I did follow the instructions.
Thanks for the attention