GithubHelp home page GithubHelp logo

Comments (7)

ranjitjhala avatar ranjitjhala commented on July 23, 2024

Yikes this is my bad. I will fix the parser! In the meantime just use =>
For implies!

On Apr 5, 2015, at 12:58 PM, chowells79 [email protected] wrote:

The examples look like this:

{-@ ex3 :: Bool -> Bool -> TRUE @-}
ex3 a b = (a && b) ==> a

{-@ ex4 :: Bool -> Bool -> TRUE @-}
ex4 a b = (a && b) ==> b
When attempting to verify the first of those, I get:

**** ERROR: Invalid Source *****************************************************

tutorial-ch2.hs:19:20-22: Error: GHC Error
Not in scope: ‘==>’
Perhaps you meant ‘==’ (imported from Prelude)
What am I missing? Just adding the definition of (==>) from earlier in the chapter doesn't fix it. I end up getting:

**** UNSAFE ********************************************************************

tutorial-ch2.hs:19:11-24: Error: Liquid Type Mismatch
Inferred type
VV : Bool

not a subtype of Required type
VV : Bool | Prop VV

In Context
VV : Bool
I assume this is because liquid haskell doesn't look inside definitions, and just uses Bool -> Bool -> Bool as the type for (==>) when it lacks an accurate liquid haskell annotation.


Reply to this email directly or view it on GitHub.

from liquidhaskell-tutorial.

ranjitjhala avatar ranjitjhala commented on July 23, 2024

@chowells79 did you install from hackage or github? This issue is fixed in master so should be fine if you rebuild from there. Apologies for not updating hackage together with the tutorial!

@gridaphobe I think we should do a new release on hackage, perhaps after @nikivazou is done with they recent slew of bug fixes? (Thanks!)

On Apr 5, 2015, at 12:58 PM, chowells79 [email protected] wrote:

The examples look like this:

{-@ ex3 :: Bool -> Bool -> TRUE @-}
ex3 a b = (a && b) ==> a

{-@ ex4 :: Bool -> Bool -> TRUE @-}
ex4 a b = (a && b) ==> b
When attempting to verify the first of those, I get:

**** ERROR: Invalid Source *****************************************************

tutorial-ch2.hs:19:20-22: Error: GHC Error
Not in scope: ‘==>’
Perhaps you meant ‘==’ (imported from Prelude)
What am I missing? Just adding the definition of (==>) from earlier in the chapter doesn't fix it. I end up getting:

**** UNSAFE ********************************************************************

tutorial-ch2.hs:19:11-24: Error: Liquid Type Mismatch
Inferred type
VV : Bool

not a subtype of Required type
VV : Bool | Prop VV

In Context
VV : Bool
I assume this is because liquid haskell doesn't look inside definitions, and just uses Bool -> Bool -> Bool as the type for (==>) when it lacks an accurate liquid haskell annotation.


Reply to this email directly or view it on GitHub.

from liquidhaskell-tutorial.

chowells79 avatar chowells79 commented on July 23, 2024

I installed from hackage. I'll give it a shot with a build from github later on and report.

from liquidhaskell-tutorial.

chowells79 avatar chowells79 commented on July 23, 2024

Same error on a build from github. I suspect you may have misdiagnosed the problem. The example shows using (==>) in the term-level expression, which isn't defined.

from liquidhaskell-tutorial.

ranjitjhala avatar ranjitjhala commented on July 23, 2024

Sorry! Are you using this file from the tutorial src/ directory

https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L132

As you can see it's defined there so I'm puzzled as to why ghc is complaining.

Else can you post a gist of the file you are running through liquid?

Thanks!

On hid Apr 6, 2015, at 3:55 AM, chowells79 [email protected] wrote:

Same error on a build from github. I suspect you may have misdiagnosed the problem. The example shows using (==>) in the term-level expression, which isn't defined.


Reply to this email directly or view it on GitHub.

from liquidhaskell-tutorial.

ranjitjhala avatar ranjitjhala commented on July 23, 2024

Ok got it! Looks like you created a NEW file, and copied the CODE for ==> over but didn't copy the SPEC over; that is shown at the top of the file over here

https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L10

So you should add that in addition to the code for ==>
From here

https://github.com/ucsd-progsys/liquidhaskell-tutorial/blob/master/src/02-logic.lhs#L132

(I didn't show the spec in chapter 2 because refinement types are only properly introduced in ch 3)
And yet I wanted to sneak them in just to get tangible feedback for the logical queries and validity.

Apologies for the confusion!

from liquidhaskell-tutorial.

chowells79 avatar chowells79 commented on July 23, 2024

That's exactly the issue - I created a new file in which to do the exercises from the chapter.

from liquidhaskell-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.