Skip to content

Commit 7ed6093

Browse files
Merge pull request #2597 from ucsd-progsys/fd/remove-no-lazy-ple
Remove --no-lazy-ple, update LF, test LF-780
2 parents f6c97e6 + 1bfa146 commit 7ed6093

File tree

9 files changed

+119
-14
lines changed

9 files changed

+119
-14
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ commands:
1010
name: Install z3
1111
command: |
1212
# Config version
13-
z3version="z3-4.8.17"
14-
z3distributiontype="x64-glibc-2.31"
13+
z3version="z3-4.15.1"
14+
z3distributiontype="x64-glibc-2.39"
1515
z3full="${z3version}-${z3distributiontype}"
1616
1717
# Download and install
@@ -145,14 +145,14 @@ jobs:
145145
# support GHC 9.12 yet.
146146
stack_900:
147147
machine:
148-
image: default
148+
image: ubuntu-2404:2025.09.1
149149
steps:
150150
- stack_build_and_test:
151151
stack_yaml_file: "stack.yaml"
152152
extra_build_flags: "--flag liquidhaskell-boot:devel"
153153
cabal_9122:
154154
machine:
155-
image: default
155+
image: ubuntu-2404:2025.09.1
156156
steps:
157157
- cabal_build_and_test:
158158
ghc_version: "9.12.2"

.github/workflows/cabal.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
ghc:
1919
- "9.12.2"
2020
z3:
21-
- "4.10.2"
21+
- "4.15.1"
2222

2323
steps:
2424
- uses: actions/checkout@v4
@@ -29,6 +29,7 @@ jobs:
2929
uses: pavpanchekha/setup-z3@6b2d476d7a9227e0d8d2b94f73cd9fcba91b5e98
3030
with:
3131
version: ${{ matrix.z3 }}
32+
distribution: glibc-2.39
3233

3334
- name: Workaround runner image issue
3435
# https://github.com/actions/runner-images/issues/7061

liquidhaskell-boot/src/Language/Haskell/Liquid/Constraint/ToFixpoint.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ fixConfig tgt cfg = def
6363
, FC.extensionality = extensionality cfg
6464
, FC.interpreter = interpreter cfg
6565
, FC.rwTermination = rwTerminationCheck cfg
66-
, FC.noLazyPLE = noLazyPLE cfg
6766
, FC.fuel = fuel cfg
6867
, FC.noEnvReduction = not (environmentReduction cfg)
6968
, FC.inlineANFBinds = inlineANFBindings cfg

