Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d33de55
add Elaborate.hs
yiyunliu Feb 5, 2020
7f412d4
elaborate almost done
yiyunliu Feb 7, 2020
4cf6998
drop only dictionaries of type Eq, Ord, Numerical, and ~
yiyunliu Feb 8, 2020
d5c2464
clean up Elaborate
yiyunliu Feb 8, 2020
049c1a1
clean up Bare.hs
yiyunliu Feb 8, 2020
5118128
Merge remote-tracking branch 'yl-fork/drop-only-embedded' into elabor…
yiyunliu Feb 8, 2020
275b01d
add class but does not unify
yiyunliu Feb 9, 2020
1597fbc
add SemigroupOp.hs example. clean up tracepp
yiyunliu Feb 9, 2020
20e8c04
add subclass (constraint generation failed)
yiyunliu Feb 13, 2020
8a3fd40
fix stripPred
yiyunliu Feb 16, 2020
6831e22
Merge remote-tracking branch 'origin/develop' into elaboration-local
yiyunliu Feb 16, 2020
5eaf518
add dictionary reflection; add ($>) to prevent Functor from becoming …
yiyunliu Feb 16, 2020
b1c5537
add Maybe to Subclass.hs
yiyunliu Feb 16, 2020
d793061
add PIff embedding. add accidentally deleted save bspec
yiyunliu Feb 17, 2020
08f4b8e
save progress because it would expensive to lose..
yiyunliu Feb 17, 2020
2866706
add refinement generation but does not work
yiyunliu Feb 18, 2020
9768942
refinement for method works (except for nat)
yiyunliu Feb 19, 2020
af0cfae
add inlineaux pass but tcsplitdfunty panics
yiyunliu Feb 19, 2020
9bce070
fix inlineaux substitution
yiyunliu Feb 19, 2020
331f2bd
forgot to add the pass
yiyunliu Feb 19, 2020
d3e09dc
make recursive call n argsNoTy
yiyunliu Feb 19, 2020
39c20e1
clean up and add failed sugared monoidassoc & desugared example
yiyunliu Feb 19, 2020
b3f1219
add termination check for dictionraies. break Rec
yiyunliu Feb 21, 2020
f8cc32a
perform let $d = $f ... substitutiton
yiyunliu Feb 21, 2020
9ccc8c5
fix makeClassAuxTypesOne unreachable
yiyunliu Feb 21, 2020
3f80186
add unfolding of dfuns
yiyunliu Feb 23, 2020
87f1301
switch to hashmap for substitution
yiyunliu Feb 23, 2020
c01f504
inline less aggressively
yiyunliu Feb 24, 2020
1ab1d57
commenting out inlineDFun. strengthen selector signatures
yiyunliu Feb 24, 2020
e70a615
update submodule
yiyunliu Feb 27, 2020
9cf44f2
add coherence obligation generator
yiyunliu Feb 28, 2020
e70f9dd
add coherence proof obligatoin
yiyunliu Feb 28, 2020
569fa17
refine cp1,cp2
yiyunliu Feb 28, 2020
1ef13fc
clean up trace
yiyunliu Feb 28, 2020
2d2d165
refine cp1, cp2 (the correct way)
yiyunliu Feb 28, 2020
34026c2
run the simplifier on core because it magically fixes termination metric
yiyunliu Feb 28, 2020
6b2f7ad
revert back because simplifier breaks fmapStateId' proof
yiyunliu Feb 29, 2020
61d707d
commit everything
yiyunliu Mar 3, 2020
1c35728
fix <=>
yiyunliu Mar 14, 2020
8b7a9eb
slightly better elaboration error messages
jprider63 Mar 24, 2020
29253b6
Merge pull request #2 from jprider63/elaboration-local
yiyunliu Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion liquid-fixpoint
4 changes: 4 additions & 0 deletions liquidhaskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ library
Language.Haskell.Liquid.Bare.Resolve
Language.Haskell.Liquid.Bare.ToBare
Language.Haskell.Liquid.Bare.Types
Language.Haskell.Liquid.Bare.Elaborate
Language.Haskell.Liquid.Constraint.Constraint
Language.Haskell.Liquid.Constraint.Env
Language.Haskell.Liquid.Constraint.Fresh
Expand Down Expand Up @@ -123,6 +124,7 @@ library
Language.Haskell.Liquid.Transforms.ANF
Language.Haskell.Liquid.Transforms.CoreToLogic
Language.Haskell.Liquid.Transforms.Rec
Language.Haskell.Liquid.Transforms.InlineAux
Language.Haskell.Liquid.Transforms.RefSplit
Language.Haskell.Liquid.Transforms.Rewrite
Language.Haskell.Liquid.Transforms.Simplify
Expand Down Expand Up @@ -190,6 +192,8 @@ library
, transformers >= 0.3
, unordered-containers >= 0.2
, vector >= 0.10
, free
, recursion-schemes
default-language: Haskell98
default-extensions: PatternGuards
ghc-options: -W -fwarn-missing-signatures
Expand Down
412 changes: 337 additions & 75 deletions src/Language/Haskell/Liquid/Bare.hs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/Language/Haskell/Liquid/Bare/Axiom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ getReflectDefs src sig spec = findVarDefType cbs sigs <$> xs

