ucsd-progsys/liquidhaskell

Cannot parse specification

Open

#1,781 opened on Oct 22, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Haskell (157 forks)batch import
good first issue

Repository metrics

Stars
 (1,306 stars)
PR merge metrics
 (Avg merge 2d 18h) (12 merged PRs in 30d)

Description

{-@ inline id' @-}
id' x = x

{-@ arith :: { id' ( 2 <= 2 ) } @-}
arith = ()

yields:

/home/zgrannan/rewriting-paper/optimization/arith.hs:4:20: error:  Cannot parse specification:
                                                                       unexpected "( "
                                                                       expecting "&&", "->", "<:", "<=>", "==>", "=>", "||", "~>", ':', '}', or monoPredicateP

This is a contrived example but I've run into similar issues generating LH specifications programmatically.

In general I would expect that if the expression {-@ thm : { x } @-} parses, then {-@ thm : { id' (x) } @-} should also parse (excluding the LH builtin operators not already present in Haskell, such as <=>)

Contributor guide