liquidhaskell-boot/src/Language/Haskell/Liquid/UX/CmdLine.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ defConfig = Config {
374374
= False
375375
&= name "skip-module"
376376
&= help "Completely skip this module, don't even compile any specifications in it."
377-
,
378-
noLazyPLE
379-
= False
380-
&= name "no-lazy-ple"
381-
&= help "Don't use Lazy PLE"
382377

383378
, fuel
384379
= Nothing

liquidhaskell-boot/src/Language/Haskell/Liquid/UX/Config.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ data Config = Config
103103
, auxInline :: Bool -- ^
104104
, rwTerminationCheck :: Bool -- ^ Enable termination checking for rewriting
105105
, skipModule :: Bool -- ^ Skip this module entirely (don't even compile any specs in it)
106-
, noLazyPLE :: Bool
107106
, fuel :: Maybe Int -- ^ Maximum PLE "fuel" (unfold depth) (default=infinite)
108107
, environmentReduction :: Bool -- ^ Perform environment reduction
109108
, noEnvironmentReduction :: Bool -- ^ Don't perform environment reduction

tests/benchmarks/sf/Lists.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-@ LIQUID "--reflection" @-}
22
{-@ LIQUID "--ple" @-}
3-
{-@ LIQUID "--no-lazy-ple" @-}
43

54
module Lists where
65

tests/ple/pos/TestLF780.hs

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{-@ LIQUID "--ple" @-}
2+
-- | Tests that we can unfold reflected functions in the solutions
3+
-- of KVars.
4+
--
5+
-- https://github.com/ucsd-progsys/liquid-fixpoint/issues/780
6+
--
7+
module TestLF780 where
8+
9+
import Data.Set as Set
10+
11+
{-@ data State s a <p :: s -> Bool, q :: s -> a -> s -> Bool>
12+
= State (x:s<p> -> (a, s)<\w -> {v:s<q x w> | true}>)
13+
@-}
14+
data State s a = State {runState :: s -> (a, s)}
15+
16+
{-@ runState :: forall <p :: s -> Bool, q :: s -> a -> s -> Bool>.
17+
State <p, q> s a -> x:s<p> -> (a, s)<\w -> {v:s<q x w> | true}> @-}
18+
19+
instance Functor (State s) where
20+
{-@
21+
instance Functor (State s) where
22+
fmap :: forall < p :: s -> Bool
23+
, q :: s -> a -> s -> Bool
24+
, q2 :: s -> a -> s -> Bool
25+
, pa :: a -> Bool
26+
, pb :: b -> Bool
27+
>.
28+
{x::a<pa>, s0::s<p>, y::b<pb> |- s<q s0 x> <: s<q2 s0 y>}
29+
(a<pa> -> b<pb>)
30+
-> State <p, q> s a<pa>
31+
-> State <p, q2> s b<pb>
32+
@-}
33+
fmap f x = State $ \s -> let (y, s') = runState x s in (f y, s')
34+
35+
instance Applicative (State s) where
36+
{-@
37+
instance Applicative (State s) where
38+
pure :: forall <p :: s -> Bool>.
39+
x:a -> State <p, \w0 y -> {w1:s<p> | w0 == w1 && y == x}> s a
40+
@-}
41+
pure x = State $ \s -> (x, s)
42+
mf <*> mx = State $ \s ->
43+
let (f, s1) = runState mf s
44+
(x, s2) = runState mx s1
45+
in (f x, s2)
46+
47+
instance Monad (State s) where
48+
{-@
49+
instance Monad (State s) where
50+
>>= :: forall < p :: s -> Bool
51+
, p2 :: a -> s -> Bool
52+
, r :: a -> Bool
53+
, q1 :: s -> a -> s -> Bool
54+
, q2 :: a -> s -> b -> s -> Bool
55+
, q :: s -> b -> s -> Bool>.
56+
{x::a<r>, w::s<p>|- s<q1 w x> <: s<p2 x>}
57+
{w::s<p>, x::a, w1::s<q1 w x>, y::b |- s<q2 x w1 y> <: s<q w y>}
58+
{x::a, w::s, w2::s<q1 w x>|- {v:a | v = x} <: a<r>}
59+
State <p, q1> s a
60+
-> (x:a<r> -> State <{v:s<p2 x> | true}, \w1 y -> {v:s<q2 x w1 y> | true}> s b)
61+
-> State <p, q> s b ;
62+
>> :: forall < p :: s -> Bool
63+
, p2 :: s -> Bool
64+
, q1 :: s -> a -> s -> Bool
65+
, q2 :: s -> b -> s -> Bool
66+
, q :: s -> b -> s -> Bool>.
67+
{x::a, w::s<p>|- s<q1 w x> <: s<p2>}
68+
{w::s<p>, w2::s<p2>, x::b, y::a |- s<q2 w2 x> <: s<q w x>}
69+
State <p, q1> s a
70+
-> State <p2, q2> s b
71+
-> State <p, q> s b ;
72+
return :: forall <p :: s -> Bool>.
73+
x:a -> State <p, \w0 y -> {w1:s<p> | w0 == w1 && y == x}> s a
74+
@-}
75+
(State g) >>= f = State $ \x -> case g x of {(y, s) -> (runState (f y)) s}
76+
77+
(State g) >> f = State $ \x -> case g x of {(y, s) -> (runState f ) s}
78+
79+
return w = State $ \s -> (w, s)
80+
81+
82+
{-@
83+
get :: forall <p :: s -> Bool>.
84+
State <p, {\s0 v s -> v = s && s = s0}> s s<p>
85+
@-}
86+
get :: State s s
87+
get = State $ \s -> (s, s)
88+
89+
{-@
90+
put :: forall <p :: s -> Bool>.
91+
s0:s -> State <p, {\_ v s -> s = s0}> s ()
92+
@-}
93+
put :: s -> State s ()
94+
put s = State $ \_ -> ((), s)
95+
96+
{-@ reflect gt0 @-}
97+
gt0 :: Int -> Bool
98+
gt0 x = x > 0
99+
100+
{-@
101+
stFun
102+
:: i:Int
103+
-> State
104+
<{\m0 -> gt0 i }
105+
, {\m0 v m -> v > 0 }>
106+
_ _
107+
@-}
108+
stFun :: Int -> State Int Int
109+
stFun i = do
110+
put i
111+
get

tests/tests.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ executable ple-pos
24412441
, T1424A
24422442
, T1424
24432443
, T2582
2444+
, TestLF780
24442445
, Tmp1
24452446
, Tmp
24462447
, ReaderEta

0 commit comments

Comments
 (0)