findVarDefType :: [Ghc.CoreBind] -> [(Ghc.Var, LocSpecType)] -> LocSymbol
-> (LocSymbol, Maybe SpecType, Ghc.Var, Ghc.CoreExpr)
findVarDefType cbs sigs x = case findVarDef (val x) cbs of
Just (v, e) -> if Ghc.isExportedId v
then (x, val <$> lookup v sigs, v, e)
findVarDefType cbs sigs x = case findVarDefMethod (val x) cbs of
Just (v, e) -> if Ghc.isExportedId v || isMethod (F.symbol x) || isDictionary (F.symbol x)
then (F.notracepp "FIND-VAR-DEF-NAME" $ x, F.notracepp "FIND-VAR-DEF" $ val <$> lookup v sigs, v, e)
else Ex.throw $ mkError x ("Lifted functions must be exported; please export " ++ show v)
Nothing -> Ex.throw $ mkError x "Cannot lift haskell function"

Expand Down Expand Up @@ -106,7 +106,7 @@ rTypeSortExp tce = typeSort tce . Ghc.expandTypeSynonyms . toType
grabBody :: Ghc.Type -> Ghc.CoreExpr -> ([Ghc.Var], Ghc.CoreExpr)
grabBody (Ghc.ForAllTy _ t) e
= grabBody t e
grabBody (Ghc.FunTy tx t) e | Ghc.isClassPred tx
grabBody (Ghc.FunTy tx t) e | isEmbeddedDictType tx
= grabBody t e
grabBody (Ghc.FunTy _ t) (Ghc.Lam x e)
= (x:xs, e') where (xs, e') = grabBody t e
Expand Down Expand Up @@ -178,7 +178,7 @@ axiomType s t = AT to (reverse xts) res
(to, (_,xts, Just res)) = runState (go t) (1,[], Nothing)
go (RAllT a t r) = RAllT a <$> go t <*> return r
go (RAllP p t) = RAllP p <$> go t
go (RFun x tx t r) | isClassType tx = (\t' -> RFun x tx t' r) <$> go t
go (RFun x tx t r) | isEmbeddedClass tx = (\t' -> RFun x tx t' r) <$> go t
go (RFun x tx t r) = do
(i,bs,res) <- get
let x' = unDummy x i
Expand Down
2 changes: 1 addition & 1 deletion src/Language/Haskell/Liquid/Bare/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ checkTerminationExpr emb env (v, Loc l _ t, les)
xts = concatMap mkClass $ zip (ty_binds trep) (ty_args trep)
trep = toRTypeRep t

mkClass (_, RApp c ts _ _) | isClass c = classBinds emb (rRCls c ts)
mkClass (_, RApp c ts _ _) | isEmbeddedDict c = classBinds emb (rRCls c ts)
mkClass (x, t) = [(x, rSort t)]

rSort = rTypeSortedReft emb
Expand Down
3 changes: 1 addition & 2 deletions src/Language/Haskell/Liquid/Bare/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ addCC x zz@(Loc l l' st0)
addForall _ t
= t


splitDictionary :: Ghc.CoreExpr -> Maybe (Ghc.Var, [Ghc.Type], [Ghc.Var])
splitDictionary = go [] []
where
Expand Down Expand Up @@ -273,4 +272,4 @@ lookupDefaultVar env name v = Mb.maybeToList
where
dmSym = F.atLoc v (GM.qualifySymbol mSym dnSym)
dnSym = F.mappendSym "$dm" nSym
(mSym, nSym) = GM.splitModuleName (F.symbol v)
(mSym, nSym) = GM.splitModuleName (F.symbol v)
Loading