liquid-fixpoint 0.6.0.1 → 0.7.0.1
raw patch · 112 files changed
+3294/−11186 lines, 112 filesdep +parallel-iodep +stmdep +tasty-ant-xmldep ~basedep ~containersdep ~mtlnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies added: parallel-io, stm, tasty-ant-xml
Dependency ranges changed: base, containers, mtl, tasty-hunit, transformers
API changes (from Hackage documentation)
- Language.Fixpoint.Defunctionalize: makeLamArg :: Sort -> Int -> Symbol
- Language.Fixpoint.Graph.Partition: instance GHC.Base.Monoid (Language.Fixpoint.Graph.Partition.CPart a)
- Language.Fixpoint.Smt.Interface: AssertAxiom :: !(Triggered Expr) -> Command
- Language.Fixpoint.Smt.Interface: [ctxSmtEnv] :: Context -> !SMTEnv
- Language.Fixpoint.Smt.Interface: makeSmtContext :: Config -> FilePath -> [(Symbol, Sort)] -> IO Context
- Language.Fixpoint.Smt.Theories: isConName :: Symbol -> FTycon -> Bool
- Language.Fixpoint.Smt.Theories: smt2Sort :: Sort -> Maybe Builder
- Language.Fixpoint.Smt.Theories: theorySEnv :: SEnv Sort
- Language.Fixpoint.Smt.Theories: toInt :: Expr -> Sort -> Expr
- Language.Fixpoint.Smt.Types: AssertAxiom :: !(Triggered Expr) -> Command
- Language.Fixpoint.Smt.Types: Thy :: !Symbol -> !Raw -> !Sort -> !Bool -> TheorySymbol
- Language.Fixpoint.Smt.Types: [ctxSmtEnv] :: Context -> !SMTEnv
- Language.Fixpoint.Smt.Types: [tsInterp] :: TheorySymbol -> !Bool
- Language.Fixpoint.Smt.Types: [tsRaw] :: TheorySymbol -> !Raw
- Language.Fixpoint.Smt.Types: [tsSort] :: TheorySymbol -> !Sort
- Language.Fixpoint.Smt.Types: [tsSym] :: TheorySymbol -> !Symbol
- Language.Fixpoint.Smt.Types: data TheorySymbol
- Language.Fixpoint.Smt.Types: instance GHC.Classes.Eq Language.Fixpoint.Smt.Types.TheorySymbol
- Language.Fixpoint.Smt.Types: instance GHC.Classes.Ord Language.Fixpoint.Smt.Types.TheorySymbol
- Language.Fixpoint.Smt.Types: instance GHC.Show.Show Language.Fixpoint.Smt.Types.TheorySymbol
- Language.Fixpoint.Smt.Types: symbolBuilder :: Symbol -> Builder
- Language.Fixpoint.Smt.Types: type Raw = Text
- Language.Fixpoint.Smt.Types: type SMTEnv = SEnv Sort
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Base.Functor Language.Fixpoint.Solver.GradualSolution.GSelect
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Base.Monoid Language.Fixpoint.Solver.GradualSolution.KInfo
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Classes.Eq Language.Fixpoint.Solver.GradualSolution.KInfo
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Classes.Ord Language.Fixpoint.Solver.GradualSolution.KInfo
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Show.Show Language.Fixpoint.Solver.GradualSolution.KInfo
- Language.Fixpoint.Solver.GradualSolution: instance GHC.Show.Show a => GHC.Show.Show (Language.Fixpoint.Solver.GradualSolution.GSelect a)
- Language.Fixpoint.Solver.GradualSolution: lhsPred :: SolEnv -> GSolution -> SimpC a -> [([(KVar, QBind)], Expr)]
- Language.Fixpoint.Solver.GradualSolution: update :: Sol a QBind -> [KVar] -> [(KVar, EQual)] -> (Bool, Sol a QBind)
- Language.Fixpoint.Solver.GradualSolve: solveGradual :: (NFData a, Fixpoint a) => Config -> SInfo a -> IO (Result (Integer, a))
- Language.Fixpoint.Solver.Instantiate: instantiateAxioms :: Config -> Context -> BindEnv -> SEnv Sort -> AxiomEnv -> Integer -> SubC c -> IO (SubC c)
- Language.Fixpoint.Solver.Instantiate: instantiateFInfo :: Config -> Context -> FInfo c -> IO (FInfo c)
- Language.Fixpoint.SortCheck: instance Control.Monad.Error.Class.MonadError GHC.Base.String Language.Fixpoint.SortCheck.CheckM
- Language.Fixpoint.SortCheck: instance GHC.Base.Applicative Language.Fixpoint.SortCheck.CheckM
- Language.Fixpoint.SortCheck: instance GHC.Base.Functor Language.Fixpoint.SortCheck.CheckM
- Language.Fixpoint.SortCheck: instance GHC.Base.Monad Language.Fixpoint.SortCheck.CheckM
- Language.Fixpoint.SortCheck: instance Language.Fixpoint.SortCheck.Freshable GHC.Types.Int
- Language.Fixpoint.SortCheck: instance Language.Fixpoint.SortCheck.Freshable [GHC.Types.Int]
- Language.Fixpoint.Types.Constraints: strengthenLhs :: Expr -> SubC a -> SubC a
- Language.Fixpoint.Types.Names: intArgName :: Int -> Symbol
- Language.Fixpoint.Types.Sorts: fApp' :: Sort -> ListNE Sort
+ Language.Fixpoint.Defunctionalize: defuncAxioms :: (Defunc a) => Config -> SymEnv -> a -> (a, [Triggered Expr])
+ Language.Fixpoint.Graph.Partition: instance GHC.Base.Monoid (Language.Fixpoint.Graph.Partition.CPart c a)
+ Language.Fixpoint.Misc: (<$$>) :: (Monad m) => (a -> m b) -> [a] -> m [b]
+ Language.Fixpoint.Misc: duplicates :: (Eq k, Hashable k) => [k] -> [k]
+ Language.Fixpoint.Misc: exTopo :: [Int]
+ Language.Fixpoint.Misc: hashNub :: (Eq k, Hashable k) => [k] -> [k]
+ Language.Fixpoint.Misc: pair :: a -> a -> [a]
+ Language.Fixpoint.Misc: powerset :: [a] -> [[a]]
+ Language.Fixpoint.Misc: revMapM :: (Monad m) => (a -> m b) -> [a] -> m [b]
+ Language.Fixpoint.Misc: safeFromList :: (?callStack :: CallStack, Eq k, Hashable k, Show k) => String -> [(k, v)] -> HashMap k v
+ Language.Fixpoint.Misc: topoSortWith :: (Ord v) => (a -> (v, [v])) -> [a] -> [a]
+ Language.Fixpoint.Misc: triple :: a -> a -> a -> [a]
+ Language.Fixpoint.Parse: dataCtorP :: Parser DataCtor
+ Language.Fixpoint.Parse: dataDeclP :: Parser DataDecl
+ Language.Fixpoint.Parse: dataFieldP :: Parser DataField
+ Language.Fixpoint.Smt.Interface: AssertAx :: !(Triggered Expr) -> Command
+ Language.Fixpoint.Smt.Interface: DeclData :: !DataDecl -> Command
+ Language.Fixpoint.Smt.Interface: [ctxSymEnv] :: Context -> !SymEnv
+ Language.Fixpoint.Smt.Interface: smtBracketAt :: SrcSpan -> Context -> String -> IO a -> IO a
+ Language.Fixpoint.Smt.Interface: smtFuncDecl :: Context -> Symbol -> ([SmtSort], SmtSort) -> IO ()
+ Language.Fixpoint.Smt.Serialize: smt2SortMono :: (PPrint a) => a -> SymEnv -> Sort -> Builder
+ Language.Fixpoint.Smt.Theories: instance Language.Fixpoint.Smt.Types.SMTLIB2 Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Smt.Theories: maxLamArg :: Int
+ Language.Fixpoint.Smt.Theories: sortSmtSort :: Bool -> SEnv a -> Sort -> SmtSort
+ Language.Fixpoint.Smt.Types: AssertAx :: !(Triggered Expr) -> Command
+ Language.Fixpoint.Smt.Types: DeclData :: !DataDecl -> Command
+ Language.Fixpoint.Smt.Types: [ctxSymEnv] :: Context -> !SymEnv
+ Language.Fixpoint.Solver.Instantiate: instantiate :: Config -> SInfo a -> IO (SInfo a)
+ Language.Fixpoint.SortCheck: applySorts :: Visitable t => t -> [Sort]
+ Language.Fixpoint.SortCheck: instance Language.Fixpoint.SortCheck.Elaborate a => Language.Fixpoint.SortCheck.Elaborate (GHC.Base.Maybe a)
+ Language.Fixpoint.SortCheck: toInt :: SymEnv -> Expr -> Sort -> Expr
+ Language.Fixpoint.SortCheck: unApplyAt :: Expr -> Maybe Sort
+ Language.Fixpoint.Types.Config: [ginteractive] :: Config -> Bool
+ Language.Fixpoint.Types.Constraints: GWInfo :: Symbol -> Sort -> Expr -> GradInfo -> GWInfo
+ Language.Fixpoint.Types.Constraints: [_cbind] :: SimpC a -> !BindId
+ Language.Fixpoint.Types.Constraints: [ddecls] :: GInfo c a -> ![DataDecl]
+ Language.Fixpoint.Types.Constraints: [gexpr] :: GWInfo -> Expr
+ Language.Fixpoint.Types.Constraints: [ginfo] :: GWInfo -> GradInfo
+ Language.Fixpoint.Types.Constraints: [gsort] :: GWInfo -> Sort
+ Language.Fixpoint.Types.Constraints: [gsym] :: GWInfo -> Symbol
+ Language.Fixpoint.Types.Constraints: [wloc] :: WfC a -> !GradInfo
+ Language.Fixpoint.Types.Constraints: data GWInfo
+ Language.Fixpoint.Types.Constraints: gwInfo :: WfC a -> GWInfo
+ Language.Fixpoint.Types.Constraints: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Constraints.GWInfo
+ Language.Fixpoint.Types.Constraints: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Constraints.GWInfo
+ Language.Fixpoint.Types.Constraints: instance GHC.Classes.Eq Language.Fixpoint.Types.Constraints.GWInfo
+ Language.Fixpoint.Types.Constraints: instance GHC.Generics.Generic Language.Fixpoint.Types.Constraints.GWInfo
+ Language.Fixpoint.Types.Constraints: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Constraints.AxiomEnv
+ Language.Fixpoint.Types.Constraints: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Constraints.Equation
+ Language.Fixpoint.Types.Constraints: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Constraints.Rewrite
+ Language.Fixpoint.Types.Constraints: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Text.PrettyPrint.HughesPJ.Doc
+ Language.Fixpoint.Types.Constraints: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Constraints.Equation
+ Language.Fixpoint.Types.Constraints: isUnsafe :: Result a -> Bool
+ Language.Fixpoint.Types.Constraints: safe :: Result a
+ Language.Fixpoint.Types.Constraints: strengthenHyp :: SInfo a -> [(Integer, Expr)] -> SInfo a
+ Language.Fixpoint.Types.Constraints: substVars :: [(Symbol, Int)] -> Sort -> Sort
+ Language.Fixpoint.Types.Constraints: unsafe :: Result a
+ Language.Fixpoint.Types.Environments: fromListIBindEnv :: [BindId] -> IBindEnv
+ Language.Fixpoint.Types.Errors: dieAt :: SrcSpan -> Error -> a
+ Language.Fixpoint.Types.Errors: panic :: String -> a
+ Language.Fixpoint.Types.Graduals: class Gradual a
+ Language.Fixpoint.Types.Graduals: data GSol
+ Language.Fixpoint.Types.Graduals: gsubst :: Gradual a => GSol -> a -> a
+ Language.Fixpoint.Types.Graduals: instance GHC.Base.Monoid Language.Fixpoint.Types.Graduals.GSol
+ Language.Fixpoint.Types.Graduals: instance GHC.Show.Show Language.Fixpoint.Types.Graduals.GSol
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual (Language.Fixpoint.Types.Constraints.SInfo a)
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual (Language.Fixpoint.Types.Constraints.SimpC a)
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual Language.Fixpoint.Types.Environments.BindEnv
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual Language.Fixpoint.Types.Refinements.Expr
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual Language.Fixpoint.Types.Refinements.Reft
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual Language.Fixpoint.Types.Refinements.SortedReft
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Gradual v => Language.Fixpoint.Types.Graduals.Gradual (Data.HashMap.Base.HashMap k v)
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique Language.Fixpoint.Types.Environments.BindId
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique Language.Fixpoint.Types.Environments.IBindEnv
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique Language.Fixpoint.Types.Refinements.Expr
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique Language.Fixpoint.Types.Refinements.Reft
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique Language.Fixpoint.Types.Refinements.SortedReft
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Graduals.Unique a => Language.Fixpoint.Types.Graduals.Unique (Data.HashMap.Base.HashMap Language.Fixpoint.Types.Constraints.SubcId a)
+ Language.Fixpoint.Types.Graduals: instance Language.Fixpoint.Types.Spans.Loc a => Language.Fixpoint.Types.Graduals.Unique (Language.Fixpoint.Types.Constraints.SimpC a)
+ Language.Fixpoint.Types.Graduals: makeSolutions :: (NFData a, Fixpoint a, Show a) => Config -> SInfo a -> [(KVar, (GWInfo, [[Expr]]))] -> Maybe [GSol]
+ Language.Fixpoint.Types.Graduals: uniquify :: (NFData a, Fixpoint a, Loc a) => SInfo a -> (SInfo a)
+ Language.Fixpoint.Types.Names: applyName :: Symbol
+ Language.Fixpoint.Types.Names: buildMany :: [Builder] -> Builder
+ Language.Fixpoint.Types.Names: gradIntSymbol :: Integer -> Symbol
+ Language.Fixpoint.Types.Names: isLamArgSymbol :: Symbol -> Bool
+ Language.Fixpoint.Types.Names: isTestSymbol :: Symbol -> Bool
+ Language.Fixpoint.Types.Names: lamArgSymbol :: Int -> Symbol
+ Language.Fixpoint.Types.Names: symbolBuilder :: (Symbolic a) => a -> Builder
+ Language.Fixpoint.Types.Names: testSymbol :: Symbol -> Symbol
+ Language.Fixpoint.Types.Names: toIntName :: Symbol
+ Language.Fixpoint.Types.PrettyPrint: instance (Language.Fixpoint.Types.PrettyPrint.PPrint a, Language.Fixpoint.Types.PrettyPrint.PPrint b, Language.Fixpoint.Types.PrettyPrint.PPrint c, Language.Fixpoint.Types.PrettyPrint.PPrint d) => Language.Fixpoint.Types.PrettyPrint.PPrint (a, b, c, d)
+ Language.Fixpoint.Types.PrettyPrint: instance (Language.Fixpoint.Types.PrettyPrint.PPrint a, Language.Fixpoint.Types.PrettyPrint.PPrint b, Language.Fixpoint.Types.PrettyPrint.PPrint c, Language.Fixpoint.Types.PrettyPrint.PPrint d, Language.Fixpoint.Types.PrettyPrint.PPrint e) => Language.Fixpoint.Types.PrettyPrint.PPrint (a, b, c, d, e)
+ Language.Fixpoint.Types.Refinements: GradInfo :: SrcSpan -> Maybe SrcSpan -> GradInfo
+ Language.Fixpoint.Types.Refinements: [gsrc] :: GradInfo -> SrcSpan
+ Language.Fixpoint.Types.Refinements: [gused] :: GradInfo -> Maybe SrcSpan
+ Language.Fixpoint.Types.Refinements: class HasGradual a
+ Language.Fixpoint.Types.Refinements: data GradInfo
+ Language.Fixpoint.Types.Refinements: gVars :: HasGradual a => a -> [KVar]
+ Language.Fixpoint.Types.Refinements: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Spans.SrcSpan
+ Language.Fixpoint.Types.Refinements: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Spans.SrcSpan
+ Language.Fixpoint.Types.Refinements: instance Data.Data.Data Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance GHC.Classes.Eq Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance GHC.Generics.Generic Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance GHC.Show.Show Language.Fixpoint.Types.Refinements.GradInfo
+ Language.Fixpoint.Types.Refinements: instance Language.Fixpoint.Types.Refinements.HasGradual Language.Fixpoint.Types.Refinements.Expr
+ Language.Fixpoint.Types.Refinements: instance Language.Fixpoint.Types.Refinements.HasGradual Language.Fixpoint.Types.Refinements.Reft
+ Language.Fixpoint.Types.Refinements: instance Language.Fixpoint.Types.Refinements.HasGradual Language.Fixpoint.Types.Refinements.SortedReft
+ Language.Fixpoint.Types.Refinements: srcGradInfo :: SourcePos -> GradInfo
+ Language.Fixpoint.Types.Refinements: ungrad :: HasGradual a => a -> a
+ Language.Fixpoint.Types.Solutions: qbExprs :: QBind -> [Expr]
+ Language.Fixpoint.Types.Sorts: DCtor :: !LocSymbol -> ![DataField] -> DataCtor
+ Language.Fixpoint.Types.Sorts: DDecl :: !FTycon -> !Int -> [DataCtor] -> DataDecl
+ Language.Fixpoint.Types.Sorts: DField :: !LocSymbol -> !Sort -> DataField
+ Language.Fixpoint.Types.Sorts: [dcFields] :: DataCtor -> ![DataField]
+ Language.Fixpoint.Types.Sorts: [dcName] :: DataCtor -> !LocSymbol
+ Language.Fixpoint.Types.Sorts: [ddCtors] :: DataDecl -> [DataCtor]
+ Language.Fixpoint.Types.Sorts: [ddTyCon] :: DataDecl -> !FTycon
+ Language.Fixpoint.Types.Sorts: [ddVars] :: DataDecl -> !Int
+ Language.Fixpoint.Types.Sorts: [dfName] :: DataField -> !LocSymbol
+ Language.Fixpoint.Types.Sorts: [dfSort] :: DataField -> !Sort
+ Language.Fixpoint.Types.Sorts: basicSorts :: [Sort]
+ Language.Fixpoint.Types.Sorts: data DataCtor
+ Language.Fixpoint.Types.Sorts: data DataDecl
+ Language.Fixpoint.Types.Sorts: data DataField
+ Language.Fixpoint.Types.Sorts: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Data.Data.Data Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Data.Data.Data Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Data.Data.Data Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Eq Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Eq Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Eq Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Ord Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Ord Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance GHC.Classes.Ord Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance GHC.Generics.Generic Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance GHC.Generics.Generic Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance GHC.Generics.Generic Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance GHC.Show.Show Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance GHC.Show.Show Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance GHC.Show.Show Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.Names.Symbolic Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.Names.Symbolic Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.Names.Symbolic Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.Names.Symbolic Language.Fixpoint.Types.Sorts.FTycon
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Sorts.DataCtor
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Sorts.DataDecl
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Sorts.DataField
+ Language.Fixpoint.Types.Sorts: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Sorts.FTycon
+ Language.Fixpoint.Types.Sorts: mapFTyCon :: FTycon
+ Language.Fixpoint.Types.Sorts: sizeBv :: FTycon -> Maybe Int
+ Language.Fixpoint.Types.Sorts: unAbs :: Sort -> Sort
+ Language.Fixpoint.Types.Sorts: unFApp :: Sort -> ListNE Sort
+ Language.Fixpoint.Types.Spans: instance Language.Fixpoint.Types.Spans.Loc ()
+ Language.Fixpoint.Types.Theories: Data :: Sem
+ Language.Fixpoint.Types.Theories: SBitVec :: !Int -> SmtSort
+ Language.Fixpoint.Types.Theories: SBool :: SmtSort
+ Language.Fixpoint.Types.Theories: SData :: !FTycon -> ![SmtSort] -> SmtSort
+ Language.Fixpoint.Types.Theories: SInt :: SmtSort
+ Language.Fixpoint.Types.Theories: SMap :: SmtSort
+ Language.Fixpoint.Types.Theories: SReal :: SmtSort
+ Language.Fixpoint.Types.Theories: SSet :: SmtSort
+ Language.Fixpoint.Types.Theories: SString :: SmtSort
+ Language.Fixpoint.Types.Theories: SVar :: !Int -> SmtSort
+ Language.Fixpoint.Types.Theories: SymEnv :: !(SEnv Sort) -> !(SEnv TheorySymbol) -> !(SEnv DataDecl) -> !(SEnv Sort) -> !(HashMap FuncSort Int) -> SymEnv
+ Language.Fixpoint.Types.Theories: Theory :: Sem
+ Language.Fixpoint.Types.Theories: Thy :: !Symbol -> !Raw -> !Sort -> !Sem -> TheorySymbol
+ Language.Fixpoint.Types.Theories: Uninterp :: Sem
+ Language.Fixpoint.Types.Theories: [seAppls] :: SymEnv -> !(HashMap FuncSort Int)
+ Language.Fixpoint.Types.Theories: [seData] :: SymEnv -> !(SEnv DataDecl)
+ Language.Fixpoint.Types.Theories: [seLits] :: SymEnv -> !(SEnv Sort)
+ Language.Fixpoint.Types.Theories: [seSort] :: SymEnv -> !(SEnv Sort)
+ Language.Fixpoint.Types.Theories: [seTheory] :: SymEnv -> !(SEnv TheorySymbol)
+ Language.Fixpoint.Types.Theories: [tsInterp] :: TheorySymbol -> !Sem
+ Language.Fixpoint.Types.Theories: [tsRaw] :: TheorySymbol -> !Raw
+ Language.Fixpoint.Types.Theories: [tsSort] :: TheorySymbol -> !Sort
+ Language.Fixpoint.Types.Theories: [tsSym] :: TheorySymbol -> !Symbol
+ Language.Fixpoint.Types.Theories: data Sem
+ Language.Fixpoint.Types.Theories: data SmtSort
+ Language.Fixpoint.Types.Theories: data SymEnv
+ Language.Fixpoint.Types.Theories: data TheorySymbol
+ Language.Fixpoint.Types.Theories: insertSymEnv :: Symbol -> Sort -> SymEnv -> SymEnv
+ Language.Fixpoint.Types.Theories: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance Control.DeepSeq.NFData Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance Data.Binary.Class.Binary Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance Data.Data.Data Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance Data.Data.Data Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance Data.Data.Data Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance Data.Data.Data Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance Data.Hashable.Class.Hashable Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance GHC.Base.Monoid Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Eq Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Eq Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Eq Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Eq Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Ord Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Ord Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance GHC.Classes.Ord Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance GHC.Generics.Generic Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance GHC.Generics.Generic Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance GHC.Generics.Generic Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance GHC.Generics.Generic Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance GHC.Show.Show Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance GHC.Show.Show Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance GHC.Show.Show Language.Fixpoint.Types.Theories.SymEnv
+ Language.Fixpoint.Types.Theories: instance GHC.Show.Show Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance Language.Fixpoint.Types.PrettyPrint.Fixpoint Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Theories.Sem
+ Language.Fixpoint.Types.Theories: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Theories.SmtSort
+ Language.Fixpoint.Types.Theories: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Theories.TheorySymbol
+ Language.Fixpoint.Types.Theories: isIntSmtSort :: SEnv a -> Sort -> Bool
+ Language.Fixpoint.Types.Theories: sortSmtSort :: Bool -> SEnv a -> Sort -> SmtSort
+ Language.Fixpoint.Types.Theories: symEnv :: SEnv Sort -> SEnv TheorySymbol -> [DataDecl] -> SEnv Sort -> [Sort] -> SymEnv
+ Language.Fixpoint.Types.Theories: symEnvSort :: Symbol -> SymEnv -> Maybe Sort
+ Language.Fixpoint.Types.Theories: symEnvTheory :: Symbol -> SymEnv -> Maybe TheorySymbol
+ Language.Fixpoint.Types.Theories: symbolAtName :: (PPrint a) => Symbol -> SymEnv -> a -> Sort -> Symbol
+ Language.Fixpoint.Types.Theories: symbolAtSmtName :: (PPrint a) => Symbol -> SymEnv -> a -> FuncSort -> Symbol
+ Language.Fixpoint.Types.Theories: type Raw = Text
+ Language.Fixpoint.Types.Triggers: instance Language.Fixpoint.Types.PrettyPrint.PPrint Language.Fixpoint.Types.Triggers.Trigger
+ Language.Fixpoint.Types.Triggers: instance Language.Fixpoint.Types.PrettyPrint.PPrint a => Language.Fixpoint.Types.PrettyPrint.PPrint (Language.Fixpoint.Types.Triggers.Triggered a)
+ Language.Fixpoint.Types.Visitor: mapGVars' :: Visitable t => ((KVar, Subst) -> Maybe Expr) -> t -> t
- Language.Fixpoint.Defunctionalize: defuncAny :: Defunc a => Config -> SEnv Sort -> a -> a
+ Language.Fixpoint.Defunctionalize: defuncAny :: Defunc a => Config -> SymEnv -> a -> a
- Language.Fixpoint.Graph.Deps: elimDeps :: SInfo a -> [CEdge] -> HashSet KVar -> CDeps
+ Language.Fixpoint.Graph.Deps: elimDeps :: (TaggedC c a) => GInfo c a -> [CEdge] -> HashSet KVar -> CDeps
- Language.Fixpoint.Graph.Deps: graphStatistics :: Config -> SInfo a -> IO ()
+ Language.Fixpoint.Graph.Deps: graphStatistics :: TaggedC c a => Config -> GInfo c a -> IO ()
- Language.Fixpoint.Graph.Partition: CPart :: !(HashMap KVar (WfC a)) -> !(HashMap Integer (SubC a)) -> CPart a
+ Language.Fixpoint.Graph.Partition: CPart :: !(HashMap KVar (WfC a)) -> !(HashMap Integer (c a)) -> CPart c a
- Language.Fixpoint.Graph.Partition: [pcm] :: CPart a -> !(HashMap Integer (SubC a))
+ Language.Fixpoint.Graph.Partition: [pcm] :: CPart c a -> !(HashMap Integer (c a))
- Language.Fixpoint.Graph.Partition: [pws] :: CPart a -> !(HashMap KVar (WfC a))
+ Language.Fixpoint.Graph.Partition: [pws] :: CPart c a -> !(HashMap KVar (WfC a))
- Language.Fixpoint.Graph.Partition: data CPart a
+ Language.Fixpoint.Graph.Partition: data CPart c a
- Language.Fixpoint.Graph.Partition: dumpPartitions :: (Fixpoint a) => Config -> [FInfo a] -> IO ()
+ Language.Fixpoint.Graph.Partition: dumpPartitions :: (Fixpoint (c a), Fixpoint a) => Config -> [GInfo c a] -> IO ()
- Language.Fixpoint.Graph.Partition: partition :: (Fixpoint a) => Config -> FInfo a -> IO (Result (Integer, a))
+ Language.Fixpoint.Graph.Partition: partition :: (Fixpoint a, Fixpoint (c a), TaggedC c a) => Config -> GInfo c a -> IO (Result (Integer, a))
- Language.Fixpoint.Graph.Partition: partition' :: Maybe MCInfo -> FInfo a -> [FInfo a]
+ Language.Fixpoint.Graph.Partition: partition' :: (TaggedC c a) => Maybe MCInfo -> GInfo c a -> [GInfo c a]
- Language.Fixpoint.Graph.Partition: partitionN :: MCInfo -> FInfo a -> [CPart a] -> [FInfo a]
+ Language.Fixpoint.Graph.Partition: partitionN :: MCInfo -> GInfo c a -> [CPart c a] -> [GInfo c a]
- Language.Fixpoint.Graph.Reducible: isReducible :: SInfo a -> Bool
+ Language.Fixpoint.Graph.Reducible: isReducible :: (TaggedC c a) => GInfo c a -> Bool
- Language.Fixpoint.Smt.Interface: Ctx :: !ProcessHandle -> !Handle -> !Handle -> !(Maybe Handle) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !SMTEnv -> Context
+ Language.Fixpoint.Smt.Interface: Ctx :: !ProcessHandle -> !Handle -> !Handle -> !(Maybe Handle) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !SymEnv -> Context
- Language.Fixpoint.Smt.Interface: Declare :: !Symbol -> [Sort] -> !Sort -> Command
+ Language.Fixpoint.Smt.Interface: Declare :: !Symbol -> [SmtSort] -> !SmtSort -> Command
- Language.Fixpoint.Smt.Interface: makeContextWithSEnv :: Config -> FilePath -> SMTEnv -> IO Context
+ Language.Fixpoint.Smt.Interface: makeContextWithSEnv :: Config -> FilePath -> SymEnv -> IO Context
- Language.Fixpoint.Smt.Interface: smt2 :: SMTLIB2 a => a -> Builder
+ Language.Fixpoint.Smt.Interface: smt2 :: SMTLIB2 a => SymEnv -> a -> Builder
- Language.Fixpoint.Smt.Theories: isSmt2App :: Expr -> [a] -> Bool
+ Language.Fixpoint.Smt.Theories: isSmt2App :: SEnv TheorySymbol -> Expr -> Maybe Int
- Language.Fixpoint.Smt.Theories: smt2App :: Expr -> [Builder] -> Maybe Builder
+ Language.Fixpoint.Smt.Theories: smt2App :: SymEnv -> Expr -> [Builder] -> Maybe Builder
- Language.Fixpoint.Smt.Theories: smt2Symbol :: Symbol -> Maybe Builder
+ Language.Fixpoint.Smt.Theories: smt2Symbol :: SymEnv -> Symbol -> Maybe Builder
- Language.Fixpoint.Smt.Theories: theorySymbols :: HashMap Symbol TheorySymbol
+ Language.Fixpoint.Smt.Theories: theorySymbols :: [DataDecl] -> SEnv TheorySymbol
- Language.Fixpoint.Smt.Types: Ctx :: !ProcessHandle -> !Handle -> !Handle -> !(Maybe Handle) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !SMTEnv -> Context
+ Language.Fixpoint.Smt.Types: Ctx :: !ProcessHandle -> !Handle -> !Handle -> !(Maybe Handle) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !SymEnv -> Context
- Language.Fixpoint.Smt.Types: Declare :: !Symbol -> [Sort] -> !Sort -> Command
+ Language.Fixpoint.Smt.Types: Declare :: !Symbol -> [SmtSort] -> !SmtSort -> Command
- Language.Fixpoint.Smt.Types: runSmt2 :: (SMTLIB2 a) => a -> Builder
+ Language.Fixpoint.Smt.Types: runSmt2 :: (SMTLIB2 a) => SymEnv -> a -> Builder
- Language.Fixpoint.Smt.Types: smt2 :: SMTLIB2 a => a -> Builder
+ Language.Fixpoint.Smt.Types: smt2 :: SMTLIB2 a => SymEnv -> a -> Builder
- Language.Fixpoint.Solver: solve :: (NFData a, Fixpoint a) => Solver a
+ Language.Fixpoint.Solver: solve :: (NFData a, Fixpoint a, Show a, Loc a) => Solver a
- Language.Fixpoint.Solver.GradualSolution: init :: Config -> SInfo a -> HashSet KVar -> GSolution
+ Language.Fixpoint.Solver.GradualSolution: init :: (Fixpoint a) => SInfo a -> [(KVar, (GWInfo, [Expr]))]
- Language.Fixpoint.Solver.Monad: filterValid :: Expr -> Cand a -> SolveM [a]
+ Language.Fixpoint.Solver.Monad: filterValid :: SrcSpan -> Expr -> Cand a -> SolveM [a]
- Language.Fixpoint.Solver.Monad: runSolverM :: Config -> SolverInfo b c -> Int -> SolveM a -> IO a
+ Language.Fixpoint.Solver.Monad: runSolverM :: Config -> SolverInfo b c -> SolveM a -> IO a
- Language.Fixpoint.Solver.Sanitize: symbolEnv :: Config -> SInfo a -> SEnv Sort
+ Language.Fixpoint.Solver.Sanitize: symbolEnv :: Config -> SInfo a -> SymEnv
- Language.Fixpoint.Solver.Solve: solve :: (NFData a, Fixpoint a) => Config -> SInfo a -> IO (Result (Integer, a))
+ Language.Fixpoint.Solver.Solve: solve :: (NFData a, Fixpoint a, Show a, Loc a) => Config -> SInfo a -> IO (Result (Integer, a))
- Language.Fixpoint.SortCheck: elaborate :: Elaborate a => String -> SEnv Sort -> a -> a
+ Language.Fixpoint.SortCheck: elaborate :: Elaborate a => String -> SymEnv -> a -> a
- Language.Fixpoint.Types.Config: Config :: FilePath -> Maybe Int -> Int -> Int -> SMTSolver -> Bool -> Bool -> Bool -> Bool -> Bool -> Eliminate -> Maybe Int -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Config
+ Language.Fixpoint.Types.Config: Config :: FilePath -> Maybe Int -> Int -> Int -> SMTSolver -> Bool -> Bool -> Bool -> Bool -> Bool -> Eliminate -> Maybe Int -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Config
- Language.Fixpoint.Types.Constraints: AEnv :: ![Symbol] -> ![Equation] -> ![Rewrite] -> HashMap SubcId Int -> HashMap SubcId Bool -> AxiomEnv
+ Language.Fixpoint.Types.Constraints: AEnv :: !Int -> ![Equation] -> ![Rewrite] -> HashMap SubcId Int -> HashMap SubcId Bool -> AxiomEnv
- Language.Fixpoint.Types.Constraints: FI :: !(HashMap SubcId (c a)) -> !(HashMap KVar (WfC a)) -> !BindEnv -> !(SEnv Sort) -> !(SEnv Sort) -> !Kuts -> ![Qualifier] -> !(HashMap BindId a) -> !HOInfo -> ![Triggered Expr] -> AxiomEnv -> GInfo c a
+ Language.Fixpoint.Types.Constraints: FI :: !(HashMap SubcId (c a)) -> !(HashMap KVar (WfC a)) -> !BindEnv -> !(SEnv Sort) -> !(SEnv Sort) -> !Kuts -> ![Qualifier] -> !(HashMap BindId a) -> ![DataDecl] -> !HOInfo -> ![Triggered Expr] -> AxiomEnv -> GInfo c a
- Language.Fixpoint.Types.Constraints: GWfC :: !IBindEnv -> !(Symbol, Sort, KVar) -> !a -> !Expr -> WfC a
+ Language.Fixpoint.Types.Constraints: GWfC :: !IBindEnv -> !(Symbol, Sort, KVar) -> !a -> !Expr -> !GradInfo -> WfC a
- Language.Fixpoint.Types.Constraints: SimpC :: !IBindEnv -> !Expr -> !(Maybe Integer) -> !Tag -> !a -> SimpC a
+ Language.Fixpoint.Types.Constraints: SimpC :: !IBindEnv -> !Expr -> !(Maybe Integer) -> !BindId -> !Tag -> !a -> SimpC a
- Language.Fixpoint.Types.Constraints: [aenvSyms] :: AxiomEnv -> ![Symbol]
+ Language.Fixpoint.Types.Constraints: [aenvSyms] :: AxiomEnv -> !Int
- Language.Fixpoint.Types.Constraints: fi :: [SubC a] -> [WfC a] -> BindEnv -> SEnv Sort -> SEnv Sort -> Kuts -> [Qualifier] -> HashMap BindId a -> Bool -> Bool -> [Triggered Expr] -> AxiomEnv -> GInfo SubC a
+ Language.Fixpoint.Types.Constraints: fi :: [SubC a] -> [WfC a] -> BindEnv -> SEnv Sort -> SEnv Sort -> Kuts -> [Qualifier] -> HashMap BindId a -> Bool -> Bool -> [Triggered Expr] -> AxiomEnv -> [DataDecl] -> GInfo SubC a
- Language.Fixpoint.Types.Refinements: PGrad :: !KVar -> !Subst -> !Expr -> Expr
+ Language.Fixpoint.Types.Refinements: PGrad :: !KVar -> !Subst -> !GradInfo -> !Expr -> Expr
- Language.Fixpoint.Types.Refinements: isGradual :: Expr -> Bool
+ Language.Fixpoint.Types.Refinements: isGradual :: HasGradual a => a -> Bool
- Language.Fixpoint.Types.Solutions: fromList :: SEnv Sort -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> HashMap KVar IBindEnv -> Sol a b
+ Language.Fixpoint.Types.Solutions: fromList :: SymEnv -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> HashMap KVar IBindEnv -> Sol a b
- Language.Fixpoint.Types.Visitor: defaultVisitor :: Monoid acc => Visitor acc ctx
+ Language.Fixpoint.Types.Visitor: defaultVisitor :: (Monoid acc) => Visitor acc ctx
- Language.Fixpoint.Types.Visitor: stripCasts :: Expr -> Expr
+ Language.Fixpoint.Types.Visitor: stripCasts :: (Visitable t) => t -> t
Files
- .ghci +0/−1
- .git +0/−1
- .gitignore +0/−30
- .travis.yml +0/−51
- CHANGES.md +0/−29
- Makefile +0/−59
- README.md +0/−303
- TODO.md +0/−37
- bin/Fixpoint.hs +0/−1
- default.nix +0/−32
- liquid-fixpoint.cabal +16/−7
- scripts/travis +0/−137
- shell.nix +0/−17
- src/Language/Fixpoint/Defunctionalize.hs +70/−51
- src/Language/Fixpoint/Graph/Deps.hs +7/−7
- src/Language/Fixpoint/Graph/Partition.hs +31/−32
- src/Language/Fixpoint/Graph/Reducible.hs +3/−3
- src/Language/Fixpoint/Misc.hs +68/−5
- src/Language/Fixpoint/Parse.hs +80/−21
- src/Language/Fixpoint/Smt/Interface.hs +157/−26
- src/Language/Fixpoint/Smt/Serialize.hs +152/−114
- src/Language/Fixpoint/Smt/Theories.hs +206/−105
- src/Language/Fixpoint/Smt/Types.hs +20/−34
- src/Language/Fixpoint/Solver.hs +18/−13
- src/Language/Fixpoint/Solver/GradualSolution.hs +6/−305
- src/Language/Fixpoint/Solver/GradualSolve.hs +0/−319
- src/Language/Fixpoint/Solver/Instantiate.hs +144/−105
- src/Language/Fixpoint/Solver/Monad.hs +20/−61
- src/Language/Fixpoint/Solver/Sanitize.hs +26/−12
- src/Language/Fixpoint/Solver/Solution.hs +18/−15
- src/Language/Fixpoint/Solver/Solve.hs +194/−23
- src/Language/Fixpoint/SortCheck.hs +303/−252
- src/Language/Fixpoint/Types.hs +1/−0
- src/Language/Fixpoint/Types/Config.hs +2/−0
- src/Language/Fixpoint/Types/Constraints.hs +154/−53
- src/Language/Fixpoint/Types/Environments.hs +3/−0
- src/Language/Fixpoint/Types/Errors.hs +15/−1
- src/Language/Fixpoint/Types/Graduals.hs +258/−0
- src/Language/Fixpoint/Types/Names.hs +60/−9
- src/Language/Fixpoint/Types/PrettyPrint.hs +17/−0
- src/Language/Fixpoint/Types/Refinements.hs +54/−16
- src/Language/Fixpoint/Types/Solutions.hs +21/−18
- src/Language/Fixpoint/Types/Sorts.hs +116/−17
- src/Language/Fixpoint/Types/Spans.hs +4/−0
- src/Language/Fixpoint/Types/Substitutions.hs +2/−2
- src/Language/Fixpoint/Types/Theories.hs +275/−0
- src/Language/Fixpoint/Types/Triggers.hs +7/−0
- src/Language/Fixpoint/Types/Utils.hs +4/−4
- src/Language/Fixpoint/Types/Visitor.hs +91/−57
- stack.yaml +0/−12
- tests/crash/num00.fq +0/−29
- tests/crash/sort00.fq +0/−12
- tests/crash/sort01.fq +0/−13
- tests/cut/test00-tx.fq +0/−12
- tests/cut/test00.fq +0/−28
- tests/cut/test00a-tx.fq +0/−43
- tests/cut/test00a.fq +0/−29
- tests/cut/test1-tx.fq +0/−43
- tests/cut/test1.fq +0/−29
- tests/cut/test2-tx.fq +0/−112
- tests/cut/test2.fq +0/−51
- tests/elim/div00.fq +0/−23
- tests/elim/elim00.fq +0/−1494
- tests/elim/kvparam00.fq +0/−20
- tests/elim/len00.fq +0/−23
- tests/elim/test00-tx.fq +0/−12
- tests/elim/test00.fq +0/−26
- tests/elim/test00a.fq +0/−28
- tests/elim/test1.fq +0/−29
- tests/elim/test2.fq +0/−53
- tests/elim/tuple00.fq +0/−114
- tests/elim/tuple01.fq +0/−137
- tests/minimize/two-cores.fq +0/−30
- tests/neg/NonLinear.hs.fq +0/−91
- tests/neg/adt0.fq +19/−0
- tests/neg/adt1.fq +31/−0
- tests/neg/adt2.fq +18/−0
- tests/neg/adt3.fq +18/−0
- tests/neg/adt_bin_0.fq +30/−0
- tests/neg/adt_even_0.fq +33/−0
- tests/neg/hex00.fq +9/−0
- tests/neg/lit00.fq +18/−0
- tests/neg/test00.hs.fq +0/−286
- tests/pos/LogicCurry1.hs.fq +0/−245
- tests/pos/adt.fq +43/−0
- tests/pos/adt_bin_0.fq +27/−0
- tests/pos/adt_bin_lam.fq +16/−0
- tests/pos/adt_curry.fq +14/−0
- tests/pos/adt_dep_0.fq +16/−0
- tests/pos/adt_dep_1.fq +16/−0
- tests/pos/adt_even_0.fq +33/−0
- tests/pos/adt_list_0.fq +15/−0
- tests/pos/adt_list_1.fq +16/−0
- tests/pos/adt_list_2.fq +14/−0
- tests/pos/adt_list_nested.fq +15/−0
- tests/pos/adt_qual.fq +25/−0
- tests/pos/hex.ts.fq +0/−342
- tests/pos/hex00.fq +9/−0
- tests/pos/listqual.hs.fq +0/−577
- tests/pos/lit00.fq +18/−0
- tests/pos/poly_inst.fq +11/−0
- tests/pos/real00.fq +9/−0
- tests/pos/test00.hs.fq +0/−1021
- tests/pos/test000.hs.fq +0/−489
- tests/smt2/Smt.hs +0/−28
- tests/test.hs +156/−5
- tests/testParser.hs +41/−5
- tests/todo/MergeSort.fq +0/−3234
- tests/todo/baz.fq +0/−22
- tests/todo/poly.fq +0/−14
- tests/todo/wl01.fq +0/−39
- unix/Language/Fixpoint/Utils/Progress.hs +1/−1
− .ghci
@@ -1,1 +0,0 @@-:set -isrc
− .git
@@ -1,1 +0,0 @@-gitdir: ../.git/modules/liquid-fixpoint
− .gitignore
@@ -1,30 +0,0 @@-.depend-*.cmi-*.cmo-*.cmx-*.o-/dist*-.liquid-/.vagrant/-/.stack-work/-/build.sh-/external/fixpoint/config.make-/external/fixpoint/fixpoint.native-/external/fixpoint/misc-/external/fixpoint/smtZ3.ml-/external/ocamlgraph/META-/external/ocamlgraph/Makefile-/external/ocamlgraph/config.status-/external/ocamlgraph/graph.a-/external/ocamlgraph/graph.cma-/external/ocamlgraph/graph.cmxa-/external/ocamlgraph/src/dot_lexer.ml-/external/ocamlgraph/src/dot_parser.ml-/external/ocamlgraph/src/dot_parser.mli-/external/ocamlgraph/src/dot_parser.output-/external/ocamlgraph/src/gml.ml-/external/ocamlgraph/src/version.ml-/tests/neg/.liquid/-/tests/pos/.liquid/-/external/ocamlgraph/config.log-/TAGS
− .travis.yml
@@ -1,51 +0,0 @@-language: c-sudo: false--# Only build master, develop, and PRs-branches:- only:- - master- - develop- - parser-az--matrix:- include:- - env: SMT="z3" CABAL=1.22 GHC=7.10.3- addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,],sources: [hvr-ghc]}}- - env: SMT="z3" CABAL=1.24 GHC=8.0.1- addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,],sources: [hvr-ghc]}}- - env: SMT="z3" CABAL=1.24 GHC=8.0.2- addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,],sources: [hvr-ghc]}}- - env: CABALVER=head GHCVER=head- addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}-- allow_failures:- - env: CABALVER=head GHCVER=head--cache:- directories:- - $HOME/.cabal- - $HOME/.ghc--before_install:- - export PATH="$HOME/.cabal/bin:/opt/ghc/$GHC/bin:/opt/cabal/$CABAL/bin:$PATH"- - scripts/travis clean_cache "$SMT"--install:- - scripts/travis install_cabal_deps- - scripts/travis install_smt "$SMT"--script:- - scripts/travis do_build && scripts/travis do_test "$SMT"- - scripts/travis clean_cache "$SMT"--after_failure:- - scripts/travis dump_fail_logs--notifications:- slack:- rooms:- secure: VT1SqW+4WQKb2PXgObQ/rNdQN8pFK5LaFacxB0fEvRZ2FSbM3qp1NGgii7WHlQdr598+L5qYhkpy1B8ssgNeR7iMmYP4GV/fhCoMd8nTQHLSrTMH8iQgT0D7SnuKdk5FQq1IXWtHjUzXtTIhnkfwOJF/xYf6BMMrO0sCta5JZgg=- on_success: change- on_failure: always- on_start: never
− CHANGES.md
@@ -1,29 +0,0 @@-# CHANGES--## NEXT--## 0.3.0.0--- Make interpreted mul and div the default, when `solver = z3`-- Use `higherorder` flag to allow higher order binders into the environment --## 0.2.2.0--- Added support for theory of Arrays `Map_t`, `Map_select`, `Map_store`--- Added support for theory of Bitvectors -- see `Language.Fixpoint.Smt.Bitvector`--- Added support for string literals--## 0.2.1.0--- Pre-compiled binaries of the underlying ocaml solver are now- provided for Linux, Mac OSX, and Windows.-- No more need to install Ocaml!--## 0.2.0.0--- Parsing has been improved to require *much* fewer parentheses.--- Experimental support for Z3's theory of real numbers with the `--real` flag.
− Makefile
@@ -1,59 +0,0 @@--OPTS="-W -O2 -XStandaloneDeriving"-PROFOPTS="-O2 -rtsopts -prof -auto-all -caf-all -XStandaloneDeriving -XDeriveDataTypeable"--CABAL=cabal-CABALI=$(CABAL) install --ghc-options=$(OPTS)-CABALP=$(CABAL) install --ghc-options=$(OPTS) -p--DEPS=unix-compat transformers mtl filemanip text parsec ghc-paths deepseq comonad contravariant semigroupoids semigroups bifunctors hscolour ansi-terminal hashable unordered-containers--TASTY=./dist/build/test/test--all:- $(CABAL) install --ghc-options=$(OPTS)--force:- $(CABAL) install --force-reinstalls --ghc-options=$(OPTS)--rebuild: ocaml- make--igoto:- $(CABAL) configure --ghc-options=$(OPTS)--goto:- $(CABAL) build --ghc-options=$(OPTS)- cp dist/build/liquid/liquid ~/.cabal/bin/--prof:- $(CABAL) install --enable-executable-profiling --enable-library-profiling --ghc-options=$(PROFOPTS)--clean:- cabal clean--docs:- $(CABAL) haddock --executables --internal --hoogle --hyperlink-source #--html-location=http://goto.ucsd.edu/~rjhala/llvm-haskell/---deps:- $(CABALI) $(DEPS)--pdeps:- $(CABALP) $(DEPS)--lint:- hlint --colour --report .--tags:- hasktags -c src/- hasktags -e src/- hasktags -x -c src/--test:- cabal configure -fdevel --enable-tests --disable-library-profiling -O2- cabal build- cabal exec $(TASTY)--test710:- $(TASTY)
− README.md
@@ -1,303 +0,0 @@-Liquid Fixpoint [](https://hackage.haskell.org/package/liquid-fixpoint) [](http://packdeps.haskellers.com/feed?needle=liquid-fixpoint) [](https://travis-ci.org/ucsd-progsys/liquid-fixpoint)-===============---This package implements a Horn-Clause/Logical Implication constraint solver used-for various Liquid Types. The solver uses SMTLIB2 to implement an algorithm similar to:--+ [Houdini](https://users.soe.ucsc.edu/~cormac/papers/fme01.pdf)-+ [cartesian predicate abstraction](http://swt.informatik.uni-freiburg.de/berit/papers/boolean-and-cartesian-....pdf)---Requirements---------------In addition to the .cabal dependencies you require an SMTLIB2 compatible solver binary:--- [Z3](http://z3.codeplex.com)-- [CVC4](http://cvc4.cs.nyu.edu)-- [MathSat](http://mathsat.fbk.eu/download.html)--If on Windows, please make sure to place the binary and any associated DLLs somewhere-in your path.--How To Build and Install---------------------------Simply do:-- git clone https://github.com/ucsd-progsys/liquid-fixpoint.git- cd liquid-fixpoint- stack install--or (`cabal` instead of `stack` if you prefer.)---Using SMTLIB-based SMT Solvers---------------------------------You can use one of several SMTLIB2 compliant solvers, by:-- fixpoint --smtsolver=z3 path/to/file.hs--Currently, we support-- * Z3- * CVC4- * MathSat----Configuration Management---------------------------It is very important that the version of Liquid Fixpoint be maintained properly.--Suppose that the current version of Liquid Haskell is `A.B.C.D`:--+ After a release to hackage is made, if any of the components `B`, `C`, or `D` are missing, they shall be added and set to `0`. Then the `D` component of Liquid Fixpoint shall be incremented by `1`. The version of Liquid Fixpoint is now `A.B.C.(D + 1)`--+ The first time a new function or type is exported from Liquid Fixpoint, if any of the components `B`, or `C` are missing, they shall be added and set to `0`. Then the `C` component shall be incremented by `1`, and the `D` component shall stripped. The version of Liquid Fixpoint is now `A.B.(C + 1)`--+ The first time the signature of an exported function or type is changed, or an exported function or type is removed (this includes functions or types that Liquid Fixpoint re-exports from its own dependencies), if the `B` component is missing, it shall be added and set to `0`. Then the `B` component shall be incremented by `1`, and the `C` and `D` components shall be stripped. The version of Liquid Fixpoint is now `A.(B + 1)`--+ The `A` component shall be updated at the sole discretion of the project owners.--It is recommended to use the [Bumper](https://hackage.haskell.org/package/bumper) utility to manage the versioning of Liquid Fixpoint. Bumper will automatically do the correct update to the cabal file. Additionally, it will update any packages that you have the source for that depend on Liquid Fixpoint.--To update Liquid Fixpoint and Liquid Haskell, first clone Liquid Haskell and Liquid Fixpoint to a common location:--```-git clone https://github.com/ucsd-progsys/liquidhaskell.git-git clone https://github.com/ucsd-progsys/liquid-fixpoint.git-```--To increment the `D` component of Liquid Fixpoint:--```-./path/to/bumper -3 liquid-fixpoint-```--This will update the `D` component of Liquid Fixpoint. If necessary, this will update the `Build-Depends` of Liquid Haskell. If the `Build-Depends` was updated, Liquid Haskell's `D` component will be incremented.--To increment the `C` component of Liquid Fixpoint, and strip the `D` component:--```-./path/to/bumper --minor liquid-fixpoint-```--As before, this will update Liquid Fixpoint and, if necessary, Liquid Haskell.--To increment the `B` component of Liquid Fixpoint, and strip the `D` and `C` components:--```-./path/to/bumper --major liquid-fixpoint-```--As before, this will update Liquid Fixpoint and, if necessary, Liquid Haskell--SMTLIB2 Interface--------------------There is a new SMTLIB2 interface directly from Haskell:--+ Language.Fixpoint.SmtLib2--See `tests/smt2/{Smt.hs, foo.smt2}` for an example of how to use it.--Options----------`--higherorder` allows higher order binders into the environment--`--extsolver` runs the **deprecated** external solver.--`--parts` Partitions an `FInfo` into a `[FInfo]` and emits a bunch of files. So:-- $ fixpoint -n -p path/to/foo.fq--will now emit files:-- path/to/.liquid/foo.1.fq- path/to/.liquid/foo.2.fq- . . .- path/to/.liquid/foo.k.fq--and also a dot file with the constraint dependency graph:-- path/to/.liquid/foo.fq.dot---## FInfo Invariants--### Binders--This is the field--```- , bs :: !BindEnv -- ^ Bind |-> (Symbol, SortedReft)-```--or in the .fq files as--```-bind 1 x : ...-bind 2 y : ...-```--* Each `BindId` must be a distinct `Int`,-* Each `BindId` that appears in a constraint- environment i.e. inside _any_ `IBindEnv`- must appear inside the `bs`--### Environments--* Each constraint's environment is a set of `BindId`- which must be defined in the `bindInfo`. Furthermore--* Each constraint should not have _duplicate_ names in its- environment, that is if you have two binders--```- bind 1 x : ...- bind 12 x : ...-```-- Then a single `IBindEnv` should only mention _at most_- one of `1` or `12`.--* There is also a "tree-shape" property that its a bit hard- to describe ... TODO --### LHS--Each `slhs` of a constraint is a `SortedReft`.--- Each `SortredReft` is basically a `Reft` -- a logical predicate.- The important bit is that a `KVar` i.e. terms of the formalized--```- $k1[x1:=y1][x2:=y2]...[xn:=yn]-```-- That is represented in the `Expr` type as--```- | PKVar !KVar !Subst-```-- must appear _only_ at the **top-level** that is not under _any_- other operators, i.e. not as a sub-`Expr` of other expressions.---- This is basically a predicate that needs to be "well sorted"- with respect to the `BindId`, intuitively--```- x:int, y:int |- x + y : int-```-- is well sorted. but--```- x:int |- x + y : int-```-- is not, and--```- x:int, y: list |- x + y : int-```-- is not. The exact definition is formalized in `Language.Fixpoint.SortCheck`---### RHS--Similarly each `rhs` of a `SubC` must either be a single `$k[...]` or an plain `$k`-free `Expr`.--### Global vs. Distinct Literals--```- , gLits :: !(SEnv Sort) -- ^ Global Constant symbols- , dLits :: !(SEnv Sort) -```--The _global_ literals `gLits` are symbols that-are in scope _everywhere_ i.e. need not be separately-defined in individual environments. These include things like--- uninterpreted _measure_ functions `len`, `height`,-- uninterpreted _data constructor_ literals `True`, `False`--Suppose you have an enumerated type like:--```-data Day = Sun | Mon | Tue | Wed | ... | Sat-```--You can model the above values in fixpoint as:--```-constant lit#Sun : Day-constant lit#Mon : Day-constant lit#Tue : Day-constant lit#Wed : Day-```--The _distinct_ literals are a subset of the above where we-want to tell the SMT solver that the values are *distinct*-i.e. **not equal** to each other, for example, you can-**additionally** specify this as:--```-distinct lit#Sun : Day-distinct lit#Mon : Day-distinct lit#Tue : Day-distinct lit#Wed : Day-```--The above two are represented programmatically by generating -suitable `Symbol` values (for the literals see `litSymbol`)-and `Sort` values as `FTC FTycon` and then making an `SEnv`-from the `[(Symbol, Sort)]`.--### Sorts--> What's the difference between an FTC and an FObj?--In early versions of fixpoint, there was support for -three sorts for expressions (`Expr`) that were sent -to the SMT solver:--1. `int`-2. `bool`-3. "other"--The `FObj` sort was introduced to represent essentially _all_ -non-int and non-bool values (e.g. tuples, lists, trees, pointers...)--However, we later realized that it is valuable to keep _more_-precise information for `Expr`s and so we introduced the `FTC`-(fixpoint type constructor), which lets us represent the above-respectively as:--- `FTC "String" []` -- in Haskell `String`-- `FTC "Tuple" [FInt, Bool]` -- in Haskell `(Int, Bool)`-- `FTC "List" [FTC "List" [FInt]]` -- in Haskell `[[Int]]`--> There is a comment that says FObj's are uninterpretted types;-> so probably a type the SMT solver doesn't know about?-> Does that then make FTC types that the SMT solver does-> know about (bools, ints, lists, sets, etc.)?--The SMT solver knows about `bool`, `int` and `set` (also `bitvector` -and `map`) but _all_ other types are _currently_ represented as plain -`Int` inside the SMT solver. However, we _will be_ changing this -to make use of SMT support for ADTs ...--To sum up: the `FObj` is there for historical reasons; it has been -subsumed by `FTC` which is what I recomend you use. However `FObj` -is there if you want a simple "unitype" / "any" type for terms -that are not "interpreted".-
− TODO.md
@@ -1,37 +0,0 @@-# TODO--## Proper Encoding of DataTypes--```-(declare-datatypes (T) ((LL lnil (lcons (lhd T) (ltl LL)))))-(declare-fun l1 () (LL Int))-(declare-fun l2 () (LL Int))-(declare-fun l3 () (LL Int))-(declare-fun x () Int)-(declare-fun zzz () Int)--(assert (not (= l1 (as lnil (LL Int)))))-(assert (not (= l2 (as lnil (LL Int)))))--(assert (= (lhd l1) (lhd l2)))-(assert (not (= l1 l2)))-(assert (= l3 (lcons x l2)))-(assert (> x 100))-(check-sat)--(get-model)---(declare-fun xs () (LL Int))-(declare-fun ys () (LL Int))-(declare-fun y () Int)--(assert (= xs (as lnil (LL Int))))-(assert (= ys (lcons y ys)))-(assert (= xs ys))-(check-sat)---;; (assert (= (ltl l1) (ltl l2)))-;; (check-sat)-```
bin/Fixpoint.hs view
@@ -8,4 +8,3 @@ writeLoud $ "Options: " ++ show cfg e <- solveFQ cfg exitWith e-
− default.nix
@@ -1,32 +0,0 @@-{ fetchgitLocal }:-{ mkDerivation, ansi-terminal, array, ascii-progress, async-, attoparsec, base, bifunctors, binary, boxes, bytestring, cereal-, cmdargs, containers, deepseq, directory, filemanip, filepath-, ghc-prim, hashable, intern, located-base, mtl, parallel, parsec, pretty-, process, stdenv, syb, tasty, tasty-hunit, tasty-rerun, text-, text-format, transformers, unordered-containers, z3-, dotgen, fgl, fgl-visualize-}:-mkDerivation {- pname = "liquid-fixpoint";- version = "9.9.9.9";- src = fetchgitLocal ./.;- isLibrary = true;- isExecutable = true;- libraryHaskellDepends = [- ansi-terminal array ascii-progress async attoparsec base bifunctors- binary boxes bytestring cereal cmdargs containers deepseq directory- filemanip filepath ghc-prim hashable intern located-base mtl parallel parsec- pretty process syb text text-format transformers- unordered-containers- dotgen fgl fgl-visualize- ];- executableHaskellDepends = [ base ];- testHaskellDepends = [- base directory filepath process tasty tasty-hunit tasty-rerun text- ];- testSystemDepends = [ z3 ];- homepage = "https://github.com/ucsd-progsys/liquid-fixpoint";- description = "Predicate Abstraction-based Horn-Clause/Implication Constraint Solver";- license = stdenv.lib.licenses.bsd3;-}
liquid-fixpoint.cabal view
@@ -1,5 +1,5 @@ name: liquid-fixpoint-version: 0.6.0.1+version: 0.7.0.1 Copyright: 2010-17 Ranjit Jhala, University of California, San Diego. synopsis: Predicate Abstraction-based Horn-Clause/Implication Constraint Solver homepage: https://github.com/ucsd-progsys/liquid-fixpoint@@ -51,7 +51,7 @@ if flag(devel) ghc-options: -Werror hs-source-dirs: bin- Build-Depends: base >= 4.8 && < 5+ Build-Depends: base >=4.8.1.0 && <5 , liquid-fixpoint Library@@ -59,12 +59,12 @@ ghc-options: -W -fno-warn-missing-methods if flag(devel) ghc-options: -Werror- ghc-prof-options: -fprof-auto hs-source-dirs: src Exposed-Modules: Language.Fixpoint.Types.Names, Language.Fixpoint.Types.Errors, Language.Fixpoint.Types.Config, Language.Fixpoint.Types.Visitor,+ Language.Fixpoint.Types.Theories, Language.Fixpoint.Types.PrettyPrint, Language.Fixpoint.Types.Spans, Language.Fixpoint.Types.Sorts,@@ -75,6 +75,7 @@ Language.Fixpoint.Types.Triggers, Language.Fixpoint.Types.Solutions, Language.Fixpoint.Types.Utils,+ Language.Fixpoint.Types.Graduals, Language.Fixpoint.Types, Language.Fixpoint.Graph.Types, Language.Fixpoint.Graph.Reducible,@@ -106,10 +107,9 @@ Language.Fixpoint.Solver.Instantiate, Language.Fixpoint.Solver.Sanitize, Language.Fixpoint.Utils.Statistics,- Language.Fixpoint.Solver.GradualSolve, Language.Fixpoint.Solver.Solve - Build-Depends: base >= 4.8 && < 5+ Build-Depends: base >=4.8.1.0 && <5 , array , async , attoparsec@@ -143,6 +143,7 @@ , fgl-visualize , dotgen , time+ , parallel-io if impl(ghc >= 7.10.2) Build-Depends: located-base@@ -160,13 +161,19 @@ if flag(devel) ghc-options: -Werror main-is: test.hs- build-depends: base,+ build-depends: base >= 4.8 && < 5, directory, filepath, process,+ stm >= 2.4,+ containers >= 0.5,+ mtl >= 2.1,+ transformers >= 0.3, tasty >= 0.10, tasty-hunit, tasty-rerun >= 1.1,+ tasty-ant-xml,+ tasty-hunit >= 0.9, text test-suite testparser@@ -177,12 +184,14 @@ if flag(devel) ghc-options: -Werror main-is: testParser.hs- build-depends: base,+ build-depends: base >= 4.8 && < 5, directory, filepath, tasty >= 0.10, tasty-hunit, tasty-rerun >= 1.1,+ tasty-ant-xml,+ tasty-hunit >= 0.9, text if flag(devel) hs-source-dirs: tests src
− scripts/travis
@@ -1,137 +0,0 @@-#!/bin/bash--set -eu-set -o pipefail--## Helper Functions--function loud {- echo "$ $@"- $@-}--# Source: https://github.com/travis-ci/travis-build/blob/fc4ae8a2ffa1f2b3a2f62533bbc4f8a9be19a8ae/lib/travis/build/script/templates/header.sh#L104-L123-RED="\033[31;1m"-GREEN="\033[32;1m"-RESET="\033[0m"-function travis_retry {- local result=0- local count=1- while [ $count -le 3 ]; do- [ $result -ne 0 ] && {- echo -e "\n${RED}The command \"$@\" failed. Retrying, $count of 3.${RESET}\n" >&2- }- set +e- "$@"- result=$?- set -e- [ $result -eq 0 ] && break- count=$(($count + 1))- sleep 1- done-- [ $count -eq 4 ] && {- echo "\n${RED}The command \"$@\" failed 3 times.${RESET}\n" >&2- }-- return $result-}--function prevent_timeout {- local cmd="$@"-- $cmd &- local cmd_pid=$!-- poke_stdout &- local poke_pid=$!-- wait $cmd_pid- exit_code=$?-- kill $poke_pid- (wait $poke_pid 2>/dev/null) || true-- return $exit_code-}--function poke_stdout {- # Print an invisible character every minute- while true; do- echo -ne "\xE2\x80\x8B"- sleep 60- done-}--function pastebin {- curl -s -F 'clbin=<-' https://clbin.com-}--## Testing Stages--function clean_cache {- local smt="$1"-- loud ghc-pkg unregister liquid-fixpoint --force || true- loud rm "$HOME/.cabal/bin/$smt" || true-}--function install_smt {- local smt="$1"-- mkdir -p "$HOME/.cabal/bin"- loud curl "http://goto.ucsd.edu/~gridaphobe/$smt" -o "$HOME/.cabal/bin/$smt"- loud chmod a+x "$HOME/.cabal/bin/$smt"-}--function install_cabal_deps {- if ! _install_cabal_deps; then- echo " ==> Cabal install failed. Clearing dependency cache and retrying."- loud rm -rf "$HOME/.cabal"- loud rm -rf "$HOME/.ghc"- _install_cabal_deps- fi-}--function _install_cabal_deps {- loud travis_retry cabal update || return 1- loud travis_retry cabal install --only-dependencies --enable-tests || return 1-}--function do_build {- loud cabal configure -fbuild-external --enable-tests -v2- loud prevent_timeout cabal build -j2- loud cabal haddock-}--function do_test {- loud prevent_timeout ./dist/build/test/test-}--function dump_fail_logs {- find . -type f -wholename '*/.liquid/*' -name '*.log' -print0 | while IFS= read -r -d $'\0' file; do- echo "${file}:"- echo " $(pastebin < "${file}")"- done-}--function test_source_pkg {- loud cabal sdist-- local src_tgz="dist/$(cabal info . | awk '{print $2 ".tar.gz";exit}')"-- if [ -f "$src_tgz" ]; then- loud prevent_timeout cabal install -j4 "$src_tgz"- else- echo "expected '$src_tgz' not found"- return 1- fi-}--## Run Test Stage--stage="$1"-shift--$stage "$@"-
− shell.nix
@@ -1,17 +0,0 @@-{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:--let-- inherit (nixpkgs) pkgs;-- f = import ./default.nix { inherit (pkgs) fetchgitLocal; };-- haskellPackages = if compiler == "default"- then pkgs.haskellPackages- else pkgs.haskell.packages.${compiler};-- drv = haskellPackages.callPackage f { inherit (pkgs) z3; };--in-- if pkgs.lib.inNixShell then drv.env else drv
src/Language/Fixpoint/Defunctionalize.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE PatternGuards #-} {-# LANGUAGE OverloadedStrings #-} + -------------------------------------------------------------------------------- -- | `defunctionalize` traverses the query to: -- 1. "normalize" lambda terms by renaming binders,@@ -18,7 +19,12 @@ -- `EApp` and `ELam` to determine the lambdas and redexes. -------------------------------------------------------------------------------- -module Language.Fixpoint.Defunctionalize (defunctionalize, Defunc(..), defuncAny, makeLamArg) where+module Language.Fixpoint.Defunctionalize+ ( defunctionalize+ , Defunc(..)+ , defuncAny+ , defuncAxioms+ ) where import qualified Data.HashMap.Strict as M import Data.Hashable@@ -37,13 +43,18 @@ defunctionalize :: (Fixpoint a) => Config -> SInfo a -> SInfo a defunctionalize cfg si = evalState (defunc si) (makeInitDFState cfg si) -defuncAny :: Defunc a => Config -> SEnv Sort -> a -> a +defuncAny :: Defunc a => Config -> SymEnv -> a -> a defuncAny cfg env e = evalState (defunc e) (makeDFState cfg env emptyIBindEnv) +defuncAxioms :: (Defunc a) => Config -> SymEnv -> a -> (a, [Triggered Expr])+defuncAxioms cfg env z = flip evalState (makeDFState cfg env emptyIBindEnv) $ do+ z' <- defunc z+ as <- map noTrigger <$> makeAxioms+ return (z', as) ------------------------------------------------------------------------------------ | Expressions defunctionalization ----------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+-- | Expressions defunctionalization --------------------------------------------------------+--------------------------------------------------------------------------------------------- txExpr :: Expr -> DF Expr txExpr e = do hoFlag <- gets dfHO@@ -56,7 +67,7 @@ >=> mapMExpr (fM normalizeLams) reBind :: Expr -> DF Expr-reBind (ELam (x, s) e) = (\y -> ELam (y, s) (subst1 e (x, EVar y))) <$> freshSym s+reBind (ELam (x, s) e) = ((\y -> ELam (y, s) (subst1 e (x, EVar y))) <$> freshSym s) reBind e = return e maxLamArg :: Int@@ -64,20 +75,19 @@ -- NIKI TODO: allow non integer lambda arguments -- sorts = [setSort intSort, bitVecSort intSort, mapSort intSort intSort, boolSort, realSort, intSort]-makeLamArg :: Sort -> Int -> Symbol-makeLamArg _ = intArgName+-- makeLamArg :: Sort -> Int -> Symbol+-- makeLamArg _ = intArgName --------------------------------------------------------------------------------- makeAxioms :: DF [Expr] makeAxioms = do alphEqs <- concatMap makeAlphaAxioms <$> getLams- betaEqs <- concatMap makeBetaAxioms <$> getRedexes+ betaEqs <- concatMap makeBetaAxioms <$> ({- tracepp "getRedexes" <$> -} getRedexes) env <- gets dfEnv return $ filter (validAxiom env) (alphEqs ++ betaEqs) -validAxiom :: SEnv Sort -> Expr -> Bool-validAxiom env = isJust . checkSortExpr env+validAxiom :: SymEnv -> Expr -> Bool+validAxiom env = isJust . checkSortExpr (seSort env) -------------------------------------------------------------------------------- -- | Alpha Equivalence ---------------------------------------------------------@@ -106,9 +116,10 @@ normalize :: Expr -> Expr normalize = snd . go where- go (ELam (y, sy) e) = let (i', e') = go e- y' = makeLamArg sy i'- in (i'+1, ELam (y', sy) (e' `subst1` (y, EVar y')))+ go (ELam (y, sy) e) = (i + 1, shiftLam i y sy e') where (i, e') = go e+ -- y' = lamArgSymbol i' -- SHIFTLAM+ -- in -- ELam (y', sy) (e' `subst1` (y, EVar y')))+ go (EApp e e2) | (ELam (x, _) bd) <- unECst e = let (i1, e1') = go bd@@ -124,6 +135,12 @@ unECst (ECst e _) = unECst e unECst e = e +shiftLam :: Int -> Symbol -> Sort -> Expr -> Expr+shiftLam i x t e = ELam (x_i, t) (e `subst1` (x, x_i_t))+ where+ x_i = lamArgSymbol i+ x_i_t = ECst (EVar x_i) t+ -- normalize lambda arguments [TODO: example] normalizeLams :: Expr -> Expr@@ -132,9 +149,10 @@ normalizeLamsFromTo :: Int -> Expr -> (Int, Expr) normalizeLamsFromTo i = go where- go (ELam (y, sy) e) = let (i', e') = go e- y' = makeLamArg sy i'- in (i' + 1, ELam (y', sy) (e' `subst1` (y, EVar y')))+ go (ELam (y, sy) e) = (i + 1, shiftLam i y sy e') where (i, e') = go e+ -- let (i', e') = go e+ -- y' = lamArgSymbol i' -- SHIFTLAM+ -- in (i' + 1, ELam (y', sy) (e' `subst1` (y, EVar y'))) go (EApp e1 e2) = let (i1, e1') = go e1 (i2, e2') = go e2 in (max i1 i2, EApp e1' e2')@@ -170,18 +188,10 @@ splitPAll acc (PAll xs e) = splitPAll (acc ++ xs) e splitPAll acc e = (acc, e) --- NOPROP instantiate :: [(Symbol, Sort)] -> [[(Symbol, (Symbol,Sort))]]--- NOPROP instantiate [] = [[]]--- NOPROP instantiate xs = L.foldl' (\acc x -> combine (instOne x) acc) [] xs- -- NOPROP where- -- NOPROP instOne (x, s) = [(x, (makeLamArg s i, s)) | i <- [1..maxLamArg]]- -- NOPROP combine xs [] = [[x] | x <- xs]- -- NOPROP combine xs acc = concat [(x:) <$> acc | x <- xs]--instantiate :: [(Symbol, Sort)] -> [[(Symbol, (Symbol,Sort))]]-instantiate = choices . map inst1+instantiate :: [(Symbol, Sort)] -> [[(Symbol, (Symbol, Sort))]]+instantiate = choices . map inst1 where- inst1 (x,s) = [(x, (makeLamArg s i, s)) | i <- [1..maxLamArg]]+ inst1 (x, s) = [(x, (lamArgSymbol i, s)) | i <- [1..maxLamArg]] choices :: [[a]] -> [[a]] choices [] = [[]]@@ -202,7 +212,7 @@ gLits' <- defunc $ gLits fi dLits' <- defunc $ dLits fi bs' <- defunc $ bs fi- ass' <- defunc $ asserts fi + ass' <- defunc $ asserts fi -- NOPROP quals' <- defunc $ quals fi axioms <- makeAxioms return $ fi { cm = cm'@@ -211,11 +221,11 @@ , dLits = dLits' , bs = bs' -- NOPROP , quals = quals'- , asserts = (noTrigger <$> axioms) ++ ass' + , asserts = (noTrigger <$> axioms) ++ ass' } instance (Defunc a) => Defunc (Triggered a) where- defunc (TR t e) = TR t <$> defunc e + defunc (TR t e) = TR t <$> defunc e instance Defunc (SimpC a) where defunc sc = do crhs' <- defunc $ _crhs sc@@ -276,8 +286,8 @@ type DF = State DFST data DFST = DFST- { dfFresh :: !Int- , dfEnv :: !(SEnv Sort)+ { dfFresh :: !Int+ , dfEnv :: !SymEnv , dfBEnv :: !IBindEnv , dfLam :: !Bool -- ^ normalize lams , dfExt :: !Bool -- ^ enable extensionality axioms@@ -291,14 +301,13 @@ , dfBinds :: !(SEnv Sort) -- ^ sorts of new lambda-binders } --makeDFState :: Config -> SEnv Sort -> IBindEnv -> DFST-makeDFState cfg senv ibind = DFST+makeDFState :: Config -> SymEnv -> IBindEnv -> DFST+makeDFState cfg env ibind = DFST { dfFresh = 0- , dfEnv = senv + , dfEnv = env , dfBEnv = ibind , dfLam = True- , dfExt = False + , dfExt = False , dfAEq = alphaEquivalence cfg , dfBEq = betaEquivalence cfg , dfNorm = normalForm cfg@@ -310,12 +319,11 @@ , dfBinds = mempty } - makeInitDFState :: Config -> SInfo a -> DFST-makeInitDFState cfg si - = makeDFState cfg - (symbolEnv cfg si) - (mconcat ((senv <$> M.elems (cm si)) ++ (wenv <$> M.elems (ws si))))+makeInitDFState cfg si+ = makeDFState cfg+ (symbolEnv cfg si)+ (mconcat ((senv <$> M.elems (cm si)) ++ (wenv <$> M.elems (ws si)))) -------------------------------------------------------------------------------- -- | Low level monad manipulation ----------------------------------------------@@ -331,18 +339,29 @@ logLam e = whenM (gets dfAEq) (putLam e) >> return e logRedex :: Expr -> DF Expr-logRedex e = whenM (gets dfBEq) (putRedex e) >> return e+logRedex e = do+ whenM (gets dfBEq) $+ when ({- tracepp ("isRedex:" ++ showpp e) $ -} isRedex e)+ (modify $ \s -> s { dfRedex = ({- tracepp "putRedex" -} e) : dfRedex s })+ return e + -- (putRedex (tracepp "isRedex" e)) >> return e+ putLam :: Expr -> DF () putLam e@(ELam {}) = modify $ \s -> s { dfLams = e : dfLams s} putLam _ = return () -putRedex :: Expr -> DF ()-putRedex e@(EApp f _)- | ELam _ _ <- stripCasts f- = modify $ \s -> s { dfRedex = e : dfRedex s }-putRedex _- = return ()+isRedex :: Expr -> Bool+isRedex (EApp f _)+ | ELam _ _ <- stripCasts f = True+isRedex _ = False+++-- putRedex :: Expr -> DF ()+-- putRedex e@(EApp f _) = case stripCasts f of+ -- ELam _ _ -> modify $ \s -> s { dfRedex = (tracepp "putRedex" e) : dfRedex s }+ -- e' -> return $ tracepp ("SKIP-Redex" ++ showpp e') ()+-- putRedex _ = return () -- | getLams and getRedexes return the (previously seen) lambdas and redexes,
src/Language/Fixpoint/Graph/Deps.hs view
@@ -222,7 +222,7 @@ -------------------------------------------------------------------------------- -- | Eliminated Dependencies ---------------------------------------------------------------------------------elimDeps :: F.SInfo a -> [CEdge] -> S.HashSet F.KVar -> CDeps+elimDeps :: (F.TaggedC c a) => F.GInfo c a -> [CEdge] -> S.HashSet F.KVar -> CDeps elimDeps si es nonKutVs = graphDeps si es' where es' = graphElim es nonKutVs@@ -437,7 +437,7 @@ ----------------------------------------------------------------------------graphDeps :: F.SInfo a -> [CEdge] -> CDeps+graphDeps :: F.TaggedC c a => F.GInfo c a -> [CEdge] -> CDeps --------------------------------------------------------------------------- graphDeps fi cs = CDs { cSucc = gSucc cg , cPrev = cPrevM@@ -472,15 +472,15 @@ iWrites = group [ (i, k) | (Cstr i, KVar k) <- es ] kReads = group [ (k, j) | (KVar k, Cstr j) <- es ] -rankF :: CMap (F.SimpC a) -> CMap Int -> CMap Int -> F.SubcId -> Rank+rankF :: F.TaggedC c a => CMap (c a) -> CMap Int -> CMap Int -> F.SubcId -> Rank rankF cm outR inR = \i -> Rank (outScc i) (inScc i) (tag i) where outScc = lookupCMap outR inScc = lookupCMap inR- tag = F._ctag . lookupCMap cm+ tag = F.stag . lookupCMap cm ----------------------------------------------------------------------------inRanks :: F.SInfo a -> [DepEdge] -> CMap Int -> CMap Int+inRanks :: F.TaggedC c a => F.GInfo c a -> [DepEdge] -> CMap Int -> CMap Int --------------------------------------------------------------------------- inRanks fi es outR | ks == mempty = outR@@ -496,7 +496,7 @@ isKutWrite = any (`F.ksMember` ks) . kvWriteBy cm ---------------------------------------------------------------------------------graphStatistics :: Config -> F.SInfo a -> IO ()+graphStatistics :: F.TaggedC c a => Config -> F.GInfo c a -> IO () -------------------------------------------------------------------------------- graphStatistics cfg si = when (elimStats cfg) $ do -- writeGraph f (kvGraph si)@@ -525,7 +525,7 @@ , ("KVars NonLin" , pprint stSetKVNonLin) ] -graphStats :: Config -> F.SInfo a -> Stats+graphStats :: F.TaggedC c a => Config -> F.GInfo c a -> Stats graphStats cfg si = Stats { stNumKVCuts = S.size $ F.tracepp "CUTS:" (depCuts d) , stNumKVNonLin = S.size nlks
src/Language/Fixpoint/Graph/Partition.hs view
@@ -51,12 +51,12 @@ -- | Constraint Partition Container -------------------------------------------- -------------------------------------------------------------------------------- -data CPart a = CPart { pws :: !(M.HashMap F.KVar (F.WfC a))- , pcm :: !(M.HashMap Integer (F.SubC a))- }--instance Monoid (CPart a) where- mempty = CPart mempty mempty+data CPart c a = CPart { pws :: !(M.HashMap F.KVar (F.WfC a))+ , pcm :: !(M.HashMap Integer (c a))+ }+ +instance Monoid (CPart c a) where+ mempty = CPart mempty mempty mappend l r = CPart { pws = pws l `mappend` pws r , pcm = pcm l `mappend` pcm r }@@ -79,7 +79,7 @@ , mcMaxPartSize = maxPartSize c } -partition :: (F.Fixpoint a) => Config -> F.FInfo a -> IO (F.Result (Integer, a))+partition :: (F.Fixpoint a, F.Fixpoint (c a), F.TaggedC c a) => Config -> F.GInfo c a -> IO (F.Result (Integer, a)) partition cfg fi = do dumpPartitions cfg fis -- writeGraph f g@@ -93,7 +93,8 @@ -- produce the maximum possible number of partitions. Or a MultiCore Info -- to control the partitioning -------------------------------------------------------------------------------partition' :: Maybe MCInfo -> F.FInfo a -> [F.FInfo a]+partition' :: (F.TaggedC c a) + => Maybe MCInfo -> F.GInfo c a -> [F.GInfo c a] ------------------------------------------------------------------------------ partition' mn fi = case mn of Nothing -> fis mkPartition id@@ -105,10 +106,10 @@ -- | Partition an FInfo into a specific number of partitions of roughly equal -- amounts of work-partitionN :: MCInfo -- ^ describes thresholds and partiton amounts- -> F.FInfo a -- ^ The originial FInfo- -> [CPart a] -- ^ A list of the smallest possible CParts- -> [F.FInfo a] -- ^ At most N partitions of at least thresh work+partitionN :: MCInfo -- ^ describes thresholds and partiton amounts+ -> F.GInfo c a -- ^ The originial FInfo+ -> [CPart c a] -- ^ A list of the smallest possible CParts+ -> [F.GInfo c a] -- ^ At most N partitions of at least thresh work partitionN mi fi cp | cpartSize (finfoToCpart fi) <= minThresh = [fi] | otherwise = map (cpartToFinfo fi) $ toNParts sortedParts@@ -140,23 +141,21 @@ -- | Return the "size" of a CPart. Used to determine if it's -- substantial enough to be worth parallelizing.-cpartSize :: CPart a -> Int+cpartSize :: CPart c a -> Int cpartSize c = (M.size . pcm) c + (length . pws) c -- | Convert a CPart to an FInfo-cpartToFinfo :: F.FInfo a -> CPart a -> F.FInfo a-cpartToFinfo fi p = fi { F.cm = pcm p- , F.ws = pws p- }+cpartToFinfo :: F.GInfo c a -> CPart c a -> F.GInfo c a+cpartToFinfo fi p = fi {F.ws = pws p, F.cm = pcm p} -- | Convert an FInfo to a CPart-finfoToCpart :: F.FInfo a -> CPart a+finfoToCpart :: F.GInfo c a -> CPart c a finfoToCpart fi = CPart { pcm = F.cm fi , pws = F.ws fi } --------------------------------------------------------------------------------------dumpPartitions :: (F.Fixpoint a) => Config -> [F.FInfo a] -> IO ()+dumpPartitions :: (F.Fixpoint (c a), F.Fixpoint a) => Config -> [F.GInfo c a] -> IO () ------------------------------------------------------------------------------------- dumpPartitions cfg fis = forM_ (zip [0..] fis) $ \(i, fi) ->@@ -165,16 +164,16 @@ -- | Type alias for a function to construct a partition. mkPartition and -- mkPartition' are the two primary functions that conform to this interface-type PartitionCtor a b = F.FInfo a- -> M.HashMap Int [(Integer, F.SubC a)]+type PartitionCtor c a b = F.GInfo c a+ -> M.HashMap Int [(Integer, c a)] -> M.HashMap Int [(F.KVar, F.WfC a)] -> Int -> b -- ^ typically a F.FInfo a or F.CPart a -partitionByConstraints :: PartitionCtor a b -- ^ mkPartition or mkPartition'- -> F.FInfo a- -> KVComps- -> ListNE b -- ^ [F.FInfo a] or [F.CPart a]+partitionByConstraints :: PartitionCtor c a b -- ^ mkPartition or mkPartition'+ -> F.GInfo c a+ -> KVComps+ -> ListNE b -- ^ [F.FInfo a] or [F.CPart a] partitionByConstraints f fi kvss = f fi icM iwM <$> js where js = fst <$> jkvs -- groups@@ -189,21 +188,21 @@ kM = M.fromList [ (k, i) | (KVar k, i) <- kvI ] cM = M.fromList [ (c, i) | (Cstr c, i) <- kvI ] -mkPartition :: F.GInfo F.SubC a+mkPartition :: F.GInfo c a -> M.HashMap Int [(Integer, c a)] -> M.HashMap Int [(F.KVar, F.WfC a)] -> Int -> F.GInfo c a mkPartition fi icM iwM j- = fi { F.cm = M.fromList $ M.lookupDefault [] j icM- , F.ws = M.fromList $ M.lookupDefault [] j iwM- }+ = fi{ F.cm = M.fromList $ M.lookupDefault [] j icM+ , F.ws = M.fromList $ M.lookupDefault [] j iwM+ } -mkPartition' :: F.FInfo a1- -> M.HashMap Int [(Integer, F.SubC a)]+mkPartition' :: F.GInfo c a+ -> M.HashMap Int [(Integer, c a)] -> M.HashMap Int [(F.KVar, F.WfC a)] -> Int- -> CPart a+ -> CPart c a mkPartition' _ icM iwM j = CPart { pcm = M.fromList $ M.lookupDefault [] j icM , pws = M.fromList $ M.lookupDefault [] j iwM
src/Language/Fixpoint/Graph/Reducible.hs view
@@ -16,7 +16,7 @@ ---------------------------------------------------------------------------------isReducible :: F.SInfo a -> Bool+isReducible :: (F.TaggedC c a) => F.GInfo c a -> Bool -------------------------------------------------------------------------------- isReducible fi = all (isReducibleWithStart g) vs where@@ -32,7 +32,7 @@ -convertToGraph :: F.SInfo a -> Gr Int ()+convertToGraph :: (F.TaggedC c a) => F.GInfo c a -> Gr Int () convertToGraph fi = mkGraph vs es where subCs = M.elems (F.cm fi)@@ -57,6 +57,6 @@ where (Just xs) = lookup u t -subcEdges' :: (F.KVar -> Node) -> F.BindEnv -> F.SimpC a -> [(Node, Node)]+subcEdges' :: (F.TaggedC c a) => (F.KVar -> Node) -> F.BindEnv -> c a -> [(Node, Node)] subcEdges' kvI be c = [(kvI k1, kvI k2) | k1 <- V.envKVars be c , k2 <- V.kvars $ F.crhs c]
src/Language/Fixpoint/Misc.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ImplicitParams #-} -- ignore hlint module Language.Fixpoint.Misc where@@ -14,7 +15,7 @@ import Data.Hashable -- import Data.IORef import Control.Arrow (second)-import Control.Monad (when, forM_)+import Control.Monad (when, forM_, filterM) import qualified Data.HashMap.Strict as M import qualified Data.List as L import Data.Tuple (swap)@@ -35,6 +36,7 @@ import System.Exit (ExitCode) import Control.Concurrent.Async + #ifdef MIN_VERSION_located_base import Prelude hiding (error, undefined) import GHC.Err.Located@@ -199,6 +201,9 @@ allMap :: (Eq k, Hashable k) => (v -> Bool) -> M.HashMap k v -> Bool allMap p = L.foldl' (\a v -> a && p v) True +hashNub :: (Eq k, Hashable k) => [k] -> [k]+hashNub = M.keys . M.fromList . fmap (, ())+ sortNub :: (Ord a) => [a] -> [a] sortNub = nubOrd . L.sort where@@ -207,6 +212,8 @@ | otherwise = x : nubOrd t nubOrd xs = xs +duplicates :: (Eq k, Hashable k) => [k] -> [k]+duplicates xs = [ x | (x, n) <- count xs, 1 < n ] #ifdef MIN_VERSION_located_base safeZip :: (?callStack :: CallStack) => String -> [a] -> [b] -> [(a,b)]@@ -240,14 +247,21 @@ safeInit :: (?callStack :: CallStack) => String -> ListNE a -> [a] safeUncons :: (?callStack :: CallStack) => String -> ListNE a -> (a, [a]) safeUnsnoc :: (?callStack :: CallStack) => String -> ListNE a -> ([a], a)+safeFromList :: (?callStack :: CallStack, Eq k, Hashable k, Show k) => String -> [(k, v)] -> M.HashMap k v #else safeHead :: String -> ListNE a -> a safeLast :: String -> ListNE a -> a safeInit :: String -> ListNE a -> [a] safeUncons :: String -> ListNE a -> (a, [a]) safeUnsnoc :: String -> ListNE a -> ([a], a)+safeFromList :: (Eq k, Hashable k, Show k) => String -> [(k, v)] -> M.HashMap k v #endif +safeFromList msg kvs = applyNonNull (M.fromList kvs) err (dups kvs)+ where+ dups = duplicates . fmap fst+ err = errorstar . wrap "safeFromList with duplicates" msg . show+ wrap m1 m2 s = m1 ++ " " ++ s ++ " " ++ m2 safeHead _ (x:_) = x safeHead msg _ = errorstar $ "safeHead with empty list " ++ msg@@ -292,6 +306,13 @@ singleton :: a -> [a] singleton x = [x] +pair :: a -> a -> [a]+pair x1 x2 = [x1, x2]++triple :: a -> a -> a -> [a]+triple x1 x2 x3 = [x1, x2, x3]++ fM :: (Monad m) => (a -> b) -> a -> m b fM f = return . f @@ -315,7 +336,26 @@ (g,f,_) = G.graphFromEdges . eF $ x vss = T.flatten <$> G.components g +topoSortWith :: (Ord v) => (a -> (v, [v])) -> [a] -> [a]+topoSortWith vF xs = fst3 . f <$> G.topSort g+ where+ (g, f, _) = G.graphFromEdges es+ es = [ (x, ux, vxs) | x <- xs, let (ux, vxs) = vF x ] +-- >>> λ> exTopo+-- >>> [1,2,4,6,5,3]+exTopo :: [Int]+exTopo = topoSortWith f [1,2,3,4,5,6]+ where+ f 1 = (1, [2, 3])+ f 2 = (2, [3, 4])+ f 3 = (3, [] )+ f 4 = (4, [5, 6])+ f 5 = (5, [] )+ f 6 = (6, [3] )+ f n = (n, [] )++ type EqHash a = (Eq a, Ord a, Hashable a) -- >>> coalesce [[1], [2,1], [5], [5, 6], [5, 7], [9, 6], [10], [10,100]]@@ -347,7 +387,30 @@ {-@ allCombinations :: xss:[[a]] -> [{v:[a]| len v == len xss}] @-} allCombinations :: [[a]] -> [[a]]-allCombinations [] = [[]]-allCombinations [[]] = [[]]-allCombinations ([]:_) = []-allCombinations ((x:xs):ys) = ((x:) <$> allCombinations ys) ++ allCombinations (xs:ys)+allCombinations xs = assert (and . map (((length xs) == ) . length)) $ go xs+ where+ go [] = [[]]+ go [[]] = []+ go ([]:_) = []+ go ((x:xs):ys) = ((x:) <$> go ys) ++ go (xs:ys)++ assert b x = if b x then x else errorstar "allCombinations: assertion violation"++powerset :: [a] -> [[a]]+powerset xs = filterM (const [False, True]) xs+++(<$$>) :: (Monad m) => (a -> m b) -> [a] -> m [b]+_ <$$> [] = return []+f <$$> [x1] = singleton <$> f x1+f <$$> [x1, x2] = pair <$> f x1 <*> f x2+f <$$> [x1, x2, x3] = triple <$> f x1 <*> f x2 <*> f x3+f <$$> xs = revMapM f ({- trace msg -} xs)+ where+ _msg = "<$$> on " ++ show (length xs)++revMapM :: (Monad m) => (a -> m b) -> [a] -> m [b]+revMapM f = go []+ where+ go !acc [] = return (reverse acc)+ go !acc (x:xs) = do {!y <- f x; go (y:acc) xs}
src/Language/Fixpoint/Parse.hs view
@@ -76,6 +76,10 @@ -- * For testing , expr0P+ , dataFieldP+ , dataCtorP+ , dataDeclP+ ) where import qualified Data.HashMap.Strict as M@@ -244,15 +248,15 @@ -- | Integer integer :: Parser Integer-integer = posInteger+integer = (Token.natural lexer <* spaces) --posInteger -- try (char '-' >> (negate <$> posInteger)) -- <|> posInteger-posInteger :: Parser Integer-posInteger = toI <$> (many1 digit <* spaces)- where- toI :: String -> Integer- toI = read+-- posInteger :: Parser Integer+-- posInteger = toI <$> (many1 digit <* spaces)+-- where+-- toI :: String -> Integer+-- toI = read ---------------------------------------------------------------- ------------------------- Expressions --------------------------@@ -303,9 +307,10 @@ isSmall :: Char -> Bool isSmall c = isLower c || c == '_' -locLowerIdP, locUpperIdP :: Parser LocSymbol+locSymbolP, locLowerIdP, locUpperIdP :: Parser LocSymbol locLowerIdP = locParserP lowerIdP locUpperIdP = locParserP upperIdP+locSymbolP = locParserP symbolP -- | Arbitrary Symbols symbolP :: Parser Symbol@@ -316,6 +321,7 @@ constantP = try (R <$> double) <|> I <$> integer + symconstP :: Parser SymConst symconstP = SL . T.pack <$> stringLiteral @@ -516,7 +522,7 @@ = (reserved "int" >> return intFTyCon) <|> (reserved "Integer" >> return intFTyCon) <|> (reserved "Int" >> return intFTyCon)- <|> (reserved "int" >> return intFTyCon) -- TODO:AZ duplicate?+ -- <|> (reserved "int" >> return intFTyCon) -- TODO:AZ duplicate? <|> (reserved "real" >> return realFTyCon) <|> (reserved "bool" >> return boolFTyCon) <|> (reserved "num" >> return numFTyCon)@@ -550,10 +556,10 @@ <|> (reservedOp "&&" >> pGAnds <$> predsP) <|> (reservedOp "||" >> POr <$> predsP) -makeUniquePGrad :: Parser Expr +makeUniquePGrad :: Parser Expr makeUniquePGrad = do uniquePos <- getPosition- return $ PGrad (KV $ symbol $ show uniquePos) mempty mempty+ return $ PGrad (KV $ symbol $ show uniquePos) mempty (srcGradInfo uniquePos) mempty -- qmP = reserved "?" <|> reserved "Bexp" @@ -641,10 +647,25 @@ refDefP :: Symbol -> Parser Expr -> Parser (Reft -> a) -> Parser a refDefP x = refBindP (optBindP x) ------------------------------------------------------------------------- | Parsing Qualifiers -------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+-- | Parsing Data Declarations -------------------------------------------------+-------------------------------------------------------------------------------- +dataFieldP :: Parser DataField+dataFieldP = DField <$> locSymbolP <* colon <*> sortP++dataCtorP :: Parser DataCtor+dataCtorP = DCtor <$> locSymbolP+ <*> braces (sepBy dataFieldP comma)++dataDeclP :: Parser DataDecl+dataDeclP = DDecl <$> fTyConP <*> intP <* (reservedOp "=")+ <*> brackets (many (reservedOp "|" *> dataCtorP))++--------------------------------------------------------------------------------+-- | Parsing Qualifiers --------------------------------------------------------+--------------------------------------------------------------------------------+ -- | Qualifiers qualifierP :: Parser Sort -> Parser Qualifier qualifierP tP = do@@ -665,7 +686,18 @@ -- where -- Just (c,cs) = T.uncons $ symbolSafeText s +---------------------------------------------------------------------+-- | Axioms for Symbolic Evaluation ---------------------------------+--------------------------------------------------------------------- +defineP :: Parser Equation+defineP = Equ <$> symbolP <*> many symbolP <*> (reserved "=" >> exprP)++matchP :: Parser Rewrite+matchP = SMeasure <$> symbolP <*> symbolP <*> many symbolP <*> (reserved "=" >> exprP)++pairsP :: Parser a -> Parser b -> Parser [(a, b)]+pairsP aP bP = brackets $ sepBy1 (pairP aP (reserved ":") bP) semi --------------------------------------------------------------------- -- | Parsing Constraints (.fq files) -------------------------------- ---------------------------------------------------------------------@@ -683,6 +715,12 @@ | Pack !KVar !Int | IBind !Int !Symbol !SortedReft | Opt !String+ | Def !Equation+ | Mat !Rewrite+ | Fuel ![(Int,Int)]+ | Expand ![(Int,Bool)]+ | Syms !Int+ | Adt !DataDecl deriving (Show, Generic) -- Sol of solbind -- Dep of FixConstraint.dep@@ -704,9 +742,18 @@ <|> Pack <$> (reserved "pack" >> kvarP) <*> (colon >> intP) <|> Qul <$> (reserved "qualif" >> qualifierP sortP) <|> Kut <$> (reserved "cut" >> kvarP)- <|> IBind <$> (reserved "bind" >> intP) <*> symbolP <*> (colon >> {-# SCC "sortedReftP" #-} sortedReftP)- <|> Opt <$> (reserved "fixpoint" >> stringLiteral)+ <|> IBind <$> (reserved "bind" >> intP)+ <*> symbolP+ <*> (colon >> {-# SCC "sortedReftP" #-} sortedReftP)+ <|> Opt <$> (reserved "fixpoint" >> stringLiteral)+ <|> Def <$> (reserved "define" >> defineP)+ <|> Mat <$> (reserved "match" >> matchP)+ <|> Fuel <$> (reserved "fuel" >> pairsP intP intP)+ <|> Expand <$> (reserved "expand" >> pairsP intP boolP)+ <|> Syms <$> (reserved "syms" >> intP)+ <|> Adt <$> (reserved "data" >> dataDeclP) + sortedReftP :: Parser SortedReft sortedReftP = refP (RR <$> (sortP <* spaces)) @@ -759,8 +806,12 @@ intP :: Parser Int intP = fromInteger <$> integer +boolP :: Parser Bool+boolP = (reserved "True" >> return True)+ <|> (reserved "False" >> return False)+ defsFInfo :: [Def a] -> FInfo a-defsFInfo defs = {-# SCC "defsFI" #-} FI cm ws bs lts dts kts qs mempty mempty mempty mempty+defsFInfo defs = {-# SCC "defsFI" #-} FI cm ws bs lts dts kts qs binfo adts mempty mempty ae where cm = M.fromList [(cid c, c) | Cst c <- defs] ws = M.fromList [(thd3 $ wrft w, w) | Wfc w <- defs]@@ -768,9 +819,16 @@ lts = fromListSEnv [(x, t) | Con x t <- defs] dts = fromListSEnv [(x, t) | Dis x t <- defs] kts = KS $ S.fromList [k | Kut k <- defs]- -- pks = Packs $ M.fromList [(k, i) | Pack k i <- defs] qs = [q | Qul q <- defs]+ binfo = mempty+ fuel = M.fromList [(fromIntegral i, f)| Fuel fs <- defs, (i,f) <- fs]+ expand = M.fromList [(fromIntegral i, f)| Expand fs <- defs, (i,f) <- fs]+ syms = sum [s | Syms s <- defs]+ eqs = [e | Def e <- defs]+ rews = [r | Mat r <- defs] cid = fromJust . sid+ ae = AEnv syms eqs rews fuel expand+ adts = [d | Adt d <- defs] -- msg = show $ "#Lits = " ++ (show $ length consts) ---------------------------------------------------------------------@@ -864,10 +922,11 @@ <|> (reserved "distinct" >> (Distinct <$> brackets (sepBy exprP comma))) cmdVarP :: Parser Command-cmdVarP = do- x <- bindP- t <- sortP- return $ Declare x [] t+cmdVarP = error "UNIMPLEMENTED: cmdVarP"+-- do+ -- x <- bindP+ -- t <- sortP+ -- return $ Declare x [] t --------------------------------------------------------------------- -- Bundling Parsers into a Typeclass --------------------------------
src/Language/Fixpoint/Smt/Interface.hs view
@@ -30,6 +30,7 @@ , makeContext , makeContextNoLog , makeContextWithSEnv+ -- , makeSmtContext , cleanupContext -- * Execute Queries@@ -40,10 +41,12 @@ , smtDecl , smtDecls , smtAssert+ -- , smtDataDecl+ , smtFuncDecl , smtAssertAxiom , smtCheckUnsat , smtCheckSat- , smtBracket+ , smtBracket, smtBracketAt , smtDistinct , smtPush, smtPop @@ -52,7 +55,6 @@ , checkValid' , checkValidWithContext , checkValids- , makeSmtContext ) where @@ -64,19 +66,20 @@ , betaEquivalence , normalForm , stringTheory)-import Language.Fixpoint.Misc (errorstar)+import qualified Language.Fixpoint.Misc as Misc+import qualified Language.Fixpoint.Types.Visitor as Vis import Language.Fixpoint.Types.Errors--- import Language.Fixpoint.SortCheck (elaborate) import Language.Fixpoint.Utils.Files-import Language.Fixpoint.Types hiding (allowHO)+import Language.Fixpoint.Types hiding (allowHO)+import qualified Language.Fixpoint.Types as F import Language.Fixpoint.Smt.Types import qualified Language.Fixpoint.Smt.Theories as Thy import Language.Fixpoint.Smt.Serialize ()- import Control.Applicative ((<|>)) import Control.Monad import Control.Exception import Data.Char+import qualified Data.HashMap.Strict as M import Data.Monoid import qualified Data.Text as T import Data.Text.Format@@ -91,9 +94,13 @@ import System.IO (Handle, IOMode (..), hClose, hFlush, openFile) import System.Process import qualified Data.Attoparsec.Text as A-import qualified Data.HashMap.Strict as M+-- import qualified Data.HashMap.Strict as M import Data.Attoparsec.Internal.Types (Parser) import Text.PrettyPrint.HughesPJ (text)+import Language.Fixpoint.SortCheck+-- import qualified Language.Fixpoint.Types as F+-- import Language.Fixpoint.Types.PrettyPrint (tracepp)+ {- runFile f = readFile f >>= runString@@ -109,17 +116,28 @@ -} --- TODO take makeContext's Bool from caller instead of always using False?-makeSmtContext :: Config -> FilePath -> [(Symbol, Sort)] -> IO Context-makeSmtContext cfg f xts = do- me <- makeContextWithSEnv cfg f $ fromListSEnv xts- smtDecls me theoryDecls- smtDecls me xts- return me+-- TODO: DEPRECATE `makeSmtContext`; instead use just `makeContextWithSEnv`+-- which should call `declare` inside it. Currently broken as the use+-- case is in `instantiate` which needs it BEFORE we `Sanitize` and+-- hence before we can call `symbolEnv` to find the set of all symbols etc... -theoryDecls :: [(Symbol, Sort)]-theoryDecls = [ (x, tsSort ty) | (x, ty) <- M.toList Thy.theorySymbols, not (tsInterp ty)]+-- makeSmtContext :: Config -> FilePath -> [DataDecl] -> [(Symbol, Sort)] -> [Sort]+-- -> IO Context+-- makeSmtContext cfg f dds xts ts = do+ -- let env = makeSmtEnv dds xts ts+ -- me <- makeContextWithSEnv cfg f env+ -- smtDecls me (theoryDecls env)+ -- smtDecls me xts+ -- return me +-- makeSmtEnv :: [DataDecl] -> [(Symbol, Sort)] -> [Sort] -> SymEnv+-- makeSmtEnv dds xts ts = symEnv (fromListSEnv xts) (Thy.theorySymbols dds) dds ts++_theoryDecls :: SymEnv -> [(Symbol, Sort)]+_theoryDecls env = [ (x, tsSort ty) | (x, ty) <- theorySyms, Uninterp == tsInterp ty]+ where+ theorySyms = toListSEnv (seTheory env)+ checkValidWithContext :: Context -> [(Symbol, Sort)] -> Expr -> Expr -> IO Bool checkValidWithContext me xts p q = smtBracket me "checkValidWithContext" $@@ -163,7 +181,8 @@ -------------------------------------------------------------------------- command me !cmd = say cmd >> hear cmd where- say = smtWrite me . Builder.toLazyText . runSmt2+ env = ctxSymEnv me+ say = smtWrite me . Builder.toLazyText . runSmt2 env hear CheckSat = smtRead me hear (GetValue _) = smtRead me hear _ = return Ok@@ -177,7 +196,7 @@ do ln <- smtReadRaw me res <- A.parseWith (smtReadRaw me) responseP ln case A.eitherResult res of- Left e -> errorstar $ "SMTREAD:" ++ e+ Left e -> Misc.errorstar $ "SMTREAD:" ++ e Right r -> do maybe (return ()) (\h -> hPutStrLnNow h $ format "; SMT Says: {}" (Only $ show r)) (ctxLog me) -- when (verbose me) $ TIO.putStrLn $ format "SMT Says: {}" (Only $ show r)@@ -254,9 +273,12 @@ where smtFile = extFileName Smt2 f -makeContextWithSEnv :: Config -> FilePath -> SMTEnv -> IO Context-makeContextWithSEnv cfg f env- = (\cxt -> cxt {ctxSmtEnv = env}) <$> makeContext cfg f+makeContextWithSEnv :: Config -> FilePath -> SymEnv -> IO Context+makeContextWithSEnv cfg f env = do+ ctx <- makeContext cfg f+ let ctx' = ctx {ctxSymEnv = env}+ declare ctx'+ return ctx' -- where msg = "makeContextWithSEnv" ++ show env makeContextNoLog :: Config -> IO Context@@ -279,7 +301,7 @@ , ctxAeq = alphaEquivalence cfg , ctxBeq = betaEquivalence cfg , ctxNorm = normalForm cfg- , ctxSmtEnv = Thy.theorySEnv+ , ctxSymEnv = mempty -- tsSort <$> Thy.theorySymbols -- Thy.theorySEnv } --------------------------------------------------------------------------@@ -333,7 +355,7 @@ | x < y = False versionGreaterEq _ [] = True versionGreaterEq [] _ = False-versionGreaterEq _ _ = errorstar "Interface.versionGreater called with bad arguments"+versionGreaterEq _ _ = Misc.errorstar "Interface.versionGreater called with bad arguments" ----------------------------------------------------------------------------- -- | SMT Commands -----------------------------------------------------------@@ -347,10 +369,19 @@ smtDecls = mapM_ . uncurry . smtDecl smtDecl :: Context -> Symbol -> Sort -> IO ()-smtDecl me x t = interact' me (Declare x ins out)+smtDecl me x t = interact' me (Declare x ins' out') where+ ins' = sortSmtSort False env <$> ins+ out' = sortSmtSort False env out (ins, out) = deconSort t+ env = seData (ctxSymEnv me) +smtFuncDecl :: Context -> Symbol -> ([SmtSort], SmtSort) -> IO ()+smtFuncDecl me x (ts, t) = interact' me (Declare x ts t)++smtDataDecl :: Context -> DataDecl -> IO ()+smtDataDecl me d = interact' me (DeclData d)+ deconSort :: Sort -> ([Sort], Sort) deconSort t = case functionSort t of Just (_, ins, out) -> (ins, out)@@ -367,9 +398,8 @@ smtAssert :: Context -> Expr -> IO () smtAssert me p = interact' me (Assert Nothing p) - smtAssertAxiom :: Context -> Triggered Expr -> IO ()-smtAssertAxiom me p = interact' me (AssertAxiom p)+smtAssertAxiom me p = interact' me (AssertAx p) smtDistinct :: Context -> [Expr] -> IO () smtDistinct me az = interact' me (Distinct az)@@ -377,6 +407,10 @@ smtCheckUnsat :: Context -> IO Bool smtCheckUnsat me = respSat <$> command me CheckSat +smtBracketAt :: SrcSpan -> Context -> String -> IO a -> IO a+smtBracketAt sp x y z = smtBracket x y z `catch` dieAt sp++ smtBracket :: Context -> String -> IO a -> IO a smtBracket me _msg a = do smtPush me@@ -410,3 +444,100 @@ = [ "(set-option :auto-config false)" , "(set-option :model true)" , "(set-option :model-partial false)"]++++--------------------------------------------------------------------------------+declare :: Context -> IO () -- SolveM ()+--------------------------------------------------------------------------------+declare me = do+ forM_ ds $ smtDataDecl me+ forM_ thyXTs $ uncurry $ smtDecl me+ forM_ qryXTs $ uncurry $ smtDecl me+ forM_ ats $ uncurry $ smtFuncDecl me+ forM_ ess $ smtDistinct me+ forM_ axs $ smtAssert me+ where+ env = ctxSymEnv me+ ds = dataDeclarations env+ lts = F.toListSEnv . F.seLits $ env+ ess = distinctLiterals lts+ axs = Thy.axiomLiterals lts+ thyXTs = filter (isKind 1) xts+ qryXTs = Misc.mapSnd tx <$> filter (isKind 2) xts+ isKind n = (n ==) . symKind env . fst+ xts = F.toListSEnv (F.seSort env)+ tx = elaborate "declare" env+ ats = funcSortVars env++dataDeclarations :: SymEnv -> [DataDecl]+dataDeclarations = -- (if True then orderDeclarations else id) .+ orderDeclarations . map snd . F.toListSEnv . F.seData++funcSortVars :: F.SymEnv -> [(F.Symbol, ([F.SmtSort], F.SmtSort))]+funcSortVars env = [(var applyName t , appSort t) | t <- ts]+ ++ [(var lambdaName t , lamSort t) | t <- ts]+ ++ [(var (lamArgSymbol i) t , argSort t) | t@(_,F.SInt) <- ts, i <- [1..Thy.maxLamArg] ]+ where+ var n = F.symbolAtSmtName n env ()+ ts = M.keys (F.seAppls env)+ appSort (s,t) = ([F.SInt, s], t)+ lamSort (s,t) = ([s, t], F.SInt)+ argSort (s,_) = ([] , s)++-- | 'symKind' returns {0, 1, 2} where:+-- 0 = Theory-Definition,+-- 1 = Theory-Declaration,+-- 2 = Query-Binder++symKind :: F.SymEnv -> F.Symbol -> Int+symKind env x = case F.tsInterp <$> F.symEnvTheory x env of+ Just F.Theory -> 0+ Just F.Data -> 0+ Just F.Uninterp -> 1+ Nothing -> 2+ -- Just t -> if tsInterp t then 0 else 1+++-- assumes :: [F.Expr] -> SolveM ()+-- assumes es = withContext $ \me -> forM_ es $ smtAssert me++-- | `distinctLiterals` is used solely to determine the set of literals+-- (of each sort) that are *disequal* to each other, e.g. EQ, LT, GT,+-- or string literals "cat", "dog", "mouse". These should only include+-- non-function sorted values.+distinctLiterals :: [(F.Symbol, F.Sort)] -> [[F.Expr]]+distinctLiterals xts = [ es | (_, es) <- tess ]+ where+ tess = Misc.groupList [(t, F.expr x) | (x, t) <- xts, notFun t]+ notFun = not . F.isFunctionSortedReft . (`F.RR` F.trueReft)+ -- _notStr = not . (F.strSort ==) . F.sr_sort . (`F.RR` F.trueReft)++--------------------------------------------------------------------------------+-- | 'orderDeclarations' sorts the data declarations such that each declarations+-- only refers to preceding ones.+--------------------------------------------------------------------------------+orderDeclarations :: [F.DataDecl] -> [F.DataDecl]+--------------------------------------------------------------------------------+orderDeclarations ds = reverse (Misc.topoSortWith f ds)+ where+ dM = M.fromList [(F.ddTyCon d, d) | d <- ds]+ f d = (F.ddTyCon d, dataDeclDeps dM d)++dataDeclDeps :: M.HashMap F.FTycon F.DataDecl -> F.DataDecl -> [F.FTycon]+dataDeclDeps dM = filter (`M.member` dM) . Misc.sortNub . dataDeclFTycons++dataDeclFTycons :: F.DataDecl -> [F.FTycon]+dataDeclFTycons = concatMap dataCtorFTycons . F.ddCtors++dataCtorFTycons :: F.DataCtor -> [F.FTycon]+dataCtorFTycons = concatMap dataFieldFTycons . F.dcFields++dataFieldFTycons :: F.DataField -> [F.FTycon]+dataFieldFTycons = sortFTycons . F.dfSort++sortFTycons :: Sort -> [FTycon]+sortFTycons = Vis.foldSort go []+ where+ go cs (FTC c) = c : cs+ go cs _ = cs
src/Language/Fixpoint/Smt/Serialize.hs view
@@ -10,8 +10,9 @@ -- typeclass. We split it into a separate module as it depends on -- Theories (see @smt2App@). -module Language.Fixpoint.Smt.Serialize () where+module Language.Fixpoint.Smt.Serialize (smt2SortMono) where +import Language.Fixpoint.SortCheck import Language.Fixpoint.Types import Language.Fixpoint.Smt.Types import qualified Language.Fixpoint.Smt.Theories as Thy@@ -19,105 +20,151 @@ import qualified Data.Text.Lazy.Builder as Builder import Data.Text.Format import Language.Fixpoint.Misc (errorstar)-import Data.Maybe (fromMaybe) --- instance SMTLIB2 Sort where--- smt2 s@(FFunc _ _) = errorstar $ "smt2 FFunc: " ++ showpp s--- smt2 FInt = "Int"--- smt2 FReal = "Real"--- smt2 t--- | t == boolSort = "Bool"--- smt2 t--- | Just d <- Thy.smt2Sort t = d--- smt2 _ = "Int"- instance SMTLIB2 (Symbol, Sort) where- smt2 c@(sym, t) = build "({} {})" (smt2 sym, smt2Sort c t)+ smt2 env c@(sym, t) = build "({} {})" (smt2 env sym, smt2SortMono c env t) -smt2Sort :: (PPrint a) => a -> Sort -> Builder.Builder-smt2Sort msg = go+smt2SortMono, smt2SortPoly :: (PPrint a) => a -> SymEnv -> Sort -> Builder.Builder+smt2SortMono = smt2Sort False+smt2SortPoly = smt2Sort True++smt2Sort :: (PPrint a) => Bool -> a -> SymEnv -> Sort -> Builder.Builder+smt2Sort poly _ env t = smt2 env (Thy.sortSmtSort poly (seData env) t)++smt2data :: SymEnv -> DataDecl -> Builder.Builder+smt2data env (DDecl tc n cs) = build "({}) (({} {}))" (tvars, name, ctors) where- go s@(FFunc _ _) = errorstar $ unwords ["smt2 FFunc:", showpp msg, showpp s]- go FInt = "Int"- go FReal = "Real"- go t- | t == boolSort = "Bool"- go t- | Just d <- Thy.smt2Sort t = d- go _ = "Int"+ tvars = smt2many (smt2TV <$> [0..(n-1)])+ name = smt2 env (symbol tc)+ ctors = smt2many (smt2ctor env <$> cs)+ smt2TV = smt2 env . SVar ++smt2ctor :: SymEnv -> DataCtor -> Builder.Builder+smt2ctor env (DCtor c []) = smt2 env c+smt2ctor env (DCtor c fs) = build "({} {})" (smt2 env c, fields)+ where+ fields = smt2many (smt2field env <$> fs)++smt2field :: SymEnv -> DataField -> Builder.Builder+smt2field env d@(DField x t) = build "({} {})" (smt2 env x, smt2SortPoly d env t)+ instance SMTLIB2 Symbol where- smt2 s- | Just t <- Thy.smt2Symbol s = t- smt2 s = Builder.fromText $ symbolSafeText s+ smt2 env s+ | Just t <- Thy.smt2Symbol env s = t+ smt2 _ s = symbolBuilder s ++instance SMTLIB2 LocSymbol where+ smt2 env = smt2 env . val+ instance SMTLIB2 SymConst where- smt2 = smt2 . symbol+ smt2 env = smt2 env . symbol instance SMTLIB2 Constant where- smt2 (I n) = build "{}" (Only n)- smt2 (R d) = build "{}" (Only d)- smt2 (L t _) = build "{}" (Only t)+ smt2 _ (I n) = build "{}" (Only n)+ smt2 _ (R d) = build "{}" (Only d)+ smt2 _ (L t _) = build "{}" (Only t) -instance SMTLIB2 LocSymbol where- smt2 = smt2 . val instance SMTLIB2 Bop where- smt2 Plus = "+"- smt2 Minus = "-"- smt2 Times = Builder.fromText $ symbolSafeText mulFuncName- smt2 Div = Builder.fromText $ symbolSafeText divFuncName- smt2 RTimes = "*"- smt2 RDiv = "/"- smt2 Mod = "mod"+ smt2 _ Plus = "+"+ smt2 _ Minus = "-"+ smt2 _ Times = symbolBuilder mulFuncName+ smt2 _ Div = symbolBuilder divFuncName+ smt2 _ RTimes = "*"+ smt2 _ RDiv = "/"+ smt2 _ Mod = "mod" instance SMTLIB2 Brel where- smt2 Eq = "="- smt2 Ueq = "="- smt2 Gt = ">"- smt2 Ge = ">="- smt2 Lt = "<"- smt2 Le = "<="- smt2 _ = errorstar "SMTLIB2 Brel"+ smt2 _ Eq = "="+ smt2 _ Ueq = "="+ smt2 _ Gt = ">"+ smt2 _ Ge = ">="+ smt2 _ Lt = "<"+ smt2 _ Le = "<="+ smt2 _ _ = errorstar "SMTLIB2 Brel" -- NV TODO: change the way EApp is printed instance SMTLIB2 Expr where- smt2 (ESym z) = smt2 z- smt2 (ECon c) = smt2 c- smt2 (EVar x) = smt2 x- smt2 e@(EApp _ _) = smt2App e- smt2 (ENeg e) = build "(- {})" (Only $ smt2 e)- smt2 (EBin o e1 e2) = build "({} {} {})" (smt2 o, smt2 e1, smt2 e2)- smt2 (EIte e1 e2 e3) = build "(ite {} {} {})" (smt2 e1, smt2 e2, smt2 e3)- smt2 (ECst e _) = smt2 e- smt2 (PTrue) = "true"- smt2 (PFalse) = "false"- smt2 (PAnd []) = "true"- smt2 (PAnd ps) = build "(and {})" (Only $ smt2s ps)- smt2 (POr []) = "false"- smt2 (POr ps) = build "(or {})" (Only $ smt2s ps)- smt2 (PNot p) = build "(not {})" (Only $ smt2 p)- smt2 (PImp p q) = build "(=> {} {})" (smt2 p, smt2 q)- smt2 (PIff p q) = build "(= {} {})" (smt2 p, smt2 q)- smt2 (PExist [] p) = smt2 p- smt2 (PExist bs p) = build "(exists ({}) {})" (smt2s bs, smt2 p)- smt2 (PAll [] p) = smt2 p- smt2 (PAll bs p) = build "(forall ({}) {})" (smt2s bs, smt2 p)+ smt2 env (ESym z) = smt2 env z+ smt2 env (ECon c) = smt2 env c+ smt2 env (EVar x) = smt2 env x+ smt2 env e@(EApp _ _) = smt2App env e+ smt2 env (ENeg e) = build "(- {})" (Only $ smt2 env e)+ smt2 env (EBin o e1 e2) = build "({} {} {})" (smt2 env o, smt2 env e1, smt2 env e2)+ smt2 env (EIte e1 e2 e3) = build "(ite {} {} {})" (smt2 env e1, smt2 env e2, smt2 env e3)+ smt2 env (ECst e t) = smt2Cast env e t+ smt2 _ (PTrue) = "true"+ smt2 _ (PFalse) = "false"+ smt2 _ (PAnd []) = "true"+ smt2 env (PAnd ps) = build "(and {})" (Only $ smt2s env ps)+ smt2 _ (POr []) = "false"+ smt2 env (POr ps) = build "(or {})" (Only $ smt2s env ps)+ smt2 env (PNot p) = build "(not {})" (Only $ smt2 env p)+ smt2 env (PImp p q) = build "(=> {} {})" (smt2 env p, smt2 env q)+ smt2 env (PIff p q) = build "(= {} {})" (smt2 env p, smt2 env q)+ smt2 env (PExist [] p) = smt2 env p+ smt2 env (PExist bs p) = build "(exists ({}) {})" (smt2s env bs, smt2 env p)+ smt2 env (PAll [] p) = smt2 env p+ smt2 env (PAll bs p) = build "(forall ({}) {})" (smt2s env bs, smt2 env p)+ smt2 env (PAtom r e1 e2) = mkRel env r e1 e2+ smt2 env (ELam b e) = smt2Lam env b e+ smt2 _ e = panic ("smtlib2 Pred " ++ show e) - smt2 (PAtom r e1 e2) = mkRel r e1 e2- smt2 (ELam (x, _) e) = smt2Lam x e- smt2 e = errorstar ("smtlib2 Pred " ++ show e)+-- | smt2Cast uses the 'as x T' pattern needed for polymorphic ADT constructors+-- like Nil, see `tests/pos/adt_list_1.fq` +smt2Cast :: SymEnv -> Expr -> Sort -> Builder.Builder+smt2Cast env (EVar x) t = smt2Var env x t+smt2Cast env e _ = smt2 env e -smt2Lam :: Symbol -> Expr -> Builder.Builder-smt2Lam x e = build "({} {} {})" (smt2 lambdaName, smt2 x, smt2 e)+smt2Var :: SymEnv -> Symbol -> Sort -> Builder.Builder+smt2Var env x t+ | isLamArgSymbol x = smtLamArg env x t+ | Just s <- symEnvSort x env+ , isPolyInst s t = smt2VarAs env x t+ | otherwise = smt2 env x -smt2App :: Expr -> Builder.Builder-smt2App e = fromMaybe (build "({} {})" (smt2 f, smt2s es)) $ Thy.smt2App (eliminate f) $ map smt2 es+smtLamArg :: SymEnv -> Symbol -> Sort -> Builder.Builder+smtLamArg env x t = symbolBuilder $ symbolAtName x env () (FFunc t FInt)+ -- symbolBuilder (symbolAtName x env () t)++smt2VarAs :: SymEnv -> Symbol -> Sort -> Builder.Builder+smt2VarAs env x t = build "(as {} {})" (smt2 env x, smt2SortMono x env t)++isPolyInst :: Sort -> Sort -> Bool+isPolyInst s t = isPoly s && not (isPoly t)++isPoly :: Sort -> Bool+isPoly (FAbs {}) = True+isPoly _ = False++smt2Lam :: SymEnv -> (Symbol, Sort) -> Expr -> Builder.Builder+smt2Lam env (x, xT) (ECst e eT) = build "({} {} {})" (smt2 env lambda, x', smt2 env e) where- (f, es) = splitEApp' e+ x' = smtLamArg env x xT+ lambda = symbolAtName lambdaName env () (FFunc xT eT) +smt2Lam _ _ e+ = panic ("smtlib2: Cannot serialize unsorted lambda: " ++ showpp e) +smt2App :: SymEnv -> Expr -> Builder.Builder+smt2App env e@(EApp (EApp f e1) e2)+ | Just t <- unApplyAt f+ = build "({} {})" (symbolBuilder (symbolAtName applyName env e t), smt2s env [e1, e2])+smt2App env e+ | Just b <- Thy.smt2App env (unCast f) (smt2 env <$> es)+ = b+ | otherwise+ = build "({} {})" (smt2 env f, smt2s env es)+ where+ (f, es) = splitEApp' e++unCast :: Expr -> Expr+unCast (ECst e _) = unCast e+unCast e = e+ splitEApp' :: Expr -> (Expr, [Expr]) splitEApp' = go [] where@@ -125,51 +172,42 @@ go acc (ECst e _) = go acc e go acc e = (e, acc) -eliminate :: Expr -> Expr-eliminate (ECst e _) = eliminate e-eliminate e = e--mkRel :: Brel -> Expr -> Expr -> Builder.Builder-mkRel Ne e1 e2 = mkNe e1 e2-mkRel Une e1 e2 = mkNe e1 e2-mkRel r e1 e2 = build "({} {} {})" (smt2 r, smt2 e1, smt2 e2)+mkRel :: SymEnv -> Brel -> Expr -> Expr -> Builder.Builder+mkRel env Ne e1 e2 = mkNe env e1 e2+mkRel env Une e1 e2 = mkNe env e1 e2+mkRel env r e1 e2 = build "({} {} {})" (smt2 env r, smt2 env e1, smt2 env e2) -mkNe :: Expr -> Expr -> Builder.Builder-mkNe e1 e2 = build "(not (= {} {}))" (smt2 e1, smt2 e2)+mkNe :: SymEnv -> Expr -> Expr -> Builder.Builder+mkNe env e1 e2 = build "(not (= {} {}))" (smt2 env e1, smt2 env e2) instance SMTLIB2 Command where- -- NIKI TODO: formalize this transformation- smt2 c@(Declare x ts t) = build "(declare-fun {} ({}) {})" (smt2 x, smt2many (smt2Sort c <$> ts), smt2Sort c t) -- HEREHEREHERE (smt2 x, smt2s ts, smt2 t)- smt2 c@(Define t) = build "(declare-sort {})" (Only $ smt2Sort c t)- smt2 (Assert Nothing p) = build "(assert {})" (Only $ smt2 p)- smt2 (Assert (Just i) p) = build "(assert (! {} :named p-{}))" (smt2 p, i)- smt2 (Distinct az)- -- Distinct must have at least 2 arguments- | length az < 2 = ""- | otherwise = build "(assert (distinct {}))" (Only $ smt2s az)- smt2 (AssertAxiom t) = build "(assert {})" (Only $ smt2 t)- smt2 (Push) = "(push 1)"- smt2 (Pop) = "(pop 1)"- smt2 (CheckSat) = "(check-sat)"- smt2 (GetValue xs) = "(get-value (" <> smt2s xs <> "))"- smt2 (CMany cmds) = smt2many (smt2 <$> cmds)+ smt2 env (DeclData d) = build "(declare-datatypes {})" (Only $ smt2data env d)+ smt2 env (Declare x ts t) = build "(declare-fun {} ({}) {})" (smt2 env x, smt2many (smt2 env <$> ts), smt2 env t)+ smt2 env c@(Define t) = build "(declare-sort {})" (Only $ smt2SortMono c env t)+ smt2 env (Assert Nothing p) = build "(assert {})" (Only $ smt2 env p)+ smt2 env (Assert (Just i) p) = build "(assert (! {} :named p-{}))" (smt2 env p, i)+ smt2 env (Distinct az)+ | length az < 2 = ""+ | otherwise = build "(assert (distinct {}))" (Only $ smt2s env az)+ smt2 env (AssertAx t) = build "(assert {})" (Only $ smt2 env t)+ smt2 _ (Push) = "(push 1)"+ smt2 _ (Pop) = "(pop 1)"+ smt2 _ (CheckSat) = "(check-sat)"+ smt2 env (GetValue xs) = "(get-value (" <> smt2s env xs <> "))"+ smt2 env (CMany cmds) = smt2many (smt2 env <$> cmds) instance SMTLIB2 (Triggered Expr) where- smt2 (TR NoTrigger e) = smt2 e - smt2 (TR _ (PExist [] p)) = smt2 p- smt2 t@(TR _ (PExist bs p)) = build "(exists ({}) (! {} :pattern({})))" (smt2s bs, smt2 p, smt2s $ makeTriggers t)- smt2 (TR _ (PAll [] p)) = smt2 p- smt2 t@(TR _ (PAll bs p)) = build "(forall ({}) (! {} :pattern({})))" (smt2s bs, smt2 p, smt2s $ makeTriggers t)- smt2 (TR _ e) = smt2 e--+ smt2 env (TR NoTrigger e) = smt2 env e+ smt2 env (TR _ (PExist [] p)) = smt2 env p+ smt2 env t@(TR _ (PExist bs p)) = build "(exists ({}) (! {} :pattern({})))" (smt2s env bs, smt2 env p, smt2s env (makeTriggers t))+ smt2 env (TR _ (PAll [] p)) = smt2 env p+ smt2 env t@(TR _ (PAll bs p)) = build "(forall ({}) (! {} :pattern({})))" (smt2s env bs, smt2 env p, smt2s env (makeTriggers t))+ smt2 env (TR _ e) = smt2 env e {-# INLINE smt2s #-}-smt2s :: SMTLIB2 a => [a] -> Builder.Builder-smt2s as = smt2many (map smt2 as)+smt2s :: SMTLIB2 a => SymEnv -> [a] -> Builder.Builder+smt2s env as = smt2many (smt2 env <$> as) -smt2many :: [Builder.Builder] -> Builder.Builder-smt2many [] = mempty-smt2many [b] = b-smt2many (b:bs) = b <> mconcat [ " " <> b | b <- bs ] {-# INLINE smt2many #-}+smt2many :: [Builder.Builder] -> Builder.Builder+smt2many = buildMany
src/Language/Fixpoint/Smt/Theories.hs view
@@ -9,7 +9,8 @@ -- * Convert theory applications TODO: merge with smt2symbol smt2App -- * Convert theory sorts- , smt2Sort+ , sortSmtSort+ -- * Convert theory symbols , smt2Symbol -- * Preamble to initialize SMT@@ -17,15 +18,11 @@ -- * Bit Vector Operations , sizeBv- , toInt+ -- , toInt -- * Theory Symbols , theorySymbols- , theorySEnv - -- * String- -- , string- -- , genLen -- * Theories , setEmpty, setEmp, setCap, setSub, setAdd, setMem@@ -33,8 +30,8 @@ -- * Query Theories , isSmt2App- , isConName , axiomLiterals+ , maxLamArg ) where import Prelude hiding (map)@@ -42,8 +39,8 @@ import Language.Fixpoint.Types.Config import Language.Fixpoint.Types import Language.Fixpoint.Smt.Types-import qualified Data.HashMap.Strict as M-import Data.Maybe (catMaybes, isJust)+-- import qualified Data.HashMap.Strict as M+import Data.Maybe (catMaybes) import Data.Monoid import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.Builder as Builder@@ -91,14 +88,7 @@ strLen = "strLen" strSubstr = "subString" strConcat = "concatString"--- NOPROP genLen :: Symbol--- NOPROP genLen = "len" --- NOPROP strlen, strsubstr, strconcat :: Raw--- NOPROP strlen = "strLen"--- NOPROP strsubstr = "subString"--- NOPROP strconcat = "concatString"- z3strlen, z3strsubstr, z3strconcat :: Raw z3strlen = "str.len" z3strsubstr = "str.substr"@@ -223,48 +213,71 @@ ----------------------------------------------------------------------------------- | Exported API ----------------------------------------------------------------------------------------------------------------------------------------------smt2Symbol :: Symbol -> Maybe Builder.Builder-smt2Symbol x = Builder.fromLazyText . tsRaw <$> M.lookup x theorySymbols+--------------------------------------------------------------------------------+-- | Exported API --------------------------------------------------------------+--------------------------------------------------------------------------------+smt2Symbol :: SymEnv -> Symbol -> Maybe Builder.Builder+smt2Symbol env x = Builder.fromLazyText . tsRaw <$> symEnvTheory x env -smt2Sort :: Sort -> Maybe Builder.Builder-smt2Sort (FApp (FTC c) _)- | isConName setConName c = Just $ build "{}" (Only set)-smt2Sort (FApp (FApp (FTC c) _) _)- | isConName mapConName c = Just $ build "{}" (Only map)-smt2Sort (FApp (FTC bv) (FTC s))- | isConName bitVecName bv- , Just n <- sizeBv s = Just $ build "(_ BitVec {})" (Only n)-smt2Sort s- | isString s = Just $ build "{}" (Only string)-smt2Sort _ = Nothing+instance SMTLIB2 SmtSort where+ smt2 _ = smt2SmtSort -smt2App :: Expr -> [Builder.Builder] -> Maybe Builder.Builder-smt2App (EVar f) [d]+smt2SmtSort :: SmtSort -> Builder.Builder+smt2SmtSort SInt = "Int"+smt2SmtSort SReal = "Real"+smt2SmtSort SBool = "Bool"+smt2SmtSort SString = build "{}" (Only string)+smt2SmtSort SSet = build "{}" (Only set)+smt2SmtSort SMap = build "{}" (Only map)+smt2SmtSort (SBitVec n) = build "(_ BitVec {})" (Only n)+smt2SmtSort (SVar n) = build "T{}" (Only n)+smt2SmtSort (SData c []) = symbolBuilder c+smt2SmtSort (SData c ts) = build "({} {})" (symbolBuilder c , smt2SmtSorts ts)+-- smt2SmtSort (SApp ts) = build "({} {})" (symbolBuilder tyAppName, smt2SmtSorts ts)++smt2SmtSorts :: [SmtSort] -> Builder.Builder+smt2SmtSorts = buildMany . fmap smt2SmtSort++--------------------------------------------------------------------------------+smt2App :: SymEnv -> Expr -> [Builder.Builder] -> Maybe Builder.Builder+--------------------------------------------------------------------------------+smt2App _ (EVar f) [d] | f == setEmpty = Just $ build "{}" (Only emp) | f == setEmp = Just $ build "(= {} {})" (emp, d) | f == setSng = Just $ build "({} {} {})" (add, emp, d)-smt2App (EVar f) (d:ds)- | Just s <- M.lookup f theorySymbols+smt2App env (EVar f) (d:ds)+ | Just s <- {- tracepp ("SYMENVTHEORY: " ++ showpp f) $ -} symEnvTheory f env = Just $ build "({} {})" (tsRaw s, d <> mconcat [ " " <> d | d <- ds])-smt2App _ _ = Nothing+smt2App _ _ _ = Nothing -- isSmt2App :: Expr -> [a] -> Bool -- isSmt2App e xs = tracepp ("isSmt2App e := " ++ show e) (isSmt2App' e xs) -isSmt2App :: Expr -> [a] -> Bool-isSmt2App (EVar f) [_]- | f == setEmpty = True- | f == setEmp = True- | f == setSng = True-isSmt2App (EVar f) _- = isJust $ M.lookup f theorySymbols-isSmt2App _ _- = False+--------------------------------------------------------------------------------+-- / isSmt2App :: SEnv TheorySymbol -> Expr -> [a] -> Bool+-- / --------------------------------------------------------------------------------+-- / isSmt2App _ (EVar f) [_]+ -- / | f == setEmpty = True+ -- / | f == setEmp = True+ -- / | f == setSng = True+-- / isSmt2App env (EVar f) _+ -- / = isJust (lookupSEnv f env)+-- / isSmt2App _ _ _+ -- / = False +--------------------------------------------------------------------------------+isSmt2App :: SEnv TheorySymbol -> Expr -> Maybe Int+--------------------------------------------------------------------------------+isSmt2App _ (EVar f)+ | f == setEmpty = Just 1+ | f == setEmp = Just 1+ | f == setSng = Just 1+isSmt2App g (EVar f) = do t <- tsSort <$> lookupSEnv f g+ ts <- snd <$> bkFFunc t+ Just (length ts - 1)+isSmt2App _ _ = Nothing + preamble :: Config -> SMTSolver -> [T.Text] preamble u Z3 = z3Preamble u preamble u Cvc4 = cvc4Preamble u@@ -278,16 +291,16 @@ -- where -- msg = "toInt e = " ++ show e ++ ", t = " ++ show s -toInt :: Expr -> Sort -> Expr-toInt e s+_toInt :: Expr -> Sort -> Expr+_toInt e s | (FApp (FTC c) _) <- s- , isConName setConName c+ , setConName == symbol c = castWith setToIntName e | (FApp (FApp (FTC c) _) _) <- s- , isConName mapConName c+ , mapConName == symbol c = castWith mapToIntName e | (FApp (FTC bv) (FTC s)) <- s- , isConName bitVecName bv+ , bitVecName == symbol bv , Just _ <- sizeBv s = castWith bitVecToIntName e | FTC c <- s@@ -307,18 +320,19 @@ -- to avoid duplicate SMT definitions. `uninterpSEnv` is for uninterpreted -- symbols, and `interpSEnv` is for interpreted symbols. ---------------------------------------------------------------------------------theorySEnv :: SEnv Sort-theorySEnv = fromListSEnv . M.toList . fmap tsSort $ theorySymbols+-- theorySEnv :: SEnv Sort+-- theorySEnv = fromListSEnv . M.toList . fmap tsSort $ theorySymbols -- | `theorySymbols` contains the list of ALL SMT symbols with interpretations, -- i.e. which are given via `define-fun` (as opposed to `declare-fun`)-theorySymbols :: M.HashMap Symbol TheorySymbol-theorySymbols = M.fromList $ uninterpSymbols ++ interpSymbols---- isTheorySymbol :: Symbol -> Bool--- isTheorySymbol x = M.member x theorySymbols+theorySymbols :: [DataDecl] -> SEnv TheorySymbol -- M.HashMap Symbol TheorySymbol+theorySymbols ds = fromListSEnv $ -- SHIFTLAM uninterpSymbols+ interpSymbols+ ++ concatMap dataDeclSymbols ds +-------------------------------------------------------------------------------- interpSymbols :: [(Symbol, TheorySymbol)]+-------------------------------------------------------------------------------- interpSymbols = [ interpSym setEmp emp (FAbs 0 $ FFunc (setSort $ FVar 0) boolSort) , interpSym setEmpty emp (FAbs 0 $ FFunc intSort (setSort $ FVar 0))@@ -352,66 +366,153 @@ interpSym :: Symbol -> Raw -> Sort -> (Symbol, TheorySymbol)-interpSym x n t = (x, Thy x n t True)--isConName :: Symbol -> FTycon -> Bool-isConName s = (s ==) . val . fTyconSymbol--sizeBv :: FTycon -> Maybe Int-sizeBv tc- | s == size32Name = Just 32- | s == size64Name = Just 64- | otherwise = Nothing- where- s = val $ fTyconSymbol tc--uninterpSymbols :: [(Symbol, TheorySymbol)]-uninterpSymbols = [ (x, uninterpSym x t) | (x, t) <- uninterpSymbols']+interpSym x n t = (x, Thy x n t Theory) -uninterpSym :: Symbol -> Sort -> TheorySymbol-uninterpSym x t = Thy x (lt x) t False- where- lt = T.fromStrict . symbolSafeText+-- SHIFTLAM _uninterpSymbols :: [(Symbol, TheorySymbol)]+-- SHIFTLAM _uninterpSymbols = [ (x, uninterpSym x t) | (x, t) <- _uninterpSymbols']+-- SHIFTLAM+-- SHIFTLAM --------------------------------------------------------------------------------+-- SHIFTLAM _uninterpSym :: Symbol -> Sort -> TheorySymbol+-- SHIFTLAM --------------------------------------------------------------------------------+-- SHIFTLAM _uninterpSym x t = Thy x (symbolRaw x) t Uninterp+-- SHIFTLAM+-- SHIFTLAM _uninterpSymbols' :: [(Symbol, Sort)]+-- SHIFTLAM _uninterpSymbols' = [] -- [ (toIntName, mkFFunc 1 [FVar 0, FInt]) ] -uninterpSymbols' :: [(Symbol, Sort)]-uninterpSymbols' =- [ (setToIntName, FFunc (setSort intSort) intSort)- , (bitVecToIntName, FFunc bitVecSort intSort)- , (mapToIntName, FFunc (mapSort intSort intSort) intSort)- , (realToIntName, FFunc realSort intSort)- , (lambdaName , FFunc intSort (FFunc intSort intSort))- ]- ++ concatMap makeApplies [1..maxLamArg]- ++ [(makeLamArg s i, s) | i <- [1..maxLamArg], s <- sorts]+ -- SHIFTLAM [ (setToIntName, FFunc (setSort intSort) intSort)+ -- SHIFTLAM , (bitVecToIntName, FFunc bitVecSort intSort)+ -- SHIFTLAM , (mapToIntName, FFunc (mapSort intSort intSort) intSort)+ -- SHIFTLAM , (realToIntName, FFunc realSort intSort)+ -- SHIFTLAM , (lambdaName , FFunc intSort (FFunc intSort intSort))+ -- SHIFTLAM ]+ -- SHIFTLAM ++ concatMap makeApplies [1..maxLamArg]+ -- SHIFTLAM ++ [(lamArgSymbol i, s) | i <- [1..maxLamArg], s <- sorts]+-- SHIFTLAM+-- SHIFTLAM -- THESE ARE DUPLICATED IN DEFUNCTIONALIZATION --- THESE ARE DUPLICATED IN DEFUNCTIONALIZATION maxLamArg :: Int maxLamArg = 7 -sorts :: [Sort]-sorts = [intSort]+-- SHIFTLAM sorts :: [Sort]+-- SHIFTLAM sorts = [intSort] -- NIKI TODO: allow non integer lambda arguments -- sorts = [setSort intSort, bitVecSort intSort, mapSort intSort intSort, boolSort, realSort, intSort]--makeLamArg :: Sort -> Int -> Symbol-makeLamArg _ = intArgName+-- makeLamArg :: Sort -> Int -> Symbol+-- makeLamArg _ = intArgName -makeApplies :: Int -> [(Symbol, Sort)]-makeApplies i =- [ (intApplyName i, go i intSort)- , (setApplyName i, go i (setSort intSort))- , (bitVecApplyName i, go i bitVecSort)- , (mapApplyName i, go i $ mapSort intSort intSort)- , (realApplyName i, go i realSort)- , (boolApplyName i, go i boolSort)- ]- where- go 0 s = FFunc intSort s- go i s = FFunc intSort $ go (i-1) s+-- SHIFTLAM makeApplies :: Int -> [(Symbol, Sort)]+-- SHIFTLAM makeApplies i =+ -- SHIFTLAM [ (intApplyName i, go i intSort)+ -- SHIFTLAM , (setApplyName i, go i (setSort intSort))+ -- SHIFTLAM , (bitVecApplyName i, go i bitVecSort)+ -- SHIFTLAM , (mapApplyName i, go i $ mapSort intSort intSort)+ -- SHIFTLAM , (realApplyName i, go i realSort)+ -- SHIFTLAM , (boolApplyName i, go i boolSort)+ -- SHIFTLAM ]+ -- SHIFTLAM where+ -- SHIFTLAM go 0 s = FFunc intSort s+ -- SHIFTLAM go i s = FFunc intSort $ go (i-1) s axiomLiterals :: [(Symbol, Sort)] -> [Expr] axiomLiterals lts = catMaybes [ lenAxiom l <$> litLen l | (l, t) <- lts, isString t ] where lenAxiom l n = EEq (EApp (expr (strLen :: Symbol)) (expr l)) (expr n `ECst` intSort) litLen = fmap (Data.Text.length . symbolText) . unLitSymbol++--------------------------------------------------------------------------------+-- | Constructors, Selectors and Tests from 'DataDecl'arations.+--------------------------------------------------------------------------------+dataDeclSymbols :: DataDecl -> [(Symbol, TheorySymbol)]+dataDeclSymbols d = {- tracepp "dataDeclSymbols" $ -} ctorSymbols d ++ testSymbols d ++ selectSymbols d++-- | 'selfSort d' returns the _self-sort_ of 'd' :: 'DataDecl'.+-- See [NOTE:DataDecl] for details.++selfSort :: DataDecl -> Sort+selfSort (DDecl c n _) = fAppTC c (FVar <$> [0..(n-1)])++-- | 'fldSort d t' returns the _real-sort_ of 'd' if 't' is the _self-sort_+-- and otherwise returns 't'. See [NOTE:DataDecl] for details.++fldSort :: DataDecl -> Sort -> Sort+fldSort d (FTC c)+ | c == ddTyCon d = selfSort d+fldSort _ s = s++-- | 'theorify' converts the 'Sort' into a full 'TheorySymbol'++theorify :: (Symbol, Sort) -> (Symbol, TheorySymbol)+theorify (x, t) = (x, Thy x (symbolRaw x) t Data)++--------------------------------------------------------------------------------+ctorSymbols :: DataDecl -> [(Symbol, TheorySymbol)]+--------------------------------------------------------------------------------+ctorSymbols d = ctorSort d <$> ddCtors d++ctorSort :: DataDecl -> DataCtor -> (Symbol, TheorySymbol)+ctorSort d ctor = (x, Thy x (symbolRaw x) t Data)+ where+ x = symbol ctor+ t = mkFFunc n (ts ++ [selfSort d])+ n = ddVars d+ ts = fldSort d . dfSort <$> dcFields ctor++--------------------------------------------------------------------------------+testSymbols :: DataDecl -> [(Symbol, TheorySymbol)]+--------------------------------------------------------------------------------+testSymbols d = testTheory t . symbol <$> ddCtors d+ where+ t = mkFFunc (ddVars d) [selfSort d, boolSort]++testTheory :: Sort -> Symbol -> (Symbol, TheorySymbol)+testTheory t x = (sx, Thy sx raw t Data)+ where+ sx = testSymbol x+ raw = "is-" <> symbolRaw x++symbolRaw :: Symbol -> T.Text+symbolRaw = T.fromStrict . symbolSafeText++--------------------------------------------------------------------------------+selectSymbols :: DataDecl -> [(Symbol, TheorySymbol)]+--------------------------------------------------------------------------------+selectSymbols d = theorify <$> concatMap (ctorSelectors d) (ddCtors d)++ctorSelectors :: DataDecl -> DataCtor -> [(Symbol, Sort)]+ctorSelectors d ctor = fieldSelector d <$> dcFields ctor++fieldSelector :: DataDecl -> DataField -> (Symbol, Sort)+fieldSelector d f = (symbol f, mkFFunc n [selfSort d, ft])+ where+ ft = fldSort d $ dfSort f+ n = ddVars d++{- | [NOTE:DataDecl] This note explains the set of symbols generated+ for the below data-declaration:++ data Vec 1 = [+ | nil { }+ | cons { vHead : @(0), vTail : Vec}+ ]++We call 'Vec' the _self-sort_ of the data-type, and we want to ensure that+in all constructors, tests and selectors, the _self-sort_ is replaced with+the actual sort, namely, 'Vec @(0)'.++Constructors // ctor : (fld-sorts) => me++ nil : func(1, [Vec @(0)])+ cons : func(1, [@(0); Vec @(0); Vec @(0)])++Tests // is#ctor : (me) => bool++ is#nil : func(1, [Vec @(0); bool])+ is#cons : func(1, [Vec @(0); bool])++Selectors // fld : (me) => fld-sort++ vHead : func(1, [Vec @(0); @(0)])+ vTail : func(1, [Vec @(0); Vec @(0)])++-}
src/Language/Fixpoint/Smt/Types.hs view
@@ -9,11 +9,10 @@ module Language.Fixpoint.Smt.Types ( -- * Serialized Representation- Raw- , symbolBuilder+ -- symbolBuilder -- * Commands- , Command (..)+ Command (..) -- * Responses , Response (..)@@ -25,40 +24,37 @@ -- * SMTLIB2 Process Context , Context (..) - -- * Theory Symbol- , TheorySymbol (..)- , SMTEnv ) where import Language.Fixpoint.Types--- import Language.Fixpoint.Misc (traceShow) import qualified Data.Text as T-import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.Builder as LT-import Text.PrettyPrint.HughesPJ +import Text.PrettyPrint.HughesPJ import System.IO (Handle) import System.Process+-- import Language.Fixpoint.Misc (traceShow) -------------------------------------------------------------------------------- -- | Types --------------------------------------------------------------------- ---------------------------------------------------------------------------------type Raw = LT.Text -symbolBuilder :: Symbol -> LT.Builder-symbolBuilder = LT.fromText . symbolSafeText+-- symbolBuilder :: Symbol -> LT.Builder+-- symbolBuilder = LT.fromText . symbolSafeText -- | Commands issued to SMT engine data Command = Push | Pop | CheckSat- | Declare !Symbol [Sort] !Sort- | Define !Sort- | Assert !(Maybe Int) !Expr- | AssertAxiom !(Triggered Expr)- | Distinct [Expr] -- {v:[Expr] | 2 <= len v}- | GetValue [Symbol]- | CMany [Command]+ | DeclData !DataDecl+-- / | Declare !Symbol [Sort] !Sort+ | Declare !Symbol [SmtSort] !SmtSort+ | Define !Sort+ | Assert !(Maybe Int) !Expr+ | AssertAx !(Triggered Expr)+ | Distinct [Expr] -- {v:[Expr] | 2 <= len v}+ | GetValue [Symbol]+ | CMany [Command] deriving (Eq, Show) instance PPrint Command where@@ -68,10 +64,11 @@ ppCmd Push = text "Push" ppCmd Pop = text "Pop" ppCmd CheckSat = text "CheckSat"+ppCmd (DeclData d) = text "Data" <+> pprint d ppCmd (Declare {}) = text "Declare ..." ppCmd (Define {}) = text "Define ..." ppCmd (Assert _ e) = text "Assert" <+> pprint e-ppCmd (AssertAxiom _) = text "AssertAxiom ..."+ppCmd (AssertAx _) = text "AssertAxiom ..." ppCmd (Distinct {}) = text "Distinct ..." ppCmd (GetValue {}) = text "GetValue ..." ppCmd (CMany {}) = text "CMany ..."@@ -96,26 +93,15 @@ , ctxAeq :: !Bool -- ^ flag to enable lambda a-equivalence axioms , ctxBeq :: !Bool -- ^ flag to enable lambda b-equivalence axioms , ctxNorm :: !Bool -- ^ flag to enable lambda normal form equivalence axioms- , ctxSmtEnv :: !SMTEnv+ , ctxSymEnv :: !SymEnv } -type SMTEnv = SEnv Sort---- | Theory Symbol-data TheorySymbol = Thy- { tsSym :: !Symbol -- ^ name- , tsRaw :: !Raw -- ^ serialized SMTLIB2 name- , tsSort :: !Sort -- ^ sort- , tsInterp :: !Bool -- ^ TRUE = defined (interpreted), FALSE = declared (uninterpreted)- }- deriving (Eq, Ord, Show)- -------------------------------------------------------------------------------- -- | AST Conversion: Types that can be serialized ------------------------------ -------------------------------------------------------------------------------- class SMTLIB2 a where- smt2 :: a -> LT.Builder+ smt2 :: SymEnv -> a -> LT.Builder -runSmt2 :: (SMTLIB2 a) => a -> LT.Builder+runSmt2 :: (SMTLIB2 a) => SymEnv -> a -> LT.Builder runSmt2 = smt2
src/Language/Fixpoint/Solver.hs view
@@ -40,8 +40,7 @@ import Language.Fixpoint.Parse (rr') import Language.Fixpoint.Types import Language.Fixpoint.Minimize (minQuery, minQuals, minKvars)-import Language.Fixpoint.Solver.Instantiate (instantiateFInfo)-import Language.Fixpoint.Smt.Interface (makeSmtContext, smtPush)+import Language.Fixpoint.Solver.Instantiate (instantiate) import Control.DeepSeq ---------------------------------------------------------------------------@@ -49,7 +48,15 @@ --------------------------------------------------------------------------- solveFQ :: Config -> IO ExitCode ----------------------------------------------------------------------------solveFQ cfg = do+solveFQ cfg = solveFQ' cfg `catch` errorExit++errorExit :: Error -> IO ExitCode+errorExit e = do+ colorStrLn Sad ("Oops, unexpected error: " ++ showpp e)+ return (ExitFailure 2)++solveFQ' :: Config -> IO ExitCode+solveFQ' cfg = do (fi, opts) <- readFInfo file cfg' <- withPragmas cfg opts let fi' = ignoreQualifiers cfg' fi@@ -73,7 +80,7 @@ -------------------------------------------------------------------------------- -- | Solve FInfo system of horn-clause constraints ----------------------------- ---------------------------------------------------------------------------------solve :: (NFData a, Fixpoint a) => Solver a+solve :: (NFData a, Fixpoint a, Show a, Loc a) => Solver a -------------------------------------------------------------------------------- solve cfg q | parts cfg = partition cfg $!! q@@ -83,12 +90,12 @@ | minimizeKs cfg = minKvars cfg solve' $!! q | otherwise = solve' cfg $!! q -solve' :: (NFData a, Fixpoint a) => Solver a+solve' :: (NFData a, Fixpoint a, Show a, Loc a) => Solver a solve' cfg q = do when (save cfg) $ saveQuery cfg q configSW cfg solveNative cfg q -configSW :: (NFData a, Fixpoint a) => Config -> Solver a -> Solver a+configSW :: (NFData a, Fixpoint a, Show a, Loc a) => Config -> Solver a -> Solver a configSW cfg | multicore cfg = solveParWith | otherwise = solveSeqWith@@ -151,7 +158,7 @@ -------------------------------------------------------------------------------- -- | Native Haskell Solver ----------------------------------------------------- ---------------------------------------------------------------------------------solveNative, solveNative' :: (NFData a, Fixpoint a) => Solver a+solveNative, solveNative' :: (NFData a, Fixpoint a, Show a, Loc a) => Solver a -------------------------------------------------------------------------------- solveNative !cfg !fi0 = (solveNative' cfg fi0) `catch`@@ -172,15 +179,12 @@ -- rnf fi0 `seq` donePhase Loud "Read Constraints" -- let qs = quals fi0 -- whenLoud $ print qs- -- TODO: make this less of a hack- ctx <- makeSmtContext cfg (srcFile cfg ++ ".evals") []- smtPush ctx- fi1 <- instantiateFInfo cfg ctx $ fi0 { quals = remakeQual <$> quals fi0 } -- whenLoud $ putStrLn $ showFix (quals fi1)+ let fi1 = fi0 { quals = remakeQual <$> quals fi0 } let si0 = {-# SCC "convertFormat" #-} convertFormat fi1 -- writeLoud $ "fq file after format convert: \n" ++ render (toFixpoint cfg si0) -- rnf si0 `seq` donePhase Loud "Format Conversion"- let si1 = either die id $ {-# SCC "sanitize" #-} sanitize $!! si0+ let si1 = either die id $ {-# SCC "sanitize" #-} sanitize $!! si0 -- writeLoud $ "fq file after sanitize: \n" ++ render (toFixpoint cfg si1) -- rnf si1 `seq` donePhase Loud "Validated Constraints" graphStatistics cfg si1@@ -193,7 +197,8 @@ loudDump 2 cfg si4 let si5 = {-# SCC "elaborate" #-} elaborate "solver" (symbolEnv cfg si4) si4 loudDump 3 cfg si5- res <- {-# SCC "Sol.solve" #-} Sol.solve cfg $!! si5+ si6 <- {-# SCC "Sol.inst" #-} instantiate cfg $!! si5+ res <- {-# SCC "Sol.solve" #-} Sol.solve cfg $!! si6 -- rnf soln `seq` donePhase Loud "Solve2" --let stat = resStatus res saveSolution cfg res
src/Language/Fixpoint/Solver/GradualSolution.hs view
@@ -4,56 +4,39 @@ module Language.Fixpoint.Solver.GradualSolution ( -- * Create Initial Solution init-- -- * Update Solution- , Sol.update-- -- * Lookup Solution- , lhsPred ) where import Control.Parallel.Strategies-import Control.Arrow (second)-import qualified Data.HashSet as S import qualified Data.HashMap.Strict as M import qualified Data.List as L-import Data.Maybe (fromMaybe, maybeToList, isNothing, catMaybes)+import Data.Maybe (maybeToList, isNothing) import Data.Monoid ((<>)) import Language.Fixpoint.Types.PrettyPrint ()-import Language.Fixpoint.Types.Visitor as V import qualified Language.Fixpoint.SortCheck as So import Language.Fixpoint.Misc-import qualified Language.Fixpoint.Smt.Theories as Thy-import Language.Fixpoint.Types.Config import qualified Language.Fixpoint.Types as F-import Language.Fixpoint.Types ((&.&)) import qualified Language.Fixpoint.Types.Solutions as Sol import Language.Fixpoint.Types.Constraints hiding (ws, bs) import Prelude hiding (init, lookup)-import Language.Fixpoint.Solver.Sanitize -------------------------------------------------------------------------------- -- | Initial Gradual Solution (from Qualifiers and WF constraints) ------------- ---------------------------------------------------------------------------------init :: Config -> F.SInfo a -> S.HashSet F.KVar -> Sol.GSolution+init :: (F.Fixpoint a) => F.SInfo a -> [(F.KVar, (F.GWInfo, [F.Expr]))] ---------------------------------------------------------------------------------init cfg si ks = Sol.fromList senv geqs keqs [] mempty+init si = map (refineG si qs genv) gs `using` parList rdeepseq where- keqs = map (refine si qs genv) ws `using` parList rdeepseq- geqs = map (refineG si qs genv) gs `using` parList rdeepseq qs = F.quals si- ws = [ w | (k, w) <- ws0, k `S.member` ks] gs = snd <$> gs0 genv = instConstants si- senv = symbolEnv cfg si - (gs0,ws0) = L.partition (isGWfc . snd) $ M.toList (F.ws si)+ gs0 = L.filter (isGWfc . snd) $ M.toList (F.ws si) ---------------------------------------------------------------------------------refineG :: F.SInfo a -> [F.Qualifier] -> F.SEnv F.Sort -> F.WfC a -> (F.KVar, (((F.Symbol,F.Sort), F.Expr), Sol.GBind))-refineG fi qs genv w = (k, (((fst3 $ wrft w, snd3 $ wrft w), wexpr w), Sol.qbToGb qb))+refineG :: F.SInfo a -> [F.Qualifier] -> F.SEnv F.Sort -> F.WfC a -> (F.KVar, (F.GWInfo, [F.Expr]))+refineG fi qs genv w = (k, (F.gwInfo w, Sol.qbExprs qb)) where (k, qb) = refine fi qs genv w @@ -135,286 +118,4 @@ p = Sol.eqPred eq tc = So.checkSorted env sr ------------------------------------------------------------------------------------- | Predicate corresponding to LHS of constraint in current solution----------------------------------------------------------------------------------lhsPred :: F.SolEnv -> Sol.GSolution -> F.SimpC a -> [([(F.KVar, Sol.QBind)], F.Expr)]-lhsPred be s c = gSelectToList (fst <$> applyGradual g s bs)- where- g = (ci, be, bs)- bs = F.senv c- ci = sid c--type Cid = Maybe Integer-type CombinedEnv = (Cid, F.SolEnv, F.IBindEnv)-type ExprInfo = (F.Expr, KInfo)--applyGradual :: CombinedEnv -> Sol.GSolution -> F.IBindEnv -> GSelect ExprInfo-applyGradual g s bs = mappendGSelect mappendExprInfo pks (applyKVarsGrad g s ks)- where- pgs = allCombinations $ applyGVars g s gs- pks = if null gs - then GNone (F.pAnd ps, mempty) - else GOpt [(fst (unzip l) , (F.pAnd (ps++snd (unzip l)), mempty)) | l <- pgs ]- (ps, ks, gs) = envConcKVars g bs-- mappendExprInfo (e1, i1) (e2, i2) = (F.pAnd [e1, e2], mappend i1 i2)---envConcKVars :: CombinedEnv -> F.IBindEnv -> ([F.Expr], [F.KVSub], [F.KVSub])-envConcKVars g bs = (concat pss, concat kss, L.nubBy (\x y -> F.ksuKVar x == F.ksuKVar y) $ concat gss)- where- (pss, kss, gss) = unzip3 [ F.sortedReftConcKVars x sr | (x, sr) <- xrs ]- xrs = (\i -> F.lookupBindEnv i be) <$> is- is = F.elemsIBindEnv bs- be = F.soeBinds (snd3 g)--applyGVars :: CombinedEnv -> Sol.GSolution -> [F.KVSub] -> [[((F.KVar, Sol.QBind), F.Expr)]]-applyGVars g s = map (applyGVar g s)---applyGVar :: CombinedEnv -> Sol.GSolution -> F.KVSub -> [((F.KVar, Sol.QBind), F.Expr)]-applyGVar g s ksu = case Sol.glookup s (F.ksuKVar ksu) of- Right (Right (e,eqss)) -> [((F.ksuKVar ksu, eqs), F.pAnd ((F.subst su (snd e)):(fst <$> Sol.qbPreds msg s su eqs))) | eqs <- Sol.gbToQbs eqss]- _ -> []- where- msg = "applyGVar: " ++ show (fst3 g)- su = F.ksuSubst ksu--applyKVarsGrad :: CombinedEnv -> Sol.GSolution -> [F.KVSub] -> GSelect ExprInfo-applyKVarsGrad g s xs = (f <$> (collapseGSelect $ map (applyKVarGrad g s) xs))- where- f xs = let (es, is) = unzip xs in (F.pAnd es, mconcat is)--applyKVarGrad :: CombinedEnv -> Sol.GSolution -> F.KVSub -> GSelect ExprInfo-applyKVarGrad g s ksu = case Sol.glookup s (F.ksuKVar ksu) of- Left cs -> hypPredGrad g s ksu cs- Right (Left eqs) -> GNone (F.pAnd $ fst <$> Sol.qbPreds msg s (F.ksuSubst ksu) eqs, mempty)- Right (Right (e,eqss)) -> GOpt [([(F.ksuKVar ksu, eqs)]- , (, mempty) $ F.pAnd ((F.subst su (snd e)):(fst <$> Sol.qbPreds msg s su eqs))) - | eqs <- Sol.gbToQbs eqss]- where- msg = "applyKVar: " ++ show (fst3 g) - su = F.ksuSubst ksu---hypPredGrad :: CombinedEnv -> Sol.GSolution -> F.KVSub -> Sol.Hyp -> GSelect ExprInfo-hypPredGrad g s ksu xs = f <$> (collapseGSelect $ map (cubePredGrad g s ksu) xs)- where- f xs = let (es, is) = unzip xs in (F.pOr es, mconcatPlus is)---{- | `cubePred g s k su c` returns the predicate for-- (k . su)-- defined by using cube-- c := [b1,...,bn] |- (k . su')-- in the binder environment `g`.-- bs' := the subset of "extra" binders in [b1...bn] that are *not* in `g`- p' := the predicate corresponding to the "extra" binders-- -}--elabExist :: Sol.Sol a Sol.QBind -> [(F.Symbol, F.Sort)] -> F.Expr -> F.Expr-elabExist s xts = F.pExist xts'- where- xts' = [ (x, elab t) | (x, t) <- xts]- elab = So.elaborate "elabExist" env- env = Sol.sEnv s---cubePredGrad :: CombinedEnv -> Sol.GSolution -> F.KVSub -> Sol.Cube -> GSelect ExprInfo-cubePredGrad g s ksu c = ((\((xts,psu,p), kI) -> (elabExist s xts (psu &.& p) , kI)) <$> cubePredExcGrad g s ksu c bs')- where- bs' = delCEnv s k bs- bs = Sol.cuBinds c- k = F.ksuKVar ksu---type Binders = [(F.Symbol, F.Sort)]---- | @cubePredExc@ computes the predicate for the subset of binders bs'.--- The output is a tuple, `(xts, psu, p, kI)` such that the actual predicate--- we want is `Exists xts. (psu /\ p)`.---cubePredExcGrad :: CombinedEnv -> Sol.GSolution -> F.KVSub -> Sol.Cube -> F.IBindEnv- -> GSelect ((Binders, F.Pred, F.Pred), KInfo)-cubePredExcGrad g s ksu c bs' - = f <$> (applyGradual g' s bs')- where- f (p', kI) = ((xts, psu, elabExist s yts' (p' &.& psu') ), extendKInfo kI (Sol.cuTag c))- yts' = symSorts g bs'- g' = addCEnv g bs- - (_ , psu') = substElim sEnv g' k su'- (xts, psu) = substElim sEnv g k su- su' = Sol.cuSubst c- bs = Sol.cuBinds c- k = F.ksuKVar ksu- su = F.ksuSubst ksu- sEnv = F.insertSEnv (F.ksuVV ksu) (F.ksuSort ksu) (Sol.sEnv s)----- TODO: SUPER SLOW! Decorate all substitutions with Sorts in a SINGLE pass.--{- | @substElim@ returns the binders that must be existentially quantified,- and the equality predicate relating the kvar-"parameters" and their- actual values. i.e. given-- K[x1 := e1]...[xn := en]-- where e1 ... en have types t1 ... tn- we want to quantify out-- x1:t1 ... xn:tn-- and generate the equality predicate && [x1 ~~ e1, ... , xn ~~ en]- we use ~~ because the param and value may have different sorts, see:-- tests/pos/kvar-param-poly-00.hs-- Finally, we filter out binders if they are-- 1. "free" in e1...en i.e. in the outer environment.- (Hmm, that shouldn't happen...?)-- 2. are binders corresponding to sorts (e.g. `a : num`, currently used- to hack typeclasses current.)- -}-substElim :: F.SEnv F.Sort -> CombinedEnv -> F.KVar -> F.Subst -> ([(F.Symbol, F.Sort)], F.Pred)-substElim sEnv g _ (F.Su m) = (xts, p)- where- p = F.pAnd [ mkSubst x (substSort sEnv frees x t) e t | (x, e, t) <- xets ]- xts = [ (x, t) | (x, _, t) <- xets, not (S.member x frees) ]- xets = [ (x, e, t) | (x, e) <- xes, t <- sortOf e, not (isClass t)]- xes = M.toList m- env = combinedSEnv g- frees = S.fromList (concatMap (F.syms . snd) xes)- sortOf = maybeToList . So.checkSortExpr env--substSort :: F.SEnv F.Sort -> S.HashSet F.Symbol -> F.Symbol -> F.Sort -> F.Sort-substSort sEnv _frees x _t = fromMaybe (err x) $ F.lookupSEnv x sEnv- where- err x = error $ "Solution.mkSubst: unknown binder " ++ F.showpp x--mkSubst :: F.Symbol -> F.Sort -> F.Expr -> F.Sort -> F.Expr-mkSubst x tx ey ty- | tx == ty = F.EEq ex ey- | otherwise = F.notracepp msg (F.EEq ex' ey')- where- msg = "mkSubst-DIFF:" ++ F.showpp (tx, ty) ++ F.showpp (ex', ey')- ex = F.expr x- ex' = Thy.toInt ex tx- ey' = Thy.toInt ey ty--isClass :: F.Sort -> Bool-isClass F.FNum = True-isClass F.FFrac = True-isClass _ = False----badExpr :: CombinedEnv -> F.KVar -> F.Expr -> a---badExpr g@(i,_,_) k e- -- = errorstar $ "substSorts has a badExpr: "- -- ++ show e- -- ++ " in cid = "- -- ++ show i- -- ++ " for kvar " ++ show k- -- ++ " in env \n"- -- ++ show (combinedSEnv g)---- substPred :: F.Subst -> F.Pred--- substPred (F.Su m) = F.pAnd [ F.PAtom F.Eq (F.eVar x) e | (x, e) <- M.toList m]--combinedSEnv :: CombinedEnv -> F.SEnv F.Sort-combinedSEnv (_, se, bs) = F.sr_sort <$> F.fromListSEnv (F.envCs be bs)- where- be = F.soeBinds se--addCEnv :: CombinedEnv -> F.IBindEnv -> CombinedEnv-addCEnv (x, be, bs) bs' = (x, be, F.unionIBindEnv bs bs')---- delCEnv :: F.IBindEnv -> CombinedEnv -> F.IBindEnv--- delCEnv bs (_, _, bs') = F.diffIBindEnv bs bs'--delCEnv :: Sol.Sol a Sol.QBind -> F.KVar -> F.IBindEnv -> F.IBindEnv-delCEnv s k bs = F.diffIBindEnv bs _kbs- -- ORIG: bs'- where- _kbs = safeLookup "delCEnv" k (Sol.sScp s)--symSorts :: CombinedEnv -> F.IBindEnv -> [(F.Symbol, F.Sort)]-symSorts (_, se, _) bs = second F.sr_sort <$> F.envCs be bs- where- be = F.soeBinds se--_noKvars :: F.Expr -> Bool-_noKvars = null . V.kvars------------------------------------------------------------------------------------- | Information about size of formula corresponding to an "eliminated" KVar.----------------------------------------------------------------------------------data KInfo = KI { kiTags :: [Tag]- , kiDepth :: !Int- , kiCubes :: !Integer- } deriving (Eq, Ord, Show)--instance Monoid KInfo where- mempty = KI [] 0 1- mappend ki ki' = KI ts d s- where- ts = appendTags (kiTags ki) (kiTags ki')- d = max (kiDepth ki) (kiDepth ki')- s = (*) (kiCubes ki) (kiCubes ki')--mplus :: KInfo -> KInfo -> KInfo-mplus ki ki' = (mappend ki ki') { kiCubes = kiCubes ki + kiCubes ki'}--mconcatPlus :: [KInfo] -> KInfo-mconcatPlus = foldr mplus mempty--appendTags :: [Tag] -> [Tag] -> [Tag]-appendTags ts ts' = sortNub (ts ++ ts')--extendKInfo :: KInfo -> F.Tag -> KInfo-extendKInfo ki t = ki { kiTags = appendTags [t] (kiTags ki)- , kiDepth = 1 + kiDepth ki }-------------------------------------------------------------------------------------- | Gradual Selection Interface ---------------------------------------------------------------------------------------------------------------------------------data GSelect a = GNone a | GOpt [([(F.KVar, Sol.QBind)], a)] deriving (Show)---gSelectToList :: GSelect a -> [([(F.KVar, Sol.QBind)], a)]-gSelectToList (GNone a) = [([], a)]-gSelectToList (GOpt xs) = xs ---instance Functor GSelect where- fmap f (GNone a) = GNone (f a)- fmap f (GOpt xs) = GOpt [(p, f a) | (p, a) <- xs]--mappendGSelect :: (a -> a -> b) -> GSelect a -> GSelect a -> GSelect b -mappendGSelect f (GNone x) (GNone y) = GNone (f x y)-mappendGSelect f (GNone x) (GOpt ys) = GOpt [(i, f x y) | (i, y) <- ys] -mappendGSelect f (GOpt xs) (GNone y) = GOpt [(i, f x y) | (i, x) <- xs]-mappendGSelect f (GOpt xs) (GOpt ys) = GOpt $ concatMap (\y -> (catMaybes $ map (\x -> g x y) xs)) ys - where- g (xs, x) (ys, y)- | null [ () | (k1, _) <- xs, (k2, _) <- ys, k1 == k2 ] - = Just (xs ++ ys, f x y)- | and [v1 == v2 | (k1, v1) <- xs, (k2, v2) <- ys, k1 == k2 ] - = Just (xs ++ [(k, v) | (k, v) <- ys, not (k `elem` (fst <$> xs))], f x y)- | otherwise- = Nothing --collapseGSelect :: [GSelect a] -> GSelect [a]-collapseGSelect = foldl (mappendGSelect (\x y -> (x ++ y))) (GNone []) . fmap (fmap (:[]))
− src/Language/Fixpoint/Solver/GradualSolve.hs
@@ -1,319 +0,0 @@-{-# LANGUAGE PatternGuards #-}-{-# LANGUAGE TupleSections #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE OverloadedStrings #-}------------------------------------------------------------------------------------- | Solve a system of horn-clause constraints --------------------------------------------------------------------------------------------------------------------module Language.Fixpoint.Solver.GradualSolve (solveGradual) where--import Control.Monad (when, filterM, foldM)-import Control.Monad.State.Strict (lift)-import Language.Fixpoint.Misc-import qualified Language.Fixpoint.Types as F-import qualified Language.Fixpoint.Types.Solutions as Sol-import qualified Language.Fixpoint.SortCheck as So-import Language.Fixpoint.Types.PrettyPrint-import Language.Fixpoint.Types.Config hiding (stats)-import qualified Language.Fixpoint.Solver.GradualSolution as S-import qualified Language.Fixpoint.Solver.Worklist as W-import qualified Language.Fixpoint.Solver.Eliminate as E-import Language.Fixpoint.Solver.Monad-import Language.Fixpoint.Utils.Progress-import Language.Fixpoint.Graph-import Text.PrettyPrint.HughesPJ-import Text.Printf-import System.Console.CmdArgs.Verbosity (whenNormal, whenLoud)-import Control.DeepSeq-import qualified Data.HashMap.Strict as M-import qualified Data.HashSet as S------------------------------------------------------------------------------------- | Progress Bar----------------------------------------------------------------------------------withProgressFI :: SolverInfo a b -> IO b -> IO b-withProgressFI = withProgress . fromIntegral . cNumScc . siDeps-----------------------------------------------------------------------------------printStats :: F.SInfo a -> W.Worklist a -> Stats -> IO ()-printStats fi w s = putStrLn "\n" >> ppTs [ ptable fi, ptable s, ptable w ]- where- ppTs = putStrLn . showpp . mconcat-----------------------------------------------------------------------------------solverInfo :: Config -> F.SInfo a -> SolverInfo a b----------------------------------------------------------------------------------solverInfo cfg fI- | useElim cfg = E.solverInfo cfg fI- | otherwise = SI mempty fI cD (siKvars fI)- where- cD = elimDeps fI (kvEdges fI) mempty--siKvars :: F.SInfo a -> S.HashSet F.KVar-siKvars = S.fromList . M.keys . F.ws-------------------------------------------------------------------------------------- | tidyResult ensures we replace the temporary kVarArg names introduced to--- ensure uniqueness with the original names in the given WF constraints.----------------------------------------------------------------------------------tidyResult :: F.Result a -> F.Result a-tidyResult r = r { F.resSolution = tidySolution (F.resSolution r)- , F.gresSolution = gtidySolution (F.gresSolution r) - }--tidySolution :: F.FixSolution -> F.FixSolution-tidySolution = fmap tidyPred--gtidySolution :: F.GFixSolution -> F.GFixSolution-gtidySolution = fmap tidyPred -- (\(e, es) -> (tidyPred e, tidyPred <$> es))--tidyPred :: F.Expr -> F.Expr-tidyPred = F.substf (F.eVar . F.tidySymbol)---predKs :: F.Expr -> [(F.KVar, F.Subst)]-predKs (F.PAnd ps) = concatMap predKs ps-predKs (F.PKVar k su) = [(k, su)]-predKs _ = []-------------------------------------------------------------------------------------minimizeResult :: Config -> M.HashMap F.KVar F.Expr- -> SolveM (M.HashMap F.KVar F.Expr)----------------------------------------------------------------------------------minimizeResult cfg s- | minimalSol cfg = mapM minimizeConjuncts s- | otherwise = return s--minimizeConjuncts :: F.Expr -> SolveM F.Expr-minimizeConjuncts p = F.pAnd <$> go (F.conjuncts p) []- where- go [] acc = return acc- go (p:ps) acc = do b <- isValid (F.pAnd (acc ++ ps)) p- if b then go ps acc- else go ps (p:acc)----showUnsat :: Bool -> Integer -> F.Pred -> F.Pred -> IO ()-showUnsat u i lP rP = {- when u $ -} do- putStrLn $ printf "UNSAT id %s %s" (show i) (show u)- putStrLn $ showpp $ "LHS:" <+> pprint lP- putStrLn $ showpp $ "RHS:" <+> pprint rP------------------------------------------------------------------------------------- | Predicate corresponding to RHS of constraint in current solution----------------------------------------------------------------------------------rhsPred :: F.SimpC a -> F.Expr----------------------------------------------------------------------------------rhsPred c- | isTarget c = F.crhs c- | otherwise = errorstar $ "rhsPred on non-target: " ++ show (F.sid c)--isValid :: F.Expr -> F.Expr -> SolveM Bool-isValid p q = (not . null) <$> filterValid p [(q, ())]------------------------------------------------------------------------------------- | solve with edits to allow Gradual types --------------------------------------------------------------------------------------------------------------------solveGradual :: (NFData a, F.Fixpoint a) => Config -> F.SInfo a -> IO (F.Result (Integer, a))--solveGradual cfg fi = do- (res, stat) <- withProgressFI sI $ runSolverM cfg sI n act- when (solverStats cfg) $ printStats fi wkl stat- return res- where- act = solveGradual_ cfg fi s0 ks wkl- sI = solverInfo cfg fi- wkl = W.init sI- n = fromIntegral $ W.wRanks wkl- s0 = siSol sI- ks = siVars sI-----------------------------------------------------------------------------------solveGradual_ :: (NFData a, F.Fixpoint a)- => Config- -> F.SInfo a- -> Sol.GSolution - -> S.HashSet F.KVar- -> W.Worklist a- -> SolveM (F.Result (Integer, a), Stats)----------------------------------------------------------------------------------solveGradual_ cfg fi s0 ks wkl = do- let s1 = mappend s0 $ {-# SCC "sol-init" #-} S.init cfg fi ks- s2 <- {-# SCC "sol-local" #-} filterLocal s1- s <- {-# SCC "sol-refine" #-} refine s2 wkl- res <- {-# SCC "sol-result" #-} result cfg wkl s- st <- stats- let res' = {-# SCC "sol-tidy" #-} tidyResult res- return $!! (res', st)--filterLocal :: Sol.GSolution -> SolveM Sol.GSolution -filterLocal sol = do - gs' <- mapM (initGBind sol) gs - return $ Sol.updateGMap sol $ M.fromList gs'- where - gs = M.toList $ Sol.gMap sol --initGBind :: Sol.GSolution -> (F.KVar, (((F.Symbol, F.Sort), F.Expr), Sol.GBind)) -> SolveM (F.KVar, (((F.Symbol, F.Sort), F.Expr), Sol.GBind))-initGBind sol (k, (e, gb)) = do - elems0 <- filterM (isLocal e) (Sol.gbEquals gb)- elems <- sortEquals elems0 - lattice <- makeLattice [] (map (:[]) elems) elems- return $ ((k,) . (e,) . Sol.equalsGb) lattice- where- makeLattice acc new elems- | null new- = return acc - | otherwise- = do let cands = [e:es |e<-elems, es<-new]- localCans <- filterM (isLocal e) cands- newElems <- filterM (notTrivial (new ++ acc)) localCans - makeLattice (acc ++ new) newElems elems-- notTrivial [] _ = return True - notTrivial (x:xs) p = do v <- isValid (mkPred x) (mkPred p)- if v then return False - else notTrivial xs p -- mkPred eq = So.elaborate "initBGind.mkPred" (Sol.sEnv sol) (F.pAnd (Sol.eqPred <$> eq))- isLocal (v, e) eqs = do - let pp = So.elaborate "filterLocal" (Sol.sEnv sol) $ F.PExist [v] $ F.pAnd (e:(Sol.eqPred <$> eqs)) - isValid mempty pp-- root = Sol.trueEqual- sortEquals xs = (bfs [0]) <$> makeEdges vs [] vs - where - vs = zip [0..] (root:(head <$> xs))-- bfs [] _ = [] - bfs (i:is) es = (snd $ (vs!!i)) : bfs (is++map snd (filter (\(j,k) -> (j==i && notElem k is)) es)) es-- makeEdges _ acc [] = return acc- makeEdges vs acc (x:xs) = do ves <- concat <$> mapM (makeEdgesOne x) vs- if any (\(i,j) -> elem (j,i) acc) ves - then makeEdges (filter ((/= fst x) . fst) vs) (filter (\(i,j) -> ((i /= fst x) && (j /= fst x))) acc) xs - else makeEdges vs (mergeEdges (ves ++ acc)) xs -- makeEdgesOne (i,_) (j,_) | i == j = return [] - makeEdgesOne (i,x) (j,y) = do - ij <- isValid (mkPred [x]) (mkPred [y])- return (if ij then [(j,i)] else [])-- mergeEdges es = filter (\(i,j) -> (not (any (\k -> ((i,k) `elem` es && (k,j) `elem` es)) (fst <$> es)))) es------------------------------------------------------------------------------------refine :: Sol.GSolution -> W.Worklist a -> SolveM Sol.GSolution----------------------------------------------------------------------------------refine s w- | Just (c, w', newScc, rnk) <- W.pop w = do- i <- tickIter newScc- (b, s') <- refineC i s c- lift $ writeLoud $ refineMsg i c b rnk- let w'' = if b then W.push c w' else w'- refine s' w''- | otherwise = return s- where- -- DEBUG- refineMsg i c b rnk = printf "\niter=%d id=%d change=%s rank=%d\n"- i (F.subcId c) (show b) rnk-------------------------------------------------------------------------------- | Single Step Refinement ----------------------------------------------------------------------------------------------------------------------------refineC :: Int -> Sol.GSolution -> F.SimpC a -> SolveM (Bool, Sol.GSolution)-----------------------------------------------------------------------------refineC _i s c- | null rhs = return (False, s)- | otherwise = do be <- getBinds- let lhss = snd <$> S.lhsPred be s c- kqs <- filterValidGradual lhss rhs- return $ S.update s ks kqs- where- _ci = F.subcId c- (ks, rhs) = rhsCands s c- -- msg = printf "refineC: iter = %d, sid = %s, soln = \n%s\n"- -- _i (show (F.sid c)) (showpp s)- _msg ks xs ys = printf "refineC: iter = %d, sid = %s, s = %s, rhs = %d, rhs' = %d \n"- _i (show _ci) (showpp ks) (length xs) (length ys)---rhsCands :: Sol.GSolution -> F.SimpC a -> ([F.KVar], Sol.Cand (F.KVar, Sol.EQual))-rhsCands s c = (fst <$> ks, kqs)- where- kqs = [ (p, (k, q)) | (k, su) <- ks, (p, q) <- cnd k su ]- ks = predKs . F.crhs $ c- cnd k su = Sol.qbPreds msg s su (Sol.lookupQBind s k)- msg = "rhsCands: " ++ show (F.sid c)------------------------------------------------------------------------------------- | Gradual Convert Solution into Result --------------------------------------------------------------------------------------------------------------------------------result :: (F.Fixpoint a) => Config -> W.Worklist a -> Sol.GSolution- -> SolveM (F.Result (Integer, a))----------------------------------------------------------------------------------result cfg wkl s = do- lift $ writeLoud "Computing Result"- stat <- result_ wkl s - lift $ whenNormal $ putStrLn $ "RESULT: " ++ show (F.sid <$> stat)- F.Result (ci <$> stat) <$> solResult cfg s <*> solResultGradual wkl cfg s - where- ci c = (F.subcId c, F.sinfo c)--result_ :: Fixpoint a => W.Worklist a -> Sol.GSolution -> SolveM (F.FixResult (F.SimpC a))-result_ w s = res <$> filterM (isUnsat s) cs- where- cs = W.unsatCandidates w- res [] = F.Safe- res cs' = F.Unsafe cs'--solResult :: Config -> Sol.GSolution -> SolveM (M.HashMap F.KVar F.Expr)-solResult cfg- = minimizeResult cfg . Sol.result---solResultGradual :: W.Worklist a -> Config -> Sol.GSolution -> SolveM F.GFixSolution-solResultGradual w _cfg sol - = F.toGFixSol . Sol.resultGradual <$> updateGradualSolution (W.unsatCandidates w) sol-----------------------------------------------------------------------------------updateGradualSolution :: [F.SimpC a] -> Sol.GSolution -> SolveM (Sol.GSolution)----------------------------------------------------------------------------------updateGradualSolution cs sol = foldM f (Sol.emptyGMap sol) cs- where- f s c = do- be <- getBinds- let lpi = S.lhsPred be sol c - let rp = rhsPred c - gbs <- firstValid rp lpi - return $ Sol.updateGMapWithKey gbs s ---firstValid :: Monoid a => F.Expr -> [(a, F.Expr)] -> SolveM a -firstValid _ [] = return mempty -firstValid rhs ((y,lhs):xs) = do- v <- isValid lhs rhs- if v then return y else firstValid rhs xs ------------------------------------------------------------------------------------isUnsat :: Fixpoint a => Sol.GSolution -> F.SimpC a -> SolveM Bool----------------------------------------------------------------------------------isUnsat s c = do- -- lift $ printf "isUnsat %s" (show (F.subcId c))- _ <- tickIter True -- newScc- be <- getBinds- let lpi = S.lhsPred be s c- let rp = rhsPred c- res <- (not . or) <$> mapM (`isValid` rp) (snd <$> lpi)- lift $ whenLoud $ showUnsat res (F.subcId c) (F.pOr (snd <$> lpi)) rp- return res--
src/Language/Fixpoint/Solver/Instantiate.hs view
@@ -12,25 +12,18 @@ -------------------------------------------------------------------------------- module Language.Fixpoint.Solver.Instantiate (-- instantiateAxioms,- instantiateFInfo,-+ instantiate ) where import Language.Fixpoint.Types-import Language.Fixpoint.Types.Config as FC-import qualified Language.Fixpoint.Smt.Theories as FT-import Language.Fixpoint.Types.Visitor (eapps, kvars, mapMExpr)-import Language.Fixpoint.Misc (mapFst)--import Language.Fixpoint.Smt.Interface ( smtPop, smtPush- , smtDecls, smtAssert- , checkValid', Context(..) )-import Language.Fixpoint.Defunctionalize (defuncAny, makeLamArg)-import Language.Fixpoint.SortCheck (elaborate)--import Control.Monad.State+import Language.Fixpoint.Types.Config as FC+import qualified Language.Fixpoint.Types.Visitor as Vis+import qualified Language.Fixpoint.Misc as Misc -- (mapFst)+import qualified Language.Fixpoint.Smt.Interface as SMT+import Language.Fixpoint.Defunctionalize+import Language.Fixpoint.SortCheck+import Language.Fixpoint.Solver.Sanitize (symbolEnv)+import Control.Monad.State -- AT: I've inlined this, but we should have a more elegant solution -- (track predicates instead of selectors!)@@ -41,7 +34,6 @@ import Data.Maybe (catMaybes, fromMaybe) import Data.Char (isUpper) import Data.Foldable (foldlM)--- import Data.Monoid ((<>)) (~>) :: (Expr, String) -> Expr -> EvalST Expr (_e,_str) ~> e' = do@@ -49,61 +41,106 @@ -- traceM $ showpp _str ++ " : " ++ showpp _e ++ showpp e' return (η e') ------------------------- Instantiate Axioms-----------------------instantiateFInfo :: Config -> Context -> FInfo c -> IO (FInfo c)-instantiateFInfo cfg ctx fi = do- cm' <- sequence $ M.mapWithKey instantiateOne (cm fi)- return $ fi { cm = cm' }- where instantiateOne = instantiateAxioms cfg ctx (bs fi) (gLits fi) (ae fi) -instantiateAxioms :: Config -> Context -> BindEnv -> SEnv Sort -> AxiomEnv- -> Integer -> SubC c- -> IO (SubC c)-instantiateAxioms _ _ _ _ aenv sid sub+--------------------------------------------------------------------------------+-- | Instantiate Axioms+--------------------------------------------------------------------------------+instantiate :: Config -> SInfo a -> IO (SInfo a)+instantiate cfg fi+ | inst = instantiate' cfg fi+ | otherwise = return fi+ where+ inst = rewriteAxioms cfg || arithmeticAxioms cfg++-- instantiate' :: Config -> SInfo a -> IO (SInfo a)+-- instantiate' cfg fi = do+ -- ctx <- SMT.makeContextWithSEnv cfg file env+ -- -- ctx <- SMT.makeSmtContext cfg file (ddecls fi) [] (applySorts fi)+ -- SMT.smtPush ctx+ -- ips <- forM cstrs $ \(i, c) -> do+ -- p <- instSimpC cfg ctx (bs fi) (ae fi) i c+ -- return (i, elaborate "PLE-instantiate" env p)+ -- return (strengthenHyp fi ips)++instantiate' :: Config -> GInfo SimpC a -> IO (SInfo a)+instantiate' cfg fi = do+ ctx <- SMT.makeContextWithSEnv cfg file env+ -- ctx <- SMT.makeSmtContext cfg file (ddecls fi) [] (applySorts fi)+ SMT.smtPush ctx+ ips <- forM cstrs $ \(i, c) ->+ (i,) <$> instSimpC cfg ctx (bs fi) (ae fi) i c+ let (is, ps) = unzip ips+ let (ps', axs) = defuncAxioms cfg env ps+ let ps'' = elaborate "PLE1" env <$> ps'+ let axs' = elaborate "PLE2" env <$> axs+ let fi' = fi { asserts = axs' ++ asserts fi }+ return $ strengthenHyp fi' (zip is ps'')+ where+ cstrs = M.toList (cm fi)+ file = srcFile cfg ++ ".evals"+ env = symbolEnv cfg fi++instSimpC :: Config -> SMT.Context -> BindEnv -> AxiomEnv+ -> Integer -> SimpC a+ -> IO Expr+instSimpC _ _ _ aenv sid _ | not (M.lookupDefault False sid (aenvExpand aenv))- = return sub-instantiateAxioms cfg ctx bds fenv aenv sid sub- = flip strengthenLhs sub . pAnd . (is0 ++) .- (if arithmeticAxioms cfg then (is ++) else id) <$>+ = return PTrue+instSimpC cfg ctx bds aenv sid sub+ = -- tracepp ("instSimpC " ++ show sid) .+ pAnd . (is0 ++) .+ (if arithmeticAxioms cfg then (is1 ++) else id) <$> if rewriteAxioms cfg then evalEqs else return [] where is0 = eqBody <$> L.filter (null . eqArgs) eqs- is = instances maxNumber aenv initOccurences+ is1 = instances maxNumber aenv initOccurences evalEqs = map (uncurry (PAtom Eq)) . filter (uncurry (/=)) <$>- evaluate cfg ctx ((vv Nothing, slhs sub):binds) fenv aenv initExpressions- initExpressions = expr (slhs sub) : expr (srhs sub) : (expr <$> binds)- binds = envCs bds (senv sub)- initOccurences = concatMap (makeInitOccurences as eqs) initExpressions+ evaluate cfg ctx ({- (vv Nothing, slhs sub): -} binds) aenv iExprs+ initOccurences = concatMap (makeInitOccurences as eqs) iExprs+ eqs = aenvEqs aenv+ (binds, iExprs) = cstrBindExprs bds sub+ -- fuel calculated and used only by `instances` arith rewrite method+ fuelNumber = M.lookupDefault 0 sid (aenvFuel aenv)+ as = (,fuelNumber) . eqName <$> filter (not . null . eqArgs) eqs+ maxNumber = (aenvSyms aenv * length initOccurences) ^ fuelNumber - eqs = aenvEqs aenv+cstrBindExprs :: BindEnv -> SimpC a -> ([(Symbol, SortedReft)], [Expr])+cstrBindExprs bds sub = {- tracepp "initExpressions" -} (unElab <$> binds, unElab <$> es)+ where+ es = {- expr (slhs sub) : -} (crhs sub) : (expr <$> binds)+ binds = envCs bds (senv sub)+ -- _tx e = tracepp ("UNELAB e = " ++ showpp e) (unElab e) - -- fuel calculated and used only by `instances` arith rewrite method- fuelNumber = M.lookupDefault 0 sid (aenvFuel aenv)- as = (,fuelNumber) . eqName <$> filter (not . null . eqArgs) eqs- maxNumber = (length (aenvSyms aenv) * length initOccurences) ^ fuelNumber+unElab :: (Vis.Visitable t) => t -> t+unElab = Vis.stripCasts . unApply +unApply :: (Vis.Visitable t) => t -> t+unApply = Vis.trans (Vis.defaultVisitor { Vis.txExpr = const go }) () ()+ where+ go (ECst (EApp (EApp f e1) e2) _)+ | Just _ <- unApplyAt f = EApp e1 e2+ go e = e ---------------------------------- Knowledge (SMT Interaction)---------------------------------- AT:@TODO: knSels and knEqs should reall just be the same thing. In this way,++--------------------------------------------------------------------------------+-- | Knowledge (SMT Interaction)+--------------------------------------------------------------------------------+-- AT:@TODO: knSels and knEqs should really just be the same thing. In this way, -- we should also unify knSims and knAms, as well as their analogues in AxiomEnv data Knowledge = KN { knSels :: ![(Expr, Expr)] , knEqs :: ![(Expr, Expr)] , knSims :: ![Rewrite] , knAms :: ![Equation]- , knContext :: IO Context- , knPreds :: !([(Symbol, Sort)] -> Expr -> Context -> IO Bool)+ , knContext :: IO SMT.Context+ , knPreds :: !([(Symbol, Sort)] -> Expr -> SMT.Context -> IO Bool) , knLams :: [(Symbol, Sort)] } -emptyKnowledge :: IO Context -> Knowledge-emptyKnowledge cxt = KN [] [] [] [] cxt (\_ _ _ -> return False) []+emptyKnowledge :: IO SMT.Context -> Knowledge+emptyKnowledge ctx = KN [] [] [] [] ctx (\_ _ _ -> return False) [] lookupKnowledge :: Knowledge -> Expr -> Maybe Expr lookupKnowledge γ e@@ -118,10 +155,10 @@ isValid :: Knowledge -> Expr -> IO Bool isValid γ b = knPreds γ (knLams γ) b =<< knContext γ -makeKnowledge :: Config -> Context -> AxiomEnv -> SEnv Sort+makeKnowledge :: Config -> SMT.Context -> AxiomEnv -> [(Symbol, SortedReft)] -> ([(Expr, Expr)], Knowledge)-makeKnowledge cfg ctx aenv fenv es = (simpleEqs,) $ (emptyKnowledge context)+makeKnowledge cfg ctx aenv es = (simpleEqs,) $ (emptyKnowledge context) { knSels = sels , knEqs = eqs , knSims = aenvSimpl aenv@@ -129,19 +166,19 @@ , knPreds = \bs e c -> askSMT c bs e } where- (xv, sv) = (vv Nothing, sr_sort $ snd $ head es)- fbinds = toListSEnv fenv ++ [(x, s) | (x, RR s _) <- es]- senv = fromListSEnv fbinds-- context :: IO Context+ -- (xv, sv) = (vv Nothing, sr_sort $ snd $ head es)+ -- fbinds = toListSEnv fenv ++ [(x, s) | (x, RR s _) <- es]+ -- senv = senvCtx { seSort = fromListSEnv fbinds }+ -- thySyms = seTheory senvCtx+ senv = SMT.ctxSymEnv ctx+ context :: IO SMT.Context context = do- smtPop ctx- smtPush ctx- smtDecls ctx $ L.nub [(x, toSMT [] s) | (x, s) <- fbinds- , not (M.member x FT.theorySymbols)]- smtAssert ctx (pAnd ([toSMT [] (PAtom Eq e1 e2) | (e1, e2) <- simpleEqs]- ++ filter (null.kvars) ((toSMT [] . expr) <$> es)- ))+ SMT.smtPop ctx+ SMT.smtPush ctx+ -- SMT.smtDecls ctx $ L.nub [(x, toSMT [] s) | (x, s) <- fbinds, not (memberSEnv x thySyms)]+ SMT.smtAssert ctx (pAnd ([toSMT [] (PAtom Eq e1 e2) | (e1, e2) <- simpleEqs]+ ++ filter (null . Vis.kvars) ((toSMT [] . expr) <$> es)+ )) return ctx -- This creates the rewrite rule e1 -> e2@@ -162,26 +199,21 @@ eqs = [(EVar x, ex) | Equ a _ bd <- filter (null . eqArgs) $ aenvEqs aenv , PAtom Eq (EVar x) ex <- splitPAnd bd , x == a- -- AT: no test needs this- --, EVar x /= ex ] - toSMT xs = defuncAny cfg (insertSEnv xv sv senv) .- elaborate "symbolic evaluation"- (foldl (\env (x,s) -> insertSEnv x s (deleteSEnv x env))- (insertSEnv xv sv senv)- xs)+ toSMT bs = defuncAny cfg senv . elaborate "makeKnowledge" (elabEnv bs)+ elabEnv = L.foldl' (\env (x, s) -> insertSymEnv x s env) senv -- AT: Non-obvious needed invariant: askSMT True is always the -- totality-effecting one- askSMT :: Context -> [(Symbol, Sort)] -> Expr -> IO Bool- askSMT cxt xss e+ askSMT :: SMT.Context -> [(Symbol, Sort)] -> Expr -> IO Bool+ askSMT ctx bs e | isTautoPred e = return True | isContraPred e = return False- | null (kvars e) = do- smtPush cxt- b <- checkValid' cxt [] PTrue (toSMT xss e)- smtPop cxt+ | null (Vis.kvars e) = do+ SMT.smtPush ctx+ b <- SMT.checkValid' ctx [] PTrue (toSMT bs e)+ SMT.smtPop ctx return b | otherwise = return False @@ -190,7 +222,6 @@ isSelector = L.isPrefixOf "select" . symbolString isProof (_, RR s _) = showpp s == "Tuple" - makeSimplifications :: [Rewrite] -> (Symbol, [Expr], Expr) -> [(Expr, Expr)] makeSimplifications sis (dc, es, e) = go =<< sis@@ -215,8 +246,8 @@ | otherwise = Nothing where- (f1, es1) = mapFst getDC $ splitEApp e1- (f2, es2) = mapFst getDC $ splitEApp e2+ (f1, es1) = Misc.mapFst getDC $ splitEApp e1+ (f2, es2) = Misc.mapFst getDC $ splitEApp e2 -- TODO: Stringy hacks getDC (EVar x)@@ -239,9 +270,9 @@ splitPAnd (PAnd es) = concatMap splitPAnd es splitPAnd e = [e] ---------------------------- Creating Measure Info-------------------------+--------------------------------------------------------------------------------+-- | Creating Measure Info+-------------------------------------------------------------------------------- -- AT@TODO do this for all reflected functions, not just DataCons -- Insert measure info for every constructor@@ -251,7 +282,7 @@ assertSelectors γ e = do EvalEnv _ _ evaenv <- get let sims = aenvSimpl evaenv- _ <- foldlM (\_ s -> mapMExpr (go s) e) e sims+ _ <- foldlM (\_ s -> Vis.mapMExpr (go s) e) e sims return () where go :: Rewrite -> Expr -> EvalST Expr@@ -266,11 +297,11 @@ addSMTEquality :: Knowledge -> Expr -> Expr -> EvalST (IO ()) addSMTEquality γ e1 e2 = return $ do ctx <- knContext γ- smtAssert ctx (PAtom Eq (makeLam γ e1) (makeLam γ e2))+ SMT.smtAssert ctx (PAtom Eq (makeLam γ e1) (makeLam γ e2)) ----------------------------------- Symbolic Evaluation with SMT--------------------------------+--------------------------------------------------------------------------------+-- | Symbolic Evaluation with SMT+-------------------------------------------------------------------------------- data EvalEnv = EvalEnv { evId :: Int , evSequence :: [(Expr,Expr)] , _evAEnv :: AxiomEnv@@ -278,15 +309,15 @@ type EvalST a = StateT EvalEnv IO a -evaluate :: Config -> Context -> [(Symbol, SortedReft)] -> SEnv Sort -> AxiomEnv+evaluate :: Config -> SMT.Context -> [(Symbol, SortedReft)] -> AxiomEnv -> [Expr] -> IO [(Expr, Expr)]-evaluate cfg ctx facts fenv aenv einit+evaluate cfg ctx facts aenv einit = (eqs ++) <$> (fmap join . sequence) (evalOne <$> L.nub (grepTopApps =<< einit)) where- (eqs, γ) = makeKnowledge cfg ctx aenv fenv facts+ (eqs, γ) = makeKnowledge cfg ctx aenv facts initEvalSt = EvalEnv 0 [] aenv -- This adds all intermediate unfoldings into the assumptions -- no test needs it@@ -296,15 +327,18 @@ (e', st) <- runStateT (eval γ e) initEvalSt if e' == e then return [] else return ((e, e'):evSequence st) +-- Don't evaluate under Lam, App, Ite, or constants grepTopApps :: Expr -> [Expr]-grepTopApps (PAnd es) = concatMap grepTopApps es+grepTopApps (PAnd es) = concatMap grepTopApps es+grepTopApps (POr es) = concatMap grepTopApps es grepTopApps (PAtom _ e1 e2) = grepTopApps e1 ++ grepTopApps e2-grepTopApps e@(EApp _ _) = [e]-grepTopApps _ = []--- POr ![Expr]--- PNot !Expr--- PImp !Expr !Expr--- PIff !Expr !Expr+grepTopApps (PIff e1 e2) = grepTopApps e1 ++ grepTopApps e2+grepTopApps (PImp e1 e2) = grepTopApps e1 ++ grepTopApps e2+grepTopApps (PNot e) = grepTopApps e+grepTopApps (EBin _ e1 e2) = grepTopApps e1 ++ grepTopApps e2+grepTopApps (ENeg e) = grepTopApps e+grepTopApps e@(EApp _ _) = [e]+grepTopApps _ = [] -- AT: I think makeLam is the adjoint of splitEApp? makeLam :: Knowledge -> Expr -> Expr@@ -312,11 +346,16 @@ eval :: Knowledge -> Expr -> EvalST Expr eval γ e | Just e' <- lookupKnowledge γ e- = (e, "Knowledge") ~> e'+ = (e, "Knowledge") ~> e' eval γ (ELam (x,s) e)- = do let x' = makeLamArg s (1+ length (knLams γ))- e' <- eval γ{knLams = (x',s):knLams γ} (subst1 e (x, EVar x'))- return $ ELam (x,s) $ subst1 e' (x', EVar x)+ -- SHIFTLAM (assuming this shifting is redundant if DEFUNC has already happened)+ -- = do let x' = lamArgSymbol (1 + length (knLams γ))+ -- e' <- eval γ{knLams = (x',s):knLams γ} (subst1 e (x, EVar x'))+ -- return $ ELam (x,s) $ subst1 e' (x', EVar x)++ = do e' <- eval γ{knLams = (x, s) : knLams γ} e+ return $ ELam (x, s) e'+ eval γ e@(EIte b e1 e2) = do b' <- eval γ b evalIte γ e b' e1 e2@@ -508,14 +547,14 @@ makeInitOccurences :: [(Symbol, Fuel)] -> [Equation] -> Expr -> [Occurence] makeInitOccurences xs eqs e- = [Occ x es xs | (EVar x, es) <- splitEApp <$> eapps e+ = [Occ x es xs | (EVar x, es) <- splitEApp <$> Vis.eapps e , Equ x' xs' _ <- eqs, x == x' , length xs' == length es] grepOccurences :: [Equation] -> (Expr, FuelMap) -> [Occurence] grepOccurences eqs (e, fs) = filter (goodFuelMap . ofuel)- [Occ x es fs | (EVar x, es) <- splitEApp <$> eapps e+ [Occ x es fs | (EVar x, es) <- splitEApp <$> Vis.eapps e , Equ x' xs' _ <- eqs, x == x' , length xs' == length es]
src/Language/Fixpoint/Solver/Monad.hs view
@@ -31,20 +31,19 @@ import Control.DeepSeq import GHC.Generics import Language.Fixpoint.Utils.Progress-import Language.Fixpoint.Misc (mapSnd, groupList) import qualified Language.Fixpoint.Types.Config as C import Language.Fixpoint.Types.Config (Config) import qualified Language.Fixpoint.Types as F+-- import qualified Language.Fixpoint.Misc as Misc+-- import Language.Fixpoint.SortCheck import qualified Language.Fixpoint.Types.Solutions as F import Language.Fixpoint.Types (pprint) -- import qualified Language.Fixpoint.Types.Errors as E-import qualified Language.Fixpoint.Smt.Theories as Thy-import Language.Fixpoint.Smt.Types (tsInterp) import Language.Fixpoint.Smt.Serialize () import Language.Fixpoint.Types.PrettyPrint () import Language.Fixpoint.Smt.Interface+-- import qualified Language.Fixpoint.Smt.Theories as Thy import Language.Fixpoint.Solver.Sanitize-import Language.Fixpoint.SortCheck import Language.Fixpoint.Graph.Types (SolverInfo (..)) -- import Language.Fixpoint.Solver.Solution -- import Data.Maybe (catMaybes)@@ -91,21 +90,21 @@ ] ---------------------------------------------------------------------------------runSolverM :: Config -> SolverInfo b c -> Int -> SolveM a -> IO a+runSolverM :: Config -> SolverInfo b c -> SolveM a -> IO a ---------------------------------------------------------------------------------runSolverM cfg sI _ act =+runSolverM cfg sI act = bracket acquire release $ \ctx -> do res <- runStateT act' (s0 ctx) smtWrite ctx "(exit)"- return $ fst res+ return (fst res) where s0 ctx = SS ctx be (stats0 fi)- act' = declare initEnv lts {- ess -} >> assumesAxioms (F.asserts fi) >> act+ act' = {- declare initEnv >> -} assumesAxioms (F.asserts fi) >> act release = cleanupContext acquire = makeContextWithSEnv cfg file initEnv initEnv = symbolEnv cfg fi- lts = F.toListSEnv (F.dLits fi)- -- ess = distinctLiterals fi+ -- lts = F.toListSEnv (F.dLits fi)+ -- ds = F.ddecls fi be = F.SolEnv (F.bs fi) file = C.srcFile cfg -- only linear arithmentic when: linear flag is on or solver /= Z3@@ -113,7 +112,6 @@ fi = (siQuery sI) {F.hoInfo = F.HOI (C.allowHO cfg) (C.allowHOqs cfg)} - -------------------------------------------------------------------------------- getBinds :: SolveM F.SolEnv --------------------------------------------------------------------------------@@ -177,23 +175,23 @@ -------------------------------------------------------------------------------- -- | `filterValid p [(x1, q1),...,(xn, qn)]` returns the list `[ xi | p => qi]` ---------------------------------------------------------------------------------filterValid :: F.Expr -> F.Cand a -> SolveM [a]+filterValid :: F.SrcSpan -> F.Expr -> F.Cand a -> SolveM [a] ---------------------------------------------------------------------------------filterValid p qs = do+filterValid sp p qs = do qs' <- withContext $ \me -> smtBracket me "filterValidLHS" $- filterValid_ p qs me+ filterValid_ sp p qs me -- stats incBrkt incChck (length qs) incVald (length qs') return qs' -filterValid_ :: F.Expr -> F.Cand a -> Context -> IO [a]-filterValid_ p qs me = catMaybes <$> do+filterValid_ :: F.SrcSpan -> F.Expr -> F.Cand a -> Context -> IO [a]+filterValid_ sp p qs me = catMaybes <$> do smtAssert me p forM qs $ \(q, x) ->- smtBracket me "filterValidRHS" $ do+ smtBracketAt sp me "filterValidRHS" $ do smtAssert me (F.PNot q) valid <- smtCheckUnsat me return $ if valid then Just x else Nothing@@ -202,7 +200,7 @@ -------------------------------------------------------------------------------- -- | `filterValidGradual ps [(x1, q1),...,(xn, qn)]` returns the list `[ xi | p => qi]`--- | for some p in the list ps +-- | for some p in the list ps -------------------------------------------------------------------------------- filterValidGradual :: [F.Expr] -> F.Cand a -> SolveM [a] --------------------------------------------------------------------------------@@ -217,12 +215,12 @@ return qs' filterValidGradual_ :: [F.Expr] -> F.Cand a -> Context -> IO [a]-filterValidGradual_ ps qs me +filterValidGradual_ ps qs me = (map snd . fst) <$> foldM partitionCandidates ([], qs) ps where partitionCandidates :: (F.Cand a, F.Cand a) -> F.Expr -> IO (F.Cand a, F.Cand a)- partitionCandidates (ok, candidates) p = do - (valids', invalids') <- partition snd <$> filterValidOne_ p candidates me + partitionCandidates (ok, candidates) p = do+ (valids', invalids') <- partition snd <$> filterValidOne_ p candidates me let (valids, invalids) = (fst <$> valids', fst <$> invalids') return (ok ++ valids, invalids) @@ -249,49 +247,10 @@ smtCheckSat me p ---------------------------------------------------------------------------------declare :: F.SEnv F.Sort -> [(F.Symbol, F.Sort)] -> SolveM ()----------------------------------------------------------------------------------declare env lts = withContext $ \me -> do- forM_ thyXTs $ uncurry $ smtDecl me- forM_ qryXTs $ uncurry $ smtDecl me- forM_ ess $ smtDistinct me- forM_ axs $ smtAssert me- return ()- where- ess = distinctLiterals lts- axs = Thy.axiomLiterals lts- thyXTs = filter (isKind 1) xts- qryXTs = mapSnd tx <$> filter (isKind 2) xts- isKind n = (n ==) . symKind . fst- xts = F.toListSEnv env- tx = elaborate "declare" env---- | symKind returns {0, 1, 2} where:--- 0 = Theory-Definition,--- 1 = Theory-Declaration,--- 2 = Query-Binder--symKind :: F.Symbol -> Int-symKind x = case M.lookup x Thy.theorySymbols of- Just t -> if tsInterp t then 0 else 1- Nothing -> 2- assumesAxioms :: [F.Triggered F.Expr] -> SolveM ()+-------------------------------------------------------------------------------- assumesAxioms es = withContext $ \me -> forM_ es $ smtAssertAxiom me --- assumes :: [F.Expr] -> SolveM ()--- assumes es = withContext $ \me -> forM_ es $ smtAssert me---- | `distinctLiterals` is used solely to determine the set of literals--- (of each sort) that are *disequal* to each other, e.g. EQ, LT, GT,--- or string literals "cat", "dog", "mouse". These should only include--- non-function sorted values.-distinctLiterals :: [(F.Symbol, F.Sort)] -> [[F.Expr]]-distinctLiterals xts = [ es | (_, es) <- tess ]- where- tess = groupList [(t, F.expr x) | (x, t) <- xts, notFun t]- notFun = not . F.isFunctionSortedReft . (`F.RR` F.trueReft)- -- _notStr = not . (F.strSort ==) . F.sr_sort . (`F.RR` F.trueReft) --------------------------------------------------------------------------- stats :: SolveM Stats
src/Language/Fixpoint/Solver/Sanitize.hs view
@@ -16,7 +16,7 @@ import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Types.Visitor (symConsts, isConcC, isKvarC, mapKVars, mapKVarSubsts)-import Language.Fixpoint.SortCheck (isFirstOrder)+import Language.Fixpoint.SortCheck (applySorts, isFirstOrder) import qualified Language.Fixpoint.Misc as Misc import qualified Language.Fixpoint.Types as F import Language.Fixpoint.Types.Config (Config, allowHO)@@ -208,18 +208,25 @@ banConstraintFreeVars :: F.SInfo a -> SanitizeM (F.SInfo a) banConstraintFreeVars fi0 = Misc.applyNonNull (Right fi0) (Left . badCs) bads where- fi = mapKVars (const $ Just F.PTrue) fi0- bads = [(c, fs) | c <- M.elems $ F.cm fi, Just fs <- [cNoFreeVars fi c]]+ fi = mapKVars (const $ Just F.PTrue) fi0+ bads = [(c, fs) | c <- M.elems $ F.cm fi, Just fs <- [cNoFreeVars fi k c]]+ k = known fi -cNoFreeVars :: F.SInfo a -> F.SimpC a -> Maybe [F.Symbol]-cNoFreeVars fi c = if S.null fv then Nothing else Just (S.toList fv)+known :: F.SInfo a -> F.Symbol -> Bool+known fi = \x -> F.memberSEnv x lits || F.memberSEnv x prims where+ lits = F.gLits fi+ prims = Thy.theorySymbols . F.ddecls $ fi++cNoFreeVars :: F.SInfo a -> (F.Symbol -> Bool) -> F.SimpC a -> Maybe [F.Symbol]+cNoFreeVars fi known c = if S.null fv then Nothing else Just (S.toList fv)+ where be = F.bs fi- lits = fst <$> F.toListSEnv (F.gLits fi)+ -- lits = fst <$> F.toListSEnv (F.gLits fi) ids = F.elemsIBindEnv $ F.senv c cDom = [fst $ F.lookupBindEnv i be | i <- ids] cRng = concat [S.toList . F.reftFreeVars . F.sr_reft . snd $ F.lookupBindEnv i be | i <- ids]- fv = cRng `nubDiff` (lits ++ cDom ++ F.prims)+ fv = (`nubDiff` cDom) . filter (not . known) $ cRng -- `nubDiff` (lits ++ cDom ++ prims fi) badCs :: Misc.ListNE (F.SimpC a, [F.Symbol]) -> E.Error badCs = E.catErrors . map (E.errFreeVarInConstraint . Misc.mapFst F.subcId)@@ -266,12 +273,19 @@ , nest 4 (pprint (F.crhs c)) ] ----------------------------------------------------------------------------------- | symbol |-> sort for EVERY variable in the FInfo+-- | symbol |-> sort for EVERY variable in the SInfo; 'symbolEnv' can ONLY be+-- called with **sanitized** environments (post the uniqification etc.) or+-- else you get duplicate sorts and other such errors. ---------------------------------------------------------------------------------symbolEnv :: Config -> F.SInfo a -> F.SEnv F.Sort-symbolEnv cfg si = Thy.theorySEnv- `mappend`- F.fromListSEnv (symbolSorts cfg si)+symbolEnv :: Config -> F.SInfo a -> F.SymEnv+symbolEnv cfg si = F.symEnv sEnv tEnv ds (F.dLits si) ts+ where+ tEnv = Thy.theorySymbols ds+ ds = F.ddecls si+ ts = Misc.hashNub (applySorts si ++ [t | (_, t) <- F.toListSEnv sEnv])+ sEnv = (F.tsSort <$> tEnv) `mappend` (F.fromListSEnv xts)+ xts = symbolSorts cfg si+ symbolSorts :: Config -> F.GInfo c a -> [(F.Symbol, F.Sort)] symbolSorts cfg fi = either E.die id $ symbolSorts' cfg fi
src/Language/Fixpoint/Solver/Solution.hs view
@@ -23,7 +23,7 @@ import Language.Fixpoint.Types.Visitor as V import qualified Language.Fixpoint.SortCheck as So import Language.Fixpoint.Misc-import qualified Language.Fixpoint.Smt.Theories as Thy+-- import qualified Language.Fixpoint.Smt.Theories as Thy import Language.Fixpoint.Types.Config import qualified Language.Fixpoint.Types as F import Language.Fixpoint.Types ((&.&))@@ -164,14 +164,14 @@ be = F.soeBinds (snd3 g) applyKVars :: CombinedEnv -> Sol.Sol a Sol.QBind -> [F.KVSub] -> ExprInfo-applyKVars g s = mrExprInfos (applyKVar g s) F.pAnd mconcat +applyKVars g s = mrExprInfos (applyKVar g s) F.pAnd mconcat applyKVar :: CombinedEnv -> Sol.Sol a Sol.QBind -> F.KVSub -> ExprInfo applyKVar g s ksu = case Sol.lookup s (F.ksuKVar ksu) of Left cs -> hypPred g s ksu cs Right eqs -> (F.pAnd $ fst <$> Sol.qbPreds msg s (F.ksuSubst ksu) eqs, mempty) -- TODO: don't initialize kvars that have a hyp solution where- msg = "applyKVar: " ++ show (fst3 g) + msg = "applyKVar: " ++ show (fst3 g) hypPred :: CombinedEnv -> Sol.Sol a Sol.QBind -> F.KVSub -> Sol.Hyp -> ExprInfo hypPred g s ksu = mrExprInfos (cubePred g s ksu) F.pOr mconcatPlus@@ -221,13 +221,13 @@ yts' = symSorts g bs' g' = addCEnv g bs (p', kI) = apply g' s bs'- (_ , psu') = substElim sEnv g' k su'- (xts, psu) = substElim sEnv g k su+ (_ , psu') = substElim (Sol.sEnv s) sEnv g' k su'+ (xts, psu) = substElim (Sol.sEnv s) sEnv g k su su' = Sol.cuSubst c bs = Sol.cuBinds c k = F.ksuKVar ksu su = F.ksuSubst ksu- sEnv = F.insertSEnv (F.ksuVV ksu) (F.ksuSort ksu) (Sol.sEnv s)+ sEnv = F.insertSEnv (F.ksuVV ksu) (F.ksuSort ksu) (F.seSort $ Sol.sEnv s) -- TODO: SUPER SLOW! Decorate all substitutions with Sorts in a SINGLE pass. @@ -255,10 +255,10 @@ 2. are binders corresponding to sorts (e.g. `a : num`, currently used to hack typeclasses current.) -}-substElim :: F.SEnv F.Sort -> CombinedEnv -> F.KVar -> F.Subst -> ([(F.Symbol, F.Sort)], F.Pred)-substElim sEnv g _ (F.Su m) = (xts, p)+substElim :: F.SymEnv -> F.SEnv F.Sort -> CombinedEnv -> F.KVar -> F.Subst -> ([(F.Symbol, F.Sort)], F.Pred)+substElim syEnv sEnv g _ (F.Su m) = (xts, p) where- p = F.pAnd [ mkSubst x (substSort sEnv frees x t) e t | (x, e, t) <- xets ]+ p = F.pAnd [ mkSubst syEnv x (substSort sEnv frees x t) e t | (x, e, t) <- xets ] xts = [ (x, t) | (x, _, t) <- xets, not (S.member x frees) ] xets = [ (x, e, t) | (x, e) <- xes, t <- sortOf e, not (isClass t)] xes = M.toList m@@ -271,15 +271,18 @@ where err x = error $ "Solution.mkSubst: unknown binder " ++ F.showpp x -mkSubst :: F.Symbol -> F.Sort -> F.Expr -> F.Sort -> F.Expr-mkSubst x tx ey ty+mkSubst :: F.SymEnv -> F.Symbol -> F.Sort -> F.Expr -> F.Sort -> F.Expr+mkSubst env x tx ey ty | tx == ty = F.EEq ex ey- | otherwise = F.notracepp msg (F.EEq ex' ey')+ | otherwise = {- F.tracepp _msg -} (F.EEq ex' ey') where- msg = "mkSubst-DIFF:" ++ F.showpp (tx, ty) ++ F.showpp (ex', ey')+ _msg = "mkSubst-DIFF:" ++ F.showpp (tx, ty) ++ F.showpp (ex', ey') ex = F.expr x- ex' = Thy.toInt ex tx- ey' = Thy.toInt ey ty+ ex' = elabToInt env ex tx+ ey' = elabToInt env ey ty++elabToInt :: F.SymEnv -> F.Expr -> F.Sort -> F.Expr+elabToInt env e s = So.elaborate "elabToInt" env (So.toInt env e s) isClass :: F.Sort -> Bool isClass F.FNum = True
src/Language/Fixpoint/Solver/Solve.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE PatternGuards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} --------------------------------------------------------------------------------@@ -14,34 +15,39 @@ import Language.Fixpoint.Misc import qualified Language.Fixpoint.Types as F import qualified Language.Fixpoint.Types.Solutions as Sol+import qualified Language.Fixpoint.Types.Graduals as G+import qualified Language.Fixpoint.Solver.GradualSolution as GS import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Types.Config hiding (stats) import qualified Language.Fixpoint.Solver.Solution as S import qualified Language.Fixpoint.Solver.Worklist as W import qualified Language.Fixpoint.Solver.Eliminate as E import Language.Fixpoint.Solver.Monad-import Language.Fixpoint.Solver.GradualSolve import Language.Fixpoint.Utils.Progress import Language.Fixpoint.Graph import Text.PrettyPrint.HughesPJ import Text.Printf-import System.Console.CmdArgs.Verbosity (whenNormal, whenLoud)+import System.Console.CmdArgs.Verbosity -- (whenNormal, whenLoud) import Control.DeepSeq import qualified Data.HashMap.Strict as M import qualified Data.HashSet as S+import qualified Data.List as L+import Control.Concurrent.ParallelIO.Global (parallel) +import qualified Language.Fixpoint.SortCheck as So+import Language.Fixpoint.Solver.Sanitize (symbolEnv) -- DEBUG -- import Debug.Trace (trace) ---------------------------------------------------------------------------------solve :: (NFData a, F.Fixpoint a) => Config -> F.SInfo a -> IO (F.Result (Integer, a))+solve :: (NFData a, F.Fixpoint a, Show a, F.Loc a) => Config -> F.SInfo a -> IO (F.Result (Integer, a)) ---------------------------------------------------------------------------------solve cfg fi | gradual cfg - = solveGradual cfg fi +solve cfg fi | gradual cfg+ = solveGradual cfg fi solve cfg fi = do -- donePhase Loud "Worklist Initialize"- (res, stat) <- withProgressFI sI $ runSolverM cfg sI n act+ (res, stat) <- withProgressFI sI $ runSolverM cfg sI act when (solverStats cfg) $ printStats fi wkl stat -- print (numIter stat) return res@@ -49,11 +55,125 @@ act = solve_ cfg fi s0 ks wkl sI = solverInfo cfg fi wkl = W.init sI- n = fromIntegral $ W.wRanks wkl s0 = siSol sI ks = siVars sI + --------------------------------------------------------------------------------+solveGradual :: (NFData a, F.Fixpoint a, Show a, F.Loc a)+ => Config -> F.SInfo a -> IO (F.Result (Integer, a))+--------------------------------------------------------------------------------+solveGradual cfg fi = do+ -- graphStatistics cfg $ G.uniquify fi+ let fis = zip [1..] $ partition' Nothing $ G.uniquify fi+ if ginteractive cfg+ then snd . traceShow "FINAL SOLUTION\n" <$> iSolveGradual cfg fis+ else snd . traceShow "FINAL SOLUTION\n" . mconcat <$> parallel (solveGradualOne cfg <$> fis)+++iSolveGradual :: (NFData a, F.Fixpoint a, Show a, F.Loc a) => Config -> [(Int, F.SInfo a)] -> IO (Maybe G.GSol, F.Result (Integer, a))+iSolveGradual cfg fis+ = mconcat <$> parallel (solveGradualOne cfg <$> fis)+++solveGradualOne :: (NFData a, F.Fixpoint a, Show a, F.Loc a) => Config -> (Int, F.SInfo a) -> IO (Maybe G.GSol, F.Result (Integer, a))+solveGradualOne cfg (_, fi) = do+ sols <- makeSolutions cfg fi+ gradualLoop (cfg{gradual = False}) fi sols++gradualLoop :: (NFData a, F.Fixpoint a, Show a, F.Loc a) => Config -> F.SInfo a -> (Maybe [G.GSol]) -> IO (Maybe G.GSol, F.Result (Integer, a))+gradualLoop _ _ Nothing+ = return (Nothing, F.safe)+gradualLoop _ _ (Just [])+ = return (Nothing, F.unsafe)+gradualLoop cfg fi (Just (s:ss))+ = do whenLoud $ putStrLn ("Solving for " ++ show s)+ whenNormal $ putStr "*"+ v <- getVerbosity+ -- putStr ("Substitution = " ++ show s)+ -- putStr ("BEFORE \n\n" ++ (show $ F.toFixpoint cfg fi))+ -- putStr ("AFTER \n\n" ++ (show $ F.toFixpoint cfg $ G.gsubst s fi))+ whenNormal $ setVerbosity Quiet+ r <- solve cfg (G.gsubst s fi)+ setVerbosity v+ whenLoud $ putStrLn ("Solution = " ++ if F.isUnsafe r then "UNSAFE" else "SAFE")+ if F.isUnsafe r+ then gradualLoop cfg fi (Just ss)+ else return (Just s, r)+++makeSolutions :: (NFData a, F.Fixpoint a, Show a) => Config -> F.SInfo a -> IO (Maybe [G.GSol])+makeSolutions cfg fi+ = G.makeSolutions cfg fi <$> makeLocalLattice cfg fi (GS.init fi)++++makeLocalLattice :: Config -> F.SInfo a+ -> [(F.KVar, (F.GWInfo, [F.Expr]))]+ -> IO [(F.KVar, (F.GWInfo, [[F.Expr]]))]+makeLocalLattice cfg fi kes = runSolverM cfg sI (act kes)+ where+ sI = solverInfo cfg fi+ act = mapM (makeLocalLatticeOne cfg fi)+++makeLocalLatticeOne :: Config -> F.SInfo a+ -> (F.KVar, (F.GWInfo, [F.Expr]))+ -> SolveM (F.KVar, (F.GWInfo, [[F.Expr]]))+makeLocalLatticeOne cfg fi (k, (e, es)) = do+ elems0 <- filterM (isLocal e) (map (:[]) es)+ elems <- sortEquals elems0+ lattice <- makeLattice [] (map (:[]) elems) elems+ return $ ((k,) . (e,)) lattice+ where+ sEnv = symbolEnv cfg fi+ makeLattice acc new elems+ | null new+ = return {- traceShow ("LATTICE FROM ELEMENTS = " ++ showElems elems ++ showElemss acc) -} acc+ | otherwise+ = do let cands = [e:es | e <- elems, es <- new]+ localCans <- filterM (isLocal e) cands+ newElems <- filterM (notTrivial (new ++ acc)) localCans+ makeLattice (acc ++ new) newElems elems+ _showElem :: F.Expr -> String+ _showElem e1 = showpp $ F.subst (F.mkSubst [(x, F.EVar $ F.tidySymbol x) | x <- F.syms e1]) e1+ _showElems = unlines . map _showElem+ _showElemss = unlines. map _showElems++ notTrivial [] _ = return True+ notTrivial (x:xs) p = do v <- isValid F.dummySpan (mkPred x) (mkPred p)+ if v then return False+ else notTrivial xs p++ mkPred es = So.elaborate "initBGind.mkPred" sEnv (F.pAnd es)++ isLocal i es = do+ let pp = So.elaborate "filterLocal" sEnv $ F.PExist [(F.gsym i, F.gsort i)] $ F.pAnd (F.gexpr i:es)+ isValid F.dummySpan mempty pp++ root = mempty+ sortEquals xs = (bfs [0]) <$> makeEdges vs [] vs+ where+ vs = zip [0..] (root:(head <$> xs))++ bfs [] _ = []+ bfs (i:is) es = (snd $ (vs!!i)) : bfs (is++map snd (filter (\(j,k) -> (j==i && notElem k is)) es)) es++ makeEdges _ acc [] = return acc+ makeEdges vs acc (x:xs) = do ves <- concat <$> mapM (makeEdgesOne x) vs+ if any (\(i,j) -> elem (j,i) acc) ves+ then makeEdges (filter ((/= fst x) . fst) vs) (filter (\(i,j) -> ((i /= fst x) && (j /= fst x))) acc) xs+ else makeEdges vs (mergeEdges (ves ++ acc)) xs++ makeEdgesOne (i,_) (j,_) | i == j = return []+ makeEdgesOne (i,x) (j,y) = do+ ij <- isValid F.dummySpan (mkPred [x]) (mkPred [y])+ return (if ij then [(j,i)] else [])++ mergeEdges es = filter (\(i,j) -> (not (any (\k -> ((i,k) `elem` es && (k,j) `elem` es)) (fst <$> es)))) es++--------------------------------------------------------------------------------+ -- | Progress Bar -------------------------------------------------------------------------------- withProgressFI :: SolverInfo a b -> IO b -> IO b@@ -78,7 +198,7 @@ siKvars = S.fromList . M.keys . F.ws ---------------------------------------------------------------------------------solve_ :: (NFData a, F.Fixpoint a)+solve_ :: (NFData a, F.Fixpoint a, F.Loc a) => Config -> F.SInfo a -> Sol.Solution@@ -86,7 +206,7 @@ -> W.Worklist a -> SolveM (F.Result (Integer, a), Stats) ---------------------------------------------------------------------------------solve_ cfg fi s0 ks wkl = do +solve_ cfg fi s0 ks wkl = do let s1 = mappend s0 $ {-# SCC "sol-init" #-} S.init cfg fi ks s <- {-# SCC "sol-refine" #-} refine s1 wkl res <- {-# SCC "sol-result" #-} result cfg wkl s@@ -108,7 +228,7 @@ tidyPred = F.substf (F.eVar . F.tidySymbol) ---------------------------------------------------------------------------------refine :: Sol.Solution -> W.Worklist a -> SolveM Sol.Solution+refine :: (F.Loc a) => Sol.Solution -> W.Worklist a -> SolveM Sol.Solution -------------------------------------------------------------------------------- refine s w | Just (c, w', newScc, rnk) <- W.pop w = do@@ -126,13 +246,14 @@ --------------------------------------------------------------------------- -- | Single Step Refinement ----------------------------------------------- ----------------------------------------------------------------------------refineC :: Int -> Sol.Solution -> F.SimpC a -> SolveM (Bool, Sol.Solution)+refineC :: (F.Loc a) => Int -> Sol.Solution -> F.SimpC a+ -> SolveM (Bool, Sol.Solution) --------------------------------------------------------------------------- refineC _i s c | null rhs = return (False, s) | otherwise = do be <- getBinds let lhs = S.lhsPred be s c- kqs <- filterValid lhs rhs+ kqs <- filterValid (cstrSpan c) lhs rhs return $ S.update s ks kqs where _ci = F.subcId c@@ -158,21 +279,21 @@ -------------------------------------------------------------------------------- -- | Convert Solution into Result ---------------------------------------------- ---------------------------------------------------------------------------------result :: (F.Fixpoint a) => Config -> W.Worklist a -> Sol.Solution+result :: (F.Fixpoint a, F.Loc a) => Config -> W.Worklist a -> Sol.Solution -> SolveM (F.Result (Integer, a)) -------------------------------------------------------------------------------- result cfg wkl s = do lift $ writeLoud "Computing Result"- stat <- result_ wkl s - lift $ whenNormal $ putStrLn $ "RESULT: " ++ show (F.sid <$> stat)+ stat <- result_ wkl s+ lift $ whenLoud $ putStrLn $ "RESULT: " ++ show (F.sid <$> stat) F.Result (ci <$> stat) <$> solResult cfg s <*> return mempty where ci c = (F.subcId c, F.sinfo c) solResult :: Config -> Sol.Solution -> SolveM (M.HashMap F.KVar F.Expr)-solResult cfg = minimizeResult cfg . Sol.result +solResult cfg = minimizeResult cfg . Sol.result -result_ :: W.Worklist a -> Sol.Solution -> SolveM (F.FixResult (F.SimpC a))+result_ :: (F.Loc a) => W.Worklist a -> Sol.Solution -> SolveM (F.FixResult (F.SimpC a)) result_ w s = res <$> filterM (isUnsat s) cs where cs = W.unsatCandidates w@@ -187,7 +308,7 @@ -- -- such that `minimizeConjuncts ps` is a minimal subset of ps where no -- is implied by /\_{q' in qs \ qs}--- see: tests/pos/min00.fq for an example. +-- see: tests/pos/min00.fq for an example. -------------------------------------------------------------------------------- minimizeResult :: Config -> M.HashMap F.KVar F.Expr -> SolveM (M.HashMap F.KVar F.Expr)@@ -200,12 +321,12 @@ minimizeConjuncts p = F.pAnd <$> go (F.conjuncts p) [] where go [] acc = return acc- go (p:ps) acc = do b <- isValid (F.pAnd (acc ++ ps)) p+ go (p:ps) acc = do b <- isValid F.dummySpan (F.pAnd (acc ++ ps)) p if b then go ps acc else go ps (p:acc) ---------------------------------------------------------------------------------isUnsat :: Sol.Solution -> F.SimpC a -> SolveM Bool+isUnsat :: (F.Loc a) => Sol.Solution -> F.SimpC a -> SolveM Bool -------------------------------------------------------------------------------- isUnsat s c = do -- lift $ printf "isUnsat %s" (show (F.subcId c))@@ -213,7 +334,7 @@ be <- getBinds let lp = S.lhsPred be s c let rp = rhsPred c- res <- not <$> isValid lp rp+ res <- not <$> isValid (cstrSpan c) lp rp lift $ whenLoud $ showUnsat res (F.subcId c) lp rp return res @@ -232,9 +353,13 @@ | isTarget c = F.crhs c | otherwise = errorstar $ "rhsPred on non-target: " ++ show (F.sid c) -isValid :: F.Expr -> F.Expr -> SolveM Bool-isValid p q = (not . null) <$> filterValid p [(q, ())]+--------------------------------------------------------------------------------+isValid :: F.SrcSpan -> F.Expr -> F.Expr -> SolveM Bool+--------------------------------------------------------------------------------+isValid sp p q = (not . null) <$> filterValid sp p [(q, ())] +cstrSpan :: (F.Loc a) => F.SimpC a -> F.SrcSpan+cstrSpan = F.srcSpan . F.sinfo {- ---------------------------------------------------------------------------@@ -245,3 +370,49 @@ putBlankLn donePhase Loud msg -}+++-- NV TODO Move to a new file+-------------------------------------------------------------------------------+-- | Interaction with the user when Solving -----------------------------------+-------------------------------------------------------------------------------++_iMergePartitions :: [(Int, F.SInfo a)] -> IO [(Int, F.SInfo a)]+_iMergePartitions ifis = do+ putStrLn "Current Partitions are: "+ putStrLn $ unlines (partitionInfo <$> ifis)+ putStrLn "Merge Partitions? Y/N"+ c <- getChar+ if c == 'N'+ then do putStrLn "Solving Partitions"+ return ifis+ else do+ (i, j) <- getMergePartition (length ifis)+ _iMergePartitions (mergePartitions i j ifis)++getMergePartition :: Int -> IO (Int, Int)+getMergePartition n = do+ putStrLn "Which two partition to merge? (i, j)"+ ic <- getLine+ let (i,j) = read ic :: (Int, Int)+ if i < 1 || n < i || j < 1 || n < j+ then do putStrLn ("Invalid Partition numbers, write (i,j) with 1 <= i <= " ++ show n)+ getMergePartition n+ else return (i,j)++mergePartitions :: Int -> Int -> [(Int, F.SInfo a)] -> [(Int, F.SInfo a)]+mergePartitions i j fis+ = zip [1..] ((takei i `mappend` (takei j){F.bs = mempty}):rest)+ where+ takei i = snd (fis L.!! (i - 1))+ rest = snd <$> filter (\(k,_) -> (k /= i && k /= j)) fis++partitionInfo :: (Int, F.SInfo a) -> String+partitionInfo (i, fi)+ = "Partition number " ++ show i ++ "\n" +++ "Defined ?? " ++ show defs ++ "\n" +++ "Used ?? " ++ show uses+ where+ gs = F.wloc . snd <$> L.filter (F.isGWfc . snd) (M.toList (F.ws fi))+ defs = L.nub (F.gsrc <$> gs)+ uses = L.nub (F.gused <$> gs)
src/Language/Fixpoint/SortCheck.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE Strict #-}+{-# LANGUAGE StrictData #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-}@@ -5,6 +7,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-}+{-# LANGUAGE BangPatterns #-} -- | This module has the functions that perform sort-checking, and related -- operations on Fixpoint expressions and predicates.@@ -39,15 +42,20 @@ -- * Sort-Directed Transformations , Elaborate (..)+ , applySorts+ , unApplyAt+ , toInt -- * Predicates on Sorts , isFirstOrder , isMono ) where -+-- import Control.DeepSeq import Control.Monad-import Control.Monad.Except (MonadError(..))+import Control.Monad.Except -- (MonadError(..))+import Control.Monad.State.Strict+ import qualified Data.HashMap.Strict as M import qualified Data.List as L import Data.Maybe (mapMaybe, fromMaybe)@@ -55,8 +63,9 @@ import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Misc import Language.Fixpoint.Types hiding (subst)-import Language.Fixpoint.Types.Visitor (mapExpr, stripCasts, foldSort)+import qualified Language.Fixpoint.Types.Visitor as Vis import qualified Language.Fixpoint.Smt.Theories as Thy+-- import qualified Language.Fixpoint.Smt.Types as Thy import Text.PrettyPrint.HughesPJ import Text.Printf @@ -67,7 +76,7 @@ -------------------------------------------------------------------------------- isMono :: Sort -> Bool ---------------------------------------------------------------------------------isMono = null . foldSort fv []+isMono = null . Vis.foldSort fv [] where fv vs (FVar i) = i : vs fv vs _ = vs@@ -77,11 +86,11 @@ -- | Elaborate: make polymorphic instantiation explicit via casts, -- make applications monomorphic for SMTLIB. This deals with -- polymorphism by `elaborate`-ing all refinements except for--- KVars. THIS IS NOW MANDATORY as sort-variables can be instantiated--- to `int` and `bool`.+-- KVars. THIS IS NOW MANDATORY as sort-variables can be+-- instantiated to `int` and `bool`. -------------------------------------------------------------------------------- class Elaborate a where- elaborate :: String -> SEnv Sort -> a -> a+ elaborate :: String -> SymEnv -> a -> a instance Elaborate (SInfo a) where elaborate x senv si = si@@ -93,6 +102,9 @@ instance (Elaborate e) => (Elaborate (Triggered e)) where elaborate x env t = fmap (elaborate x env) t +instance (Elaborate a) => (Elaborate (Maybe a)) where+ elaborate x env t = fmap (elaborate x env) t+ instance Elaborate Sort where elaborate _ _ = go where@@ -105,16 +117,16 @@ funSort = FApp . FApp funcSort instance Elaborate Expr where- elaborate msg env = elabNumeric . elabApply . elabExpr msg env+ elaborate msg env = elabNumeric . elabApply env . elabExpr msg env instance Elaborate (Symbol, Sort) where- elaborate msg env (x, s) = (x,) (elaborate msg env s)+ elaborate msg env (x, s) = (x, elaborate msg env s) instance Elaborate a => Elaborate [a] where elaborate msg env xs = elaborate msg env <$> xs elabNumeric :: Expr -> Expr-elabNumeric = mapExpr go+elabNumeric = Vis.mapExpr go where go (ETimes e1 e2) | exprSort "txn1" e1 == FReal@@ -131,7 +143,7 @@ elaborate x env (RR s (Reft (v, e))) = RR s (Reft (v, e')) where e' = elaborate x env' e- env' = insertSEnv v s env+ env' = insertSymEnv v s env instance Elaborate BindEnv where elaborate z env = mapBindEnv (\i (x, sr) -> (x, elaborate (z ++ msg i x sr) env sr))@@ -146,28 +158,29 @@ -- , qBody = elaborate [env ++ qParams] (qBody q) -- } -elabExpr :: String -> SEnv Sort -> Expr -> Expr-elabExpr msg γ e- = case runCM0 $ elab f e of+elabExpr :: String -> SymEnv -> Expr -> Expr+elabExpr msg env e+ = case runCM0 $ elab (env, f) e of Left msg -> die $ err dummySpan (d msg) Right s -> fst s where- f = (`lookupSEnvWithDistance` γ')- γ' = γ `mappend` Thy.theorySEnv- d m = vcat [ "elaborate" <+> text msg <+> "failed on:"+ sEnv = seSort env+ f = (`lookupSEnvWithDistance` sEnv)+ -- γ' = γ `mappend` (Thy.tsSort <$> Thy.theorySymbols)+ d m = vcat [ "elaborate" <+> text msg <+> "failed on:" , nest 4 (pprint e) , "with error" , nest 4 (text m) , "in environment"- , nest 4 (pprint $ subEnv γ' e)+ , nest 4 (pprint $ subEnv sEnv e) ] -elabApply :: Expr -> Expr-elabApply = go+elabApply :: SymEnv -> Expr -> Expr+elabApply env = go where go e = case splitArgs e of (e', []) -> step e'- (f , es) -> defuncEApp (go f) (mapFst go <$> es)+ (f , es) -> defuncEApp env (go f) (mapFst go <$> es) step (PAnd []) = PTrue step (POr []) = PFalse step (ENeg e) = ENeg (go e)@@ -184,7 +197,7 @@ step (PAtom r e1 e2) = PAtom r (go e1) (go e2) step e@(EApp {}) = go e step (ELam b e) = ELam b (go e)- step (PGrad k su e) = PGrad k su (go e)+ step (PGrad k su i e) = PGrad k su i (go e) step e@(PKVar {}) = e step e@(ESym {}) = e step e@(ECon {}) = e@@ -228,60 +241,42 @@ -- | Checking Refinements ------------------------------------------------------ -------------------------------------------------------------------------------- +-- RJ: why are we handrolling monads! -- | Types used throughout checker -type StateM = Int--newtype CheckM a = CM {runCM :: StateM -> (StateM, Either String a)}+-- newtype CheckM a = CM {runCM :: StateM -> (StateM, Either String a)}+-- type CheckM = ExceptT ChError (State ChState)+type CheckM = StateT ChState (Either ChError)+type ChError = String+type ChState = Int type Env = Symbol -> SESearch Sort---instance Monad CheckM where- return x = CM $ \i -> (i, Right x)- (CM m) >>= f = CM $ \i -> case m i of- (j, Left s) -> (j, Left s)- (j, Right x) -> runCM (f x) j---instance MonadError String CheckM where- throwError s = CM $ \i -> (i, Left s)- (CM m) `catchError` f = CM $ \i -> case m i of- (j, Left s) -> runCM (f s) j- (j, Right x) -> (j, Right x)+type ElabEnv = (SymEnv, Env) withError :: CheckM a -> String -> CheckM a act `withError` e' = act `catchError` (\e -> throwError (e ++ "\n because\n" ++ e')) -instance Functor CheckM where- fmap f (CM m) = CM $ \i -> case m i of {(j, Left s) -> (j, Left s); (j, Right x) -> (j, Right $ f x)}--instance Applicative CheckM where- pure x = CM $ \i -> (i, Right x)- (CM f) <*> (CM m) = CM $ \i -> case m i of- (j, Left s) -> (j, Left s)- (_, Right x) -> case f i of- (k, Left s) -> (k, Left s)- (k, Right g) -> (k, Right $ g x)--initCM :: StateM-initCM = 42- runCM0 :: CheckM a -> Either String a-runCM0 act = snd $ runCM act initCM+-- runCM0 act = snd $ runCM act initCM+runCM0 act = fst <$> runStateT act initCM -- :: Either ChError (a, ChState)+ where+ initCM = 42 -class Freshable a where- fresh :: CheckM a- refresh :: a -> CheckM a- refresh _ = fresh -instance Freshable Int where- fresh = CM (\n -> (n+1, Right n))+-- class Freshable a where+-- fresh :: CheckM a+-- refresh :: a -> CheckM a+-- refresh _ = fresh -instance Freshable [Int] where- fresh = mapM (const fresh) [0..]- refresh = mapM refresh+-- instance Freshable Int where +fresh :: CheckM Int+fresh = do+ !n <- get+ put (n + 1)+ return n+ -- CM (\n -> (n + 1, Right n))+ -------------------------------------------------------------------------------- -- | Checking Refinements ------------------------------------------------------ --------------------------------------------------------------------------------@@ -369,7 +364,7 @@ checkExpr f (POr ps) = mapM_ (checkPred f) ps >> return boolSort checkExpr f (PAtom r e e') = checkRel f r e e' >> return boolSort checkExpr _ (PKVar {}) = return boolSort-checkExpr f (PGrad _ _ e) = checkPred f e >> return boolSort+checkExpr f (PGrad _ _ _ e) = checkPred f e >> return boolSort checkExpr f (PAll bs e ) = checkExpr (addEnv f bs) e checkExpr f (PExist bs e) = checkExpr (addEnv f bs) e@@ -386,17 +381,17 @@ -------------------------------------------------------------------------------- -- | Elaborate expressions with types to make polymorphic instantiation explicit. ---------------------------------------------------------------------------------elab :: Env -> Expr -> CheckM (Expr, Sort)+elab :: ElabEnv -> Expr -> CheckM (Expr, Sort) ---------------------------------------------------------------------------------elab f e@(EBin o e1 e2) = do+elab f@(_, g) e@(EBin o e1 e2) = do (e1', s1) <- elab f e1 (e2', s2) <- elab f e2- s <- checkExpr f e+ s <- checkOpTy g e s1 s2 return (EBin o (ECst e1' s1) (ECst e2' s2), s) elab f (EApp e1@(EApp _ _) e2) = do (e1', _, e2', s2, s) <- elabEApp f e1 e2- return (eAppC s e1' (ECst e2' s2), s)+ return (eAppC s e1' (ECst e2' s2), s) elab f (EApp e1 e2) = do (e1', s1, e2', s2, s) <- elabEApp f e1 e2@@ -417,22 +412,22 @@ elab _ e@(PKVar _ _) = return (e, boolSort) -elab f (PGrad k su e) = - ((, boolSort) . PGrad k su . fst) <$> elab f e +elab f (PGrad k su i e) =+ ((, boolSort) . PGrad k su i . fst) <$> elab f e -elab f e@(EVar x) =+elab (_, f) e@(EVar x) = (e,) <$> checkSym f x elab f (ENeg e) = do (e', s) <- elab f e return (ENeg e', s) -elab f (EIte p e1 e2) = do- (p', _) <- elab f p- (e1', _) <- elab f e1- (e2', _) <- elab f e2- s <- checkIte f p e1 e2- return (EIte p' e1' e2', s)+elab f@(_,g) (EIte p e1 e2) = do+ (p', _) <- elab f p+ (e1', s1) <- elab f e1+ (e2', s2) <- elab f e2+ s <- checkIteTy g p e1' e2' s1 s2+ return (EIte p' (cast e1' s) (cast e2' s), s) elab f (ECst e t) = do (e', _) <- elab f e@@ -460,13 +455,13 @@ ps' <- mapM (elab f) ps return (POr (fst <$> ps'), boolSort) -elab f e@(PAtom Eq e1 e2) = do- t1 <- checkExpr f e1- t2 <- checkExpr f e2- (t1',t2') <- unite f e t1 t2 `withError` (errElabExpr e)+elab f@(_,g) e@(PAtom Eq e1 e2) = do+ t1 <- checkExpr g e1+ t2 <- checkExpr g e2+ (t1',t2') <- unite g e t1 t2 `withError` (errElabExpr e) e1' <- elabAs f t1' e1 e2' <- elabAs f t2' e2- return (PAtom Eq (ECst e1' t1') (ECst e2' t2'), boolSort)+ return (PAtom Eq (ECst e1' t1') (ECst e2' t2') , boolSort) elab f (PAtom r e1 e2) | r == Ueq || r == Une = do@@ -474,109 +469,175 @@ (e2', _) <- elab f e2 return (PAtom r e1' e2', boolSort) -elab f (PAtom r e1 e2) = do- e1' <- uncurry Thy.toInt <$> elab f e1- e2' <- uncurry Thy.toInt <$> elab f e2+elab f@(env, _) (PAtom r e1 e2) = do+ e1' <- uncurry (toInt env) <$> elab f e1+ e2' <- uncurry (toInt env) <$> elab f e2 return (PAtom r e1' e2', boolSort) elab f (PExist bs e) = do- (e', s) <- elab (addEnv f bs) e+ (e', s) <- elab (elabAddEnv f bs) e let bs' = elaborate "PExist Args" mempty bs return (PExist bs' e', s) elab f (PAll bs e) = do- (e', s) <- elab (addEnv f bs) e+ (e', s) <- elab (elabAddEnv f bs) e let bs' = elaborate "PAll Args" mempty bs return (PAll bs' e', s) elab f (ELam (x,t) e) = do- (e', s) <- elab (addEnv f [(x,t)]) e+ (e', s) <- elab (elabAddEnv f [(x, t)]) e let t' = elaborate "ELam Arg" mempty t- return (ELam (x,t') (ECst e' s), FFunc t s)+ return (ELam (x, t') (ECst e' s), FFunc t s) elab _ (ETApp _ _) = error "SortCheck.elab: TODO: implement ETApp" elab _ (ETAbs _ _) = error "SortCheck.elab: TODO: implement ETAbs" --- elabAs :: Env -> Sort -> Expr -> CheckM Expr--- elabAs f t e = tracepp msg <$> elabAs' f t e--- where--- msg = "elabAs: t = " ++ show t ++ " e = " ++ show e+elabAddEnv :: Eq a => (t, a -> SESearch b) -> [(a, b)] -> (t, a -> SESearch b)+elabAddEnv (g, f) bs = (g, addEnv f bs) -elabAs :: Env -> Sort -> Expr -> CheckM Expr-elabAs f t (EApp e1 e2) = elabAppAs f t e1 e2-elabAs f _ e = fst <$> elab f e+cast :: Expr -> Sort -> Expr+cast (ECst e _) t = ECst e t+cast e t = ECst e t -elabAppAs :: Env -> Sort -> Expr -> Expr -> CheckM Expr-elabAppAs f t g e = do- gT <- generalize =<< checkExpr f g+elabAs :: ElabEnv -> Sort -> Expr -> CheckM Expr+elabAs f t e = {- tracepp _msg <$> -} go e+ where+ _msg = "elabAs: t = " ++ showpp t ++ " e = " ++ showpp e+ go (EApp e1 e2) = elabAppAs f t e1 e2+ -- go (EIte b e1 e2) = EIte b <$> go e1 <*> go e2+ go e = fst <$> elab f e++-- DUPLICATION with `checkApp'`+elabAppAs :: ElabEnv -> Sort -> Expr -> Expr -> CheckM Expr+elabAppAs env@(_, f) t g e = do+ gT <- checkExpr f g eT <- checkExpr f e (iT, oT, isu) <- checkFunSort gT let ge = Just (EApp g e) su <- unifyMany f ge isu [oT, iT] [t, eT] let tg = apply su gT- g' <- elabAs f tg g+ g' <- elabAs env tg g let te = apply su eT- e' <- elabAs f te e+ e' <- elabAs env te e return $ EApp (ECst g' tg) (ECst e' te) -elabEApp :: Env -> Expr -> Expr -> CheckM (Expr, Sort, Expr, Sort, Sort)-elabEApp f e1 e2 = do- (e1', s1) <- elab f e1- (e2', s2) <- elab f e2- s <- elabAppSort f e1 e2 s1 s2- return (e1', s1, e2', s2, s)+elabEApp :: ElabEnv -> Expr -> Expr -> CheckM (Expr, Sort, Expr, Sort, Sort)+elabEApp f@(_, g) e1 e2 = do+ (e1', s1) <- elab f e1+ (e2', s2) <- elab f e2+ (s1', s2', s) <- elabAppSort g e1 e2 s1 s2+ return (e1', s1', e2', s2', s) +elabAppSort :: Env -> Expr -> Expr -> Sort -> Sort -> CheckM (Sort, Sort, Sort)+elabAppSort f e1 e2 s1 s2 = do+ let e = Just (EApp e1 e2)+ (sIn, sOut, su) <- checkFunSort s1+ su' <- unify1 f e su sIn s2 -- unifyMany f e su [sIn] [s2]+ return $ (apply su' s1, apply su' s2, apply su' sOut)++ -------------------------------------------------------------------------------- -- | defuncEApp monomorphizes function applications. ---------------------------------------------------------------------------------defuncEApp :: Expr -> [(Expr, Sort)] -> Expr-defuncEApp e es- | Thy.isSmt2App (stripCasts e) es- = eApps e (fst <$> es)- | otherwise- = L.foldl' makeApplication e es+defuncEApp :: SymEnv -> Expr -> [(Expr, Sort)] -> Expr+defuncEApp env e es = L.foldl' makeApplication e' es'+ where+ (e', es') = takeArgs (seTheory env) e es --- e1 e2 => App (App runFun e1) (toInt e2)+takeArgs :: SEnv TheorySymbol -> Expr -> [(Expr, a)] -> (Expr, [(Expr, a)])+takeArgs env e es =+ case Thy.isSmt2App env (Vis.stripCasts e) of+ Just n -> let (es1, es2) = splitAt n es+ in (eApps e (fst <$> es1), es2)+ Nothing -> (e, es)++-- 'e1' is the function, 'e2' is the argument, 's' is the OUTPUT TYPE makeApplication :: Expr -> (Expr, Sort) -> Expr-makeApplication e1 (e2, s) = ECst (EApp (EApp (EVar f) e1) e2') s+makeApplication e1 (e2, s) = ECst (EApp (EApp f e1) e2) s where- f = makeFunSymbol (spec s)- e2' = Thy.toInt e2 (exprSort "makeApplication" e2)- -- s = fromMaybe (resultType e1 e2) sO- spec :: Sort -> Sort- spec (FAbs _ s) = spec s- spec s = s+ f = applyAt (exprSort "makeAppl" e2) s -makeFunSymbol :: Sort -> Symbol-makeFunSymbol s- | (FApp (FTC c) _) <- s- , Thy.isConName setConName c- = setApplyName 1- | (FApp (FApp (FTC c) _) _) <- s- , Thy.isConName mapConName c- = mapApplyName 1- | (FApp (FTC bv) (FTC s)) <- s- , Thy.isConName bitVecName bv- , Just _ <- Thy.sizeBv s- = bitVecApplyName 1- | FTC c <- s, c == boolFTyCon- = boolApplyName 1- | s == FReal- = realApplyName 1- | otherwise- = intApplyName 1+applyAt :: Sort -> Sort -> Expr+applyAt s t = ECst (EVar applyName) (FFunc s t) +-- JUST make "toInt" call "makeApplication" also, so they are wrapped in apply+-- MAY CAUSE CRASH (apply-on-apply) so rig `isSmt2App` to treat `apply` as SPECIAL.++-- TODO: proper toInt+toInt :: SymEnv -> Expr -> Sort -> Expr+toInt env e s+ | isSmtInt = e+ | otherwise = ECst (EApp f (ECst e s)) FInt+ where+ isSmtInt = isInt env s+ f = toIntAt s++isInt :: SymEnv -> Sort -> Bool+isInt env s = case sortSmtSort False (seData env) s of+ SInt -> True+ SString -> True+ SReal -> True+ _ -> False++toIntAt :: Sort -> Expr+toIntAt s = ECst (EVar toIntName) (FFunc s FInt)++unApplyAt :: Expr -> Maybe Sort+unApplyAt (ECst (EVar f) t@(FFunc {}))+ | f == applyName = Just t+unApplyAt _ = Nothing++ splitArgs :: Expr -> (Expr, [(Expr, Sort)]) splitArgs = go [] where go acc (ECst (EApp e1 e) s) = go ((e, s) : acc) e1+ -- go acc e@(EApp f _)+ -- | Just _ <- unApplyAt f = (e, acc) go _ e@EApp{} = errorstar $ "UNEXPECTED: splitArgs: EApp without output type: " ++ showpp e -- go acc (ECst e _) = go acc e go acc e = (e, acc) --------------------------------------------------------------------------------+{- | [NOTE:apply-monomorphization]++ Because SMTLIB does not support higher-order functions,+ all _non-theory_ function applications++ EApp e1 e2++ are represented, in SMTLIB, as++ (Eapp (EApp apply e1) e2)++ where 'apply' is 'ECst (EVar "apply") t' and+ 't' is 'FFunc a b'+ 'a','b' are the sorts of 'e2' and 'e1 e2' respectively.++ Note that *all polymorphism* goes through this machinery.++ Just before sending to the SMT solver, we use the cast 't'+ to generate a special 'apply_at_t' symbol.++ To let us do the above, we populate 'SymEnv' with the _set_+ of all sorts at which 'apply' is used, computed by 'applySorts'.+ -}++--------------------------------------------------------------------------------+applySorts :: Vis.Visitable t => t -> [Sort]+--------------------------------------------------------------------------------+applySorts = {- tracepp "applySorts" . -} (defs ++) . Vis.fold vis () []+ where+ defs = [FFunc t1 t2 | t1 <- basicSorts, t2 <- basicSorts]+ vis = (Vis.defaultVisitor :: Vis.Visitor [KVar] t) { Vis.accExpr = go }+ go _ (EApp (ECst (EVar f) t) _)+ | f == applyName+ = [t]+ go _ _ = []++-------------------------------------------------------------------------------- -- | Expressions sort --------------------------------------------------------- -------------------------------------------------------------------------------- exprSort :: String -> Expr -> Sort@@ -603,7 +664,7 @@ checkSym :: Env -> Symbol -> CheckM Sort checkSym f x = case f x of- Found s -> return s+ Found s -> instantiate s Alts xs -> throwError $ errUnboundAlts x xs -- | Helper for checking if-then-else expressions@@ -612,9 +673,15 @@ checkPred f p t1 <- checkExpr f e1 t2 <- checkExpr f e2- ((`apply` t1) <$> unifys f e' [t1] [t2]) `withError` (errIte e1 e2 t1 t2)+ checkIteTy f p e1 e2 t1 t2++-- ((`apply` t1) <$> unifys f e' [t1] [t2]) `withError` (errIte e1 e2 t1 t2)++checkIteTy :: Env -> Expr -> Expr -> Expr -> Sort -> Sort -> CheckM Sort+checkIteTy f p e1 e2 t1 t2+ = ((`apply` t1) <$> unifys f e' [t1] [t2]) `withError` (errIte e1 e2 t1 t2) where- e' = Just (EIte p e1 e2)+ e' = Just (EIte p e1 e2) -- | Helper for checking cast expressions checkCst :: Env -> Sort -> Expr -> CheckM Sort@@ -624,17 +691,6 @@ = do t' <- checkExpr f e ((`apply` t) <$> unifys f (Just e) [t] [t']) `withError` (errCast e t' t) -elabAppSort :: Env -> Expr -> Expr -> Sort -> Sort -> CheckM Sort-elabAppSort f e1 e2 s1 s2 = do- s1' <- generalize s1- let e = Just (EApp e1 e2)- case s1' of- FFunc sx s -> (`apply` s) <$> unifys f e [sx] [s2]- FVar i -> do j <- refresh 0 - k <- refresh 0 - (`apply` (FVar k)) <$> unifyMany f e (updateVar i (FFunc (FVar j) (FVar j)) emptySubst) [FVar j] [s2]- _ -> errorstar ("elabAppSort for expr" ++ showpp (EApp e1 e2) ++ " with sorts" ++ showpp s1 ++ " and " ++ showpp s2 )- checkApp :: Env -> Maybe Sort -> Expr -> Expr -> CheckM Sort checkApp f to g es = snd <$> checkApp' f to g es@@ -648,42 +704,26 @@ return $ apply θ t -- | Helper for checking uninterpreted function applications--- | Checking function application should be curried,--- | consider checking+-- | Checking function application should be curried, e.g. -- | fromJust :: Maybe a -> a, f :: Maybe (b -> b), x: c |- fromJust f x+-- RJ: The above comment makes no sense to me :( +-- DUPLICATION with 'elabAppAs' checkApp' :: Env -> Maybe Sort -> Expr -> Expr -> CheckM (TVSubst, Sort) checkApp' f to g e = do- gt <- checkExpr f g >>= generalize+ gt <- checkExpr f g et <- checkExpr f e (it, ot, isu) <- checkFunSort gt let ge = Just (EApp g e)- θ <- unifyMany f ge isu [it] [et]- let t = apply θ ot+ su <- unifyMany f ge isu [it] [et]+ let t = apply su ot case to of- Nothing -> return (θ, t)- Just t' -> do θ' <- unifyMany f ge θ [t] [t']+ Nothing -> return (su, t)+ Just t' -> do θ' <- unifyMany f ge su [t] [t'] let ti = apply θ' et _ <- checkExprAs f ti e return (θ', apply θ' t) -{--checkApp' f to g' e- = do gt <- checkExpr f g- gt' <- generalize gt- (its, ot) <- sortFunction (length es) gt'- ets <- mapM (checkExpr f) es- θ <- unifys f its ets- let t = apply θ ot- case to of- Nothing -> return (θ, t)- Just t' -> do θ' <- unifyMany f θ [t] [t']- let ts = apply θ' <$> ets- _ <- zipWithM (checkExprAs f) ts es- return (θ', apply θ' t)- where- (g, es) = splitEApp $ EApp g' e--} -- | Helper for checking binary (numeric) operations checkNeg :: Env -> Expr -> CheckM Sort@@ -735,7 +775,6 @@ -------------------------------------------------------------------------------- -- | Checking Predicates ------------------------------------------------------- --------------------------------------------------------------------------------- checkPred :: Env -> Expr -> CheckM () checkPred f e = checkExpr f e >>= checkBoolSort e @@ -762,6 +801,7 @@ t2 <- checkExpr f e2 checkRelTy f (PAtom r e1 e2) r t1 t2 + checkRelTy :: Env -> Expr -> Brel -> Sort -> Sort -> CheckM () checkRelTy _ _ Ueq _ _ = return () checkRelTy _ _ Une _ _ = return ()@@ -774,16 +814,10 @@ checkRelTy f _ _ s1 FInt = checkNumeric f s1 `withError` (errNonNumeric s1) checkRelTy f _ _ FReal s2 = checkFractional f s2 `withError` (errNonFractional s2) checkRelTy f _ _ s1 FReal = checkFractional f s1 `withError` (errNonFractional s1)---- checkRelTy _ e Eq t1 t2--- | t1 == boolSort || t2 == boolSort = throwError $ errRel e t1 t2--- checkRelTy _ e Ne t1 t2--- | t1 == boolSort || t2 == boolSort = throwError $ errRel e t1 t2--checkRelTy f e Eq t1 t2 = void (unifys f (Just e) [t1] [t2] `withError` (errRel e t1 t2))-checkRelTy f e Ne t1 t2 = void (unifys f (Just e) [t1] [t2] `withError` (errRel e t1 t2))+checkRelTy f e Eq t1 t2 = void (unifys f (Just e) [t1] [t2] `withError` (errRel e t1 t2))+checkRelTy f e Ne t1 t2 = void (unifys f (Just e) [t1] [t2] `withError` (errRel e t1 t2)) -checkRelTy _ e _ t1 t2 = unless (t1 == t2) (throwError $ errRel e t1 t2)+checkRelTy _ e _ t1 t2 = unless (t1 == t2) (throwError $ errRel e t1 t2) -------------------------------------------------------------------------------- -- | Sort Unification@@ -827,120 +861,137 @@ unify1 :: Env -> Maybe Expr -> TVSubst -> Sort -> Sort -> CheckM TVSubst-unify1 f e θ (FVar i) t+unify1 f e !θ (FVar !i) !t = unifyVar f e θ i t-unify1 f e θ t (FVar i)+unify1 f e !θ !t (FVar !i) = unifyVar f e θ i t-unify1 f e θ (FApp t1 t2) (FApp t1' t2')+unify1 f e !θ (FApp !t1 !t2) (FApp !t1' !t2') = unifyMany f e θ [t1, t2] [t1', t2']-unify1 _ _ θ (FTC l1) (FTC l2)+unify1 _ _ !θ (FTC !l1) (FTC !l2) | isListTC l1 && isListTC l2 = return θ-unify1 f e θ t1@(FAbs _ _) t2 = do- t1'<- generalize t1+unify1 f e !θ !t1@(FAbs _ _) !t2 = do+ !t1' <- instantiate t1 unifyMany f e θ [t1'] [t2]-unify1 f e θ t1 t2@(FAbs _ _) = do- t2' <- generalize t2+unify1 f e !θ !t1 t2@(FAbs _ _) = do+ !t2' <- instantiate t2 unifyMany f e θ [t1] [t2']-unify1 _ _ θ s1 s2+unify1 _ _ !θ !s1 !s2 | isString s1, isString s2 = return θ--unify1 _ _ θ FInt FReal = return θ+unify1 _ _ !θ !FInt !FReal = return θ -unify1 _ _ θ FReal FInt = return θ+unify1 _ _ !θ !FReal !FInt = return θ -unify1 f e θ t FInt = do+unify1 f e !θ !t FInt = do checkNumeric f t `withError` (errUnify e t FInt) return θ -unify1 f e θ FInt t = do+unify1 f e !θ !FInt !t = do checkNumeric f t `withError` (errUnify e FInt t) return θ -unify1 f e θ (FFunc t1 t2) (FFunc t1' t2') = do+unify1 f e !θ (FFunc !t1 !t2) (FFunc !t1' !t2') = do unifyMany f e θ [t1, t2] [t1', t2'] -unify1 _ e θ t1 t2+unify1 _ e θ !t1 !t2 | t1 == t2 = return θ | otherwise = throwError $ errUnify e t1 t2 -subst :: (Int, Sort) -> Sort -> Sort-subst (j,tj) t@(FVar i)- | i == j = tj- | otherwise = t-subst su (FApp t1 t2) = FApp (subst su t1) (subst su t2)-subst _ (FTC l) = FTC l-subst su (FFunc t1 t2) = FFunc (subst su t1) (subst su t2)-subst (j,tj) (FAbs i t)- | i == j = FAbs i t- | otherwise = FAbs i $ subst (j,tj) t-subst _ s = s+subst :: Int -> Sort -> Sort -> Sort+subst !j !tj !t@(FVar !i)+ | i == j = tj+ | otherwise = t +subst !j !tj (FApp !t1 !t2) = FApp t1' t2'+ where+ !t1' = subst j tj t1+ !t2' = subst j tj t2 -generalize :: Sort -> CheckM Sort-generalize (FAbs i t) = do- v <- refresh 0- let sub = (i, FVar v)- subst sub <$> generalize t-generalize t =- return t+-- subst _ _ !(FTC l) = FTC l+subst !j !tj (FFunc !t1 !t2) = FFunc t1' t2'+ where+ !t1' = subst j tj $! t1+ !t2' = subst j tj $! t2 +subst !j !tj (FAbs !i !t)+ | i == j = FAbs i t+ | otherwise = FAbs i t'+ where+ !t' = subst j tj t++subst _ _ !s = s++--------------------------------------------------------------------------------+instantiate :: Sort -> CheckM Sort+--------------------------------------------------------------------------------+instantiate !t = go t+ -- / | tn > 10 = go $ tracepp ("SIZE=" ++ show tn) t+ -- / | otherwise = go t+ where+ -- _tn = sortSize t+ go (FAbs !i !t) = do+ !t' <- instantiate t+ !v <- fresh+ return $ subst i (FVar v) t'+ go !t =+ return t++-- instantiate s = do+-- where+-- (is, t) = unAbs s++_unAbs :: Sort -> ([Int], Sort)+_unAbs = go []+ where+ go !acc (FAbs !i !t) = go (i:acc) t+ go !acc !t = (reverse acc, t)++_sortSize :: Sort -> Int+_sortSize !t = go t+ where+ go :: Sort -> Int+ go (FApp !t1 !t2) = go t1 + go t2+ go (FFunc !t1 !t2) = go t1 + go t2+ go (FAbs _ !t) = 1 + go t+ go _ = 1++ unifyVar :: Env -> Maybe Expr -> TVSubst -> Int -> Sort -> CheckM TVSubst-unifyVar _ _ θ i t@(FVar j)+unifyVar _ _ θ !i !t@(FVar !j) = case lookupVar i θ of- Just t' -> if t == t' then return θ else return $ updateVar j t' θ- Nothing -> return $ updateVar i t θ+ Just !t' -> if t == t' then return θ else return (updateVar j t' θ)+ Nothing -> return (updateVar i t θ) -unifyVar f e θ i t+unifyVar f e θ !i !t = case lookupVar i θ of- Just (FVar j) -> return $ updateVar i t $ updateVar j t θ- Just t' -> if t == t' then return θ else unify1 f e θ t t'- Nothing -> return $ updateVar i t θ+ Just (FVar !j) -> return $ updateVar i t $ updateVar j t θ+ Just !t' -> if t == t' then return θ else unify1 f e θ t t'+ Nothing -> return (updateVar i t θ) -------------------------------------------------------------------------------- -- | Applying a Type Substitution ---------------------------------------------- -------------------------------------------------------------------------------- apply :: TVSubst -> Sort -> Sort ---------------------------------------------------------------------------------apply θ = sortMap f+apply θ = Vis.mapSort f where f t@(FVar i) = fromMaybe t (lookupVar i θ) f t = t ---------------------------------------------------------------------------------sortMap :: (Sort -> Sort) -> Sort -> Sort----------------------------------------------------------------------------------sortMap f (FAbs i t) = FAbs i (sortMap f t)-sortMap f (FFunc t1 t2) = FFunc (sortMap f t1) (sortMap f t2)-sortMap f (FApp t1 t2) = FApp (sortMap f t1) (sortMap f t2)-sortMap f t = f t---------------------------------------------------------------------------------- -- | Deconstruct a function-sort ----------------------------------------------- --------------------------------------------------------------------------------- checkFunSort :: Sort -> CheckM (Sort, Sort, TVSubst) checkFunSort (FAbs _ t) = checkFunSort t checkFunSort (FFunc t1 t2) = return (t1, t2, emptySubst)-checkFunSort (FVar i) = do j <- refresh 0 - k <- refresh 0 +checkFunSort (FVar i) = do j <- fresh+ k <- fresh return (FVar j, FVar k, updateVar i (FFunc (FVar j) (FVar k)) emptySubst) checkFunSort t = throwError $ errNonFunction 1 t -{--sortFunction :: Int -> Sort -> CheckM ([Sort], Sort)-sortFunction i t- = case functionSort t of- Nothing -> throwError $ errNonFunction i t- Just (_, ts, t') -> if length ts < i- then throwError $ errNonFunction i t- else let (its, ots) = splitAt i ts- in return (its, foldl FFunc t' ots)--}- -------------------------------------------------------------------------------- -- | API for manipulating Sort Substitutions ----------------------------------- --------------------------------------------------------------------------------@@ -951,7 +1002,7 @@ lookupVar i (Th m) = M.lookup i m updateVar :: Int -> Sort -> TVSubst -> TVSubst-updateVar i t (Th m) = Th (M.insert i t m)+updateVar !i !t (Th m) = Th (M.insert i t m) emptySubst :: TVSubst emptySubst = Th M.empty
src/Language/Fixpoint/Types.hs view
@@ -16,3 +16,4 @@ import Language.Fixpoint.Types.Constraints as X import Language.Fixpoint.Types.Utils as X import Language.Fixpoint.Types.Triggers as X+import Language.Fixpoint.Types.Theories as X
src/Language/Fixpoint/Types/Config.hs view
@@ -81,6 +81,7 @@ , minimizeKs :: Bool -- ^ min .fq by delta debug (sat with min kvars) , minimalSol :: Bool -- ^ shrink final solution by pruning redundant qualfiers from fixpoint , gradual :: Bool -- ^ solve "gradual" constraints+ , ginteractive :: Bool -- ^ interactive gradual solving , extensionality :: Bool -- ^ allow function extensionality , alphaEquivalence :: Bool -- ^ allow lambda alpha equivalence axioms , betaEquivalence :: Bool -- ^ allow lambda beta equivalence axioms@@ -161,6 +162,7 @@ , minimizeKs = False &= help "Delta debug to minimize fq file (sat with max kvars replaced by True)" , minimalSol = False &= help "Shrink fixpoint by removing implied qualifiers" , gradual = False &= help "Solve gradual-refinement typing constraints"+ , ginteractive = False &= help "Interactive Gradual Solving" , extensionality = False &= help "Allow function extensionality axioms" , alphaEquivalence = False &= help "Allow lambda alpha equivalence axioms" , betaEquivalence = False &= help "Allow lambda alpha equivalence axioms"
src/Language/Fixpoint/Types/Constraints.hs view
@@ -36,12 +36,14 @@ , SimpC (..) , Tag , TaggedC, clhs, crhs- , strengthenLhs+ -- , strengthenLhs+ , strengthenHyp -- * Accessing Constraints , addIds , sinfo , shiftVV+ , gwInfo, GWInfo (..) -- * Qualifiers , Qualifier (..)@@ -53,6 +55,7 @@ , FixSolution , GFixSolution, toGFixSol , Result (..)+ , unsafe, isUnsafe, safe -- * Cut KVars , Kuts (..)@@ -68,6 +71,9 @@ , Equation (..) , Rewrite (..) , getEqBody++ -- * Misc [should be elsewhere but here due to dependencies]+ , substVars ) where import qualified Data.Binary as B@@ -111,42 +117,89 @@ , wrft :: !(Symbol, Sort, KVar) , winfo :: !a , wexpr :: !Expr+ , wloc :: !GradInfo } deriving (Eq, Generic, Functor) +data GWInfo = GWInfo { gsym :: Symbol+ , gsort :: Sort+ , gexpr :: Expr+ , ginfo :: GradInfo+ }+ deriving (Eq, Generic) +gwInfo :: WfC a -> GWInfo+gwInfo (GWfC _ (x,s,_) _ e i)+ = GWInfo x s e i+gwInfo _+ = errorstar "gwInfo"+ updateWfCExpr :: (Expr -> Expr) -> WfC a -> WfC a updateWfCExpr _ w@(WfC {}) = w updateWfCExpr f w@(GWfC {}) = w{wexpr = f (wexpr w)} isGWfc :: WfC a -> Bool-isGWfc (GWfC _ _ _ _) = True-isGWfc (WfC _ _ _) = False+isGWfc (GWfC {}) = True+isGWfc (WfC {}) = False type SubcId = Integer -data SubC a = SubC { _senv :: !IBindEnv- , slhs :: !SortedReft- , srhs :: !SortedReft- , _sid :: !(Maybe SubcId)- , _stag :: !Tag- , _sinfo :: !a- }- deriving (Eq, Generic, Functor)+data SubC a = SubC+ { _senv :: !IBindEnv+ , slhs :: !SortedReft+ , srhs :: !SortedReft+ , _sid :: !(Maybe SubcId)+ , _stag :: !Tag+ , _sinfo :: !a+ }+ deriving (Eq, Generic, Functor) -data SimpC a = SimpC { _cenv :: !IBindEnv- , _crhs :: !Expr- , _cid :: !(Maybe Integer)- , _ctag :: !Tag- , _cinfo :: !a- }- deriving (Generic, Functor)+data SimpC a = SimpC+ { _cenv :: !IBindEnv+ , _crhs :: !Expr+ , _cid :: !(Maybe Integer)+ , _cbind :: !BindId -- ^ Id of lhs/rhs binder+ , _ctag :: !Tag+ , _cinfo :: !a+ }+ deriving (Generic, Functor) -strengthenLhs :: Expr -> SubC a -> SubC a-strengthenLhs e subc = subc {slhs = go (slhs subc)}++strengthenHyp :: SInfo a -> [(Integer, Expr)] -> SInfo a+strengthenHyp si ies = strengthenBinds si bindExprs where- go (RR s (Reft(v, r))) = RR s (Reft (v, pAnd [r, e]))+ bindExprs = safeFromList "strengthenHyp" (mapFst (subcBind si) <$> ies) +subcBind :: SInfo a -> Integer -> BindId+subcBind si i+ | Just c <- M.lookup i (cm si)+ = _cbind c+ | otherwise+ = errorstar $ "Unknown subcId in subcBind: " ++ show i+++strengthenBinds :: SInfo a -> M.HashMap BindId Expr -> SInfo a+strengthenBinds si m = si { bs = mapBindEnv f (bs si) }+ where+ f i (x, sr) = case M.lookup i m of+ Nothing -> (x, sr)+ Just e -> (x, strengthenSortedReft sr e)++strengthenSortedReft :: SortedReft -> Expr -> SortedReft+strengthenSortedReft (RR s (Reft (v, r))) e = RR s (Reft (v, pAnd [r, e]))++++{-+ [(Int, Expr)] ==> [(BindId, Expr)]++ -}++-- strengthenLhs :: Expr -> SubC a -> SubC a+-- strengthenLhs e subc = subc {slhs = go (slhs subc)}+-- where+-- go (RR s (Reft(v, r))) = RR s (Reft (v, pAnd [r, e]))+ class TaggedC c a where senv :: c a -> IBindEnv sid :: c a -> Maybe Integer@@ -206,6 +259,15 @@ soln = mappend (resSolution r1) (resSolution r2) gsoln = mappend (gresSolution r1) (gresSolution r2) +unsafe, safe :: Result a+unsafe = mempty {resStatus = Unsafe []}+safe = mempty {resStatus = Safe}++isUnsafe :: Result a -> Bool+isUnsafe r | Unsafe _ <- resStatus r+ = True+isUnsafe _ = False+ instance (Ord a, Fixpoint a) => Fixpoint (FixResult (SubC a)) where toFix Safe = text "Safe" -- toFix (UnknownError d) = text $ "Unknown Error: " ++ d@@ -285,6 +347,7 @@ instance B.Binary Qualifier instance B.Binary Kuts instance B.Binary HOInfo+instance B.Binary GWInfo instance B.Binary GFixSolution instance (B.Binary a) => B.Binary (SubC a) instance (B.Binary a) => B.Binary (WfC a)@@ -295,6 +358,7 @@ instance NFData Kuts instance NFData HOInfo instance NFData GFixSolution+instance NFData GWInfo instance (NFData a) => NFData (SubC a) instance (NFData a) => NFData (WfC a)@@ -307,11 +371,14 @@ --------------------------------------------------------------------------- wfC :: (Fixpoint a) => IBindEnv -> SortedReft -> a -> [WfC a]-wfC be sr x = if all isEmptySubst (sus ++ gsus)- then [WfC be (v, sr_sort sr, k) x | k <- ks] ++ [GWfC be (v, sr_sort sr, k) x e | (k, e) <- gs ]+wfC be sr x = if all isEmptySubst (sus ) -- ++ gsus)+ -- NV TO RJ This tests fails with [LT:=GHC.Types.LT][EQ:=GHC.Types.EQ][GT:=GHC.Types.GT]]+ -- NV TO RJ looks like a resolution issue+ then [WfC be (v, sr_sort sr, k) x | k <- ks ]+ ++ [GWfC be (v, sr_sort sr, k) x e i | (k, e, i) <- gs ] else errorstar msg where- msg = "wfKvar: malformed wfC " ++ show sr+ msg = "wfKvar: malformed wfC " ++ show sr ++ "\n" ++ show (sus ++ gsus) Reft (v, ras) = sr_reft sr (ks, sus) = unzip $ go ras (gs, gsus) = unzip $ go' ras@@ -320,7 +387,7 @@ go (PAnd es) = [(k, su) | PKVar k su <- es] go _ = [] - go' (PGrad k su e) = [((k, e), su)]+ go' (PGrad k su i e) = [((k, e, i), su)] go' (PAnd es) = concatMap go' es go' _ = [] @@ -481,8 +548,9 @@ -> Bool -> [Triggered Expr] -> AxiomEnv+ -> [DataDecl] -> GInfo SubC a-fi cs ws binds ls ds ks qs bi aHO aHOq es axe+fi cs ws binds ls ds ks qs bi aHO aHOq es axe adts = FI { cm = M.fromList $ addIds cs , ws = M.fromListWith err [(k, w) | w <- ws, let (_, _, k) = wrft w] , bs = binds@@ -494,6 +562,7 @@ , hoInfo = HOI aHO aHOq , asserts = es , ae = axe+ , ddecls = adts } where --TODO handle duplicates gracefully instead (merge envs by intersect?)@@ -518,22 +587,21 @@ allowHOquals = hoQuals . hoInfo data GInfo c a =- FI { cm :: !(M.HashMap SubcId (c a)) -- ^ cst id |-> Horn Constraint+ FI { cm :: !(M.HashMap SubcId (c a)) -- ^ cst id |-> Horn Constraint , ws :: !(M.HashMap KVar (WfC a)) -- ^ Kvar |-> WfC defining its scope/args , bs :: !BindEnv -- ^ Bind |-> (Symbol, SortedReft) , gLits :: !(SEnv Sort) -- ^ Global Constant symbols , dLits :: !(SEnv Sort) -- ^ Distinct Constant symbols , kuts :: !Kuts -- ^ Set of KVars *not* to eliminate- -- , packs :: !Packs -- ^ Pack-sets of related KVars , quals :: ![Qualifier] -- ^ Abstract domain , bindInfo :: !(M.HashMap BindId a) -- ^ Metadata about binders+ , ddecls :: ![DataDecl] -- ^ User-defined data declarations , hoInfo :: !HOInfo -- ^ Higher Order info , asserts :: ![Triggered Expr] , ae :: AxiomEnv } deriving (Eq, Show, Functor, Generic) - instance Monoid HOInfo where mempty = HOI False False mappend i1 i2 = HOI { hoBinds = hoBinds i1 || hoBinds i2@@ -541,19 +609,19 @@ } instance Monoid (GInfo c a) where- mempty = FI M.empty mempty mempty mempty mempty mempty mempty mempty mempty mempty mempty+ mempty = FI M.empty mempty mempty mempty mempty mempty mempty mempty mempty mempty mempty mempty mappend i1 i2 = FI { cm = mappend (cm i1) (cm i2) , ws = mappend (ws i1) (ws i2) , bs = mappend (bs i1) (bs i2) , gLits = mappend (gLits i1) (gLits i2) , dLits = mappend (dLits i1) (dLits i2) , kuts = mappend (kuts i1) (kuts i2)- -- , packs = mappend (packs i1) (packs i2) , quals = mappend (quals i1) (quals i2) , bindInfo = mappend (bindInfo i1) (bindInfo i2)+ , ddecls = mappend (ddecls i1) (ddecls i2) , hoInfo = mappend (hoInfo i1) (hoInfo i2) , asserts = mappend (asserts i1) (asserts i2)- , ae = mappend (ae i1) (ae i2)+ , ae = mappend (ae i1) (ae i2) } instance PTable (SInfo a) where@@ -576,6 +644,7 @@ $++$ csDoc x' $++$ wsDoc x' $++$ binfoDoc x'+ $++$ aeDoc x' $++$ text "\n" where cfgDoc cfg = text ("// " ++ show cfg)@@ -587,6 +656,7 @@ -- packsDoc = toFix . packs bindsDoc = toFix . bs qualsDoc = vcat . map toFix . quals+ aeDoc = toFix . ae metaDoc (i,d) = toFixMeta (text "bind" <+> toFix i) (toFix d) mdata = metadata cfg binfoDoc@@ -604,33 +674,37 @@ writeFInfo :: (Fixpoint a, Fixpoint (c a)) => Config -> GInfo c a -> FilePath -> IO () writeFInfo cfg fq f = writeFile f (render $ toFixpoint cfg fq) ---------------------------------------------------------------------------+-------------------------------------------------------------------------------- -- | Query Conversions: FInfo to SInfo----------------------------------------------------------------------------+-------------------------------------------------------------------------------- convertFormat :: (Fixpoint a) => FInfo a -> SInfo a-----------------------------------------------------------------------------convertFormat fi = fi' { cm = subcToSimpc <$> cm fi' }+--------------------------------------------------------------------------------+convertFormat fi = fi' { cm = subcToSimpc bindm <$> cm fi' } where- fi' = M.foldlWithKey' blowOutVV fi $ cm fi+ (bindm, fi') = M.foldlWithKey' outVV (M.empty, fi) $ cm fi -subcToSimpc :: SubC a -> SimpC a-subcToSimpc s = SimpC- { _cenv = senv s- , _crhs = reftPred $ sr_reft $ srhs s- , _cid = sid s- , _ctag = stag s- , _cinfo = sinfo s+subcToSimpc :: BindM -> SubC a -> SimpC a+subcToSimpc m s = SimpC+ { _cenv = senv s+ , _crhs = reftPred $ sr_reft $ srhs s+ , _cid = sid s+ , _cbind = safeLookup "subcToSimpc" (subcId s) m+ , _ctag = stag s+ , _cinfo = sinfo s } -blowOutVV :: FInfo a -> Integer -> SubC a -> FInfo a-blowOutVV fi i subc = fi { bs = be', cm = cm' }+outVV :: (BindM, FInfo a) -> Integer -> SubC a -> (BindM, FInfo a)+outVV (m, fi) i c = (m', fi') where- sr = slhs subc+ fi' = fi { bs = be', cm = cm' }+ m' = M.insert i bId m+ (bId, be') = insertBindEnv x sr $ bs fi+ cm' = M.insert i c' $ cm fi+ c' = c { _senv = insertsIBindEnv [bId] $ senv c }+ sr = slhs c x = reftBind $ sr_reft sr- (bindId, be') = insertBindEnv x sr $ bs fi- subc' = subc { _senv = insertsIBindEnv [bindId] $ senv subc }- cm' = M.insert i subc' $ cm fi +type BindM = M.HashMap Integer BindId --------------------------------------------------------------------------- -- | Top level Solvers ----------------------------------------------------@@ -662,7 +736,7 @@ --------------------------------------------------------------------------- -- | Axiom Instantiation Information -------------------------------------- ----------------------------------------------------------------------------data AxiomEnv = AEnv { aenvSyms :: ![Symbol]+data AxiomEnv = AEnv { aenvSyms :: !Int , aenvEqs :: ![Equation] , aenvSimpl :: ![Rewrite] , aenvFuel :: M.HashMap SubcId Int@@ -682,9 +756,9 @@ instance NFData Eliminate instance Monoid AxiomEnv where- mempty = AEnv [] [] [] (M.fromList []) (M.fromList [])+ mempty = AEnv 0 [] [] (M.fromList []) (M.fromList []) mappend a1 a2 = AEnv aenvSyms' aenvEqs' aenvSimpl' aenvFuel' aenvExpand'- where aenvSyms' = mappend (aenvSyms a1) (aenvSyms a2)+ where aenvSyms' = aenvSyms a1 + aenvSyms a2 aenvEqs' = mappend (aenvEqs a1) (aenvEqs a2) aenvSimpl' = mappend (aenvSimpl a1) (aenvSimpl a2) aenvFuel' = mappend (aenvFuel a1) (aenvFuel a2)@@ -696,6 +770,10 @@ } deriving (Eq, Show, Generic) +instance PPrint Equation where+ pprintTidy k (Equ f xs e) = "def" <+> pprint f <+> intersperse " " (pprint <$> xs) <+> ":=" <+> pprintTidy k e++ -- eg SMeasure (f D [x1..xn] e) -- for f (D x1 .. xn) = e data Rewrite = SMeasure { smName :: Symbol -- eg. f@@ -704,6 +782,29 @@ , smBody :: Expr -- eg. e[xs] } deriving (Eq, Show, Generic)++instance Fixpoint AxiomEnv where+ toFix axe = vcat ((toFix <$> aenvEqs axe) ++ (toFix <$> aenvSimpl axe))+ $+$ text "syms" <+> text (show (aenvSyms axe))+ $+$ text "fuel" <+> toFix (pairdoc <$> M.toList (aenvFuel axe))+ $+$ text "expand" <+> toFix (pairdoc <$> M.toList(aenvExpand axe))+ where pairdoc (x,y) = text $ show x ++ " : " ++ show y++-- teehee+instance Fixpoint Doc where+ toFix = id++instance Fixpoint Equation where+ toFix (Equ f xs e) = text "define"+ <+> toFix f <+> hsep (toFix <$> xs) <+> text " = "+ <+> lparen <> toFix e <> rparen+instance Fixpoint Rewrite where+ toFix (SMeasure f d xs e)+ = text "match"+ <+> toFix f+ <+> parens (toFix d <+> hsep (toFix <$> xs))+ <+> text " = "+ <+> lparen <> toFix e <> rparen getEqBody :: Equation -> Maybe Expr getEqBody (Equ x xs (PAnd ((PAtom Eq fxs e):_)))
src/Language/Fixpoint/Types/Environments.hs view
@@ -31,6 +31,7 @@ , insertsIBindEnv , deleteIBindEnv , elemsIBindEnv+ , fromListIBindEnv , memberIBindEnv , unionIBindEnv , diffIBindEnv@@ -187,6 +188,8 @@ elemsIBindEnv :: IBindEnv -> [BindId] elemsIBindEnv (FB s) = S.toList s +fromListIBindEnv :: [BindId] -> IBindEnv+fromListIBindEnv = FB . S.fromList -- | Functions for Global Binder Environment insertBindEnv :: Symbol -> SortedReft -> BindEnv -> (BindId, BindEnv)
src/Language/Fixpoint/Types/Errors.hs view
@@ -38,7 +38,9 @@ , catErrors -- * Fatal Exit+ , panic , die+ , dieAt , exit -- * Some popular errors@@ -48,7 +50,6 @@ ) where import Control.Exception--- import qualified Control.Monad.Error as E import Data.Serialize (Serialize (..)) import Data.Generics (Data) import Data.Typeable@@ -128,9 +129,22 @@ err sp d = Error [Error1 sp d] ---------------------------------------------------------------------+panic :: String -> a+---------------------------------------------------------------------+panic = die . err dummySpan . text . (panicMsg ++)++panicMsg :: String+panicMsg = "PANIC: Please file an issue at https://github.com/ucsd-progsys/liquid-fixpoint \n"++--------------------------------------------------------------------- die :: Error -> a --------------------------------------------------------------------- die = throw++---------------------------------------------------------------------+dieAt :: SrcSpan -> Error -> a+---------------------------------------------------------------------+dieAt sp (Error es) = die (Error [ e {errLoc = sp} | e <- es]) --------------------------------------------------------------------- exit :: a -> IO a -> IO a
+ src/Language/Fixpoint/Types/Graduals.hs view
@@ -0,0 +1,258 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE TupleSections #-}++-- | This module contains the top-level SOLUTION data types,+-- including various indices used for solving.++module Language.Fixpoint.Types.Graduals (+ uniquify,++ makeSolutions,++ GSol,++ Gradual (..)+ ) where++import Language.Fixpoint.Types.Refinements+import Language.Fixpoint.Types.Constraints+import Language.Fixpoint.Types.Config+import Language.Fixpoint.Types.PrettyPrint+import Language.Fixpoint.Types.Environments+import Language.Fixpoint.Types.Substitutions+import Language.Fixpoint.Types.Visitor+import Language.Fixpoint.Types.Spans+import Language.Fixpoint.Types.Theories+import Language.Fixpoint.Types.Names (gradIntSymbol, tidySymbol)+import Language.Fixpoint.Misc (allCombinations, errorstar)++import Control.DeepSeq++import qualified Data.HashMap.Strict as M+import qualified Data.List as L++import Control.Monad.State.Lazy+import Data.Maybe (fromMaybe)+import qualified Language.Fixpoint.SortCheck as So+import Language.Fixpoint.Solver.Sanitize (symbolEnv)+++data GSol = GSol !SymEnv !(M.HashMap KVar (Expr, GradInfo))++instance Monoid GSol where+ mempty = GSol mempty mempty+ mappend (GSol e1 m1) (GSol e2 m2) = GSol (mappend e1 e2) (mappend m1 m2)++instance Show GSol where+ show (GSol _ m) = "GSOL = \n" ++ unlines ((\(k,(e, i)) -> showpp k ++ showInfo i ++ " |-> " ++ showpp (tx e)) <$> M.toList m)+ where+ tx e = subst (mkSubst $ [(x, EVar $ tidySymbol x) | x <- syms e]) e+ showInfo i = show i+++makeSolutions :: (NFData a, Fixpoint a, Show a)+ => Config -> SInfo a+ -> [(KVar, (GWInfo, [[Expr]]))]+ -> Maybe [GSol]++makeSolutions _ _ []+ = Nothing+makeSolutions cfg fi kes+ = Just $ map (GSol env . M.fromList) (allCombinations (go <$> kes))+ where+ go (k, (i, es)) = [(k, (pAnd (gexpr i:e'), ginfo i)) | e' <- es]+ env = symbolEnv cfg fi+++-------------------------------------------------------------------------------+-- | Make each gradual appearence unique -------------------------------------+-------------------------------------------------------------------------------+uniquify :: (NFData a, Fixpoint a, Loc a) => SInfo a -> (SInfo a)++uniquify fi = fi{cm = cm', ws = ws', bs = bs'}+ where+ (cm', km, bs') = uniquifyCS (bs fi) (cm fi)+ ws' = expandWF km (ws fi)++uniquifyCS :: (NFData a, Fixpoint a, Loc a)+ => BindEnv+ -> M.HashMap SubcId (SimpC a)+ -> (M.HashMap SubcId (SimpC a), M.HashMap KVar [(KVar, Maybe SrcSpan)], BindEnv)+uniquifyCS bs cs+ = (x, km, benv st)+-- = (x, km, mapBindEnv (\i (x,r) -> if i `elem` ubs st then (x, ungrad r) else (x, r)) $ benv st)+ where+ (x, st) = runState (uniq cs) (initUniqueST bs)+ km = kmap st+ -- gs = [x | xs <- M.elems km, (x,_) <- xs]+++class Unique a where+ uniq :: a -> UniqueM a++instance Unique a => Unique (M.HashMap SubcId a) where+ uniq m = M.fromList <$> mapM (\(i,x) -> (i,) <$> uniq x) (M.toList m)++instance Loc a => Unique (SimpC a) where+ uniq cs = do+ updateLoc $ srcSpan $ _cinfo cs+ rhs <- uniq (_crhs cs)+ env <- uniq (_cenv cs)+ return cs{_crhs = rhs, _cenv = env}++instance Unique IBindEnv where+ uniq env = withCache (fromListIBindEnv <$> mapM uniq (elemsIBindEnv env))++instance Unique BindId where+ uniq i = do+ bs <- benv <$> get+ let (x, t) = lookupBindEnv i bs+ resetChange+ t' <- uniq t+ hasChanged <- change <$> get+ if hasChanged+ then do let (i', bs') = insertBindEnv x t' bs+ updateBEnv i bs'+ return i'+ else return i++instance Unique SortedReft where+ uniq (RR s r) = RR s <$> uniq r++instance Unique Reft where+ uniq (Reft (x,e)) = (Reft . (x,)) <$> uniq e++instance Unique Expr where+ uniq = mapMExpr go+ where+ go (PGrad k su i e) = do+ k' <- freshK k+ src <- uloc <$> get+ return $ PGrad k' su (i{gused = src}) e+ go e = return e++-------------------------------------------------------------------------------+-- | The Unique Monad ---------------------------------------------------------+-------------------------------------------------------------------------------++type UniqueM = State UniqueST+data UniqueST+ = UniqueST { freshId :: Integer+ , kmap :: M.HashMap KVar [(KVar, Maybe SrcSpan)]+ , change :: Bool+ , cache :: M.HashMap KVar KVar+ , uloc :: Maybe SrcSpan+ , ubs :: [BindId]+ , benv :: BindEnv+ }++updateLoc :: SrcSpan -> UniqueM ()+updateLoc x = modify $ \s -> s{uloc = Just x}++withCache :: UniqueM a -> UniqueM a+withCache act = do+ emptyCache+ a <- act+ emptyCache+ return a++emptyCache :: UniqueM ()+emptyCache = modify $ \s -> s{cache = mempty}++addCache :: KVar -> KVar -> UniqueM ()+addCache k k' = modify $ \s -> s{cache = M.insert k k' (cache s)}++updateBEnv :: BindId -> BindEnv -> UniqueM ()+updateBEnv i bs = modify $ \s -> s{benv = bs, ubs = i:(ubs s)}++setChange :: UniqueM ()+setChange = modify $ \s -> s{change = True}++resetChange :: UniqueM ()+resetChange = modify $ \s -> s{change = False}++initUniqueST :: BindEnv -> UniqueST+initUniqueST = UniqueST 0 mempty False mempty Nothing mempty++freshK, freshK' :: KVar -> UniqueM KVar+freshK k = do+ setChange+ cached <- cache <$> get+ case M.lookup k cached of+ {- OPTIMIZATION: Only create one fresh occurence of ? per constraint environment. -}+ Just k' -> return k'+ Nothing -> freshK' k++freshK' k = do+ i <- freshId <$> get+ modify $ (\s -> s{freshId = i + 1})+ let k' = KV $ gradIntSymbol i+ addK k k'+ addCache k k'+ return k'++addK :: KVar -> KVar -> UniqueM ()+addK key val =+ modify $ (\s -> s{kmap = M.insertWith (++) key [(val, uloc s)] (kmap s)})++-------------------------------------------------------------------------------+-- | expandWF -----------------------------------------------------------------+-------------------------------------------------------------------------------++expandWF :: (NFData a, Fixpoint a)+ => M.HashMap KVar [(KVar, Maybe SrcSpan)]+ -> M.HashMap KVar (WfC a)+ -> M.HashMap KVar (WfC a)+expandWF km ws+ = M.fromList $+ ([(k, updateKVar k src w) | (i, w) <- gws, (kw, ks) <- km', kw == i, (k, src) <- ks]+ ++ kws)+ where+ (gws, kws) = L.partition (isGWfc . snd) $ M.toList ws+ km' = M.toList km+ updateKVar k src wfc = wfc { wrft = (\(v,s,_) -> (v,s,k)) $ wrft wfc+ , wloc = (wloc wfc){gused = src}+ }++-------------------------------------------------------------------------------+-- | Substitute Gradual Solution ---------------------------------------------+-------------------------------------------------------------------------------++class Gradual a where+ gsubst :: GSol -> a -> a++instance Gradual Expr where+ gsubst (GSol env m) e = mapGVars' (\(k, _) -> Just (fromMaybe (err k) (mknew k))) e+ where+ mknew k = So.elaborate "initBGind.mkPred" env $ fst <$> M.lookup k m+ err k = errorstar ("gradual substitution: Cannot find " ++ showpp k)++instance Gradual Reft where+ gsubst su (Reft (x, e)) = Reft (x, gsubst su e)++instance Gradual SortedReft where+ gsubst su r = r {sr_reft = gsubst su (sr_reft r)}++instance Gradual (SimpC a) where+ gsubst su c = c {_crhs = gsubst su (_crhs c)}++instance Gradual BindEnv where+ gsubst su = mapBindEnv (\_ (x, r) -> (x, gsubst su r))++instance Gradual v => Gradual (M.HashMap k v) where+ gsubst su = M.map (gsubst su)++instance Gradual (SInfo a) where+ gsubst su fi = fi { bs = gsubst su (bs fi)+ , cm = gsubst su (cm fi)+ }
src/Language/Fixpoint/Types/Names.hs view
@@ -30,12 +30,16 @@ , symbolSafeString , symbolText , symbolString+ , symbolBuilder+ , buildMany -- Predicates , isPrefixOfSym , isSuffixOfSym , isNonSymbol , isLitSymbol+ , isTestSymbol+ -- , isCtorSymbol , isNontrivialVV , isDummy @@ -62,9 +66,11 @@ , dummySymbol , intSymbol , tempSymbol+ , gradIntSymbol -- * Wrapping Symbols , litSymbol+ , testSymbol , renameSymbol , kArgSymbol , existSymbol@@ -83,8 +89,6 @@ , tupConName , setConName , mapConName- -- , propConName- -- , hpropConName , strConName , nilName , consName@@ -94,16 +98,19 @@ , bitVecName , bvAndName , bvOrName+ -- HKT , tyAppName , prims , mulFuncName , divFuncName -- * Casting function names- , setToIntName, bitVecToIntName, mapToIntName, boolToIntName, realToIntName+ , setToIntName, bitVecToIntName, mapToIntName, boolToIntName, realToIntName, toIntName , setApplyName, bitVecApplyName, mapApplyName, boolApplyName, realApplyName, intApplyName+ , applyName , lambdaName- , intArgName+ , lamArgSymbol+ , isLamArgSymbol ) where @@ -111,6 +118,7 @@ import Control.Arrow (second) import Data.Char (ord) import Data.Maybe (fromMaybe)+import Data.Monoid ((<>)) import Data.Generics (Data) import Data.Hashable (Hashable (..)) import qualified Data.HashSet as S@@ -118,10 +126,10 @@ import Data.Interned.Internal.Text import Data.String (IsString(..)) import qualified Data.Text as T+import qualified Data.Text.Lazy.Builder as Builder import Data.Binary (Binary (..)) import Data.Typeable (Typeable) import GHC.Generics (Generic)- import Text.PrettyPrint.HughesPJ (text) import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Types.Spans@@ -391,6 +399,19 @@ vvCon = vvName `suffixSymbol` "F" dummySymbol = dummyName +-- ctorSymbol :: Symbol -> Symbol+-- ctorSymbol s = ctorPrefix `mappendSym` s++-- isCtorSymbol :: Symbol -> Bool+-- isCtorSymbol = isPrefixOfSym ctorPrefix++-- | 'testSymbol c' creates the `is-c` symbol for the adt-constructor named 'c'.+testSymbol :: Symbol -> Symbol+testSymbol s = testPrefix `mappendSym` s++isTestSymbol :: Symbol -> Bool+isTestSymbol = isPrefixOfSym testPrefix+ litSymbol :: Symbol -> Symbol litSymbol s = litPrefix `mappendSym` s @@ -415,13 +436,22 @@ existSymbol :: Symbol -> Integer -> Symbol existSymbol prefix = intSymbol (existPrefix `mappendSym` prefix) +gradIntSymbol :: Integer -> Symbol+gradIntSymbol = intSymbol gradPrefix -tempPrefix, anfPrefix, renamePrefix, litPrefix :: Symbol+tempPrefix, anfPrefix, renamePrefix, litPrefix, gradPrefix :: Symbol tempPrefix = "lq_tmp$" anfPrefix = "lq_anf$" renamePrefix = "lq_rnm$" litPrefix = "lit$"+gradPrefix = "grad$" +testPrefix :: Symbol+testPrefix = "is$"++-- ctorPrefix :: Symbol+-- ctorPrefix = "mk$"+ kArgPrefix, existPrefix :: Symbol kArgPrefix = "lq_karg$" existPrefix = "lq_ext$"@@ -467,6 +497,14 @@ instance Symbolic Symbol where symbol = id +symbolBuilder :: (Symbolic a) => a -> Builder.Builder+symbolBuilder = Builder.fromText . symbolSafeText . symbol++{-# INLINE buildMany #-}+buildMany :: [Builder.Builder] -> Builder.Builder+buildMany [] = mempty+buildMany [b] = b+buildMany (b:bs) = b <> mconcat [ " " <> b | b <- bs ] ---------------------------------------------------------------------------- --------------- Global Name Definitions ------------------------------------ ----------------------------------------------------------------------------@@ -474,14 +512,21 @@ lambdaName :: Symbol lambdaName = "smt_lambda" -intArgName :: Int -> Symbol-intArgName = intSymbol "lam_int_arg"+lamArgPrefix :: Symbol+lamArgPrefix = "lam_arg" -setToIntName, bitVecToIntName, mapToIntName, realToIntName :: Symbol+lamArgSymbol :: Int -> Symbol+lamArgSymbol = intSymbol lamArgPrefix++isLamArgSymbol :: Symbol -> Bool+isLamArgSymbol = isPrefixOfSym lamArgPrefix++setToIntName, bitVecToIntName, mapToIntName, realToIntName, toIntName :: Symbol setToIntName = "set_to_int" bitVecToIntName = "bitvec_to_int" mapToIntName = "map_to_int" realToIntName = "real_to_int"+toIntName = "cast_as_int" boolToIntName :: (IsString a) => a boolToIntName = "bool_to_int"@@ -494,6 +539,8 @@ realApplyName = intSymbol "real_apply_" intApplyName = intSymbol "int_apply_" +applyName :: Symbol+applyName = "apply" preludeName, dummyName, boolConName, funConName :: Symbol preludeName = "Prelude"@@ -501,6 +548,7 @@ boolConName = "Bool" funConName = "->" + listConName, listLConName, tupConName, _propConName, _hpropConName, vvName, setConName, mapConName :: Symbol listConName = "[]" listLConName = "List"@@ -527,6 +575,9 @@ bitVecName = "BitVec" bvOrName = "bvor" bvAndName = "bvand"++-- HKT tyAppName :: Symbol+-- HKT tyAppName = "LF-App" mulFuncName, divFuncName :: Symbol mulFuncName = "Z3_OP_MUL"
src/Language/Fixpoint/Types/PrettyPrint.hs view
@@ -88,6 +88,7 @@ showTable :: (PPrint k, PPrint v) => Tidy -> [(k, v)] -> String showTable k = render . pprintKVs k +-- | Please do not alter this. tracepp :: (PPrint a) => String -> a -> a tracepp s x = trace ("\nTrace: [" ++ s ++ "] : " ++ showpp x) x @@ -118,6 +119,22 @@ pprintTidy k (x, y, z) = parens $ pprintTidy k x <> "," <+> pprintTidy k y <> "," <+> pprintTidy k z++++instance (PPrint a, PPrint b, PPrint c, PPrint d) => PPrint (a, b, c, d) where+ pprintTidy k (w, x, y, z) = parens $ pprintTidy k w <> "," <+>+ pprintTidy k x <> "," <+>+ pprintTidy k y <> "," <+>+ pprintTidy k z++instance (PPrint a, PPrint b, PPrint c, PPrint d, PPrint e) => PPrint (a, b, c, d, e) where+ pprintTidy k (v, w, x, y, z) = parens $ pprintTidy k v <> "," <+>+ pprintTidy k w <> "," <+>+ pprintTidy k x <> "," <+>+ pprintTidy k y <> "," <+>+ pprintTidy k z+ instance (PPrint a, PPrint b) => PPrint (a,b) where
src/Language/Fixpoint/Types/Refinements.hs view
@@ -24,6 +24,7 @@ , Bop (..) , Brel (..) , Expr (..), Pred+ , GradInfo (..) , pattern PTrue, pattern PTop, pattern PFalse, pattern EBot , pattern ETimes, pattern ERTimes, pattern EDiv, pattern ERDiv , pattern EEq@@ -88,7 +89,8 @@ -- * Gradual Type Manipulation , pGAnds, pGAnd- , isGradual+ , HasGradual (..)+ , srcGradInfo ) where @@ -118,7 +120,9 @@ -- import qualified Data.HashSet as S instance NFData KVar+instance NFData SrcSpan instance NFData Subst+instance NFData GradInfo instance NFData Constant instance NFData SymConst instance NFData Brel@@ -131,8 +135,10 @@ put = B.put . M.toList get = M.fromList <$> B.get +instance B.Binary SrcSpan instance B.Binary KVar instance B.Binary Subst+instance B.Binary GradInfo instance B.Binary Constant instance B.Binary SymConst instance B.Binary Brel@@ -151,10 +157,35 @@ isKvar (PKVar _ _) = True isKvar _ = False -isGradual :: Expr -> Bool-isGradual (PGrad _ _ _) = True-isGradual _ = False+class HasGradual a where+ isGradual :: a -> Bool+ gVars :: a -> [KVar]+ ungrad :: a -> a +instance HasGradual Expr where+ isGradual (PGrad {}) = True+ isGradual (PAnd xs) = any isGradual xs+ isGradual _ = False++ gVars (PGrad k _ _ _) = [k]+ gVars (PAnd xs) = concatMap gVars xs+ gVars _ = []++ ungrad (PGrad {}) = PTrue+ ungrad (PAnd xs) = PAnd (ungrad <$> xs )+ ungrad e = e+++instance HasGradual Reft where+ isGradual (Reft (_,r)) = isGradual r+ gVars (Reft (_,r)) = gVars r+ ungrad (Reft (x,r)) = Reft(x, ungrad r)++instance HasGradual SortedReft where+ isGradual = isGradual . sr_reft+ gVars = gVars . sr_reft+ ungrad r = r {sr_reft = ungrad (sr_reft r)}+ refaConjuncts :: Expr -> [Expr] refaConjuncts p = [p' | p' <- conjuncts p, not $ isTautoPred p'] @@ -246,7 +277,7 @@ | PKVar !KVar !Subst | PAll ![(Symbol, Sort)] !Expr | PExist ![(Symbol, Sort)] !Expr- | PGrad !KVar !Subst !Expr+ | PGrad !KVar !Subst !GradInfo !Expr deriving (Eq, Show, Data, Typeable, Generic) type Pred = Expr@@ -262,6 +293,12 @@ pattern ERDiv e1 e2 = EBin RDiv e1 e2 +data GradInfo = GradInfo {gsrc :: SrcSpan, gused :: Maybe SrcSpan}+ deriving (Eq, Show, Data, Typeable, Generic)++srcGradInfo :: SourcePos -> GradInfo+srcGradInfo src = GradInfo (SS src src) Nothing+ mkEApp :: LocSymbol -> [Expr] -> Expr mkEApp = eApps . EVar . val @@ -277,8 +314,7 @@ eAppC :: Sort -> Expr -> Expr -> Expr eAppC s e1 e2 = ECst (EApp e1 e2) s --+-------------------------------------------------------------------------------- debruijnIndex :: Expr -> Int debruijnIndex = go where@@ -302,7 +338,7 @@ go (PAll _ e) = go e go (PExist _ e) = go e go (PKVar _ _) = 1- go (PGrad _ _ e) = go e+ go (PGrad _ _ _ e) = go e -- | Parsed refinement of @Symbol@ as @Expr@@@ -370,6 +406,7 @@ toFix (ENeg e) = parens $ text "-" <+> parens (toFix e) toFix (EBin o e1 e2) = parens $ toFix e1 <+> toFix o <+> toFix e2 toFix (EIte p e1 e2) = parens $ text "if" <+> toFix p <+> text "then" <+> toFix e1 <+> text "else" <+> toFix e2+ -- toFix (ECst e _so) = toFix e toFix (ECst e so) = parens $ toFix e <+> text " : " <+> toFix so -- toFix (EBot) = text "_|_" -- toFix PTop = text "???"@@ -388,7 +425,7 @@ $+$ ("." <+> toFix p)) toFix (ETApp e s) = text "tapp" <+> toFix e <+> toFix s toFix (ETAbs e s) = text "tabs" <+> toFix e <+> toFix s- toFix (PGrad _ _ e) = toFix e <+> text "&&" <+> text "??" -- <+> toFix k <+> toFix su+ toFix (PGrad k _ _ e) = toFix e <+> text "&&" <+> toFix k -- text "??" -- <+> toFix k <+> toFix su toFix (ELam (x,s) e) = text "lam" <+> toFix x <+> ":" <+> toFix s <+> "." <+> toFix e simplify (PAnd []) = PTrue@@ -396,9 +433,9 @@ simplify (PAnd [p]) = simplify p simplify (POr [p]) = simplify p - simplify (PGrad k su e)+ simplify (PGrad k su i e) | isContraPred e = PFalse- | otherwise = PGrad k su (simplify e)+ | otherwise = PGrad k su i (simplify e) simplify (PAnd ps) | any isContraPred ps = PFalse@@ -525,8 +562,9 @@ "else" <+> pprintPrec (zi+1) k e2 where zi = 1 - -- pprintPrec _ k (ECst e so) = parens $ pprint e <+> ":" <+> const (text "...") (pprintTidy k so)- pprintPrec z k (ECst e _) = pprintPrec z k e+ -- RJ: DO NOT DELETE!+ pprintPrec _ k (ECst e so) = parens $ pprint e <+> ":" <+> {- const (text "...") -} (pprintTidy k so)+ -- pprintPrec z k (ECst e _) = pprintPrec z k e pprintPrec _ _ PTrue = trueD pprintPrec _ _ PFalse = falseD pprintPrec z k (PNot p) = parensIf (z > zn) $@@ -559,7 +597,7 @@ pprintPrec _ _ p@(PKVar {}) = toFix p pprintPrec _ _ (ETApp e s) = "ETApp" <+> toFix e <+> toFix s pprintPrec _ _ (ETAbs e s) = "ETAbs" <+> toFix e <+> toFix s- pprintPrec z k (PGrad _ _ e) = pprintPrec z k e <+> "&&" <+> "??"+ pprintPrec z k (PGrad x _ _ e) = pprintPrec z k e <+> "&&" <+> toFix x -- "??" pprintQuant :: Tidy -> Doc -> [(Symbol, Sort)] -> Expr -> Doc pprintQuant k d xts p = (d <+> toFix xts)@@ -721,8 +759,8 @@ pGAnds = foldl pGAnd PTrue pGAnd :: Expr -> Expr -> Expr-pGAnd (PGrad k su p) q = PGrad k su (pAnd [p, q])-pGAnd p (PGrad k su q) = PGrad k su (pAnd [p, q])+pGAnd (PGrad k su i p) q = PGrad k su i (pAnd [p, q])+pGAnd p (PGrad k su i q) = PGrad k su i (pAnd [p, q]) pGAnd p q = pAnd [p,q] ------------------------------------------------------------
src/Language/Fixpoint/Types/Solutions.hs view
@@ -30,8 +30,8 @@ , eQual , trueEqual - -- * Gradual Solution elements - , qbToGb, gbToQbs, gbEquals, equalsGb, emptyGMap + -- * Gradual Solution elements+ , qbToGb, gbToQbs, gbEquals, equalsGb, emptyGMap, qbExprs -- * Solution Candidates (move to SolverMonad?) , Cand@@ -78,6 +78,7 @@ import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Types.Names import Language.Fixpoint.Types.Sorts+import Language.Fixpoint.Types.Theories import Language.Fixpoint.Types.Refinements import Language.Fixpoint.Types.Environments import Language.Fixpoint.Types.Constraints@@ -122,11 +123,11 @@ newtype QBind = QB [EQual] deriving (Show, Data, Typeable, Generic, Eq) newtype GBind = GB [[EQual]] deriving (Show, Data, Typeable, Generic) -emptyGMap :: GSolution -> GSolution +emptyGMap :: GSolution -> GSolution emptyGMap sol = mapGMap sol (\(x,_) -> (x, GB [])) updateGMapWithKey :: [(KVar, QBind)] -> GSolution -> GSolution-updateGMapWithKey kqs sol = sol {gMap = foldl (\m (k, (QB eq)) -> M.adjust (\(x, GB eqs) -> (x, GB (if eq `elem` eqs then eqs else eq:eqs))) k m) (gMap sol) kqs } +updateGMapWithKey kqs sol = sol {gMap = foldl (\m (k, (QB eq)) -> M.adjust (\(x, GB eqs) -> (x, GB (if eq `elem` eqs then eqs else eq:eqs))) k m) (gMap sol) kqs } qb :: [EQual] -> QBind qb = QB@@ -134,21 +135,24 @@ qbEQuals :: QBind -> [EQual] qbEQuals (QB xs) = xs +qbExprs :: QBind -> [Expr]+qbExprs (QB xs) = eqPred <$> xs+ qbToGb :: QBind -> GBind qbToGb (QB xs) = GB $ map (:[]) xs gbToQbs :: GBind -> [QBind]-gbToQbs (GB []) = [QB [trueEqual]] +gbToQbs (GB []) = [QB [trueEqual]] gbToQbs (GB ess) = QB <$> ess gbEquals :: GBind -> [[EQual]]-gbEquals (GB eqs) = eqs +gbEquals (GB eqs) = eqs equalsGb :: [[EQual]] -> GBind-equalsGb = GB +equalsGb = GB gbFilterM :: Monad m => ([EQual] -> m Bool) -> GBind -> m GBind-gbFilterM f (GB eqs) = GB <$> filterM f eqs +gbFilterM f (GB eqs) = GB <$> filterM f eqs qbSize :: QBind -> Int qbSize = length . qbEQuals@@ -167,19 +171,18 @@ -- in particular, to compute `lhsPred` for any given constraint. -------------------------------------------------------------------------------- data Sol b a = Sol- { sEnv :: !(SEnv Sort) -- ^ Environment used to elaborate solutions+ { sEnv :: !SymEnv -- ^ Environment used to elaborate solutions , sMap :: !(M.HashMap KVar a) -- ^ Actual solution (for cut kvar)- , gMap :: !(M.HashMap KVar b) -- ^ Solution for gradual variables + , gMap :: !(M.HashMap KVar b) -- ^ Solution for gradual variables , sHyp :: !(M.HashMap KVar Hyp) -- ^ Defining cubes (for non-cut kvar)- -- , sBot :: !(M.HashMap KVar ()) -- ^ set of BOT (cut kvars) , sScp :: !(M.HashMap KVar IBindEnv) -- ^ set of allowed binders for kvar } -updateGMap :: Sol b a -> M.HashMap KVar b -> Sol b a +updateGMap :: Sol b a -> M.HashMap KVar b -> Sol b a updateGMap sol gmap = sol {gMap = gmap} -mapGMap :: Sol b a -> (b -> b) -> Sol b a +mapGMap :: Sol b a -> (b -> b) -> Sol b a mapGMap sol f = sol {gMap = M.map f (gMap sol)} @@ -194,7 +197,7 @@ } instance Functor (Sol a) where- fmap f (Sol e s m1 m2 m3) = Sol e (f <$> s) m1 m2 m3 + fmap f (Sol e s m1 m2 m3) = Sol e (f <$> s) m1 m2 m3 instance (PPrint a, PPrint b) => PPrint (Sol a b) where pprintTidy k = pprintTidy k . sMap@@ -227,15 +230,15 @@ resultGradual :: GSolution -> M.HashMap KVar (Expr, [Expr]) -------------------------------------------------------------------------------- resultGradual s = fmap go' (gMap s)- where - go' ((_,e), GB eqss) + where+ go' ((_,e), GB eqss) = (e, [PAnd $ fmap eqPred eqs | eqs <- eqss]) -------------------------------------------------------------------------------- -- | Create a Solution --------------------------------------------------------- ---------------------------------------------------------------------------------fromList :: SEnv Sort -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> M.HashMap KVar IBindEnv -> Sol a b+fromList :: SymEnv -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> M.HashMap KVar IBindEnv -> Sol a b fromList env kGs kXs kYs = Sol env kXm kGm kYm -- kBm where kXm = M.fromList kXs@@ -313,7 +316,7 @@ } deriving (Eq, Show, Data, Typeable, Generic) trueEqual :: EQual-trueEqual = EQL trueQual mempty [] +trueEqual = EQL trueQual mempty [] instance PPrint EQual where pprintTidy k = pprintTidy k . eqPred
src/Language/Fixpoint/Types/Sorts.hs view
@@ -21,20 +21,31 @@ -- * Embedding to Fixpoint Types Sort (..)+ , Sub (..) , FTycon, TCEmb , sortFTycon- , intFTyCon, boolFTyCon, realFTyCon, numFTyCon, strFTyCon, setFTyCon -- TODO: hide these+ , intFTyCon+ , boolFTyCon+ , realFTyCon+ , numFTyCon+ , strFTyCon+ , setFTyCon+ , mapFTyCon -- TODO: hide these - , intSort, realSort, boolSort, strSort, funcSort+ , basicSorts, intSort, realSort, boolSort, strSort, funcSort , setSort, bitVecSort, mapSort , listFTyCon , isListTC+ , sizeBv , isFirstOrder , mappendFTC , fTyconSymbol, symbolFTycon, fTyconSort, symbolNumInfoFTyCon- , fApp, fApp', fAppTC+ , fApp+ , fAppTC , fObj+ , unFApp+ , unAbs , sortSubst , functionSort@@ -42,6 +53,12 @@ , bkFFunc , isNumeric, isReal, isString++ -- * User-defined ADTs+ , DataField (..)+ , DataCtor (..)+ , DataDecl (..)+ ) where import qualified Data.Binary as B@@ -65,6 +82,8 @@ data FTycon = TC LocSymbol TCInfo deriving (Ord, Show, Data, Typeable, Generic) type TCEmb a = M.HashMap a FTycon +instance Symbolic FTycon where+ symbol (TC s _) = symbol s instance Eq FTycon where (TC s _) == (TC s' _) = val s == val s'@@ -90,7 +109,8 @@ defRealInfo = False defStrInfo = False -charFTyCon, intFTyCon, boolFTyCon, realFTyCon, funcFTyCon, numFTyCon, strFTyCon, listFTyCon, setFTyCon :: FTycon+charFTyCon, intFTyCon, boolFTyCon, realFTyCon, funcFTyCon, numFTyCon :: FTycon+strFTyCon, listFTyCon, mapFTyCon, setFTyCon :: FTycon intFTyCon = TC (dummyLoc "int" ) numTcInfo boolFTyCon = TC (dummyLoc "bool" ) defTcInfo realFTyCon = TC (dummyLoc "real" ) realTcInfo@@ -100,6 +120,7 @@ listFTyCon = TC (dummyLoc listConName) defTcInfo charFTyCon = TC (dummyLoc "Char" ) defTcInfo setFTyCon = TC (dummyLoc setConName ) defTcInfo+mapFTyCon = TC (dummyLoc mapConName ) defTcInfo isListConName :: LocSymbol -> Bool isListConName x = c == listConName || c == listLConName --"List"@@ -109,6 +130,14 @@ isListTC :: FTycon -> Bool isListTC (TC z _) = isListConName z +sizeBv :: FTycon -> Maybe Int+sizeBv tc+ | s == size32Name = Just 32+ | s == size64Name = Just 64+ | otherwise = Nothing+ where+ s = val $ fTyconSymbol tc+ fTyconSymbol :: FTycon -> Located Symbol fTyconSymbol (TC s _) = s @@ -132,12 +161,20 @@ fAppTC :: FTycon -> [Sort] -> Sort fAppTC = fApp . fTyconSort -fApp' :: Sort -> ListNE Sort-fApp' = go []+-- | fApp' (FApp (FApp "Map" key) val) ===> ["Map", key, val]+-- That is, `fApp'` is used to split a type application into+-- the FTyCon and its args.++unFApp :: Sort -> ListNE Sort+unFApp = go [] where go acc (FApp t1 t2) = go (t2 : acc) t1 go acc t = t : acc +unAbs :: Sort -> Sort+unAbs (FAbs _ s) = unAbs s+unAbs s = s+ fObj :: LocSymbol -> Sort fObj = fTyconSort . (`TC` defTcInfo) @@ -161,10 +198,9 @@ go vs ss (FFunc s1 s2) = go vs (s1:ss) s2 go vs ss t = (reverse vs, reverse ss, t) ------------------------------------------------------------------------------------------------------- Sorts --------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+-- | Sorts ---------------------------------------------------------------------+-------------------------------------------------------------------------------- data Sort = FInt | FReal | FNum -- ^ numeric kind for Num tyvars@@ -175,11 +211,34 @@ | FAbs !Int !Sort -- ^ type-abstraction | FTC !FTycon | FApp !Sort !Sort -- ^ constructed type- deriving (Eq, Ord, Show, Data, Typeable, Generic)+ deriving (Eq, Ord, Show, Data, Typeable, Generic) +data DataField = DField+ { dfName :: !LocSymbol -- ^ Field Name+ , dfSort :: !Sort -- ^ Field Sort+ } deriving (Eq, Ord, Show, Data, Typeable, Generic) -isFirstOrder, isFunction :: Sort -> Bool+data DataCtor = DCtor+ { dcName :: !LocSymbol -- ^ Ctor Name+ , dcFields :: ![DataField] -- ^ Ctor Fields+ } deriving (Eq, Ord, Show, Data, Typeable, Generic) +data DataDecl = DDecl+ { ddTyCon :: !FTycon -- ^ Name of defined datatype+ , ddVars :: !Int -- ^ Number of type variables+ , ddCtors :: [DataCtor] -- ^ Datatype Ctors+ } deriving (Eq, Ord, Show, Data, Typeable, Generic)++instance Symbolic DataDecl where+ symbol = symbol . ddTyCon++instance Symbolic DataField where+ symbol = val . dfName++instance Symbolic DataCtor where+ symbol = val . dcName++isFirstOrder, isFunction :: Sort -> Bool isFirstOrder (FFunc sx s) = not (isFunction sx) && isFirstOrder s isFirstOrder (FAbs _ s) = isFirstOrder s isFirstOrder (FApp s1 s2) = (not $ isFunction s1) && (not $ isFunction s2)@@ -257,8 +316,10 @@ instance Fixpoint Sort where toFix = toFixSort ++ toFixSort :: Sort -> Doc-toFixSort (FVar i) = text "@" <> parens (toFix i)+toFixSort (FVar i) = text "@" <> parens (toFix i) toFixSort FInt = text "int" toFixSort FReal = text "real" toFixSort FFrac = text "frac"@@ -267,7 +328,7 @@ toFixSort t@(FAbs _ _) = toFixAbsApp t toFixSort t@(FFunc _ _)= toFixAbsApp t toFixSort (FTC c) = toFix c-toFixSort t@(FApp _ _) = toFixFApp (fApp' t)+toFixSort t@(FApp _ _) = toFixFApp (unFApp t) toFixAbsApp :: Sort -> Doc toFixAbsApp t = text "func" <> parens (toFix n <> text ", " <> toFix ts)@@ -280,11 +341,36 @@ toFixFApp [t] = toFixSort t toFixFApp [FTC c, t] | isListTC c = brackets $ toFixSort t-toFixFApp ts = parens $ intersperse space (toFixSort <$> ts)+toFixFApp ts = parens $ intersperse (text "") (toFixSort <$> ts) instance Fixpoint FTycon where- toFix (TC s _) = toFix s+ toFix (TC s _) = toFix (val s) +instance Fixpoint DataField where+ toFix (DField x t) = toFix x <+> text ":" <+> toFix t++instance Fixpoint DataCtor where+ toFix (DCtor x flds) = toFix x <+> braces (intersperse comma (toFix <$> flds))++instance Fixpoint DataDecl where+ toFix (DDecl tc n ctors) = vcat ([header] ++ body ++ [footer])+ where+ header = {- text "data" <+> -} toFix tc <+> toFix n <+> text "= ["+ body = [nest 2 (text "|" <+> toFix ct) | ct <- ctors]+ footer = text "]"++instance PPrint FTycon where+ pprintTidy _ = toFix++instance PPrint DataField where+ pprintTidy _ = toFix++instance PPrint DataCtor where+ pprintTidy _ = toFix++instance PPrint DataDecl where+ pprintTidy _ = toFix+ ------------------------------------------------------------------------- -- | Exported Basic Sorts ----------------------------------------------- -------------------------------------------------------------------------@@ -315,6 +401,9 @@ | c == numFTyCon = FNum | otherwise = FTC c +basicSorts :: [Sort]+basicSorts = [FInt, boolSort] -- , setSort, mapSort, bitVecSort]+ ------------------------------------------------------------------------ sortSubst :: M.HashMap Symbol Sort -> Sort -> Sort ------------------------------------------------------------------------@@ -328,11 +417,21 @@ instance B.Binary FTycon instance B.Binary TCInfo instance B.Binary Sort+instance B.Binary DataField+instance B.Binary DataCtor+instance B.Binary DataDecl instance B.Binary Sub -instance NFData FTycon+instance NFData FTycon where+ rnf (TC x i) = x `seq` i `seq` ()++-- data FTycon = TC LocSymbol TCInfo deriving (Ord, Show, Data, Typeable, Generic)+ instance NFData TCInfo instance NFData Sort+instance NFData DataField+instance NFData DataCtor+instance NFData DataDecl instance NFData Sub
src/Language/Fixpoint/Types/Spans.hs view
@@ -42,6 +42,7 @@ import Text.Printf -- import Debug.Trace + ----------------------------------------------------------------------- -- | Located Values --------------------------------------------------- -----------------------------------------------------------------------@@ -167,6 +168,9 @@ instance Hashable SrcSpan where hashWithSalt i z = hashWithSalt i (sp_start z, sp_stop z)++instance Loc () where+ srcSpan _ = dummySpan dummySpan :: SrcSpan dummySpan = SS l l
src/Language/Fixpoint/Types/Substitutions.hs view
@@ -121,7 +121,7 @@ substf f (PAtom r e1 e2) = PAtom r (substf f e1) (substf f e2) substf _ p@(PKVar _ _) = p substf _ (PAll _ _) = errorstar "substf: FORALL"- substf f (PGrad k su e) = PGrad k su (substf f e)+ substf f (PGrad k su i e)= PGrad k su i (substf f e) substf _ p = p @@ -139,7 +139,7 @@ subst su (PIff p1 p2) = PIff (subst su p1) (subst su p2) subst su (PAtom r e1 e2) = PAtom r (subst su e1) (subst su e2) subst su (PKVar k su') = PKVar k $ su' `catSubst` su- subst su (PGrad k su' e) = PGrad k (su' `catSubst` su) (subst su e)+ subst su (PGrad k su' i e) = PGrad k (su' `catSubst` su) i (subst su e) subst su (PAll bs p) | disjoint su bs = PAll bs $ subst su p --(substExcept su (fst <$> bs)) p | otherwise = errorstar "subst: PAll (without disjoint binds)"
+ src/Language/Fixpoint/Types/Theories.hs view
@@ -0,0 +1,275 @@+{- LANGUAGE FlexibleInstances #-}+{- LANGUAGE FlexibleContexts #-}+{- LANGUAGE NoMonomorphismRestriction #-}+{- LANGUAGE OverloadedStrings #-}+{- LANGUAGE UndecidableInstances #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE DeriveDataTypeable #-}++-- | This module contains the types defining an SMTLIB2 interface.++module Language.Fixpoint.Types.Theories (++ -- * Serialized Representation+ Raw++ -- * Theory Symbol+ , TheorySymbol (..)+ , Sem (..)++ -- * Theory Sorts+ , SmtSort (..)+ , sortSmtSort+ , isIntSmtSort++ -- * Symbol Environments+ , SymEnv (..)+ , symEnv+ , symEnvSort+ , symEnvTheory+ , insertSymEnv+ , symbolAtName+ , symbolAtSmtName+++ ) where+++import Data.Generics (Data)+import Data.Typeable (Typeable)+import Data.Hashable+import GHC.Generics (Generic)+import Control.DeepSeq+import Language.Fixpoint.Types.PrettyPrint+import Language.Fixpoint.Types.Names+import Language.Fixpoint.Types.Sorts+import Language.Fixpoint.Types.Errors+import Language.Fixpoint.Types.Environments++import Text.PrettyPrint.HughesPJ+import qualified Data.Text.Lazy as LT+import qualified Data.Binary as B+import qualified Data.HashMap.Strict as M+import qualified Language.Fixpoint.Misc as Misc -- (sortNub, errorstar) -- traceShow)++--------------------------------------------------------------------------------+-- | 'Raw' is the low-level representation for SMT values+--------------------------------------------------------------------------------+type Raw = LT.Text++--------------------------------------------------------------------------------+-- | 'SymEnv' is used to resolve the 'Sort' and 'Sem' of each 'Symbol'+--------------------------------------------------------------------------------+data SymEnv = SymEnv+ { seSort :: !(SEnv Sort) -- ^ Sorts of *all* defined symbols+ , seTheory :: !(SEnv TheorySymbol) -- ^ Information about theory-specific Symbols+ , seData :: !(SEnv DataDecl) -- ^ User-defined data-declarations+ , seLits :: !(SEnv Sort) -- ^ Distinct Constant symbols+ , seAppls :: !(M.HashMap FuncSort Int) -- ^ Types at which `apply` was used;+ -- see [NOTE:apply-monomorphization]+ }+ deriving (Eq, Show, Data, Typeable, Generic)++{- type FuncSort = {v:Sort | isFFunc v} @-}+type FuncSort = (SmtSort, SmtSort)++instance NFData SymEnv+instance B.Binary SymEnv++instance Monoid SymEnv where+ mempty = SymEnv emptySEnv emptySEnv emptySEnv emptySEnv mempty+ mappend e1 e2 = SymEnv { seSort = seSort e1 `mappend` seSort e2+ , seTheory = seTheory e1 `mappend` seTheory e2+ , seData = seData e1 `mappend` seData e2+ , seLits = seLits e1 `mappend` seLits e2+ , seAppls = seAppls e1 `mappend` seAppls e2+ }++symEnv :: SEnv Sort -> SEnv TheorySymbol -> [DataDecl] -> SEnv Sort -> [Sort] -> SymEnv+symEnv xEnv fEnv ds ls ts = SymEnv xEnv' fEnv dEnv ls sortMap+ where+ xEnv' = unionSEnv xEnv wiredInEnv+ dEnv = fromListSEnv [(symbol d, d) | d <- ds]+ sortMap = M.fromList (zip smts [0..])+ smts = funcSorts dEnv ts -- tracepp "smt-apply-sorts" $ Misc.sortNub $ (SInt, SInt) : [ (tx t1, tx t2) | FFunc t1 t2 <- ts]++-- | These are "BUILT-in" polymorphic functions which are+-- UNININTERPRETED but POLYMORPHIC, hence need to go through+-- the apply-defunc stuff.++wiredInEnv :: M.HashMap Symbol Sort+wiredInEnv = M.fromList [(toIntName, mkFFunc 1 [FVar 0, FInt])]+++-- | 'smtSorts' attempts to compute a list of all the input-output sorts+-- at which applications occur. This is a gross hack; as during unfolding+-- we may create _new_ terms with wierd new sorts. Ideally, we MUST allow+-- for EXTENDING the apply-sorts with those newly created terms.+-- the solution is perhaps to *preface* each VC query of the form+--+-- push+-- assert p+-- check-sat+-- pop+--+-- with the declarations needed to make 'p' well-sorted under SMT, i.e.+-- change the above to+--+-- declare apply-sorts+-- push+-- assert p+-- check-sat+-- pop+--+-- such a strategy would NUKE the entire apply-sort machinery from the CODE base.+-- [TODO]: dynamic-apply-declaration++funcSorts :: SEnv a -> [Sort] -> [FuncSort]+funcSorts dEnv ts = [ (t1, t2) | t1 <- smts, t2 <- smts]+ where+ smts = Misc.sortNub $ concat [ [tx t1, tx t2] | FFunc t1 t2 <- ts]+ tx = applySmtSort dEnv+++symEnvTheory :: Symbol -> SymEnv -> Maybe TheorySymbol+symEnvTheory x env = lookupSEnv x (seTheory env)++symEnvSort :: Symbol -> SymEnv -> Maybe Sort+symEnvSort x env = lookupSEnv x (seSort env)++insertSymEnv :: Symbol -> Sort -> SymEnv -> SymEnv+insertSymEnv x t env = env { seSort = insertSEnv x t (seSort env) }++symbolAtName :: (PPrint a) => Symbol -> SymEnv -> a -> Sort -> Symbol+symbolAtName mkSym env e = symbolAtSmtName mkSym env e . ffuncSort env++symbolAtSmtName :: (PPrint a) => Symbol -> SymEnv -> a -> FuncSort -> Symbol+symbolAtSmtName mkSym env e = intSymbol mkSym . funcSortIndex env e++funcSortIndex :: (PPrint a) => SymEnv -> a -> FuncSort -> Int+funcSortIndex env e z = M.lookupDefault err z (seAppls env)+ where+ err = panic ("Unknown func-sort: " ++ showpp z ++ " for " ++ showpp e)++ffuncSort :: SymEnv -> Sort -> FuncSort+ffuncSort env t = (tx t1, tx t2)+ where+ tx = applySmtSort (seData env)+ (t1, t2) = args t+ args (FFunc a b) = (a, b)+ args _ = (FInt, FInt)++applySmtSort :: SEnv a -> Sort -> SmtSort+applySmtSort = sortSmtSort False++isIntSmtSort :: SEnv a -> Sort -> Bool+isIntSmtSort env s = SInt == applySmtSort env s++--------------------------------------------------------------------------------+-- | 'TheorySymbol' represents the information about each interpreted 'Symbol'+--------------------------------------------------------------------------------+data TheorySymbol = Thy+ { tsSym :: !Symbol -- ^ name+ , tsRaw :: !Raw -- ^ serialized SMTLIB2 name+ , tsSort :: !Sort -- ^ sort+ , tsInterp :: !Sem -- ^ TRUE = defined (interpreted), FALSE = declared (uninterpreted)+ }+ deriving (Eq, Ord, Show, Data, Typeable, Generic)++instance NFData Sem+instance NFData TheorySymbol+instance B.Binary TheorySymbol++instance PPrint Sem where+ pprintTidy _ = text . show++instance Fixpoint TheorySymbol where+ toFix (Thy x _ t d) = text "TheorySymbol" <+> pprint (x, t) <+> parens (pprint d)++instance PPrint TheorySymbol where+ pprintTidy k (Thy x _ t d) = text "TheorySymbol" <+> pprintTidy k (x, t) <+> parens (pprint d)++--------------------------------------------------------------------------------+-- | 'Sem' describes the SMT semantics for a given symbol+--------------------------------------------------------------------------------++data Sem+ = Uninterp -- ^ for UDF: `len`, `height`, `append`+ | Data -- ^ for ADT ctors & accessor: `cons`, `nil`, `head`+ | Theory -- ^ for theory ops: mem, cup, select+ deriving (Eq, Ord, Show, Data, Typeable, Generic)++instance B.Binary Sem+++--------------------------------------------------------------------------------+-- | A Refinement of 'Sort' that describes SMTLIB Sorts+--------------------------------------------------------------------------------+data SmtSort+ = SInt+ | SBool+ | SReal+ | SString+ | SSet+ | SMap+ | SBitVec !Int+ | SVar !Int+ | SData !FTycon ![SmtSort]+ -- HKT | SApp ![SmtSort] -- ^ Representing HKT+ deriving (Eq, Ord, Show, Data, Typeable, Generic)++instance Hashable SmtSort+instance NFData SmtSort+instance B.Binary SmtSort++-- | 'smtSort True msg t' serializes a sort 't' using type variables,+-- 'smtSort False msg t' serializes a sort 't' using 'Int' instead of tyvars.++sortSmtSort :: Bool -> SEnv a -> Sort -> SmtSort+sortSmtSort poly env = go+ where+ go (FFunc _ _) = SInt+ go FInt = SInt+ go FReal = SReal+ go t+ | t == boolSort = SBool+ go (FVar i)+ | poly = SVar i+ | otherwise = SInt+ go t = fappSmtSort poly env ct ts where (ct:ts)= unFApp t++fappSmtSort :: Bool -> SEnv a -> Sort -> [Sort] -> SmtSort+fappSmtSort poly env = go+ where+-- HKT go t@(FVar _) ts = SApp (sortSmtSort poly env <$> (t:ts))+ go (FTC c) _+ | setConName == symbol c = SSet+ go (FTC c) _+ | mapConName == symbol c = SMap+ go (FTC bv) [FTC s]+ | bitVecName == symbol bv+ , Just n <- sizeBv s = SBitVec n+ go s []+ | isString s = SString+ go (FTC c) ts+ | symEnvData c env = SData c (sortSmtSort poly env <$> ts)+ go _ _ = SInt++symEnvData :: (Symbolic x) => x -> SEnv a -> Bool+symEnvData = memberSEnv . symbol++instance PPrint SmtSort where+ pprintTidy _ SInt = text "Int"+ pprintTidy _ SBool = text "Bool"+ pprintTidy _ SReal = text "Real"+ pprintTidy _ SString = text "Str"+ pprintTidy _ SSet = text "Set"+ pprintTidy _ SMap = text "Map"+ pprintTidy _ (SBitVec n) = text "BitVec" <+> int n+ pprintTidy _ (SVar i) = text "@" <> int i+-- HKT pprintTidy k (SApp ts) = ppParens k (pprintTidy k tyAppName) ts+ pprintTidy k (SData c ts) = ppParens k (pprintTidy k c) ts++ppParens :: (PPrint d) => Tidy -> Doc -> [d] -> Doc+ppParens k d ds = parens $ Misc.intersperse (text "") (d : (pprintTidy k <$> ds))
src/Language/Fixpoint/Types/Triggers.hs view
@@ -15,8 +15,10 @@ import qualified Data.Binary as B import Control.DeepSeq import GHC.Generics (Generic)+import Text.PrettyPrint.HughesPJ import Language.Fixpoint.Types.Refinements+import Language.Fixpoint.Types.PrettyPrint import Language.Fixpoint.Misc (errorstar) @@ -26,6 +28,11 @@ data Trigger = NoTrigger | LeftHandSide deriving (Eq, Show, Generic) +instance PPrint Trigger where + pprintTidy _ = text . show ++instance PPrint a => PPrint (Triggered a) where + pprintTidy k (TR t x) = parens (pprintTidy k t <+> text ":" <+> pprintTidy k x) noTrigger :: e -> Triggered e noTrigger = TR NoTrigger
src/Language/Fixpoint/Types/Utils.hs view
@@ -51,7 +51,7 @@ rs = reftConjuncts (sr_reft sr) t = sr_sort sr - go ps ks gs ((v, PKVar k su ):xs) = go ps (KVS v t k su:ks) gs xs - go ps ks gs ((v, PGrad k su _):xs) = go ps ks (KVS v t k su:gs) xs - go ps ks gs ((_, p):xs) = go (p:ps) ks gs xs - go ps ks gs [] = (ps, ks, gs)+ go ps ks gs ((v, PKVar k su ):xs) = go ps (KVS v t k su:ks) gs xs + go ps ks gs ((v, PGrad k su _ _):xs) = go ps ks (KVS v t k su:gs) xs + go ps ks gs ((_, p):xs) = go (p:ps) ks gs xs + go ps ks gs [] = (ps, ks, gs)
src/Language/Fixpoint/Types/Visitor.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Language.Fixpoint.Types.Visitor ( -- * Visitor@@ -28,25 +30,31 @@ , envKVars , envKVarsN , rhsKVars- , mapKVars, mapKVars', mapKVarSubsts+ , mapKVars, mapKVars', mapGVars', mapKVarSubsts , mapExpr, mapMExpr -- * Predicates on Constraints , isConcC , isKvarC -- * Sorts- , foldSort, mapSort+ , foldSort+ , mapSort ) where -import Control.Monad.Trans.State.Strict (State, modify, runState)+-- import Control.Monad.Trans.State.Strict (State, modify, runState)+-- import Control.DeepSeq+import Control.Monad.State.Strict import qualified Data.HashSet as S import qualified Data.HashMap.Strict as M import qualified Data.List as L import Language.Fixpoint.Types hiding (mapSort)-import Language.Fixpoint.Misc (count, sortNub)+import qualified Language.Fixpoint.Misc as Misc +++ data Visitor acc ctx = Visitor { -- | Context @ctx@ is built in a "top-down" fashion; not "across" siblings ctxExpr :: ctx -> Expr -> ctx@@ -59,10 +67,10 @@ } ----------------------------------------------------------------------------------defaultVisitor :: Monoid acc => Visitor acc ctx+defaultVisitor :: (Monoid acc) => Visitor acc ctx --------------------------------------------------------------------------------- defaultVisitor = Visitor- { ctxExpr = const -- \c _ -> c+ { ctxExpr = const , txExpr = \_ x -> x , accExpr = \_ _ -> mempty }@@ -82,11 +90,21 @@ type VisitM acc = State acc accum :: (Monoid a) => a -> VisitM a ()-accum = modify . mappend+accum !z = modify (mappend z)+ -- do+ -- !cur <- get+ -- put ((mappend $!! z) $!! cur) -(<$$>) :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)-f <$$> x = traverse f x+(<$$>) :: (Monad m) => (a -> m b) -> [a] -> m [b]+f <$$> xs = f Misc.<$$> xs +-- (<$$>) :: (Applicative f) => (a -> f b) -> [a] -> f [b]+-- f <$$> x = traverse f x+-- _ <$$> [] = return []+-- f <$$> (x:xs) = do+ -- !y <- f x+ -- !ys <- f <$$> xs+ -- return (y:ys) ------------------------------------------------------------------------------ class Visitable t where visit :: (Monoid a) => Visitor a c -> c -> t -> VisitM a t@@ -130,34 +148,34 @@ --------------------------------------------------------------------------------- visitExpr :: (Monoid a) => Visitor a ctx -> ctx -> Expr -> VisitM a Expr-visitExpr v = vE+visitExpr !v = vE where- vE c e = do {-# SCC "visitExpr.vE.accum" #-} accum acc- {-# SCC "visitExpr.vE.step" #-} step c' e'- where c' = ctxExpr v c e- e' = txExpr v c' e- acc = accExpr v c' e- step _ e@(ESym _) = return e- step _ e@(ECon _) = return e- step _ e@(EVar _) = return e- step c (EApp f e) = EApp <$> vE c f <*> vE c e- step c (ENeg e) = ENeg <$> vE c e- step c (EBin o e1 e2) = EBin o <$> vE c e1 <*> vE c e2- step c (EIte p e1 e2) = EIte <$> vE c p <*> vE c e1 <*> vE c e2- step c (ECst e t) = (`ECst` t) <$> vE c e- step c (PAnd ps) = PAnd <$> (vE c <$$> ps)- step c (POr ps) = POr <$> (vE c <$$> ps)- step c (PNot p) = PNot <$> vE c p- step c (PImp p1 p2) = PImp <$> vE c p1 <*> vE c p2- step c (PIff p1 p2) = PIff <$> vE c p1 <*> vE c p2- step c (PAtom r e1 e2) = PAtom r <$> vE c e1 <*> vE c e2- step c (PAll xts p) = PAll xts <$> vE c p- step c (ELam (x,t) e) = ELam (x,t) <$> vE c e- step c (PExist xts p) = PExist xts <$> vE c p- step c (ETApp e s) = (`ETApp` s) <$> vE c e- step c (ETAbs e s) = (`ETAbs` s) <$> vE c e- step _ p@(PKVar _ _) = return p- step c (PGrad k su e) = PGrad k su <$> vE c e + vE !c !e = do {-# SCC "visitExpr.vE.accum" #-} accum acc+ {-# SCC "visitExpr.vE.step" #-} step c' e'+ where !c' = ctxExpr v c e+ !e' = txExpr v c' e+ !acc = accExpr v c' e+ step _ !e@(ESym _) = return e+ step _ !e@(ECon _) = return e+ step _ !e@(EVar _) = return e+ step !c !(EApp f e) = EApp <$> vE c f <*> vE c e+ step !c !(ENeg e) = ENeg <$> vE c e+ step !c !(EBin o e1 e2) = EBin o <$> vE c e1 <*> vE c e2+ step !c !(EIte p e1 e2) = EIte <$> vE c p <*> vE c e1 <*> vE c e2+ step !c !(ECst e t) = (`ECst` t) <$> vE c e+ step !c !(PAnd ps) = PAnd <$> (vE c <$$> ps)+ step !c !(POr ps) = POr <$> (vE c <$$> ps)+ step !c !(PNot p) = PNot <$> vE c p+ step !c !(PImp p1 p2) = PImp <$> vE c p1 <*> vE c p2+ step !c !(PIff p1 p2) = PIff <$> vE c p1 <*> vE c p2+ step !c !(PAtom r e1 e2) = PAtom r <$> vE c e1 <*> vE c e2+ step !c !(PAll xts p) = PAll xts <$> vE c p+ step !c !(ELam (x,t) e) = ELam (x,t) <$> vE c e+ step !c !(PExist xts p) = PExist xts <$> vE c p+ step !c !(ETApp e s) = (`ETApp` s) <$> vE c e+ step !c !(ETAbs e s) = (`ETAbs` s) <$> vE c e+ step _ !p@(PKVar _ _) = return p+ step !c !(PGrad k su i e) = PGrad k su i <$> vE c e mapKVars :: Visitable t => (KVar -> Maybe Expr) -> t -> t mapKVars f = mapKVars' f'@@ -165,17 +183,27 @@ f' (kv', _) = f kv' mapKVars' :: Visitable t => ((KVar, Subst) -> Maybe Expr) -> t -> t-mapKVars' f = trans kvVis () []+mapKVars' f = trans kvVis () () where kvVis = defaultVisitor { txExpr = txK } txK _ (PKVar k su) | Just p' <- f (k, su) = subst su p'- txK _ (PGrad k su _)+ txK _ (PGrad k su _ _) | Just p' <- f (k, su) = subst su p' txK _ p = p +++mapGVars' :: Visitable t => ((KVar, Subst) -> Maybe Expr) -> t -> t+mapGVars' f = trans kvVis () ()+ where+ kvVis = defaultVisitor { txExpr = txK }+ txK _ (PGrad k su _ _)+ | Just p' <- f (k, su) = subst su p'+ txK _ p = p+ mapExpr :: (Expr -> Expr) -> Expr -> Expr-mapExpr f = trans (defaultVisitor {txExpr = const f}) () []+mapExpr f = trans (defaultVisitor {txExpr = const f}) () () mapMExpr :: (Monad m) => (Expr -> m Expr) -> Expr -> m Expr@@ -185,7 +213,7 @@ go e@(ECon _) = f e go e@(EVar _) = f e go e@(PKVar _ _) = f e- go (PGrad k su e) = f =<< (PGrad k su <$> go e )+ go (PGrad k s i e) = f =<< (PGrad k s i <$> go e ) go (ENeg e) = f =<< (ENeg <$> go e ) go (PNot p) = f =<< (PNot <$> go p ) go (ECst e t) = f =<< ((`ECst` t) <$> go e )@@ -204,15 +232,15 @@ go (POr ps) = f =<< (POr <$> (go <$$> ps) ) mapKVarSubsts :: Visitable t => (KVar -> Subst -> Subst) -> t -> t-mapKVarSubsts f = trans kvVis () []+mapKVarSubsts f = trans kvVis () () where kvVis = defaultVisitor { txExpr = txK } txK _ (PKVar k su) = PKVar k (f k su)- txK _ (PGrad k su e) = PGrad k (f k su) e+ txK _ (PGrad k su i e) = PGrad k (f k su) i e txK _ p = p- -newtype MInt = MInt Integer +newtype MInt = MInt Integer -- deriving (Eq, NFData)+ instance Monoid MInt where mempty = MInt 0 mappend (MInt m) (MInt n) = MInt (m + n)@@ -243,9 +271,9 @@ kvars = fold kvVis () [] where kvVis = (defaultVisitor :: Visitor [KVar] t) { accExpr = kv' }- kv' _ (PKVar k _) = [k]- kv' _ (PGrad k _ _) = [k]- kv' _ _ = []+ kv' _ (PKVar k _) = [k]+ kv' _ (PGrad k _ _ _) = [k]+ kv' _ _ = [] envKVars :: (TaggedC c a) => BindEnv -> c a -> [KVar] envKVars be c = squish [ kvs sr | (_, sr) <- clhs be c]@@ -256,7 +284,7 @@ envKVarsN :: (TaggedC c a) => BindEnv -> c a -> [(KVar, Int)] envKVarsN be c = tally [ kvs sr | (_, sr) <- clhs be c] where- tally = count . concat+ tally = Misc.count . concat kvs = kvars . sr_reft rhsKVars :: (TaggedC c a) => c a -> [KVar]@@ -270,18 +298,24 @@ isKvar :: Expr -> Bool isKvar (PKVar {}) = True-isKvar (PGrad {}) = True +isKvar (PGrad {}) = True isKvar _ = False isConc :: Expr -> Bool isConc = null . kvars -stripCasts :: Expr -> Expr-stripCasts = mapExpr go+stripCasts :: (Visitable t) => t -> t+stripCasts = trans (defaultVisitor { txExpr = const go }) () () where go (ECst e _) = e go e = e +-- stripCasts :: Expr -> Expr+-- stripCasts = mapExpr go+-- where+-- go (ECst e _) = e+-- go e = e+ --------------------------------------------------------------------------------- -- | Visitors over @Sort@ ---------------------------------------------------------------------------------@@ -297,11 +331,11 @@ mapSort :: (Sort -> Sort) -> Sort -> Sort mapSort f = step where- step = go . f- go (FFunc t1 t2) = FFunc (step t1) (step t2)- go (FApp t1 t2) = FApp (step t1) (step t2)- go (FAbs i t) = FAbs i (step t)- go t = t+ step !x = go (f x)+ go !(FFunc t1 t2) = FFunc (step t1) (step t2)+ go !(FApp t1 t2) = FApp (step t1) (step t2)+ go !(FAbs i t) = FAbs i (step t)+ go !t = t --------------------------------------------------------------- -- | String Constants -----------------------------------------@@ -315,7 +349,7 @@ -- instance SymConsts (FInfo a) where instance (SymConsts (c a)) => SymConsts (GInfo c a) where- symConsts fi = sortNub $ csLits ++ bsLits ++ qsLits+ symConsts fi = Misc.sortNub $ csLits ++ bsLits ++ qsLits where csLits = concatMap symConsts $ M.elems $ cm fi bsLits = symConsts $ bs fi
− stack.yaml
@@ -1,12 +0,0 @@-flags:- liquid-fixpoint:- devel: True-packages:-- '.'-extra-deps:-- dotgen-0.4.2-- fgl-visualize-0.1.0.1-- intern-0.9.1.4-- located-base-0.1.1.0--resolver: nightly-2016-05-21
− tests/crash/num00.fq
@@ -1,29 +0,0 @@-// This qualifier saves the day; solve constraints WITHOUT IT--qualif Zog(v:a) : (0 <= v)-qualif Bog(v:a) : (0 <= 1)---bind 0 zog : {v : int | true}--constraint:- env [0]- lhs {v : alpha | (v = 10)}- rhs {v : alpha | $k0}- id 1 tag []--constraint:- env [0]- lhs {v : alpha | $k0}- rhs {v : alpha | $k0}- id 2 tag []--constraint:- env [0]- lhs {v : alpha | $k0}- rhs {v : alpha | 0 <= v}- id 3 tag []--wf:- env [0]- reft {v: alpha | $k0}
− tests/crash/sort00.fq
@@ -1,12 +0,0 @@-// for LH Issue 773--constant foo : (func(0, [int; int]))--bind 0 x : {v: Str | true}--constraint:- env [ 0 ]- lhs {v : int | (foo x = 0)}- rhs {v : int | (3 = 1 + 2) }- id 1 tag []-
− tests/crash/sort01.fq
@@ -1,13 +0,0 @@-// for LH Issue 774--constant foo : (func(0, [int; int]))--bind 0 x : {v: Str | true}-bind 1 y : {v: Str | true}--constraint:- env [ 0; 1 ]- lhs {v : int | (foo x = foo y)}- rhs {v : int | (3 = 1 + 2) }- id 1 tag []-
− tests/cut/test00-tx.fq
@@ -1,12 +0,0 @@---// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 a : {v:int | (v = 10 || v = 20) }--constraint:- env [ 0 ]- lhs {v : int | v = a}- rhs {v : int | 10 <= v}- id 3
− tests/cut/test00.fq
@@ -1,28 +0,0 @@---// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 a : {v: int | $k0}--constraint:- env [ ]- lhs {v : int | (v = 10)}- rhs {v : int | $k0}- id 1 --constraint:- env [ ]- lhs {v : int | v = 20}- rhs {v : int | $k0}- id 2 --constraint:- env [ 0 ]- lhs {v : int | v = a}- rhs {v : int | 10 <= v}- id 3 --wf:- env [ ]- reft {v: int | $k0}
− tests/cut/test00a-tx.fq
@@ -1,43 +0,0 @@-// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--constraint:- env [z : {v : int | true}]- lhs {v : int | (z=10) \/ (z=20)}- rhs {v : int | 10 <= z}- id 3 --/*--Rewriting constraints as:-- id 1- x:int, v:int |- x=10 /\ v=x => k0- - id 2- y:int, v:int |- y=20 /\ v=y => k0--Projecting out all variables NOT in the WF of k0-- id 1- v:int |- (exists x:int. x=10 /\ v=x) => k0- - id 2- v:int |- (exists y:int. y=20 /\ v=y) => k0--Take the \/ of all constraints on k0-- k0 = (exists x:int. x=10 /\ v=x) \/ (exists y:int. y=20 /\ v=y)- - k0[z/v]- = (\x. x=10 /\ v=x) \/ (\y. y=20 /\ v=y)[z/v]- = (\x. x=10 /\ z=x) \/ (\y. y=20 /\ z=y)--So you get:-- env [2]- lhs {v : int | (\x. x=10 /\ z=x) \/ (\y. y=20 /\ z=y)}- rhs {v : int | 10 <= z}- id 3 --*/
− tests/cut/test00a.fq
@@ -1,29 +0,0 @@-// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 x : {v : int | true}-bind 1 y : {v : int | true}-bind 2 z : {v : int | true}--constraint:- env [0]- lhs {v : int | (x = 10)}- rhs {v : int | $k0[v:=x]}- id 1 --constraint:- env [1]- lhs {v : int | y = 20}- rhs {v : int | $k0[v:=y]}- id 2 --constraint:- env [2]- lhs {v : int | $k0[v:=z]}- rhs {v : int | 10 <= z}- id 3 --wf:- env [ ]- reft {v: int | $k0}-
− tests/cut/test1-tx.fq
@@ -1,43 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--constraint:- env [a : {v : int | (exists x:int. x=10 /\ v=x) - \/ (exists y:int. y=20 /\ v=y) }]- lhs {v : int | v = a }- rhs {v : int | 10 <= v}- id 3 --/*--Rewriting constraints as:-- id 1- x:int, v:int |- (v=10)[x/v] /\ (v=x) => k0- x:int, v:int |- (x=10) /\ (v=x) => k0-- id 2- y:int, v:int |- (v=20)[y/v] /\ (v=y) => k0- y:int, v:int |- (y=20) /\ (v=y) => k0--Projecting out all variables NOT in the WF of k0-- id 1- v:int |- (exists x:int. x=10 /\ v=x) => k0-- id 2- v:int |- (exists y:int. y=20 /\ v=y) => k0--Take the \/ of all constraints on k0-- k0 = (exists x:int. x=10 /\ v=x) \/ (exists y:int. y=20 /\ v=y)- -So you get:-- env [a : {v : int | (exists x:int. x=10 /\ v=x) \/ (exists y:int. y=20 /\ v=y) }]- lhs {v : int | v = a }- rhs {v : int | 10 <= v}- id 3--*/
− tests/cut/test1.fq
@@ -1,29 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 x : {v : int | v = 10}-bind 1 y : {v : int | v = 20}-bind 2 a : {v : int | $k0 }- -constraint:- env [0]- lhs {v : int | v = x}- rhs {v : int | $k0 }- id 1 --constraint:- env [1]- lhs {v : int | v = y}- rhs {v : int | $k0 }- id 2 --constraint:- env [2]- lhs {v : int | v = a }- rhs {v : int | 10 <= v}- id 3 --wf:- env [ ]- reft {v : int | $k0}
− tests/cut/test2-tx.fq
@@ -1,112 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a): (10 <= v)--// But you may use this one-qualif Pog(v:a): (0 <= v)-----/* ---- Version 1 (eliminate k1) ----Rewriting constraints as:-- id 0- v:int |- (v=0) => k1-- id 3- v:int |- k0 => k1--Projecting out all variables NOT in the WF of k1-- N/A--Take the \/ of all constraints on k1-- k1 = (v=0) \/ k0--So you get:-- bind 0 x: {v: int | v = 10 }- bind 1 a: {v: int | (v=0) \/ k0 }- bind 2 y: {v: int | v = 20 }- bind 3 b: {v: int | (v=0) \/ k0 }- bind 4 c: {v: int | k0 }-- constraint:- env [ 0; 1]- lhs {v : int | v = x + a}- rhs {v : int | k0}- id 1 -- constraint:- env [2; 3]- lhs {v : int | v = y + b}- rhs {v : int | k0}- id 2 -- constraint:- env [4]- lhs {v : int | v = c }- rhs {v : int | 10 <= v}- id 4 -- wf:- env [ ]- reft {v: int | k1}------- Version 2 (eliminate k0) ----Rewriting constraints as:-- id 1- x:int, a:int, v:int |- (v=10)[x/v] /\ k1[a/v] /\ (v=x+a) => k0- x:int, a:int, v:int |- (x=10) /\ k1[a/v] /\ (v=x+a) => k0-- id 2- y:int, b:int, v:int |- (v=20)[y/v] /\ k1[b/v] /\ (v=y+b) => k0- y:int, b:int, v:int |- (y=20) /\ k1[b/v] /\ (v=y+b) => k0--Projecting out all variables NOT in the WF of k0-- id 1- v:int |- (exists x:int a:int. (x=10) /\ k1[a/v] /\ (v=x+a)) => k0- - id 2- v:int |- (exists y:int b:int. (y=20) /\ k1[b/v] /\ (v=y+b)) => k0--Take the \/ of all constraints on k0-- k0 = (exists x:int a:int. (x=10) /\ k1[a/v] /\ (v=x+a))- \/ (exists y:int b:int. (y=20) /\ k1[b/v] /\ (v=y+b))--So you get:-- bind 4 c: {v: int | (exists x:int a:int. (x=10) /\ k1[a/v] /\ (v=x+a))- \/ (exists y:int b:int. (y=20) /\ k1[b/v] /\ (v=y+b)) }-- constraint:- env [ ]- lhs {v : int | v = 0}- rhs {v : int | k1 }- id 0 --- constraint:- env [ ]- lhs {v : int | (exists x:int a:int. (x=10) /\ k1[a/v] /\ (v=x+a))- \/ (exists y:int b:int. (y=20) /\ k1[b/v] /\ (v=y+b))}- rhs {v : int | k1}- id 3-- constraint:- env [4]- lhs {v : int | v = c }- rhs {v : int | 10 <= v}- id 4
− tests/cut/test2.fq
@@ -1,51 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a): (10 <= v)--// But you may use this one-qualif Pog(v:a): (0 <= v)--bind 0 x: {v: int | v = 10}-bind 1 a: {v: int | $k1 }-bind 2 y: {v: int | v = 20}-bind 3 b: {v: int | $k1 }-bind 4 c: {v: int | $k0 }--constraint:- env [ ]- lhs {v : int | v = 0}- rhs {v : int | $k1 }- id 0 ---constraint:- env [ 0; 1]- lhs {v : int | v = x + a}- rhs {v : int | $k0}- id 1 --constraint:- env [2; 3]- lhs {v : int | v = y + b}- rhs {v : int | $k0}- id 2 --constraint:- env [ ]- lhs {v : int | $k0}- rhs {v : int | $k1}- id 3--constraint:- env [4]- lhs {v : int | v = c }- rhs {v : int | 10 <= v}- id 4 --wf:- env [ ]- reft {v: int | $k0}--wf:- env [ ]- reft {v: int | $k1}
− tests/elim/div00.fq
@@ -1,23 +0,0 @@--// --eliminate should be able to solve this WITHOUT the qualifier-// qualif Zog(v:int) : (v /= 0)--bind 0 n : {v: int | true }-bind 1 m : {v: int | true }-bind 2 z : {v: int | $k0[n := m] }--constraint:- env [ ]- lhs {v : int | v = 12 }- rhs {v : int | $k0 }- id 1 tag []--constraint:- env [ 1; 2 ]- lhs {v : int | v = z}- rhs {v : int | v /= 0}- id 2 tag []--wf:- env [ 0 ]- reft {v: int | $k0 }
− tests/elim/elim00.fq
@@ -1,1494 +0,0 @@-fixpoint "--defunct"--// qualif Cmp(v : @(0), x : @(0)): ((v > x)) // "tests/todo/elim00.hs.fq" (line 1, column 8)-// qualif Cmp(v : @(0), x : @(0)): ((v = x)) // "tests/todo/elim00.hs.fq" (line 2, column 8)---constant Control.Exception.Base.irrefutPatError##09 : (func(1, [int;- @(0)]))-constant GHC.Base..##r2C : (func(3, [func(0, [@(0); @(1)]);- func(0, [@(2); @(0)]);- @(2);- @(1)]))-constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant GHC.Tuple.$40$$44$$44$$41$$35$$35$76 : (func(3, [@(0);- @(1);- @(2);- (Tuple @(0) @(1) @(2))]))-constant GHC.Real.D$58$Integral$35$$35$rWH : (func(1, [func(0, [@(0);- @(0);- @(0)]);- func(0, [@(0); @(0); @(0)]);- func(0, [@(0); @(0); @(0)]);- func(0, [@(0); @(0); @(0)]);- func(0, [@(0); @(0); (Tuple @(0) @(0))]);- func(0, [@(0); @(0); (Tuple @(0) @(0))]);- func(0, [@(0); int]);- (GHC.Real.Integral @(0))]))-constant addrLen : (func(0, [int; int]))-constant papp5 : (func(10, [(Pred @(0) @(1) @(2) @(3) @(4));- @(5);- @(6);- @(7);- @(8);- @(9);- bool]))-constant xsListSelector : (func(1, [[@(0)]; [@(0)]]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant Elim.foo##rlD : (func(0, [Elim.Foo; Elim.Foo]))-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant GHC.Integer.Type.smallInteger##0Z : (func(0, [int; int]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant GHC.Base.Just##r1e : (func(1, [@(0);- (GHC.Base.Maybe @(0))]))-constant Elim.xx##rlB : (func(0, [Elim.Foo; int]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant GHC.Prim.$43$$35$$35$$35$98 : (func(0, [int; int; int]))-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant GHC.Types.LT##6S : (GHC.Types.Ordering)-constant GHC.Prim.$60$$35$$35$$35$9q : (func(0, [int; int; int]))-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(3));- @(4);- @(5);- @(6);- @(7);- bool]))-constant Elim.PP##rlx : (func(2, [@(0);- @(1);- (Elim.Pair @(0) @(1))]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant GHC.Types.GT##6W : (GHC.Types.Ordering)-constant GHC.Prim.$45$$35$$35$$35$99 : (func(0, [int; int; int]))-constant GHC.Types.$58$$35$$35$64 : (func(1, [@(0);- [@(0)];- [@(0)]]))-constant autolen : (func(1, [@(0); int]))-constant GHC.Types.I###6c : (func(0, [int; int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant xx : (func(0, [Elim.Foo; int]))-constant null : (func(1, [[@(0)]; bool]))-constant GHC.Num.$43$$35$$35$rt : (func(1, [@(0); @(0); @(0)]))-constant GHC.Tuple.$40$$44$$44$$44$$44$$41$$35$$35$7a : (func(5, [@(0);- @(1);- @(2);- @(3);- @(4);- (Tuple @(0) @(1) @(2) @(3) @(4))]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant GHC.Tuple.$40$$44$$41$$35$$35$74 : (func(2, [@(0);- @(1);- (Tuple @(0) @(1))]))-constant Elim.yy##rlC : (func(0, [Elim.Foo; int]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant papp7 : (func(14, [(Pred @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(7);- @(8);- @(9);- @(10);- @(11);- @(12);- @(13);- bool]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant GHC.Prim.$62$$35$$35$$35$9m : (func(0, [int; int; int]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant Elim.Emp##rly : (func(2, [(Elim.Pair @(0) @(1))]))-constant len : (func(2, [(@(0) @(1)); int]))-constant GHC.Tuple.$40$$44$$44$$44$$44$$44$$44$$41$$35$$35$7e : (func(7, [@(0);- @(1);- @(2);- @(3);- @(4);- @(5);- @(6);- (Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6))]))-constant papp6 : (func(12, [(Pred @(0) @(1) @(2) @(3) @(4) @(5));- @(6);- @(7);- @(8);- @(9);- @(10);- @(11);- bool]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant Data.Foldable.length##r1s : (func(2, [(@(0) @(0)); int]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant xListSelector : (func(1, [[@(0)]; @(0)]))-constant strLen : (func(0, [int; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant GHC.Tuple.$40$$44$$44$$44$$41$$35$$35$78 : (func(4, [@(0);- @(1);- @(2);- @(3);- (Tuple @(0) @(1) @(2) @(3))]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant GHC.Prim.$61$$61$$35$$35$$35$9o : (func(0, [int;- int;- int]))-constant Elim.Foo##rlA : (func(0, [int; int; Elim.Foo]))-constant Prop : (func(0, [GHC.Types.Bool; bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(2, [(Pred @(0)); @(1); bool]))-constant yy : (func(0, [Elim.Foo; int]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant GHC.Prim.$62$$61$$35$$35$$35$9n : (func(0, [int;- int;- int]))-constant lit$36$tests$47$pos$47$elim00.hs$58$14$58$5$45$30$124$PP$32$wink$32$cow : (Str)-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant GHC.Types.EQ##6U : (GHC.Types.Ordering)-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant GHC.Base.Nothing##r1d : (func(1, [(GHC.Base.Maybe @(0))]))-constant GHC.Num.$45$$35$$35$02B : (func(1, [@(0); @(0); @(0)]))-constant GHC.Num.$42$$35$$35$ru : (func(1, [@(0); @(0); @(0)]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant GHC.Types.$91$$93$$35$$35$6m : (func(1, [[@(0)]]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant GHC.Prim.$60$$61$$35$$35$$35$9r : (func(0, [int;- int;- int]))-constant GHC.Real.D$58$Fractional$35$$35$rVU : (func(1, [func(0, [@(0);- @(0);- @(0)]);- func(0, [@(0); @(0)]);- func(0, [(GHC.Real.Ratio int); @(0)]);- (GHC.Real.Fractional @(0))]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant GHC.Tuple.$40$$44$$44$$44$$44$$44$$41$$35$$35$7c : (func(6, [@(0);- @(1);- @(2);- @(3);- @(4);- @(5);- (Tuple @(0) @(1) @(2) @(3) @(4) @(5))]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))-constant GHC.Prim.void###0l : (GHC.Prim.Void#)---bind 0 GHC.Prim.void###0l : {VV##180 : GHC.Prim.Void# | []}-bind 1 Elim.Emp##rly : {VV : func(2, [(Elim.Pair @(0) @(1))]) | []}-bind 2 GHC.Types.EQ##6U : {VV##185 : GHC.Types.Ordering | [(VV##185 = GHC.Types.EQ##6U)]}-bind 3 GHC.Types.LT##6S : {VV##186 : GHC.Types.Ordering | [(VV##186 = GHC.Types.LT##6S)]}-bind 4 GHC.Types.GT##6W : {VV##187 : GHC.Types.Ordering | [(VV##187 = GHC.Types.GT##6W)]}-bind 5 Elim.Emp##rly : {VV : func(2, [(Elim.Pair @(0) @(1))]) | []}-bind 6 GHC.Types.$91$$93$$35$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 7 GHC.Types.GT##6W : {VV##213 : GHC.Types.Ordering | [((cmp VV##213) = GHC.Types.GT##6W)]}-bind 8 GHC.Types.LT##6S : {VV##214 : GHC.Types.Ordering | [((cmp VV##214) = GHC.Types.LT##6S)]}-bind 9 GHC.Types.EQ##6U : {VV##215 : GHC.Types.Ordering | [((cmp VV##215) = GHC.Types.EQ##6U)]}-bind 10 GHC.Base.Nothing##r1d : {VV : func(1, [(GHC.Base.Maybe @(0))]) | []}-bind 11 ds_dxd : {VV##222 : Elim.Foo | []}-bind 12 lq_anf$##dxr : {lq_tmp$x##223 : Elim.Foo | [(lq_tmp$x##223 = ds_dxd)]}-bind 13 lq_anf$##dxr : {lq_tmp$x##225 : Elim.Foo | [(lq_tmp$x##225 = ds_dxd)]}-bind 14 xig##awy : {lq_tmp$x##233 : int | []}-bind 15 yog##awz : {lq_tmp$x##234 : int | [(xig##awy < lq_tmp$x##234)]}-bind 16 lq_anf$##dxr : {lq_tmp$x##225 : Elim.Foo | [(lq_tmp$x##225 = ds_dxd);- ((yy lq_tmp$x##225) = yog##awz);- ((xx lq_tmp$x##225) = xig##awy);- (lq_tmp$x##225 = (Elim.Foo##rlA xig##awy yog##awz));- ((yy lq_tmp$x##225) = yog##awz);- ((xx lq_tmp$x##225) = xig##awy)]}-bind 17 lq_anf$##dxs : {lq_tmp$x##242 : (Elim.Pair int int) | [(lq_tmp$x##242 = (Elim.PP##rlx xig##awy yog##awz))]}-bind 18 lq_anf$##dxt : {lq_tmp$x##273 : (Elim.Pair int int) | [(lq_tmp$x##273 = lq_anf$##dxs)]}-bind 19 lq_anf$##dxt : {lq_tmp$x##277 : (Elim.Pair int int) | [(lq_tmp$x##277 = lq_anf$##dxs)]}-bind 20 wink##ax3 : {lq_tmp$x##275 : int | [$k_##248[lq_tmp$x##277:=lq_anf$##dxt][VV##247:=lq_tmp$x##275][lq_tmp$x##242:=lq_anf$##dxt][lq_tmp$x##271:=lq_tmp$x##275][lq_tmp$x##273:=lq_anf$##dxt][lq_tmp$x##245:=xig##awy][lq_tmp$x##246:=yog##awz][lq_tmp$x##250:=lq_tmp$x##275]]}-bind 21 cow##ax4 : {lq_tmp$x##276 : int | [$k_##252[lq_tmp$x##277:=lq_anf$##dxt][lq_tmp$x##281:=wink##ax3][VV##251:=lq_tmp$x##276][lq_tmp$x##242:=lq_anf$##dxt][lq_tmp$x##254:=lq_tmp$x##276][lq_tmp$x##273:=lq_anf$##dxt][lq_tmp$x##245:=xig##awy][lq_tmp$x##246:=yog##awz][lq_tmp$x##272:=lq_tmp$x##276]]}-bind 22 lq_anf$##dxt : {lq_tmp$x##277 : (Elim.Pair int int) | [(lq_tmp$x##277 = lq_anf$##dxs);- (lq_tmp$x##277 = (Elim.PP##rlx wink##ax3 cow##ax4));- (lq_tmp$x##277 = (Elim.PP##rlx wink##ax3 cow##ax4));- (lq_tmp$x##277 = (Elim.PP##rlx wink##ax3 cow##ax4))]}-bind 23 lq_tmp$x##307 : {VV##308 : int | []}-bind 24 lq_anf$##dxt : {lq_tmp$x##313 : (Elim.Pair int int) | [(lq_tmp$x##313 = lq_anf$##dxs)]}-bind 25 lq_anf$##dxt : {lq_tmp$x##313 : (Elim.Pair int int) | [(lq_tmp$x##313 = lq_anf$##dxs);- (lq_tmp$x##313 = Elim.Emp##rly);- (lq_tmp$x##313 = Elim.Emp##rly);- (lq_tmp$x##313 = Elim.Emp##rly)]}-bind 26 ds_dxg : {VV##318 : GHC.Prim.Void# | [$k_##319]}-bind 27 lq_anf$##dxu : {lq_tmp$x##335 : int | [(lq_tmp$x##335 ~~ lit$36$tests$47$pos$47$elim00.hs$58$14$58$5$45$30$124$PP$32$wink$32$cow);- ((strLen lq_tmp$x##335) = 39)]}-bind 28 ds_dxh : {VV##268 : (Tuple int int) | [$k_##269]}-bind 29 lq_anf$##dxw : {lq_tmp$x##368 : (Tuple int int) | [(lq_tmp$x##368 = ds_dxh)]}-bind 30 lq_anf$##dxw : {lq_tmp$x##374 : (Tuple int int) | [(lq_tmp$x##374 = ds_dxh)]}-bind 31 wink##ax3 : {lq_tmp$x##370 : int | [$k_##259[lq_tmp$x##368:=lq_anf$##dxw][VV##268:=lq_anf$##dxw][lq_tmp$x##364:=lq_tmp$x##370][VV##258:=lq_tmp$x##370][lq_tmp$x##374:=lq_anf$##dxw]]}-bind 32 cow##Xxd : {lq_tmp$x##371 : int | [$k_##262[lq_tmp$x##368:=lq_anf$##dxw][VV##268:=lq_anf$##dxw][VV##261:=lq_tmp$x##371][lq_tmp$x##365:=lq_tmp$x##371][lq_tmp$x##379:=wink##ax3][lq_tmp$x##374:=lq_anf$##dxw];- $k_##266[lq_tmp$x##368:=lq_anf$##dxw][lq_tmp$x##373:=lq_tmp$x##371][VV##265:=lq_tmp$x##371][lq_tmp$x##264:=wink##ax3][lq_tmp$x##367:=lq_tmp$x##371][VV##268:=lq_anf$##dxw][lq_tmp$x##372:=wink##ax3][lq_tmp$x##366:=wink##ax3][lq_tmp$x##379:=wink##ax3][lq_tmp$x##374:=lq_anf$##dxw]]}-bind 33 lq_anf$##dxw : {lq_tmp$x##374 : (Tuple int int) | [(lq_tmp$x##374 = ds_dxh);- ((snd lq_tmp$x##374) = cow##Xxd);- ((fst lq_tmp$x##374) = wink##ax3);- ((x_Tuple22 lq_tmp$x##374) = cow##Xxd);- ((x_Tuple21 lq_tmp$x##374) = wink##ax3);- (lq_tmp$x##374 = (GHC.Tuple.$40$$44$$41$$35$$35$74 wink##ax3 cow##Xxd));- ((snd lq_tmp$x##374) = cow##Xxd);- ((fst lq_tmp$x##374) = wink##ax3);- ((x_Tuple22 lq_tmp$x##374) = cow##Xxd);- ((x_Tuple21 lq_tmp$x##374) = wink##ax3)]}-bind 34 wink##ax3 : {VV##361 : int | [$k_##362]}-// bind 45 wink##ax3 : {lq_tmp$x##452 : int | [$k_##428[lq_tmp$x##425:=wink##ax3][lq_tmp$x##456:=lq_anf$##dxy][VV##427:=lq_tmp$x##452][lq_tmp$x##426:=cow##ax4][lq_tmp$x##450:=lq_anf$##dxy][lq_tmp$x##430:=lq_tmp$x##452][lq_tmp$x##446:=lq_tmp$x##452][lq_tmp$x##422:=lq_anf$##dxy]]}--bind 35 lq_anf$##dxv : {lq_tmp$x##398 : (Tuple int int) | [(lq_tmp$x##398 = ds_dxh)]}-bind 36 lq_anf$##dxv : {lq_tmp$x##404 : (Tuple int int) | [(lq_tmp$x##404 = ds_dxh)]}-bind 37 wink##ax3 : {lq_tmp$x##400 : int | [$k_##259[VV##268:=lq_anf$##dxv][lq_tmp$x##394:=lq_tmp$x##400][VV##258:=lq_tmp$x##400][lq_tmp$x##398:=lq_anf$##dxv][lq_tmp$x##404:=lq_anf$##dxv]]}-bind 38 cow##ax4 : {lq_tmp$x##401 : int | [$k_##262[VV##268:=lq_anf$##dxv][VV##261:=lq_tmp$x##401][lq_tmp$x##409:=wink##ax3][lq_tmp$x##398:=lq_anf$##dxv][lq_tmp$x##395:=lq_tmp$x##401][lq_tmp$x##404:=lq_anf$##dxv];- $k_##266[lq_tmp$x##396:=wink##ax3][VV##265:=lq_tmp$x##401][lq_tmp$x##264:=wink##ax3][VV##268:=lq_anf$##dxv][lq_tmp$x##397:=lq_tmp$x##401][lq_tmp$x##409:=wink##ax3][lq_tmp$x##403:=lq_tmp$x##401][lq_tmp$x##398:=lq_anf$##dxv][lq_tmp$x##402:=wink##ax3][lq_tmp$x##404:=lq_anf$##dxv]]}-bind 39 lq_anf$##dxv : {lq_tmp$x##404 : (Tuple int int) | [(lq_tmp$x##404 = ds_dxh);- ((snd lq_tmp$x##404) = cow##ax4);- ((fst lq_tmp$x##404) = wink##ax3);- ((x_Tuple22 lq_tmp$x##404) = cow##ax4);- ((x_Tuple21 lq_tmp$x##404) = wink##ax3);- (lq_tmp$x##404 = (GHC.Tuple.$40$$44$$41$$35$$35$74 wink##ax3 cow##ax4));- ((snd lq_tmp$x##404) = cow##ax4);- ((fst lq_tmp$x##404) = wink##ax3);- ((x_Tuple22 lq_tmp$x##404) = cow##ax4);- ((x_Tuple21 lq_tmp$x##404) = wink##ax3)]}-bind 40 cow##ax4 : {VV##391 : int | [$k_##392]}-bind 41 lq_tmp$x##438 : {VV##439 : int | []}-bind 42 ds_dxi : {lq_tmp$x##422 : (Tuple int int) | [((snd lq_tmp$x##422) = cow##ax4);- ((fst lq_tmp$x##422) = wink##ax3);- ((x_Tuple22 lq_tmp$x##422) = cow##ax4);- ((x_Tuple21 lq_tmp$x##422) = wink##ax3)]}-bind 43 lq_anf$##dxy : {lq_tmp$x##450 : (Tuple int int) | [(lq_tmp$x##450 = ds_dxi)]}-bind 44 lq_anf$##dxy : {lq_tmp$x##456 : (Tuple int int) | [(lq_tmp$x##456 = ds_dxi)]}-bind 45 wink##ax3 : {lq_tmp$x##452 : int | [$k_##428[lq_tmp$x##425:=wink##ax3][lq_tmp$x##456:=lq_anf$##dxy][VV##427:=lq_tmp$x##452][lq_tmp$x##426:=cow##ax4][lq_tmp$x##450:=lq_anf$##dxy][lq_tmp$x##430:=lq_tmp$x##452][lq_tmp$x##446:=lq_tmp$x##452][lq_tmp$x##422:=lq_anf$##dxy]]}-bind 46 cow##ax4 : {lq_tmp$x##453 : int | [$k_##432[lq_tmp$x##425:=wink##ax3][lq_tmp$x##456:=lq_anf$##dxy][lq_tmp$x##426:=cow##ax4][VV##431:=lq_tmp$x##453][lq_tmp$x##450:=lq_anf$##dxy][lq_tmp$x##447:=lq_tmp$x##453][lq_tmp$x##461:=wink##ax3][lq_tmp$x##422:=lq_anf$##dxy][lq_tmp$x##434:=lq_tmp$x##453];- $k_##436[lq_tmp$x##425:=wink##ax3][lq_tmp$x##456:=lq_anf$##dxy][lq_tmp$x##426:=cow##ax4][lq_tmp$x##455:=lq_tmp$x##453][lq_tmp$x##450:=lq_anf$##dxy][lq_tmp$x##461:=wink##ax3][lq_tmp$x##438:=wink##ax3][lq_tmp$x##421:=wink##ax3][lq_tmp$x##422:=lq_anf$##dxy][lq_tmp$x##434:=lq_tmp$x##453][lq_tmp$x##448:=wink##ax3][lq_tmp$x##449:=lq_tmp$x##453][VV##435:=lq_tmp$x##453][lq_tmp$x##454:=wink##ax3]]}-bind 47 lq_anf$##dxy : {lq_tmp$x##456 : (Tuple int int) | [(lq_tmp$x##456 = ds_dxi);- ((snd lq_tmp$x##456) = cow##ax4);- ((fst lq_tmp$x##456) = wink##ax3);- ((x_Tuple22 lq_tmp$x##456) = cow##ax4);- ((x_Tuple21 lq_tmp$x##456) = wink##ax3);- (lq_tmp$x##456 = (GHC.Tuple.$40$$44$$41$$35$$35$74 wink##ax3 cow##ax4));- ((snd lq_tmp$x##456) = cow##ax4);- ((fst lq_tmp$x##456) = wink##ax3);- ((x_Tuple22 lq_tmp$x##456) = cow##ax4);- ((x_Tuple21 lq_tmp$x##456) = wink##ax3)]}-bind 48 wink##awA : {VV##443 : int | [$k_##444]}--bind 49 lq_anf$##dxx : {lq_tmp$x##480 : (Tuple int int) | [(lq_tmp$x##480 = ds_dxi)]}-bind 50 lq_anf$##dxx : {lq_tmp$x##486 : (Tuple int int) | [(lq_tmp$x##486 = ds_dxi)]}-bind 51 wink##ax3 : {lq_tmp$x##482 : int | [$k_##428[lq_tmp$x##425:=wink##ax3][VV##427:=lq_tmp$x##482][lq_tmp$x##426:=cow##ax4][lq_tmp$x##476:=lq_tmp$x##482][lq_tmp$x##430:=lq_tmp$x##482][lq_tmp$x##480:=lq_anf$##dxx][lq_tmp$x##422:=lq_anf$##dxx][lq_tmp$x##486:=lq_anf$##dxx]]}-bind 52 cow##ax4 : {lq_tmp$x##483 : int | [$k_##432[lq_tmp$x##425:=wink##ax3][lq_tmp$x##426:=cow##ax4][VV##431:=lq_tmp$x##483][lq_tmp$x##491:=wink##ax3][lq_tmp$x##480:=lq_anf$##dxx][lq_tmp$x##477:=lq_tmp$x##483][lq_tmp$x##422:=lq_anf$##dxx][lq_tmp$x##434:=lq_tmp$x##483][lq_tmp$x##486:=lq_anf$##dxx];- $k_##436[lq_tmp$x##425:=wink##ax3][lq_tmp$x##426:=cow##ax4][lq_tmp$x##491:=wink##ax3][lq_tmp$x##480:=lq_anf$##dxx][lq_tmp$x##479:=lq_tmp$x##483][lq_tmp$x##485:=lq_tmp$x##483][lq_tmp$x##438:=wink##ax3][lq_tmp$x##421:=wink##ax3][lq_tmp$x##422:=lq_anf$##dxx][lq_tmp$x##434:=lq_tmp$x##483][lq_tmp$x##484:=wink##ax3][lq_tmp$x##478:=wink##ax3][lq_tmp$x##486:=lq_anf$##dxx][VV##435:=lq_tmp$x##483]]}-bind 53 lq_anf$##dxx : {lq_tmp$x##486 : (Tuple int int) | [(lq_tmp$x##486 = ds_dxi);- ((snd lq_tmp$x##486) = cow##ax4);- ((fst lq_tmp$x##486) = wink##ax3);- ((x_Tuple22 lq_tmp$x##486) = cow##ax4);- ((x_Tuple21 lq_tmp$x##486) = wink##ax3);- (lq_tmp$x##486 = (GHC.Tuple.$40$$44$$41$$35$$35$74 wink##ax3 cow##ax4));- ((snd lq_tmp$x##486) = cow##ax4);- ((fst lq_tmp$x##486) = wink##ax3);- ((x_Tuple22 lq_tmp$x##486) = cow##ax4);- ((x_Tuple21 lq_tmp$x##486) = wink##ax3)]}-bind 54 cow##awB : {VV##473 : int | [$k_##474]}-bind 55 ds_dxo : {VV##514 : Elim.Foo | []}-bind 56 lq_anf$##dxz : {lq_tmp$x##515 : Elim.Foo | [(lq_tmp$x##515 = ds_dxo)]}-bind 57 lq_anf$##dxz : {lq_tmp$x##517 : Elim.Foo | [(lq_tmp$x##517 = ds_dxo)]}-bind 58 ds_dxp : {lq_tmp$x##525 : int | []}-bind 59 ds_dxq : {lq_tmp$x##526 : int | [(ds_dxp < lq_tmp$x##526)]}-bind 60 lq_anf$##dxz : {lq_tmp$x##517 : Elim.Foo | [(lq_tmp$x##517 = ds_dxo);- ((yy lq_tmp$x##517) = ds_dxq);- ((xx lq_tmp$x##517) = ds_dxp);- (lq_tmp$x##517 = (Elim.Foo##rlA ds_dxp ds_dxq));- ((yy lq_tmp$x##517) = ds_dxq);- ((xx lq_tmp$x##517) = ds_dxp)]}-bind 61 ds_dxl : {VV##537 : Elim.Foo | []}-bind 62 lq_anf$##dxA : {lq_tmp$x##538 : Elim.Foo | [(lq_tmp$x##538 = ds_dxl)]}-bind 63 lq_anf$##dxA : {lq_tmp$x##540 : Elim.Foo | [(lq_tmp$x##540 = ds_dxl)]}-bind 64 ds_dxm : {lq_tmp$x##548 : int | []}-bind 65 ds_dxn : {lq_tmp$x##549 : int | [(ds_dxm < lq_tmp$x##549)]}-bind 66 lq_anf$##dxA : {lq_tmp$x##540 : Elim.Foo | [(lq_tmp$x##540 = ds_dxl);- ((yy lq_tmp$x##540) = ds_dxn);- ((xx lq_tmp$x##540) = ds_dxm);- (lq_tmp$x##540 = (Elim.Foo##rlA ds_dxm ds_dxn));- ((yy lq_tmp$x##540) = ds_dxn);- ((xx lq_tmp$x##540) = ds_dxm)]}-bind 67 VV##559 : {VV##559 : int | [(VV##559 = ds_dxm)]}-bind 68 VV##561 : {VV##561 : int | [(VV##561 = ds_dxq)]}-bind 69 VV##563 : {VV##563 : Elim.Foo | [((yy VV##563) = cow##awB);- ((xx VV##563) = wink##awA)]}-bind 70 VV##565 : {VV##565 : int | [(VV##565 = cow##awB)]}-bind 71 VV##567 : {VV##567 : int | [(VV##567 = wink##awA)]}-bind 72 VV##569 : {VV##569 : int | [(VV##569 = cow##ax4)]}-bind 73 VV##571 : {VV##571 : int | [(VV##571 = wink##ax3)]}-bind 74 VV##573 : {VV##573 : int | [(VV##573 = cow##ax4)]}-bind 75 VV##575 : {VV##575 : int | [(VV##575 = wink##ax3)]}-bind 76 VV##577 : {VV##577 : int | [(VV##577 = cow##ax4)]}-bind 77 VV##579 : {VV##579 : int | [(VV##579 = wink##ax3)]}-bind 78 VV##581 : {VV##581 : (Tuple int int) | [$k_##333[VV##332:=VV##581][ds_dxg:=GHC.Prim.void###0l]]}-bind 79 VV##583 : {VV##583 : int | [$k_##323[VV##322:=VV##583][VV##332:=VV##581][ds_dxg:=GHC.Prim.void###0l]]}-bind 80 VV##585 : {VV##585 : int | [$k_##326[VV##325:=VV##585][VV##332:=VV##581][ds_dxg:=GHC.Prim.void###0l]]}-bind 81 lq_tmp$x##264 : {VV##587 : int | []}-bind 82 VV##588 : {VV##588 : int | [$k_##330[VV##332:=VV##581][VV##329:=VV##588][ds_dxg:=GHC.Prim.void###0l][lq_tmp$x##328:=lq_tmp$x##264]]}-bind 83 VV##590 : {VV##590 : GHC.Prim.Void# | [(VV##590 = GHC.Prim.void###0l)]}-bind 84 VV##592 : {VV##592 : (Tuple int int) | [$k_##351[lq_tmp$x##339:=lq_anf$##dxu][lq_tmp$x##357:=VV##592][VV##350:=VV##592]]}-bind 85 VV##594 : {VV##594 : int | [$k_##341[lq_tmp$x##353:=VV##594][lq_tmp$x##339:=lq_anf$##dxu][lq_tmp$x##357:=VV##592][VV##340:=VV##594][VV##350:=VV##592]]}-bind 86 VV##596 : {VV##596 : int | [$k_##344[lq_tmp$x##339:=lq_anf$##dxu][lq_tmp$x##357:=VV##592][VV##343:=VV##596][lq_tmp$x##354:=VV##596][VV##350:=VV##592]]}-bind 87 lq_tmp$x##328 : {VV##598 : int | []}-bind 88 VV##599 : {VV##599 : int | [$k_##348[lq_tmp$x##355:=lq_tmp$x##328][lq_tmp$x##356:=VV##599][VV##347:=VV##599][lq_tmp$x##339:=lq_anf$##dxu][lq_tmp$x##346:=lq_tmp$x##328][lq_tmp$x##357:=VV##592][VV##350:=VV##592]]}-bind 89 VV##601 : {VV##601 : int | [(VV##601 = lq_anf$##dxu)]}-bind 90 VV##603 : {VV##603 : (Tuple int int) | [((snd VV##603) = cow##ax4);- ((fst VV##603) = wink##ax3);- ((x_Tuple22 VV##603) = cow##ax4);- ((x_Tuple21 VV##603) = wink##ax3)]}-bind 91 VV##605 : {VV##605 : int | [$k_##297[lq_tmp$x##295:=cow##ax4][lq_tmp$x##299:=VV##605][lq_tmp$x##291:=VV##603][lq_tmp$x##294:=wink##ax3][VV##296:=VV##605]]}-bind 92 VV##607 : {VV##607 : int | [$k_##301[lq_tmp$x##295:=cow##ax4][lq_tmp$x##291:=VV##603][lq_tmp$x##294:=wink##ax3][VV##300:=VV##607][lq_tmp$x##303:=VV##607]]}-bind 93 lq_tmp$x##264 : {VV##609 : int | []}-bind 94 VV##610 : {VV##610 : int | [$k_##305[lq_tmp$x##295:=cow##ax4][lq_tmp$x##290:=lq_tmp$x##264][VV##304:=VV##610][lq_tmp$x##307:=lq_tmp$x##264][lq_tmp$x##291:=VV##603][lq_tmp$x##294:=wink##ax3][lq_tmp$x##303:=VV##610]]}-bind 95 VV##612 : {VV##612 : int | [(VV##612 = cow##ax4)]}-bind 96 VV##614 : {VV##614 : int | [(VV##614 = wink##ax3)]}-bind 97 VV##616 : {VV##616 : int | [(VV##616 = yog##awz)]}-bind 98 VV##618 : {VV##618 : int | [(VV##618 = xig##awy)]}-bind 99 VV##473 : {VV##473 : int | [$k_##474]}-bind 100 VV##443 : {VV##443 : int | [$k_##444]}-bind 101 VV##435 : {VV##435 : int | [$k_##436]}-bind 102 VV##431 : {VV##431 : int | [$k_##432]}-bind 103 VV##427 : {VV##427 : int | [$k_##428]}-bind 104 VV##391 : {VV##391 : int | [$k_##392]}-bind 105 VV##361 : {VV##361 : int | [$k_##362]}-bind 106 VV##318 : {VV##318 : GHC.Prim.Void# | [$k_##319]}-bind 107 VV##350 : {VV##350 : (Tuple int int) | [$k_##351]}-bind 108 VV##340 : {VV##340 : int | [$k_##341]}-bind 109 VV##343 : {VV##343 : int | [$k_##344]}-bind 110 lq_tmp$x##346 : {VV##631 : int | []}-bind 111 VV##347 : {VV##347 : int | [$k_##348]}-bind 112 VV##332 : {VV##332 : (Tuple int int) | [$k_##333]}-bind 113 VV##322 : {VV##322 : int | [$k_##323]}-bind 114 VV##325 : {VV##325 : int | [$k_##326]}-bind 115 lq_tmp$x##328 : {VV##636 : int | []}-bind 116 VV##329 : {VV##329 : int | [$k_##330]}-bind 117 VV##304 : {VV##304 : int | [$k_##305]}-bind 118 VV##300 : {VV##300 : int | [$k_##301]}-bind 119 VV##296 : {VV##296 : int | [$k_##297]}-bind 120 VV##268 : {VV##268 : (Tuple int int) | [$k_##269]}-bind 121 VV##258 : {VV##258 : int | [$k_##259]}-bind 122 VV##261 : {VV##261 : int | [$k_##262]}-bind 123 lq_tmp$x##264 : {VV##644 : int | []}-bind 124 VV##265 : {VV##265 : int | [$k_##266]}-bind 125 VV##251 : {VV##251 : int | [$k_##252]}-bind 126 VV##247 : {VV##247 : int | [$k_##248]}--constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 42;- 48;- 54 ]- lhs {VV##1 : int | [(VV##1 = cow##awB)]}- rhs {VV##1 : int | [(wink##awA < VV##1)]}- id 1 tag [1]- // META constraint id 1 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 42;- 48;- 49;- 50;- 51;- 52;- 53]- lhs {VV##2 : int | [(VV##2 = cow##ax4)]}- rhs {VV##2 : int | [$k_##474[VV##569:=VV##2][VV##F##2:=VV##2][VV##F:=VV##2][VV##473:=VV##2]]}- id 2 tag [1]- // META constraint id 2 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- lhs {VV##18 : (Tuple int int) | [((snd VV##18) = cow##ax4);- ((fst VV##18) = wink##ax3);- ((x_Tuple22 VV##18) = cow##ax4);- ((x_Tuple21 VV##18) = wink##ax3)]}- rhs {VV##18 : (Tuple int int) | [$k_##269[VV##F##18:=VV##18][VV##268:=VV##18][VV##603:=VV##18][VV##F:=VV##18]]}- id 18 tag [1]- // META constraint id 18 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 42;- 43;- 44;- 45;- 46;- 47]- lhs {VV##3 : int | [(VV##3 = wink##ax3)]}- rhs {VV##3 : int | [$k_##444[VV##571:=VV##3][VV##F:=VV##3][VV##F##3:=VV##3][VV##443:=VV##3]]}- id 3 tag [1]- // META constraint id 3 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22;- 90]- lhs {VV##19 : int | [$k_##297[lq_tmp$x##295:=cow##ax4][VV##605:=VV##19][lq_tmp$x##299:=VV##19][lq_tmp$x##291:=VV##603][VV##F##19:=VV##19][lq_tmp$x##294:=wink##ax3][VV##F:=VV##19][VV##296:=VV##19]]}- rhs {VV##19 : int | [$k_##259[VV##605:=VV##19][VV##268:=VV##603][VV##258:=VV##19][VV##F##19:=VV##19][VV##F:=VV##19]]}- id 19 tag [1]- // META constraint id 19 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40]- lhs {VV##4 : int | [(VV##4 = cow##ax4)]}- rhs {VV##4 : int | [$k_##432[lq_tmp$x##425:=wink##ax3][VV##431:=VV##4][VV##573:=VV##4][lq_tmp$x##434:=VV##4][VV##F:=VV##4][VV##F##4:=VV##4]]}- id 4 tag [1]- // META constraint id 4 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22;- 90]- lhs {VV##20 : int | [$k_##301[lq_tmp$x##295:=cow##ax4][VV##607:=VV##20][VV##F##20:=VV##20][lq_tmp$x##291:=VV##603][lq_tmp$x##294:=wink##ax3][VV##300:=VV##20][lq_tmp$x##303:=VV##20][VV##F:=VV##20]]}- rhs {VV##20 : int | [$k_##262[VV##268:=VV##603][VV##607:=VV##20][VV##F##20:=VV##20][VV##261:=VV##20][VV##F:=VV##20]]}- id 20 tag [1]- // META constraint id 20 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40]- lhs {VV##5 : int | [(VV##5 = cow##ax4)]}- rhs {VV##5 : int | [$k_##436[lq_tmp$x##425:=wink##ax3][VV##F##5:=VV##5][VV##573:=VV##5][lq_tmp$x##438:=wink##ax3][lq_tmp$x##434:=VV##5][VV##F:=VV##5][VV##435:=VV##5]]}- id 5 tag [1]- // META constraint id 5 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22;- 90;- 93]- lhs {VV##21 : int | [$k_##305[lq_tmp$x##295:=cow##ax4][lq_tmp$x##290:=lq_tmp$x##264][VV##304:=VV##21][VV##610:=VV##21][lq_tmp$x##307:=lq_tmp$x##264][lq_tmp$x##291:=VV##603][lq_tmp$x##294:=wink##ax3][lq_tmp$x##303:=VV##21][VV##F##21:=VV##21][VV##F:=VV##21]]}- rhs {VV##21 : int | [$k_##266[VV##265:=VV##21][VV##610:=VV##21][VV##268:=VV##603][VV##F##21:=VV##21][VV##F:=VV##21]]}- id 21 tag [1]- // META constraint id 21 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40]- lhs {VV##6 : int | [(VV##6 = wink##ax3)]}- rhs {VV##6 : int | [$k_##428[VV##F##6:=VV##6][VV##427:=VV##6][lq_tmp$x##430:=VV##6][VV##F:=VV##6][VV##575:=VV##6]]}- id 6 tag [1]- // META constraint id 6 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- lhs {VV##22 : int | [(VV##22 = cow##ax4)]}- rhs {VV##22 : int | [$k_##301[VV##F##22:=VV##22][VV##612:=VV##22][lq_tmp$x##294:=wink##ax3][VV##300:=VV##22][lq_tmp$x##303:=VV##22][VV##F:=VV##22]]}- id 22 tag [1]- // META constraint id 22 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 35;- 36;- 37;- 38;- 39]- lhs {VV##7 : int | [(VV##7 = cow##ax4)]}- rhs {VV##7 : int | [$k_##392[VV##391:=VV##7][VV##F##7:=VV##7][VV##F:=VV##7][VV##577:=VV##7]]}- id 7 tag [1]- // META constraint id 7 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- lhs {VV##23 : int | [(VV##23 = cow##ax4)]}- rhs {VV##23 : int | [$k_##305[VV##304:=VV##23][lq_tmp$x##307:=wink##ax3][VV##612:=VV##23][lq_tmp$x##294:=wink##ax3][lq_tmp$x##303:=VV##23][VV##F:=VV##23][VV##F##23:=VV##23]]}- id 23 tag [1]- // META constraint id 23 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 29;- 30;- 31;- 32;- 33]- lhs {VV##8 : int | [(VV##8 = wink##ax3)]}- rhs {VV##8 : int | [$k_##362[VV##579:=VV##8][VV##F##8:=VV##8][VV##361:=VV##8][VV##F:=VV##8]]}- id 8 tag [1]- // META constraint id 8 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- lhs {VV##24 : int | [(VV##24 = wink##ax3)]}- rhs {VV##24 : int | [$k_##297[lq_tmp$x##299:=VV##24][VV##614:=VV##24][VV##F:=VV##24][VV##296:=VV##24][VV##F##24:=VV##24]]}- id 24 tag [1]- // META constraint id 24 : ()---constraint:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16]- lhs {VV##25 : int | [(VV##25 = yog##awz)]}- rhs {VV##25 : int | [$k_##252[VV##251:=VV##25][lq_tmp$x##254:=VV##25][lq_tmp$x##245:=xig##awy][VV##F:=VV##25][VV##616:=VV##25][VV##F##25:=VV##25]]}- id 25 tag [1]- // META constraint id 25 : ()---constraint:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16]- lhs {VV##26 : int | [(VV##26 = xig##awy)]}- rhs {VV##26 : int | [$k_##248[VV##618:=VV##26][VV##247:=VV##26][VV##F##26:=VV##26][VV##F:=VV##26][lq_tmp$x##250:=VV##26]]}- id 26 tag [1]- // META constraint id 26 : ()-----wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 115]- reft {VV##329 : int | [$k_##330]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25]- reft {VV##318 : GHC.Prim.Void# | [$k_##319]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 27;- 107]- reft {VV##343 : int | [$k_##344]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40]- reft {VV##427 : int | [$k_##428]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16]- reft {VV##247 : int | [$k_##248]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 41]- reft {VV##435 : int | [$k_##436]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 42]- reft {VV##443 : int | [$k_##444]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- reft {VV##296 : int | [$k_##297]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 27;- 110]- reft {VV##347 : int | [$k_##348]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40;- 42;- 48]- reft {VV##473 : int | [$k_##474]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 27]- reft {VV##350 : (Tuple int int) | [$k_##351]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34]- reft {VV##391 : int | [$k_##392]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26]- reft {VV##332 : (Tuple int int) | [$k_##333]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 120]- reft {VV##258 : int | [$k_##259]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 120]- reft {VV##261 : int | [$k_##262]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 27;- 107]- reft {VV##340 : int | [$k_##341]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22;- 23]- reft {VV##304 : int | [$k_##305]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 112]- reft {VV##325 : int | [$k_##326]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28]- reft {VV##361 : int | [$k_##362]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 123]- reft {VV##265 : int | [$k_##266]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 24;- 25;- 26;- 112]- reft {VV##322 : int | [$k_##323]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 18;- 19;- 20;- 21;- 22]- reft {VV##300 : int | [$k_##301]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17]- reft {VV##268 : (Tuple int int) | [$k_##269]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15;- 16;- 17;- 28;- 34;- 40]- reft {VV##431 : int | [$k_##432]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16]- reft {VV##251 : int | [$k_##252]}- // META wf : ()
− tests/elim/kvparam00.fq
@@ -1,20 +0,0 @@-bind 0 x : {v : int | []}--bind 1 y : {v : int | []}--constraint:- env [0; 1]- lhs {VV#F1 : int | []}- rhs {VV#F1 : int | [$k_0[v:=x]]}- id 1 tag [3]--constraint:- env [0; 1]- lhs {VV#F2 : int | [$k_0[v:=y]]}- rhs {VV#F2 : int | [y = x]}- id 2 tag [4]--wf:- env []- reft {v : int | [$k_0]}-
− tests/elim/len00.fq
@@ -1,23 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-//qualif ListZ(v : [@(0)]): (len v >= 0)--constant len : (func(2, [(@(0) @(1)); int]))--bind 0 y : {v : [(Tuple int a)] | [len v >= 0]}--constraint:- env [0]- lhs {v : [(Tuple int a)] | [v = y] }- rhs {v : [(Tuple int a)] | [$k0] }- id 1 tag []--constraint:- env []- lhs {v : [(Tuple int a)] | [$k0] }- rhs {v : [(Tuple int a)] | [len v >= 0] }- id 2 tag []--wf:- env [ ]- reft {v : [(Tuple int a)] | [$k0] }
− tests/elim/test00-tx.fq
@@ -1,12 +0,0 @@---// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 a : {v:int | (v = 10 || v = 20) }--constraint:- env [ 0 ]- lhs {v : int | v = a}- rhs {v : int | 10 <= v}- id 3 tag []
− tests/elim/test00.fq
@@ -1,26 +0,0 @@-// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 a : {v: int | $k0}--constraint:- env [ ]- lhs {v : int | v = 10}- rhs {v : int | $k0}- id 1 tag []--constraint:- env [ ]- lhs {v : int | v = 20}- rhs {v : int | $k0}- id 2 tag []--constraint:- env [ 0 ]- lhs {v : int | v = a}- rhs {v : int | 10 <= v}- id 3 tag []--wf:- env [ ]- reft {v: int | $k0}
− tests/elim/test00a.fq
@@ -1,28 +0,0 @@-// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 x : {v : int | true}-bind 1 y : {v : int | true}-bind 2 z : {v : int | true}--constraint:- env [0]- lhs {v : int | (x = 10)}- rhs {v : int | $k0[v:=x]}- id 1 tag []--constraint:- env [1]- lhs {v : int | y = 20}- rhs {v : int | $k0[v:=y]}- id 2 tag []--constraint:- env [2]- lhs {v : int | $k0[v:=z]}- rhs {v : int | 10 <= z}- id 3 tag []--wf:- env [ ]- reft {v: int | $k0}
− tests/elim/test1.fq
@@ -1,29 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a) : (10 <= v)--bind 0 x : {v : int | v = 10}-bind 1 y : {v : int | v = 20}-bind 2 a : {v : int | $k0 }- -constraint:- env [0]- lhs {v : int | v = x}- rhs {v : int | $k0 }- id 1 tag []--constraint:- env [1]- lhs {v : int | v = y}- rhs {v : int | $k0 }- id 2 tag []--constraint:- env [2]- lhs {v : int | v = a }- rhs {v : int | 10 <= v}- id 3 tag []--wf:- env [ ]- reft {v : int | $k0}
− tests/elim/test2.fq
@@ -1,53 +0,0 @@--// This qualifier saves the day; solve constraints WITHOUT IT-// qualif Zog(v:a): (10 <= v)--// But you may use this one-qualif Pog(v:a): (0 <= v)--bind 0 x: {v: int | v = 10}-bind 1 a: {v: int | $k1 }-bind 2 y: {v: int | v = 20}-bind 3 b: {v: int | $k1 }-bind 4 c: {v: int | $k0 }--cut $k1--constraint:- env [ ]- lhs {v : int | v = 0}- rhs {v : int | $k1 }- id 0 tag []---constraint:- env [0; 1]- lhs {v : int | v = x + a}- rhs {v : int | $k0}- id 1 tag []--constraint:- env [2; 3]- lhs {v : int | v = y + b}- rhs {v : int | $k0}- id 2 tag []--constraint:- env [ ]- lhs {v : int | $k0}- rhs {v : int | $k1}- id 3 tag []--constraint:- env [4]- lhs {v : int | v = c }- rhs {v : int | 10 <= v}- id 4 tag []--wf:- env [ ]- reft {v: int | $k0}--wf:- env [ ]- reft {v: int | $k1}
− tests/elim/tuple00.fq
@@ -1,114 +0,0 @@--bind 0 cat : {v: int | v = 100 }-bind 1 dog : {v: int | v = 200 }-bind 2 frog : {v: int | v = 400 }-bind 3 mouse : {v: int | v = 500 }-bind 4 hippo : {v: int | v = 600 }-bind 5 goose : {v: int | v = 700 }-bind 6 crow : {v: int | v = 800 }-bind 7 pig : {v: int | v = 900 }--bind 20 x_1_1 : {v: int | $k_1_1 }-bind 21 x_1_2 : {v: int | $k_1_2 }-bind 22 x_2_1 : {v: int | $k_2_1 }-bind 23 x_2_2 : {v: int | $k_2_2 }-bind 24 x_3_1 : {v: int | $k_3_1 }-bind 25 x_3_2 : {v: int | $k_3_2 }--pack $k_1_1 : 1-pack $k_1_2 : 1-pack $k_2_1 : 2-pack $k_2_2 : 2-pack $k_3_1 : 3-pack $k_3_2 : 3-pack $k_4_1 : 4-pack $k_4_2 : 4----constraint:- env [ 0; 1; 2; 3; 4; 5; 6; 7 ]- lhs {v : int | v = 1}- rhs {v : int | $k_1_1}- id 1 tag []--constraint:- env [ 0; 1; 2; 3; 4; 5; 6; 7 ]- lhs {v : int | v = 2}- rhs {v : int | $k_1_2}- id 2 tag []--constraint:- env [ 20; 21 ]- lhs {v : int | v = x_1_1 }- rhs {v : int | $k_2_1 }- id 3 tag []--constraint:- env [ 20; 21 ]- lhs {v : int | v = x_1_2 }- rhs {v : int | $k_2_2 }- id 4 tag []--constraint:- env [ 22; 23 ]- lhs {v : int | v = x_2_1 }- rhs {v : int | $k_3_1 }- id 5 tag []--constraint:- env [ 22; 23 ]- lhs {v : int | v = x_2_2 }- rhs {v : int | $k_3_2 }- id 6 tag []--constraint:- env [ 24; 25 ]- lhs {v : int | v = x_3_1 }- rhs {v : int | $k_4_1 }- id 7 tag []--constraint:- env [ 24; 25 ]- lhs {v : int | v = x_3_2 }- rhs {v : int | $k_4_2 }- id 8 tag []--constraint:- env [ ]- lhs {v : int | $k_4_1 }- rhs {v : int | v = 1 }- id 9 tag []--wf:- env [ ]- reft {v: int | $k_1_1}--wf:- env [ ]- reft {v: int | $k_1_2}--wf:- env [ ]- reft {v: int | $k_2_1}--wf:- env [ ]- reft {v: int | $k_2_2}--wf:- env [ ]- reft {v: int | $k_3_1}--wf:- env [ ]- reft {v: int | $k_3_2}---wf:- env [ ]- reft {v: int | $k_4_1}--wf:- env [ ]- reft {v: int | $k_4_2}
− tests/elim/tuple01.fq
@@ -1,137 +0,0 @@-// This test illustrates how you can get an exponential VC from nested tuples--bind 0 cat : {v: int | v = 100 }-bind 1 dog : {v: int | v = 200 }-bind 2 frog : {v: int | v = 400 }-bind 3 mouse : {v: int | v = 500 }-bind 4 hippo : {v: int | v = 600 }-bind 5 goose : {v: int | v = 700 }-bind 6 crow : {v: int | v = 800 }-bind 7 pig : {v: int | v = 900 }--bind 20 x_1_1 : {v: int | $k_1_1 }-bind 21 x_1_2 : {v: int | $k_1_2 }-bind 22 x_2_1 : {v: int | $k_2_1 }-bind 23 x_2_2 : {v: int | $k_2_2 }-bind 24 x_3_1 : {v: int | $k_3_1 }-bind 25 x_3_2 : {v: int | $k_3_2 }-bind 26 x_4_1 : {v: int | $k_4_1 }-bind 27 x_4_2 : {v: int | $k_4_2 }--// pack $k_1_1 : 1-// pack $k_1_2 : 1-// pack $k_2_1 : 2-// pack $k_2_2 : 2-// pack $k_3_1 : 3-// pack $k_3_2 : 3-// pack $k_4_1 : 4-// pack $k_4_2 : 4-// pack $k_5_1 : 5-// pack $k_5_2 : 5--constraint:- env [ 0; 1; 2; 3; 4; 5; 6; 7 ]- lhs {v : int | v = 1}- rhs {v : int | $k_1_1}- id 1 tag []--constraint:- env [ 0; 1; 2; 3; 4; 5; 6; 7 ]- lhs {v : int | v = 2}- rhs {v : int | $k_1_2}- id 2 tag []--constraint:- env [ 20; 21 ]- lhs {v : int | v = x_1_1 }- rhs {v : int | $k_2_1 }- id 3 tag []--constraint:- env [ 20; 21 ]- lhs {v : int | v = x_1_2 }- rhs {v : int | $k_2_2 }- id 4 tag []--constraint:- env [ 22; 23 ]- lhs {v : int | v = x_2_1 }- rhs {v : int | $k_3_1 }- id 5 tag []--constraint:- env [ 22; 23 ]- lhs {v : int | v = x_2_2 }- rhs {v : int | $k_3_2 }- id 6 tag []--constraint:- env [ 24; 25 ]- lhs {v : int | v = x_3_1 }- rhs {v : int | $k_4_1 }- id 7 tag []--constraint:- env [ 24; 25 ]- lhs {v : int | v = x_3_2 }- rhs {v : int | $k_4_2 }- id 8 tag []--constraint:- env [ 26; 27 ]- lhs {v : int | v = x_4_1 }- rhs {v : int | $k_5_1 }- id 9 tag []--constraint:- env [ 26; 27 ]- lhs {v : int | v = x_4_2 }- rhs {v : int | $k_5_2 }- id 10 tag []--constraint:- env [ ]- lhs {v : int | $k_5_1 }- rhs {v : int | v = 1 }- id 11 tag []--wf:- env [ ]- reft {v: int | $k_1_1}--wf:- env [ ]- reft {v: int | $k_1_2}--wf:- env [ ]- reft {v: int | $k_2_1}--wf:- env [ ]- reft {v: int | $k_2_2}--wf:- env [ ]- reft {v: int | $k_3_1}--wf:- env [ ]- reft {v: int | $k_3_2}---wf:- env [ ]- reft {v: int | $k_4_1}--wf:- env [ ]- reft {v: int | $k_4_2}--wf:- env [ ]- reft {v: int | $k_5_1}--wf:- env [ ]- reft {v: int | $k_5_2}
− tests/minimize/two-cores.fq
@@ -1,30 +0,0 @@-qualif Cmp(v:a): (v = 10)-qualif Cmp(v:a): (v = 12)--constraint:- env []- lhs {v : int | [v = 10]}- rhs {v : int | [$k_0]}- id 1 tag [3]--constraint:- env []- lhs {v : int | [$k_0]}- rhs {v : int | [v != 10]}- id 4 tag [4]--constraint:- env []- lhs {v : int | [v = 12]}- rhs {v : int | [$k_0]}- id 2 tag [5]--constraint:- env []- lhs {v : int | [$k_0]}- rhs {v : int | [v != 12]}- id 3 tag [6]--wf:- env []- reft {v : int | [$k_0]}
− tests/neg/NonLinear.hs.fq
@@ -1,91 +0,0 @@--bind 0 GHC.Num.$fNumInt##rlL : {VV##27 : (GHC.Num.Num int) | []}-bind 1 GHC.Types.EQ##6U : {VV##28 : GHC.Types.Ordering | [(VV##28 = GHC.Types.EQ##6U)]}-bind 2 GHC.Types.LT##6S : {VV##29 : GHC.Types.Ordering | [(VV##29 = GHC.Types.LT##6S)]}-bind 3 GHC.Types.GT##6W : {VV##30 : GHC.Types.Ordering | [(VV##30 = GHC.Types.GT##6W)]}-bind 4 pig##amI : {VV##33 : int | []}-bind 5 lq_anf$##dvQ : {lq_tmp$x##41 : int | [(lq_tmp$x##41 = (1 : int))]}-bind 6 zink##alG : {zink##0 : int | [(zink##0 = 5)]}-bind 7 zonk##alH : {zonk##1 : int | [(zonk##1 = 67)]}-bind 8 bob##alJ : {lq_tmp$x##65 : int | [$k_##38[VV##37:=lq_tmp$x##65][lq_tmp$x##67:=zonk##alH][pig##amI:=zonk##alH]]}-bind 9 alice##alI : {lq_tmp$x##71 : int | [$k_##38[VV##37:=lq_tmp$x##71][pig##amI:=zink##alG][lq_tmp$x##73:=zink##alG]]}-bind 10 VV##96 : {VV##96 : int | []}-bind 11 zink##alG : {zink##0 : int | []}-bind 12 VV##99 : {VV##99 : int | []}-bind 13 lq_tmp$x##92 : {zonk##1 : int | []}-bind 14 VV##102 : {VV##102 : int | []}-bind 15 VV##104 : {VV##104 : int | []}-bind 16 zonk##alH : {zonk##1 : int | []}-bind 17 VV##107 : {VV##107 : int | []}-bind 18 VV##109 : {VV##109 : int | [(VV##109 = (alice##alI + bob##alJ))]}-bind 19 VV##111 : {VV##111 : int | [$k_##38[VV##37:=VV##111][lq_tmp$x##88:=VV##111][lq_tmp$x##67:=zonk##alH][lq_tmp$x##65:=VV##111][pig##amI:=zonk##alH];- (VV##111 = bob##alJ)]}-bind 20 VV##113 : {VV##113 : int | [$k_##38[VV##37:=VV##113][lq_tmp$x##87:=VV##113][lq_tmp$x##71:=VV##113][pig##amI:=zink##alG][lq_tmp$x##73:=zink##alG];- (VV##113 = alice##alI)]}-bind 21 VV##115 : {VV##115 : int | [(VV##115 = 5);- (VV##115 = zink##alG)]}-bind 22 VV##117 : {VV##117 : int | [(VV##117 = 67);- (VV##117 = zonk##alH)]}-bind 23 VV##119 : {VV##119 : int | [(VV##119 = (pig##amI + lq_anf$##dvQ))]}-bind 24 VV##121 : {VV##121 : int | [(VV##121 = (1 : int));- (VV##121 = lq_anf$##dvQ)]}-bind 25 VV##123 : {VV##123 : int | [$k_##34[lq_tmp$x##57:=VV##123][VV##33:=VV##123];- (VV##123 = pig##amI)]}-bind 26 VV##125 : {VV##125 : int | [(VV##125 = 1)]}-bind 27 VV##33 : {VV##33 : int | [$k_##34]}-bind 28 VV##37 : {VV##37 : int | [$k_##38]}-----constraint:- env [0; 1; 2; 3; 6; 7; 8; 9]- lhs {VV##F##1 : int | [(VV##F##1 = (alice##alI + bob##alJ))]}- rhs {VV##F##1 : int | [(VV##F##1 = 0)]}- id 1 tag [2]- // META constraint id 1 : ()---constraint:- env [0; 1; 2; 3; 6; 7]- lhs {VV##F##2 : int | [(VV##F##2 = 5); (VV##F##2 = zink##alG)]}- rhs {VV##F##2 : int | [$k_##34[VV##115:=VV##F##2][lq_tmp$x##70:=VV##F##2][VV##F:=VV##F##2][VV##33:=VV##F##2]]}- id 2 tag [2]- // META constraint id 2 : ()---constraint:- env [0; 1; 2; 3; 6; 7]- lhs {VV##F##3 : int | [(VV##F##3 = 67); (VV##F##3 = zonk##alH)]}- rhs {VV##F##3 : int | [$k_##34[lq_tmp$x##64:=VV##F##3][VV##117:=VV##F##3][VV##F:=VV##F##3][VV##33:=VV##F##3]]}- id 3 tag [2]- // META constraint id 3 : ()---constraint:- env [0; 1; 2; 3; 4; 5]- lhs {VV##F##4 : int | [(VV##F##4 = (pig##amI + lq_anf$##dvQ))]}- rhs {VV##F##4 : int | [$k_##38[VV##37:=VV##F##4][VV##119:=VV##F##4][VV##F:=VV##F##4]]}- id 4 tag [1]- // META constraint id 4 : ()-----wf:- env [0; 1; 2; 3; 4]- reft {VV##37 : int | [$k_##38]}- // META wf : ()---wf:- env [0; 1; 2; 3]- reft {VV##33 : int | [$k_##34]}- // META wf : ()-------
+ tests/neg/adt0.fq view
@@ -0,0 +1,19 @@++data Vec 1 = [+ | mkNil { }+ | mkCons { head : @(0), tail : Vec }+]++bind 1 x : {v : int | true}+bind 2 y : {v : int | true}+bind 3 xs : {v : Vec int | true}+bind 4 ys : {v : Vec int | true}+bind 5 l1 : {v : Vec int | v = mkCons x xs }+bind 6 l2 : {v : Vec int | v = mkCons y ys }+bind 7 l3 : {v : Vec int | true }++constraint:+ env [1;2;3;4;5;6]+ lhs {v : int | true }+ rhs {v : int | x = y }+ id 1 tag []
+ tests/neg/adt1.fq view
@@ -0,0 +1,31 @@++data Vec 1 = [+ | mkNil { }+ | mkCons { head : @(0), tail : Vec }+]++bind 1 x : {v : int | true}+bind 2 y : {v : int | true}+bind 3 xs : {v : Vec int | v = mkNil }+bind 4 ys : {v : Vec int | true}+bind 5 l1 : {v : Vec int | v = mkCons x xs }+bind 6 l2 : {v : Vec int | v = mkCons y ys }+bind 7 l3 : {v : Vec int | true }++constraint:+ env [1;3;5;7]+ lhs {v : int | true }+ rhs {v : int | is$mkCons l3 }+ id 3 tag []++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | x = head l3 }+ id 4 tag []++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | mkNil = tail l3 }+ id 5 tag []
+ tests/neg/adt2.fq view
@@ -0,0 +1,18 @@+data Vec 1 = [+ | mkNil { }+ | mkCons { head : @(0), tail : Vec }+]++bind 1 x : {v : int | true}+bind 2 y : {v : int | true}+bind 3 xs : {v : Vec int | v = mkNil }+bind 4 ys : {v : Vec int | true}+bind 5 l1 : {v : Vec int | v = mkCons x xs }+bind 6 l2 : {v : Vec int | v = mkCons y ys }+bind 7 l3 : {v : Vec int | true }++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | y = head l3 }+ id 4 tag []
+ tests/neg/adt3.fq view
@@ -0,0 +1,18 @@+data Vec 1 = [+ | mkNil { }+ | mkCons { head : @(0), tail : Vec }+]++bind 1 x : {v : int | true}+bind 2 y : {v : int | true}+bind 3 xs : {v : Vec int | true }+bind 4 ys : {v : Vec int | true}+bind 5 l1 : {v : Vec int | v = mkCons x xs }+bind 6 l2 : {v : Vec int | v = mkCons y ys }+bind 7 l3 : {v : Vec int | true }++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | mkNil = tail l3 }+ id 5 tag []
+ tests/neg/adt_bin_0.fq view
@@ -0,0 +1,30 @@+constant prop : func(2, [@(0); @(1)])+constant gibber : func(0, [int; int; int])+++// constant prop : func(0, [Binary; Bin])++data Bin 0 = [+ | mkBin { nBin : Int }+]++data Binary 0 = [+ | mkB0 { }+ | mkB1 { }+]++bind 0 n : {n:Int | gibber 2 3 = 4 }+bind 1 p : {p:Binary | prop p = mkBin n && prop p = mkBin 0}+bind 2 p : {p:Binary | prop p = mkBin n && prop p = mkBin 1}++constraint:+ env [0; 1]+ lhs {v:int | true}+ rhs {v:int | n == 0 || n == 1}+ id 1 tag []++constraint:+ env [0; 2]+ lhs {v:int | true}+ rhs {v:int | n == 0 }+ id 2 tag []
+ tests/neg/adt_even_0.fq view
@@ -0,0 +1,33 @@+constant prop : func(2, [@(0); @(1)])++data Peano 0 = [+ | mkZ { }+ | mkS { cS0 : Peano }+]++data Ev 0 = [+ | mkEv { cEv0 : Peano }+]++data Even 0 = [+ | mkEZ { }+ | mkESS { cESS0 : Peano, cESS1 : Even }+]++bind 0 n : {n:Peano | true}+bind 1 p : {p:Even | prop p = mkEv (mkS (mkS n)) && prop p = mkEv mkZ}+bind 2 m : {m:Peano | true}+bind 3 q : {q:Even | prop q = mkEv m }+bind 4 p : {p:Even | prop p = mkEv (mkS (mkS n)) && prop p = mkEv (mkS (mkS m))}++constraint:+ env [0; 1]+ lhs {v:Even | true}+ rhs {v:Even | prop v = mkEv n}+ id 1 tag []++constraint:+ env [0; 2; 3; 4]+ lhs {v:Even | true }+ rhs {v:Even | prop v = mkEv n}+ id 2 tag []
+ tests/neg/hex00.fq view
@@ -0,0 +1,9 @@+bind 0 a : {a : int | a = 0x8 }+bind 1 b : {b : int | b = 0x7 } ++constraint:+ env [0; 1]+ lhs {v:int | v = a + b}+ rhs {v:int | v = 0xC }+ id 1 tag []+
+ tests/neg/lit00.fq view
@@ -0,0 +1,18 @@+// Config {srcFile = "/Users/rjhala/research/stack/liquidhaskell/tests/pos/lit00.hs", cores = Nothing, minPartSize = 500, maxPartSize = 700, solver = z3, linear = False, stringTheory = False, defunction = False, allowHO = False, allowHOqs = False, eliminate = some, elimBound = Nothing, elimStats = False, solverStats = False, metadata = False, stats = False, parts = False, save = True, minimize = False, minimizeQs = False, minimizeKs = False, minimalSol = False, gradual = False, ginteractive = False, extensionality = False, alphaEquivalence = False, betaEquivalence = False, normalForm = False, autoKuts = False, nonLinCuts = True, noslice = False, rewriteAxioms = True, arithmeticAxioms = False}++constant Zero : (Peano) +constant One : (Peano) ++distinct Zero : (Peano) +distinct One : (Peano) +++bind 0 xZero : {v : Peano | v = Zero } +bind 1 xOne : {v : Peano | v = One } ++constraint:+ env [0; 1]+ lhs {v:int | true} + rhs {v:int | xZero = xOne } + id 1 tag []+
− tests/neg/test00.hs.fq
@@ -1,286 +0,0 @@-qualif Fst(v : @(1), y : @(0)): (v = fst([y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.spec" (line 29, column 8)-qualif Snd(v : @(1), y : @(0)): (v = snd([y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.spec" (line 30, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) > 0)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 13, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) = 0)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 14, column 8)-qualif ListZ(v : [@(0)]): (len([v]) = 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 16, column 8)-qualif ListZ(v : [@(0)]): (len([v]) >= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 17, column 8)-qualif ListZ(v : [@(0)]): (len([v]) > 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 18, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) = len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 20, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) >= len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 21, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) > len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 22, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) <= len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 23, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) < len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 24, column 8)-qualif EqLen(v : int, xs : [@(0)]): (v = len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 26, column 8)-qualif LenEq(v : [@(0)], x : int): (x = len([v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 27, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x + 1)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 28, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x - 1)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 29, column 8)-qualif LenAcc(v : int, xs : [@(0)], n : int): (v = (len([xs]) + n)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 30, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 3, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 4, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 5, column 8)-qualif Bot(v : bool): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 6, column 8)-qualif Bot(v : int): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 7, column 8)-qualif CmpZ(v : @(0)): (v < 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 9, column 8)-qualif CmpZ(v : @(0)): (v <= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 10, column 8)-qualif CmpZ(v : @(0)): (v > 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 11, column 8)-qualif CmpZ(v : @(0)): (v >= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 12, column 8)-qualif CmpZ(v : @(0)): (v = 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 13, column 8)-qualif CmpZ(v : @(0)): (v != 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 14, column 8)-qualif Cmp(v : @(0), x : @(0)): (v < x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 16, column 8)-qualif Cmp(v : @(0), x : @(0)): (v <= x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 17, column 8)-qualif Cmp(v : @(0), x : @(0)): (v > x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 18, column 8)-qualif Cmp(v : @(0), x : @(0)): (v >= x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 19, column 8)-qualif Cmp(v : @(0), x : @(0)): (v = x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 20, column 8)-qualif Cmp(v : @(0), x : @(0)): (v != x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 21, column 8)-qualif One(v : int): (v = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 28, column 8)-qualif True(v : bool): (? v) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 29, column 8)-qualif False(v : bool): (~ ((? v))) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 30, column 8)-qualif True1(v : GHC.Types.Bool): (? Prop([v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 31, column 8)-qualif False1(v : GHC.Types.Bool): (~ ((? Prop([v])))) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 32, column 8)-qualif Papp(v : @(0), p : (Pred @(0))): (? papp1([p;- v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 35, column 8)-qualif Papp2(v : @(1), x : @(0), p : (Pred @(1) @(0))): (? papp2([p;- v;- x])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 38, column 8)-qualif Papp3(v : @(2), x : @(0), y : @(1), p : (Pred @(2) @(0) @(1))): (? papp3([p;- v;- x;- y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 41, column 8)-----constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant addrLen : (func(0, [int; int]))-constant xsListSelector : (func(1, [[@(0)]; [@(0)]]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant GHC.Types.False$35$68 : (GHC.Types.Bool)-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(6));- @(3);- @(4);- @(5);- @(7);- bool]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant autolen : (func(1, [@(0); int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant null : (func(1, [[@(0)]; bool]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant len : (func(2, [(@(0) @(1)); int]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant xListSelector : (func(1, [[@(0)]; @(0)]))-constant strLen : (func(0, [int; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant Prop : (func(0, [GHC.Types.Bool; bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(1, [(Pred @(0)); @(0); bool]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant GHC.Types.I$35$$35$6c : (func(0, [int; int]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))-constant GHC.Types.True$35$6u : (GHC.Types.Bool)---bind 0 GHC.Types.False$35$68 : {VV$35$159 : GHC.Types.Bool | []}-bind 1 GHC.Types.True$35$6u : {VV$35$161 : GHC.Types.Bool | []}-bind 2 GHC.Classes.$36$fOrdInt$35$rni : {VV$35$166 : (GHC.Classes.Ord int) | []}-bind 3 GHC.Types.EQ$35$6U : {VV$35$167 : GHC.Types.Ordering | [(VV$35$167 = GHC.Types.EQ$35$6U)]}-bind 4 GHC.Types.LT$35$6S : {VV$35$168 : GHC.Types.Ordering | [(VV$35$168 = GHC.Types.LT$35$6S)]}-bind 5 GHC.Types.GT$35$6W : {VV$35$169 : GHC.Types.Ordering | [(VV$35$169 = GHC.Types.GT$35$6W)]}-bind 6 GHC.Types.True$35$6u : {v$35$4 : GHC.Types.Bool | [(? Prop([v$35$4]))]}-bind 7 GHC.Types.False$35$68 : {v$35$5 : GHC.Types.Bool | [(~ ((? Prop([v$35$5]))))]}-bind 8 GHC.Types.False$35$68 : {v$35$5 : GHC.Types.Bool | [(~ ((? Prop([v$35$5]))))]}-bind 9 GHC.Types.$91$$93$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 10 GHC.Types.True$35$6u : {v$35$4 : GHC.Types.Bool | [(? Prop([v$35$4]))]}-bind 11 GHC.Types.GT$35$6W : {VV$35$214 : GHC.Types.Ordering | [(cmp([VV$35$214]) = GHC.Types.GT$35$6W)]}-bind 12 GHC.Types.LT$35$6S : {VV$35$215 : GHC.Types.Ordering | [(cmp([VV$35$215]) = GHC.Types.LT$35$6S)]}-bind 13 GHC.Types.EQ$35$6U : {VV$35$216 : GHC.Types.Ordering | [(cmp([VV$35$216]) = GHC.Types.EQ$35$6U)]}-bind 14 GHC.Base.Nothing$35$r1d : {VV : func(1, [(GHC.Base.Maybe @(0))]) | []}-bind 15 z$35$a10N : {VV$35$221 : int | [$k_$35$222]}-bind 16 lq_anf$36$_d116 : {lq_tmp$36$x$35$229 : int | [(lq_tmp$36$x$35$229 = (100 : int))]}-bind 17 lq_anf$36$_d117 : {lq_tmp$36$x$35$236 : GHC.Types.Bool | [((? Prop([lq_tmp$36$x$35$236])) <=> (z$35$a10N >= lq_anf$36$_d116))]}-bind 18 lq_anf$36$_d118 : {lq_tmp$36$x$35$254 : int | [(lq_tmp$36$x$35$254 = (0 : int))]}-bind 19 Test0.x$35$rYP : {VV$35$250 : int | [$k_$35$251]}-bind 20 lq_anf$36$_d119 : {lq_tmp$36$x$35$269 : int | [(lq_tmp$36$x$35$269 = (0 : int))]}-bind 21 lq_anf$36$_d11a : {lq_tmp$36$x$35$275 : GHC.Types.Bool | [((? Prop([lq_tmp$36$x$35$275])) <=> (Test0.x$35$rYP > lq_anf$36$_d119))]}-bind 22 lq_anf$36$_d11b : {lq_tmp$36$x$35$291 : GHC.Types.Bool | [(lq_tmp$36$x$35$291 = lq_anf$36$_d11a)]}-bind 23 lq_anf$36$_d11b : {lq_tmp$36$x$35$293 : GHC.Types.Bool | [(lq_tmp$36$x$35$293 = lq_anf$36$_d11a)]}-bind 24 lq_anf$36$_d11b : {lq_tmp$36$x$35$293 : GHC.Types.Bool | [(lq_tmp$36$x$35$293 = lq_anf$36$_d11a);- (~ ((? Prop([lq_tmp$36$x$35$293]))));- (~ ((? Prop([lq_tmp$36$x$35$293]))));- (~ ((? Prop([lq_tmp$36$x$35$293]))))]}-bind 25 lq_anf$36$_d11b : {lq_tmp$36$x$35$299 : GHC.Types.Bool | [(lq_tmp$36$x$35$299 = lq_anf$36$_d11a)]}-bind 26 lq_anf$36$_d11b : {lq_tmp$36$x$35$299 : GHC.Types.Bool | [(lq_tmp$36$x$35$299 = lq_anf$36$_d11a);- (? Prop([lq_tmp$36$x$35$299]));- (? Prop([lq_tmp$36$x$35$299]));- (? Prop([lq_tmp$36$x$35$299]))]}-bind 27 Test0.prop_abs$35$r10h : {VV$35$265 : GHC.Types.Bool | [$k_$35$266]}-bind 28 VV$35$310 : {VV$35$310 : GHC.Types.Bool | [$k_$35$226[lq_tmp$36$x$35$307:=Test0.x$35$rYP][lq_tmp$36$x$35$305:=VV$35$310][VV$35$225:=VV$35$310][z$35$a10N:=Test0.x$35$rYP]]}-bind 29 VV$35$310 : {VV$35$310 : GHC.Types.Bool | [$k_$35$226[lq_tmp$36$x$35$307:=Test0.x$35$rYP][lq_tmp$36$x$35$305:=VV$35$310][VV$35$225:=VV$35$310][z$35$a10N:=Test0.x$35$rYP]]}-bind 30 VV$35$313 : {VV$35$313 : int | [(VV$35$313 = Test0.x$35$rYP)]}-bind 31 VV$35$313 : {VV$35$313 : int | [(VV$35$313 = Test0.x$35$rYP)]}-bind 32 VV$35$316 : {VV$35$316 : GHC.Types.Bool | [(VV$35$316 = GHC.Types.False$35$68)]}-bind 33 VV$35$316 : {VV$35$316 : GHC.Types.Bool | [(VV$35$316 = GHC.Types.False$35$68)]}-bind 34 VV$35$319 : {VV$35$319 : int | [(VV$35$319 = lq_anf$36$_d119)]}-bind 35 VV$35$319 : {VV$35$319 : int | [(VV$35$319 = lq_anf$36$_d119)]}-bind 36 VV$35$322 : {VV$35$322 : int | [(VV$35$322 = Test0.x$35$rYP)]}-bind 37 VV$35$322 : {VV$35$322 : int | [(VV$35$322 = Test0.x$35$rYP)]}-bind 38 VV$35$325 : {VV$35$325 : int | [(VV$35$325 = 0)]}-bind 39 VV$35$325 : {VV$35$325 : int | [(VV$35$325 = 0)]}-bind 40 VV$35$328 : {VV$35$328 : int | []}-bind 41 VV$35$328 : {VV$35$328 : int | []}-bind 42 VV$35$331 : {VV$35$331 : int | [(VV$35$331 = lq_anf$36$_d118)]}-bind 43 VV$35$331 : {VV$35$331 : int | [(VV$35$331 = lq_anf$36$_d118)]}-bind 44 VV$35$334 : {VV$35$334 : int | [(VV$35$334 = 0)]}-bind 45 VV$35$334 : {VV$35$334 : int | [(VV$35$334 = 0)]}-bind 46 VV$35$337 : {VV$35$337 : GHC.Types.Bool | [(? Prop([VV$35$337]))]}-bind 47 VV$35$337 : {VV$35$337 : GHC.Types.Bool | [(? Prop([VV$35$337]))]}-bind 48 VV$35$340 : {VV$35$340 : GHC.Types.Bool | [(VV$35$340 = lq_anf$36$_d117)]}-bind 49 VV$35$340 : {VV$35$340 : GHC.Types.Bool | [(VV$35$340 = lq_anf$36$_d117)]}-bind 50 VV$35$343 : {VV$35$343 : int | [(VV$35$343 = lq_anf$36$_d116)]}-bind 51 VV$35$343 : {VV$35$343 : int | [(VV$35$343 = lq_anf$36$_d116)]}-bind 52 VV$35$346 : {VV$35$346 : int | [(VV$35$346 = z$35$a10N)]}-bind 53 VV$35$346 : {VV$35$346 : int | [(VV$35$346 = z$35$a10N)]}-bind 54 VV$35$349 : {VV$35$349 : int | [(VV$35$349 = 100)]}-bind 55 VV$35$349 : {VV$35$349 : int | [(VV$35$349 = 100)]}-bind 56 VV$35$282 : {VV$35$282 : int | [$k_$35$283]}-bind 57 VV$35$265 : {VV$35$265 : GHC.Types.Bool | [$k_$35$266]}-bind 58 VV$35$250 : {VV$35$250 : int | [$k_$35$251]}-bind 59 VV$35$221 : {VV$35$221 : int | [$k_$35$222]}-bind 60 VV$35$225 : {VV$35$225 : GHC.Types.Bool | [$k_$35$226]}-----constraint:- env [0;- 1;- 2;- 3;- 19;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 8;- 9;- 25;- 10;- 26;- 11;- 12;- 13;- 14;- 30]- lhs {VV$35$F2 : int | [(VV$35$F2 = Test0.x$35$rYP)]}- rhs {VV$35$F2 : int | [$k_$35$222[VV$35$221:=VV$35$F2][lq_tmp$36$x$35$304:=VV$35$F2][VV$35$313:=VV$35$F2][VV$35$F:=VV$35$F2]]}- id 2 tag [3]- // META constraint id 2 : tests/neg/test00.hs:8:30---constraint:- env [0; 1; 2; 18; 3; 4; 5; 6; 7; 8; 40; 9; 10; 11; 12; 13; 14]- lhs {VV$35$F6 : int | []}- rhs {VV$35$F6 : int | [$k_$35$251[VV$35$328:=VV$35$F6][VV$35$250:=VV$35$F6][VV$35$F:=VV$35$F6]]}- id 6 tag [2]- // META constraint id 6 : tests/neg/test00.hs:6:1-12---constraint:- env [0;- 16;- 48;- 1;- 17;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15]- lhs {VV$35$F8 : GHC.Types.Bool | [(VV$35$F8 = lq_anf$36$_d117)]}- rhs {VV$35$F8 : GHC.Types.Bool | [(? Prop([VV$35$F8]))]}- id 8 tag [1]- // META constraint id 8 : tests/neg/test00.hs:11:23-35-----wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14]- reft {VV$35$221 : int | [$k_$35$222]}- // META wf : <no location info>---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14]- reft {VV$35$250 : int | [$k_$35$251]}- // META wf : <no location info>-------
− tests/pos/LogicCurry1.hs.fq
@@ -1,245 +0,0 @@-fixpoint "--allowho"--qualif Fst(v : @(1), y : @(0)): ((v = (fst y))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.spec" (line 28, column 8)-qualif Snd(v : @(1), y : @(0)): ((v = (snd y))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.spec" (line 29, column 8)-qualif Auto(v##1 : int, n : int, x : int): ((v##1 = (ack n x))) // "/Users/rjhala/research/stack/liquidhaskell/tests/pos/LogicCurry1.hs" (line 10, column 1)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((v <=> ((len xs) > 0))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 13, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((v <=> ((len xs) = 0))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 14, column 8)-qualif ListZ(v : [@(0)]): (((len v) = 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 16, column 8)-qualif ListZ(v : [@(0)]): (((len v) >= 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 17, column 8)-qualif ListZ(v : [@(0)]): (((len v) > 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 18, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) = (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 20, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) >= (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 21, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) > (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 22, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) <= (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 23, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) < (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 24, column 8)-qualif EqLen(v : int, xs : [@(0)]): ((v = (len xs))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 26, column 8)-qualif LenEq(v : [@(0)], x : int): ((x = (len v))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 27, column 8)-qualif LenDiff(v : [@(0)], x : int): (((len v) = (x + 1))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 28, column 8)-qualif LenDiff(v : [@(0)], x : int): (((len v) = (x - 1))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 29, column 8)-qualif LenAcc(v : int, xs : [@(0)], n : int): ((v = ((len xs) + n))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/GHC/Base.hquals" (line 30, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 3, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 4, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 5, column 8)-qualif Bot(v : bool): ((0 = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 6, column 8)-qualif Bot(v : int): ((0 = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 7, column 8)-qualif CmpZ(v : @(0)): ((v < 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 9, column 8)-qualif CmpZ(v : @(0)): ((v <= 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 10, column 8)-qualif CmpZ(v : @(0)): ((v > 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 11, column 8)-qualif CmpZ(v : @(0)): ((v >= 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 12, column 8)-qualif CmpZ(v : @(0)): ((v = 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 13, column 8)-qualif CmpZ(v : @(0)): ((v != 0)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 14, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v < x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 16, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v <= x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 17, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v > x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 18, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v >= x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 19, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v = x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 20, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v != x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 21, column 8)-qualif One(v : int): ((v = 1)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 28, column 8)-qualif True1(v : GHC.Types.Bool): (v) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 29, column 8)-qualif False1(v : GHC.Types.Bool): ((~ (v))) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 30, column 8)-qualif Papp(v : @(0), p : (Pred @(0))): ((papp1 p v)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 34, column 8)-qualif Papp2(v : @(1), x : @(0), p : (Pred @(1) @(0))): ((papp2 p v x)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 37, column 8)-qualif Papp3(v : @(2), x : @(0), y : @(1), p : (Pred @(2) @(0) @(1))): ((papp3 p v x y)) // "/Users/rjhala/research/stack/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2016-05-21/7.10.3/share/x86_64-osx-ghc-7.10.3/liquidhaskell-0.6.0.0/include/Prelude.hquals" (line 39, column 8)-----constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant addrLen : (func(0, [Str; int]))-constant papp5 : (func(10, [(Pred @(0) @(1) @(2) @(3) @(4));- @(5);- @(6);- @(7);- @(8);- @(9);- bool]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant GHC.Types.False##68 : (bool)-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant GHC.Types.True##6u : (bool)-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant GHC.Types.LT##6S : (GHC.Types.Ordering)-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(3));- @(4);- @(5);- @(6);- @(7);- bool]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant GHC.Types.GT##6W : (GHC.Types.Ordering)-constant autolen : (func(1, [@(0); int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant head : (func(1, [[@(0)]; @(0)]))-constant null : (func(1, [[@(0)]; bool]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant papp7 : (func(14, [(Pred @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(7);- @(8);- @(9);- @(10);- @(11);- @(12);- @(13);- bool]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant ack : (func(0, [int; int; int]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant len : (func(2, [(@(0) @(1)); int]))-constant papp6 : (func(12, [(Pred @(0) @(1) @(2) @(3) @(4) @(5));- @(6);- @(7);- @(8);- @(9);- @(10);- @(11);- bool]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant GHC.Err.undefined##02v : (func(1, [@(0)]))-constant strLen : (func(0, [[Char]; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(2, [(Pred @(0)); @(1); bool]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant tail : (func(1, [[@(0)]; [@(0)]]))-constant GHC.Types.EQ##6U : (GHC.Types.Ordering)-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant Main.ack##rjG : (func(0, [int; int; int]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))---distinct GHC.Types.False##68 : (bool)-distinct GHC.Types.True##6u : (bool)-distinct GHC.Types.LT##6S : (GHC.Types.Ordering)-distinct GHC.Types.GT##6W : (GHC.Types.Ordering)-distinct GHC.Types.EQ##6U : (GHC.Types.Ordering)---bind 0 GHC.Err.undefined##02v : {VV : func(1, [@(0)]) | []}-bind 1 GHC.Types.True##6u : {VV##9 : bool | [(VV##9 = GHC.Types.True##6u)]}-bind 2 GHC.Types.False##68 : {VV##10 : bool | [(VV##10 = GHC.Types.False##68)]}-bind 3 GHC.Types.EQ##6U : {VV##11 : GHC.Types.Ordering | [(VV##11 = GHC.Types.EQ##6U)]}-bind 4 GHC.Types.LT##6S : {VV##12 : GHC.Types.Ordering | [(VV##12 = GHC.Types.LT##6S)]}-bind 5 GHC.Types.GT##6W : {VV##13 : GHC.Types.Ordering | [(VV##13 = GHC.Types.GT##6W)]}-bind 6 Main.ack##rjG : {VV : func(0, [int; int; int]) | []}-bind 7 Main.ack##rjG : {VV : func(0, [int; int; int]) | []}-bind 8 m##alH : {VV##41 : int | []}-bind 9 Main.bar##rlx : {VV : func(0, [int; int; int]) | []}-bind 10 VV##55 : {VV##55 : int | []}-bind 11 m##alH : {VV##57 : int | []}-bind 12 VV##58 : {VV##58 : int | []}-bind 13 lq_tmp$x##51 : {v : int | []}-bind 14 VV##61 : {VV##61 : int | []}-bind 15 VV##63 : {VV##63 : int | []}-bind 16 lq_tmp$x##40 : {v : int | []}-bind 17 VV##66 : {VV##66 : int | [(VV##66 = (ack m##alH lq_tmp$x##40))]}-bind 18 VV##68 : {VV##68 : int | [(VV##68 = m##alH)]}-bind 19 VV##70 : {VV##70 : int | []}-bind 20 lq_tmp$x##17 : {VV##72 : int | []}-bind 21 VV##73 : {VV##73 : int | []}-bind 22 lq_tmp$x##19 : {VV##75 : int | []}-bind 23 VV##76 : {VV##76 : int | [$k_##31[lq_tmp$x##22:=lq_tmp$x##17][VV##30:=VV##76][lq_tmp$x##26:=lq_tmp$x##19][lq_tmp$x##35:=VV##76]]}-bind 24 VV##23 : {VV##23 : int | [$k_##24]}-bind 25 lq_tmp$x##22 : {VV##23 : int | [$k_##24]}-bind 26 VV##27 : {VV##27 : int | [$k_##28]}-bind 27 lq_tmp$x##26 : {VV##27 : int | [$k_##28]}-bind 28 VV##30 : {VV##30 : int | [$k_##31]}-----constraint:- env [0; 1; 2; 3; 4; 5; 6; 7; 8]- lhs {VV##F##1 : func(0, [int; int]) | [(VV##F##1 = (ack m##alH))]}- rhs {VV##F##1 : func(0, [int; int]) | [(VV##F##1 = (ack m##alH))]}- id 1 tag [2]- // META constraint id 1 : ()---constraint:- env [0; 1; 2; 3; 4; 5; 6]- lhs {VV##F##2 : int | []}- rhs {VV##F##2 : int | [$k_##24[VV##70:=VV##F##2][VV##23:=VV##F##2][VV##F:=VV##F##2][lq_tmp$x##33:=VV##F##2]]}- id 2 tag [1]- // META constraint id 2 : ()---constraint:- env [0; 1; 2; 3; 4; 5; 6; 20]- lhs {VV##F##3 : int | []}- rhs {VV##F##3 : int | [$k_##28[lq_tmp$x##22:=lq_tmp$x##17][lq_tmp$x##34:=VV##F##3][VV##27:=VV##F##3][VV##73:=VV##F##3][VV##F:=VV##F##3]]}- id 3 tag [1]- // META constraint id 3 : ()-----wf:- env [0; 1; 2; 3; 4; 5; 6; 25]- reft {VV##27 : int | [$k_##28]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 25; 27]- reft {VV##30 : int | [$k_##31]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6]- reft {VV##23 : int | [$k_##24]}- // META wf : ()-------
+ tests/pos/adt.fq view
@@ -0,0 +1,43 @@++data Vec 1 = [+ | mkNil { }+ | mkCons { head : @(0), tail : Vec }+]++bind 1 x : {v : int | true}+bind 2 y : {v : int | true}+bind 3 xs : {v : Vec int | v = mkNil }+bind 4 ys : {v : Vec int | true}+bind 5 l1 : {v : Vec int | v = mkCons x xs }+bind 6 l2 : {v : Vec int | v = mkCons y ys }+bind 7 l3 : {v : Vec int | true }++constraint:+ env [1;2;3;4;5;6]+ lhs {v : int | l1 = l2 }+ rhs {v : int | x = y }+ id 1 tag []++constraint:+ env [1;2;3;4;5;6]+ lhs {v : int | l1 = l2 }+ rhs {v : int | xs = ys }+ id 2 tag []++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | is$mkCons l3 }+ id 3 tag []++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | x = head l3 }+ id 4 tag []++constraint:+ env [1;3;5;7]+ lhs {v : int | l1 = l3 }+ rhs {v : int | mkNil = tail l3 }+ id 5 tag []
+ tests/pos/adt_bin_0.fq view
@@ -0,0 +1,27 @@+constant prop : func(2, [@(0); @(1)])+constant gibber : func(0, [int; int; int])++data Bin 0 = [+ | mkBin { nBin : Int }+]++data Binary 0 = [+ | mkB0 { }+ | mkB1 { }+]++bind 0 n : {n:Int | gibber 2 3 = 4 }+bind 1 p : {p:Binary | prop p = mkBin n && prop p = mkBin 0}+bind 2 p : {p:Binary | prop p = mkBin n && prop p = mkBin 1}++constraint:+ env [0; 1]+ lhs {v:int | true}+ rhs {v:int | n == 0 || n == 1}+ id 1 tag []++constraint:+ env [0; 2]+ lhs {v:int | true}+ rhs {v:int | n == 0 || n == 1}+ id 2 tag []
+ tests/pos/adt_bin_lam.fq view
@@ -0,0 +1,16 @@+fixpoint "--allowho"++data Bin 0 = [+ | mkBin { nBin : Int }+]++bind 0 b : {b : Bin | true}+bind 1 g1 : {g1 : func(0, [int; Bin]) | g1 = (\x:int -> b) }+bind 2 g2 : {g2 : func(0, [bool; Bin]) | g2 = (\x:bool -> b) }+bind 3 f : {f:func(0, [Bin; Bin]) | f = (\x:Bin -> b) }++constraint:+ env [0; 1; 2; 3]+ lhs {v:int | f b == b }+ rhs {v:int | b == f b }+ id 1 tag []
+ tests/pos/adt_curry.fq view
@@ -0,0 +1,14 @@+fixpoint "--allowho"++data Vec 1 = [+ | VCons { head : @(0) } +]++bind 0 foo : {v: Vec (func(0, [int; int])) | true} ++constraint:+ env [0]+ lhs {v : int | (head foo 0) = 0 }+ rhs {v : int | (head foo 0) = 0 }+ id 1 tag []+
+ tests/pos/adt_dep_0.fq view
@@ -0,0 +1,16 @@++data Zob 0 = [+ | boo { choo : int } +]++data LL 0 = [+ | emp { }+ | con { lHead : Zob, lTail : LL }+]++constraint:+ env []+ lhs {v:int | true }+ rhs {v:int | emp = (if (1 < 2) then emp else emp) }+ id 1 tag []+
+ tests/pos/adt_dep_1.fq view
@@ -0,0 +1,16 @@++data LL 0 = [+ | emp { }+ | con { lHead : Bob, lTail : LL }+]++data Bob 0 = [+ | boo { choo : int } +]++constraint:+ env []+ lhs {v:int | true }+ rhs {v:int | emp = (if (1 < 2) then emp else emp) }+ id 1 tag []+
+ tests/pos/adt_even_0.fq view
@@ -0,0 +1,33 @@+constant prop : func(2, [@(0); @(1)])++data Peano 0 = [+ | mkZ { }+ | mkS { cS0 : Peano }+]++data Ev 0 = [+ | mkEv { cEv0 : Peano }+]++data Even 0 = [+ | mkEZ { }+ | mkESS { cESS0 : Peano, cESS1 : Even }+]++bind 0 n : {n:Peano | true}+bind 1 p : {p:Even | prop p = mkEv (mkS (mkS n)) && prop p = mkEv mkZ}+bind 2 m : {m:Peano | true}+bind 3 q : {q:Even | prop q = mkEv m }+bind 4 p : {p:Even | prop p = mkEv (mkS (mkS n)) && prop p = mkEv (mkS (mkS m))}++constraint:+ env [0; 1]+ lhs {v:Even | true}+ rhs {v:Even | prop v = mkEv n}+ id 1 tag []++constraint:+ env [0; 2; 3; 4]+ lhs {v:Even | v = q}+ rhs {v:Even | prop v = mkEv n}+ id 2 tag []
+ tests/pos/adt_list_0.fq view
@@ -0,0 +1,15 @@++data LL 0 = [+ | emp { }+ | con { lHead : int, lTail : LL }+]++bind 0 n : {n:int | true}+bind 1 m : {m:int | true}++constraint:+ env [0; 1]+ lhs {v:int | (con n (con m emp) = con m (con n emp)) }+ rhs {v:int | m = n }+ id 1 tag []+
+ tests/pos/adt_list_1.fq view
@@ -0,0 +1,16 @@++data LL 1 = [+ | emp { }+ | con { lHead : @(0), lTail : LL }+]++bind 1 n1 : {n:int | true}+bind 2 m1 : {m:int | true}+bind 3 n2 : {n:int | true}+bind 4 m2 : {m:int | true}++constraint:+ env [1; 2; 3; 4]+ lhs {v:int | (con n1 (con n2 emp) = con m1 (con m2 emp)) }+ rhs {v:int | n1 = m1 && n2 = m2 }+ id 0 tag []
+ tests/pos/adt_list_2.fq view
@@ -0,0 +1,14 @@++data LL 1 = [+ | emp { }+ | con { lHead : @(0), lTail : LL }+]++bind 0 junk : {v:LL bool | true} ++constraint:+ env [0]+ lhs {v:int | true }+ rhs {v:int | emp = (if (1 < 2) then emp else (con 1 emp)) }+ id 1 tag []+
+ tests/pos/adt_list_nested.fq view
@@ -0,0 +1,15 @@+++data LL 1 = [+ | emp { }+ | con { lHead : @(0), lTail : LL }+]++bind 0 junk : {v:LL int | true}+bind 1 pink : {v:LL (LL int) | true }++constraint:+ env [0]+ lhs {v:int | true }+ rhs {v:int | emp = (if (1 < 2) then emp else (con junk emp)) }+ id 1 tag []
+ tests/pos/adt_qual.fq view
@@ -0,0 +1,25 @@++qualif Eq(v:@(0), x:@(0)): (v = x)+qualif Leq(v:@(0), x:@(0)): (v <= x)++data Zob 0 = [+ | boo { choo : int } +]++bind 0 a : {a : Zob | true} ++constraint:+ env [0]+ lhs {v:Zob | v = a }+ rhs {v:Zob | $k0 } + id 1 tag []++constraint:+ env [0]+ lhs {v:Zob | $k0 }+ rhs {v:Zob | v = a } + id 2 tag []++wf: + env [0]+ reft {v:Zob | $k0 }
− tests/pos/hex.ts.fq
@@ -1,342 +0,0 @@-qualif Bot(v : a): (0 = 1) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Bot(v : obj): (0 = 1) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Bot(v : Boolean): (0 = 1) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Bot(v : int): (0 = 1) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v < 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v <= 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v > 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v >= 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v = 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif CmpZ(v : int): (v != 0) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : int, x : int): (v < x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : int, x : int): (v <= x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : int, x : int): (v > x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : int, x : int): (v >= x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : a, x : a): (v ~~ x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Cmp(v : a, x : a): (v != x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif True1(v : Boolean): (? Prop([v])) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif False1(v : Boolean): (~ ((? Prop([v])))) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Tag(v : a, x : Str): (ttag([v]) = x) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-qualif Len(v : b, w : a): (v < len([w])) // "/Users/rjhala/research/stack/liquid/refscript/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/refscript-0.1.0.0/include/prelude.ts" (line 1, column 1)-----constant lit$36$Array : (Str)-constant lit$36$PI : (Str)-constant lit$36$documentElement : (Str)-constant extends_class : (func(1, [@(0); Str; bool]))-constant numeric_min_value : (int)-constant numeric_positive_infinity : (int)-constant lit$36$Document : (Str)-constant lit$36$Console : (Str)-constant lit$36$LOG10E : (Str)-constant lit$36$MAX_VALUE : (Str)-constant lit$36$Error : (Str)-constant numeric_nan : (int)-constant lit$36$Math : (Str)-constant lit$36$LN2 : (Str)-constant offset : (func(2, [@(0); Str; @(1)]))-constant hasDirectProperty : (func(1, [Str; @(0); bool]))-constant lit$36$Object : (Str)-constant lit$36$StringConstructor : (Str)-constant lit$36$object : (Str)-constant lit$36$NEGATIVE_INFINITY : (Str)-constant lit$36$BUBBLING_PHASE : (Str)-constant ttag : (func(1, [@(0); Str]))-constant lit$36$AT_TARGET : (Str)-constant lit$36$LN10 : (Str)-constant lit$36$Event : (Str)-constant numeric_max_value : (int)-constant lit$36$CAPTURING_PHASE : (Str)-constant lit$36$NaN : (Str)-constant lit$36$undefined : (Str)-constant lit$36$Function : (Str)-constant len : (func(2, [(Array @(0) @(1)); int]))-constant extends_interface : (func(1, [@(0); Str; bool]))-constant numeric_negative_infinity : (int)-constant lit$36$SQRT1_2 : (Str)-constant Prop : (func(1, [@(0); bool]))-constant hasProperty : (func(1, [Str; @(0); bool]))-constant lit$36$String : (Str)-constant lit$36$E : (Str)-constant lit$36$POSITIVE_INFINITY : (Str)-constant lit$36$MIN_VALUE : (Str)-constant lit$36$prototype : (Str)-constant lit$36$SQRT2 : (Str)-constant lit$36$LOG2E : (Str)-constant lit$36$Number : (Str)-constant lit$36$HTMLElement : (Str)-constant lit$36$number : (Str)-constant enumProp : (func(1, [Str; @(0); bool]))-constant lit$36$boolean : (Str)-constant lit$36$Window : (Str)---bind 0 undefined : {v : Undefined | [(ttag([v]) = lit$36$undefined);- (~ ((? Prop([v]))))]}-bind 1 Object : {VV$35$285 : Object | [(? Prop([VV$35$285]));- (ttag([VV$35$285]) = lit$36$object)]}-bind 2 Object.prototype : {VV : (Object Immutable) | [(? extends_interface([VV;- lit$36$Object]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Object; lit$36$prototype]))]}-bind 3 NaN : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v = numeric_nan)]}-bind 4 Number : {VV$35$325 : Object | [(? Prop([VV$35$325]));- (ttag([VV$35$325]) = lit$36$object)]}-bind 5 Number.POSITIVE_INFINITY : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Number; lit$36$POSITIVE_INFINITY]))]}-bind 6 Number.MIN_VALUE : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Number; lit$36$MIN_VALUE]))]}-bind 7 Number.prototype : {VV : (Number Immutable) | [(? extends_interface([VV;- lit$36$Number]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Number; lit$36$prototype]))]}-bind 8 Number.NaN : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Number; lit$36$NaN]))]}-bind 9 Number.NEGATIVE_INFINITY : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Number; lit$36$NEGATIVE_INFINITY]))]}-bind 10 Number.MAX_VALUE : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Number; lit$36$MAX_VALUE]))]}-bind 11 Math : {VV$35$387 : (Math Immutable) | [(? extends_interface([VV$35$387;- lit$36$Math]));- (? Prop([VV$35$387]));- (ttag([VV$35$387]) = lit$36$object)]}-bind 12 Math.SQRT2 : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$SQRT2]))]}-bind 13 Math.LN2 : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$LN2]))]}-bind 14 Math.PI : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$PI]))]}-bind 15 Math.LOG10E : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$LOG10E]))]}-bind 16 Math.LOG2E : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$LOG2E]))]}-bind 17 Math.E : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$E]))]}-bind 18 Math.SQRT1_2 : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$SQRT1_2]))]}-bind 19 Math.LN10 : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Math; lit$36$LN10]))]}-bind 20 String : {VV$35$469 : (StringConstructor Immutable) | [(? extends_interface([VV$35$469;- lit$36$StringConstructor]));- (? Prop([VV$35$469]));- (ttag([VV$35$469]) = lit$36$object)]}-bind 21 String.prototype : {VV : (String Immutable) | [(? extends_interface([VV;- lit$36$String]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([String; lit$36$prototype]))]}-bind 22 Array : {VV$35$727 : Object | [(? Prop([VV$35$727]));- (ttag([VV$35$727]) = lit$36$object)]}-bind 23 Array.prototype : {VV : (Array Mutable Top) | [(? extends_interface([VV;- lit$36$Array]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Array; lit$36$prototype]))]}-bind 24 Function : {VV$35$762 : Object | [(? Prop([VV$35$762]));- (ttag([VV$35$762]) = lit$36$object)]}-bind 25 Function.prototype : {VV : (Function Immutable) | [(? extends_interface([VV;- lit$36$Function]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Function;- lit$36$prototype]))]}-bind 26 Console : {VV$35$891 : Object | [(? Prop([VV$35$891]));- (ttag([VV$35$891]) = lit$36$object)]}-bind 27 Console.prototype : {VV : (Console Immutable) | [(? extends_interface([VV;- lit$36$Console]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Console;- lit$36$prototype]))]}-bind 28 console : {VV$35$893 : (Console Immutable) | [(? extends_interface([VV$35$893;- lit$36$Console]));- (? Prop([VV$35$893]));- (ttag([VV$35$893]) = lit$36$object)]}-bind 29 Error : {VV$35$983 : Object | [(? Prop([VV$35$983]));- (ttag([VV$35$983]) = lit$36$object)]}-bind 30 Error.prototype : {VV : (Error Immutable) | [(? extends_interface([VV;- lit$36$Error]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Error; lit$36$prototype]))]}-bind 31 Event : {VV$35$1025 : Object | [(? Prop([VV$35$1025]));- (ttag([VV$35$1025]) = lit$36$object)]}-bind 32 Event.CAPTURING_PHASE : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Event; lit$36$CAPTURING_PHASE]))]}-bind 33 Event.AT_TARGET : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Event; lit$36$AT_TARGET]))]}-bind 34 Event.prototype : {VV : (Event Immutable) | [(? extends_interface([VV;- lit$36$Event]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([Event; lit$36$prototype]))]}-bind 35 Event.BUBBLING_PHASE : {v : int | [(ttag([v]) = lit$36$number);- ((? Prop([v])) <=> (v != 0));- (v ~~ offset([Event; lit$36$BUBBLING_PHASE]))]}-bind 36 document : {VV$35$1027 : (Document Immutable) | [(? extends_interface([VV$35$1027;- lit$36$Document]));- (? Prop([VV$35$1027]));- (ttag([VV$35$1027]) = lit$36$object)]}-bind 37 document.documentElement : {VV : (HTMLElement Immutable) | [(? extends_interface([VV;- lit$36$HTMLElement]));- (? Prop([VV]));- (ttag([VV]) = lit$36$object);- (VV ~~ offset([document;- lit$36$documentElement]))]}-bind 38 window : {VV$35$1031 : (Window Immutable) | [(? extends_interface([VV$35$1031;- lit$36$Window]));- (? Prop([VV$35$1031]));- (ttag([VV$35$1031]) = lit$36$object)]}-bind 39 lq_tmp_nano_1 : {VV : (BitVec Size32) | [(VV = (lit "#x00000008" (BitVec Size32)))]}-bind 40 a_SSA_0 : {VV : (BitVec Size32) | [(VV ~~ lq_tmp_nano_1);- (VV = (lit "#x00000008" (BitVec Size32)))]}-bind 41 lq_tmp_nano_2 : {VV : (BitVec Size32) | [(VV = (lit "#x00000008" (BitVec Size32)))]}-bind 42 b_SSA_1 : {VV : (BitVec Size32) | [(VV ~~ lq_tmp_nano_2);- (VV = (lit "#x00000008" (BitVec Size32)))]}-bind 43 lq_tmp_nano_3 : {v : (BitVec Size32) | [(v = bvor([a_SSA_0;- a_SSA_0]))]}-bind 44 lq_tmp_nano_6 : {v : Boolean | [(ttag([v]) = lit$36$boolean);- ((? Prop([v])) <=> (b_SSA_1 ~~ lq_tmp_nano_3))]}-bind 45 lq_tmp_nano_9 : {VV$35$4 : Void | []}-----constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 42;- 11;- 27;- 43;- 12;- 28;- 44;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV$35$F1 : Boolean | [(ttag([VV$35$F1]) = lit$36$boolean);- (VV$35$F1 ~~ lq_tmp_nano_6);- (ttag([VV$35$F1]) = lit$36$boolean);- ((? Prop([VV$35$F1])) <=> (b_SSA_1 ~~ lq_tmp_nano_3))]}- rhs {VV$35$F1 : Boolean | [(? Prop([VV$35$F1]))]}- id 1 tag [1]- // META constraint id 1 : /Users/rjhala/research/stack/liquid/refscript/tests/pos/simple/hex.ts:7:1-7:22---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 42;- 11;- 27;- 43;- 12;- 28;- 44;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV$35$F2 : Boolean | [(ttag([VV$35$F2]) = lit$36$boolean);- (VV$35$F2 ~~ lq_tmp_nano_6);- (ttag([VV$35$F2]) = lit$36$boolean);- ((? Prop([VV$35$F2])) <=> (b_SSA_1 ~~ lq_tmp_nano_3))]}- rhs {VV$35$F2 : Boolean | [(? Prop([VV$35$F2]))]}- id 2 tag [1]- // META constraint id 2 : /Users/rjhala/research/stack/liquid/refscript/tests/pos/simple/hex.ts:7:1-7:22---------
+ tests/pos/hex00.fq view
@@ -0,0 +1,9 @@+bind 0 a : {a : int | a = 0x8 }+bind 1 b : {b : int | b = 0x7 } ++constraint:+ env [0; 1]+ lhs {v:int | v = a + b}+ rhs {v:int | v = 0xF }+ id 1 tag []+
− tests/pos/listqual.hs.fq
@@ -1,577 +0,0 @@-qualif Append(v : [@(0)], xs : [@(0)], ys : [@(0)]): (len([v]) = (len([xs]) + len([ys]))) // "tests/pos/listqual.hs" (line 3, column 12)-qualif Fst(v : @(1), y : @(0)): (v = fst([y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.spec" (line 29, column 8)-qualif Snd(v : @(1), y : @(0)): (v = snd([y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.spec" (line 30, column 8)-qualif Auto(v : [int]): (len([v]) = 2) // "tests/pos/listqual.hs" (line 10, column 1)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) > 0)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 13, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) = 0)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 14, column 8)-qualif ListZ(v : [@(0)]): (len([v]) = 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 16, column 8)-qualif ListZ(v : [@(0)]): (len([v]) >= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 17, column 8)-qualif ListZ(v : [@(0)]): (len([v]) > 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 18, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) = len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 20, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) >= len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 21, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) > len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 22, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) <= len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 23, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) < len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 24, column 8)-qualif EqLen(v : int, xs : [@(0)]): (v = len([xs])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 26, column 8)-qualif LenEq(v : [@(0)], x : int): (x = len([v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 27, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x + 1)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 28, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x - 1)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 29, column 8)-qualif LenAcc(v : int, xs : [@(0)], n : int): (v = (len([xs]) + n)) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/GHC/Base.hquals" (line 30, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 3, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 4, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 5, column 8)-qualif Bot(v : bool): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 6, column 8)-qualif Bot(v : int): (0 = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 7, column 8)-qualif CmpZ(v : @(0)): (v < 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 9, column 8)-qualif CmpZ(v : @(0)): (v <= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 10, column 8)-qualif CmpZ(v : @(0)): (v > 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 11, column 8)-qualif CmpZ(v : @(0)): (v >= 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 12, column 8)-qualif CmpZ(v : @(0)): (v = 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 13, column 8)-qualif CmpZ(v : @(0)): (v != 0) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 14, column 8)-qualif Cmp(v : @(0), x : @(0)): (v < x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 16, column 8)-qualif Cmp(v : @(0), x : @(0)): (v <= x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 17, column 8)-qualif Cmp(v : @(0), x : @(0)): (v > x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 18, column 8)-qualif Cmp(v : @(0), x : @(0)): (v >= x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 19, column 8)-qualif Cmp(v : @(0), x : @(0)): (v = x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 20, column 8)-qualif Cmp(v : @(0), x : @(0)): (v != x) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 21, column 8)-qualif One(v : int): (v = 1) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 28, column 8)-qualif True(v : bool): (? v) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 29, column 8)-qualif False(v : bool): (~ ((? v))) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 30, column 8)-qualif True1(v : GHC.Types.Bool): (? Prop([v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 31, column 8)-qualif False1(v : GHC.Types.Bool): (~ ((? Prop([v])))) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 32, column 8)-qualif Papp(v : @(0), p : (Pred @(0))): (? papp1([p;- v])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 35, column 8)-qualif Papp2(v : @(1), x : @(0), p : (Pred @(1) @(0))): (? papp2([p;- v;- x])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 38, column 8)-qualif Papp3(v : @(2), x : @(0), y : @(1), p : (Pred @(2) @(0) @(1))): (? papp3([p;- v;- x;- y])) // "/Users/rjhala/research/stack/liquid/liquidhaskell/.stack-work/install/x86_64-osx/nightly-2015-09-24/7.10.2/share/x86_64-osx-ghc-7.10.2/liquidhaskell-0.5.0.2/include/Prelude.hquals" (line 41, column 8)---cut $k__185-cut $k__172-cut $k__178-cut $k__175-cut $k__182-cut $k__162-cut $k__168-cut $k__158-cut $k__165---constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant addrLen : (func(0, [int; int]))-constant xsListSelector : (func(1, [[@(0)]; [@(0)]]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(6));- @(3);- @(4);- @(5);- @(7);- bool]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant autolen : (func(1, [@(0); int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant null : (func(1, [[@(0)]; bool]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant GHC.Types.$91$$93$$35$6m : (func(1, [[@(0)]]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant GHC.Types.$58$$35$64 : (func(1, [@(0); [@(0)]; [@(0)]]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant len : (func(2, [(@(0) @(1)); int]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant xListSelector : (func(1, [[@(0)]; @(0)]))-constant strLen : (func(0, [int; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant Prop : (func(0, [GHC.Types.Bool; bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(1, [(Pred @(0)); @(0); bool]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant GHC.Types.I$35$$35$6c : (func(0, [int; int]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))---bind 0 GHC.Types.$91$$93$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 1 GHC.Types.EQ$35$6U : {VV$35$125 : GHC.Types.Ordering | [(VV$35$125 = GHC.Types.EQ$35$6U)]}-bind 2 GHC.Types.LT$35$6S : {VV$35$126 : GHC.Types.Ordering | [(VV$35$126 = GHC.Types.LT$35$6S)]}-bind 3 GHC.Types.GT$35$6W : {VV$35$127 : GHC.Types.Ordering | [(VV$35$127 = GHC.Types.GT$35$6W)]}-bind 4 GHC.Types.$91$$93$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 5 GHC.Types.GT$35$6W : {VV$35$150 : GHC.Types.Ordering | [(cmp([VV$35$150]) = GHC.Types.GT$35$6W)]}-bind 6 GHC.Types.LT$35$6S : {VV$35$151 : GHC.Types.Ordering | [(cmp([VV$35$151]) = GHC.Types.LT$35$6S)]}-bind 7 GHC.Types.EQ$35$6U : {VV$35$152 : GHC.Types.Ordering | [(cmp([VV$35$152]) = GHC.Types.EQ$35$6U)]}-bind 8 GHC.Base.Nothing$35$r1d : {VV : func(1, [(GHC.Base.Maybe @(0))]) | []}-bind 9 ds_dwT : {VV$35$164 : [a_awA] | [$k__165;- (len([VV$35$164]) >= 0)]}-bind 10 ys$35$awn : {VV$35$174 : [a_awA] | [$k__175[lq_tmp_x_187:=ds_dwT][lq_tmp_x_189:=ds_dwT][ds_dwT:=ds_dwT];- (len([VV$35$174]) >= 0)]}-bind 11 lq_anf__dwU : {lq_tmp_x_195 : [a_awA] | [(lq_tmp_x_195 = ds_dwT);- (len([lq_tmp_x_195]) >= 0)]}-bind 12 lq_anf__dwU : {lq_tmp_x_198 : [a_awA] | [(lq_tmp_x_198 = ds_dwT);- (len([lq_tmp_x_198]) >= 0);- (len([lq_tmp_x_198]) >= 0)]}-bind 13 lq_anf__dwU : {lq_tmp_x_198 : [a_awA] | [(lq_tmp_x_198 = ds_dwT);- (len([lq_tmp_x_198]) >= 0);- (len([lq_tmp_x_198]) = 0);- ((? null([lq_tmp_x_198])) <=> true);- (lq_tmp_x_198 = GHC.Types.$91$$93$$35$6m([]));- (len([lq_tmp_x_198]) = 0);- ((? null([lq_tmp_x_198])) <=> true);- (len([lq_tmp_x_198]) >= 0)]}-bind 14 lq_anf__dwU : {lq_tmp_x_208 : [a_awA] | [(lq_tmp_x_208 = ds_dwT);- (len([lq_tmp_x_208]) >= 0);- (len([lq_tmp_x_208]) >= 0)]}-bind 15 x$35$awo : {VV : a_awA | [$k__158[VV$35$164:=lq_anf__dwU][lq_tmp_x_208:=lq_anf__dwU][lq_tmp_x_195:=lq_anf__dwU][VV$35$157:=VV]]}-bind 16 xs$35$awp : {lq_tmp_x_218 : [a_awA] | [(len([lq_tmp_x_218]) >= 0)]}-bind 17 lq_anf__dwU : {lq_tmp_x_208 : [a_awA] | [(lq_tmp_x_208 = ds_dwT);- (len([lq_tmp_x_208]) >= 0);- (len([lq_tmp_x_208]) = (1 + len([xs$35$awp])));- ((? null([lq_tmp_x_208])) <=> false);- (xsListSelector([lq_tmp_x_208]) = xs$35$awp);- (xListSelector([lq_tmp_x_208]) = x$35$awo);- (lq_tmp_x_208 = GHC.Types.$58$$35$64([x$35$awo;- xs$35$awp]));- (len([lq_tmp_x_208]) = (1 + len([xs$35$awp])));- ((? null([lq_tmp_x_208])) <=> false);- (xsListSelector([lq_tmp_x_208]) = xs$35$awp);- (xListSelector([lq_tmp_x_208]) = x$35$awo);- (len([lq_tmp_x_208]) >= 0)]}-bind 18 lq_anf__dwV : {VV$35$184 : [a_awA] | [$k__185[lq_tmp_x_187:=xs$35$awp][lq_tmp_x_189:=xs$35$awp][ds_dwT:=xs$35$awp][lq_tmp_x_188:=ys$35$awn][ys$35$awn:=ys$35$awn][lq_tmp_x_190:=ys$35$awn];- (len([VV$35$184]) >= 0)]}-bind 19 lq_tmp_x_259 : {VV : a_awA | []}-bind 20 lq_anf__dwW : {lq_tmp_x_264 : int | [(lq_tmp_x_264 = (1 : int))]}-bind 21 lq_tmp_x_278 : {VV$35$279 : int | []}-bind 22 lq_anf__dwX : {lq_tmp_x_270 : [int] | [(len([lq_tmp_x_270]) = 0);- ((? null([lq_tmp_x_270])) <=> true);- (len([lq_tmp_x_270]) >= 0)]}-bind 23 lq_tmp_x_296 : {VV$35$297 : int | []}-bind 24 lq_anf__dwY : {lq_tmp_x_284 : [int] | [(len([lq_tmp_x_284]) = (1 + len([lq_anf__dwX])));- ((? null([lq_tmp_x_284])) <=> false);- (xsListSelector([lq_tmp_x_284]) = lq_anf__dwX);- (xListSelector([lq_tmp_x_284]) = lq_anf__dwW);- (len([lq_tmp_x_284]) >= 0)]}-bind 25 lq_anf__dwZ : {lq_tmp_x_305 : int | [(lq_tmp_x_305 = (2 : int))]}-bind 26 lq_tmp_x_319 : {VV$35$320 : int | []}-bind 27 lq_anf__dx0 : {lq_tmp_x_311 : [int] | [(len([lq_tmp_x_311]) = 0);- ((? null([lq_tmp_x_311])) <=> true);- (len([lq_tmp_x_311]) >= 0)]}-bind 28 lq_tmp_x_337 : {VV$35$338 : int | []}-bind 29 lq_anf__dx1 : {lq_tmp_x_325 : [int] | [(len([lq_tmp_x_325]) = (1 + len([lq_anf__dx0])));- ((? null([lq_tmp_x_325])) <=> false);- (xsListSelector([lq_tmp_x_325]) = lq_anf__dx0);- (xListSelector([lq_tmp_x_325]) = lq_anf__dwZ);- (len([lq_tmp_x_325]) >= 0)]}-bind 30 ListQual.boo$35$rlx : {v : [int] | [(len([v]) = 2);- (len([v]) >= 0)]}-bind 31 VV$35$368 : {VV$35$368 : [int] | [$k__185[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1];- (len([VV$35$368]) >= 0)]}-bind 32 VV$35$368 : {VV$35$368 : [int] | [$k__185[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1];- (len([VV$35$368]) >= 0)]}-bind 33 VV$35$371 : {VV$35$371 : int | [$k__356[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_353:=lq_anf__dwY][VV$35$355:=VV$35$371][lq_tmp_x_350:=VV$35$368][lq_tmp_x_358:=VV$35$371];- $k__178[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$177:=VV$35$371][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][lq_tmp_x_358:=VV$35$371][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1]]}-bind 34 VV$35$371 : {VV$35$371 : int | [$k__356[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_353:=lq_anf__dwY][VV$35$355:=VV$35$371][lq_tmp_x_350:=VV$35$368][lq_tmp_x_358:=VV$35$371];- $k__178[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$177:=VV$35$371][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][lq_tmp_x_358:=VV$35$371][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1]]}-bind 35 fldList : {VV$35$374 : int | []}-bind 36 VV$35$375 : {VV$35$375 : int | [$k__182[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$181:=VV$35$375][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][lq_tmp_x_180:=fldList][lq_tmp_x_349:=fldList][lq_tmp_x_358:=VV$35$375][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1]]}-bind 37 VV$35$375 : {VV$35$375 : int | [$k__182[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$181:=VV$35$375][lq_tmp_x_350:=VV$35$368][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][lq_tmp_x_180:=fldList][lq_tmp_x_349:=fldList][lq_tmp_x_358:=VV$35$375][VV$35$184:=VV$35$368][lq_tmp_x_190:=lq_anf__dx1]]}-bind 38 VV$35$378 : {VV$35$378 : [int] | [(VV$35$378 = lq_anf__dx1);- (len([VV$35$378]) >= 0)]}-bind 39 VV$35$378 : {VV$35$378 : [int] | [(VV$35$378 = lq_anf__dx1);- (len([VV$35$378]) >= 0)]}-bind 40 VV$35$381 : {VV$35$381 : int | [$k__331[lq_tmp_x_329:=lq_anf__dx0][lq_tmp_x_363:=VV$35$381][VV$35$330:=VV$35$381][lq_tmp_x_366:=VV$35$378][lq_tmp_x_328:=lq_anf__dwZ][lq_tmp_x_333:=VV$35$381][lq_tmp_x_325:=VV$35$378]]}-bind 41 VV$35$381 : {VV$35$381 : int | [$k__331[lq_tmp_x_329:=lq_anf__dx0][lq_tmp_x_363:=VV$35$381][VV$35$330:=VV$35$381][lq_tmp_x_366:=VV$35$378][lq_tmp_x_328:=lq_anf__dwZ][lq_tmp_x_333:=VV$35$381][lq_tmp_x_325:=VV$35$378]]}-bind 42 lq_tmp_x_347 : {VV$35$384 : int | []}-bind 43 VV$35$385 : {VV$35$385 : int | [$k__335[lq_tmp_x_365:=VV$35$385][lq_tmp_x_329:=lq_anf__dx0][lq_tmp_x_324:=lq_tmp_x_347][lq_tmp_x_364:=lq_tmp_x_347][lq_tmp_x_366:=VV$35$378][lq_tmp_x_328:=lq_anf__dwZ][lq_tmp_x_333:=VV$35$385][lq_tmp_x_337:=lq_tmp_x_347][lq_tmp_x_325:=VV$35$378][VV$35$334:=VV$35$385]]}-bind 44 VV$35$385 : {VV$35$385 : int | [$k__335[lq_tmp_x_365:=VV$35$385][lq_tmp_x_329:=lq_anf__dx0][lq_tmp_x_324:=lq_tmp_x_347][lq_tmp_x_364:=lq_tmp_x_347][lq_tmp_x_366:=VV$35$378][lq_tmp_x_328:=lq_anf__dwZ][lq_tmp_x_333:=VV$35$385][lq_tmp_x_337:=lq_tmp_x_347][lq_tmp_x_325:=VV$35$378][VV$35$334:=VV$35$385]]}-bind 45 VV$35$388 : {VV$35$388 : [int] | [(VV$35$388 = lq_anf__dwY);- (len([VV$35$388]) >= 0)]}-bind 46 VV$35$388 : {VV$35$388 : [int] | [(VV$35$388 = lq_anf__dwY);- (len([VV$35$388]) >= 0)]}-bind 47 VV$35$391 : {VV$35$391 : int | [$k__290[VV$35$289:=VV$35$391][lq_tmp_x_288:=lq_anf__dwX][lq_tmp_x_292:=VV$35$391][lq_tmp_x_362:=VV$35$388][lq_tmp_x_359:=VV$35$391][lq_tmp_x_284:=VV$35$388][lq_tmp_x_287:=lq_anf__dwW]]}-bind 48 VV$35$391 : {VV$35$391 : int | [$k__290[VV$35$289:=VV$35$391][lq_tmp_x_288:=lq_anf__dwX][lq_tmp_x_292:=VV$35$391][lq_tmp_x_362:=VV$35$388][lq_tmp_x_359:=VV$35$391][lq_tmp_x_284:=VV$35$388][lq_tmp_x_287:=lq_anf__dwW]]}-bind 49 lq_tmp_x_345 : {VV$35$394 : int | []}-bind 50 VV$35$395 : {VV$35$395 : int | [$k__294[lq_tmp_x_361:=VV$35$395][lq_tmp_x_288:=lq_anf__dwX][lq_tmp_x_360:=lq_tmp_x_345][VV$35$293:=VV$35$395][lq_tmp_x_292:=VV$35$395][lq_tmp_x_362:=VV$35$388][lq_tmp_x_296:=lq_tmp_x_345][lq_tmp_x_283:=lq_tmp_x_345][lq_tmp_x_284:=VV$35$388][lq_tmp_x_287:=lq_anf__dwW]]}-bind 51 VV$35$395 : {VV$35$395 : int | [$k__294[lq_tmp_x_361:=VV$35$395][lq_tmp_x_288:=lq_anf__dwX][lq_tmp_x_360:=lq_tmp_x_345][VV$35$293:=VV$35$395][lq_tmp_x_292:=VV$35$395][lq_tmp_x_362:=VV$35$388][lq_tmp_x_296:=lq_tmp_x_345][lq_tmp_x_283:=lq_tmp_x_345][lq_tmp_x_284:=VV$35$388][lq_tmp_x_287:=lq_anf__dwW]]}-bind 52 VV$35$398 : {VV$35$398 : [int] | [(VV$35$398 = lq_anf__dx0);- (len([VV$35$398]) >= 0)]}-bind 53 VV$35$398 : {VV$35$398 : [int] | [(VV$35$398 = lq_anf__dx0);- (len([VV$35$398]) >= 0)]}-bind 54 VV$35$401 : {VV$35$401 : int | [$k__313[lq_tmp_x_340:=VV$35$401][lq_tmp_x_343:=VV$35$398][VV$35$312:=VV$35$401][lq_tmp_x_311:=VV$35$398][lq_tmp_x_315:=VV$35$401]]}-bind 55 VV$35$401 : {VV$35$401 : int | [$k__313[lq_tmp_x_340:=VV$35$401][lq_tmp_x_343:=VV$35$398][VV$35$312:=VV$35$401][lq_tmp_x_311:=VV$35$398][lq_tmp_x_315:=VV$35$401]]}-bind 56 lq_tmp_x_322 : {VV$35$404 : int | []}-bind 57 VV$35$405 : {VV$35$405 : int | [$k__317[lq_tmp_x_342:=VV$35$405][lq_tmp_x_343:=VV$35$398][lq_tmp_x_341:=lq_tmp_x_322][VV$35$316:=VV$35$405][lq_tmp_x_319:=lq_tmp_x_322][lq_tmp_x_311:=VV$35$398][lq_tmp_x_310:=lq_tmp_x_322][lq_tmp_x_315:=VV$35$405]]}-bind 58 VV$35$405 : {VV$35$405 : int | [$k__317[lq_tmp_x_342:=VV$35$405][lq_tmp_x_343:=VV$35$398][lq_tmp_x_341:=lq_tmp_x_322][VV$35$316:=VV$35$405][lq_tmp_x_319:=lq_tmp_x_322][lq_tmp_x_311:=VV$35$398][lq_tmp_x_310:=lq_tmp_x_322][lq_tmp_x_315:=VV$35$405]]}-bind 59 VV$35$408 : {VV$35$408 : int | [(VV$35$408 = lq_anf__dwZ)]}-bind 60 VV$35$408 : {VV$35$408 : int | [(VV$35$408 = lq_anf__dwZ)]}-bind 61 VV$35$411 : {VV$35$411 : int | [(VV$35$411 = 2)]}-bind 62 VV$35$411 : {VV$35$411 : int | [(VV$35$411 = 2)]}-bind 63 VV$35$414 : {VV$35$414 : [int] | [(VV$35$414 = lq_anf__dwX);- (len([VV$35$414]) >= 0)]}-bind 64 VV$35$414 : {VV$35$414 : [int] | [(VV$35$414 = lq_anf__dwX);- (len([VV$35$414]) >= 0)]}-bind 65 VV$35$417 : {VV$35$417 : int | [$k__272[lq_tmp_x_274:=VV$35$417][VV$35$271:=VV$35$417][lq_tmp_x_302:=VV$35$414][lq_tmp_x_299:=VV$35$417][lq_tmp_x_270:=VV$35$414]]}-bind 66 VV$35$417 : {VV$35$417 : int | [$k__272[lq_tmp_x_274:=VV$35$417][VV$35$271:=VV$35$417][lq_tmp_x_302:=VV$35$414][lq_tmp_x_299:=VV$35$417][lq_tmp_x_270:=VV$35$414]]}-bind 67 lq_tmp_x_281 : {VV$35$420 : int | []}-bind 68 VV$35$421 : {VV$35$421 : int | [$k__276[lq_tmp_x_269:=lq_tmp_x_281][VV$35$275:=VV$35$421][lq_tmp_x_274:=VV$35$421][lq_tmp_x_301:=VV$35$421][lq_tmp_x_302:=VV$35$414][lq_tmp_x_300:=lq_tmp_x_281][lq_tmp_x_278:=lq_tmp_x_281][lq_tmp_x_270:=VV$35$414]]}-bind 69 VV$35$421 : {VV$35$421 : int | [$k__276[lq_tmp_x_269:=lq_tmp_x_281][VV$35$275:=VV$35$421][lq_tmp_x_274:=VV$35$421][lq_tmp_x_301:=VV$35$421][lq_tmp_x_302:=VV$35$414][lq_tmp_x_300:=lq_tmp_x_281][lq_tmp_x_278:=lq_tmp_x_281][lq_tmp_x_270:=VV$35$414]]}-bind 70 VV$35$424 : {VV$35$424 : int | [(VV$35$424 = lq_anf__dwW)]}-bind 71 VV$35$424 : {VV$35$424 : int | [(VV$35$424 = lq_anf__dwW)]}-bind 72 VV$35$427 : {VV$35$427 : int | [(VV$35$427 = 1)]}-bind 73 VV$35$427 : {VV$35$427 : int | [(VV$35$427 = 1)]}-bind 74 VV$35$430 : {VV$35$430 : [a_awA] | [(len([VV$35$430]) = (1 + len([lq_anf__dwV])));- ((? null([VV$35$430])) <=> false);- (xsListSelector([VV$35$430]) = lq_anf__dwV);- (xListSelector([VV$35$430]) = x$35$awo);- (len([VV$35$430]) >= 0)]}-bind 75 VV$35$430 : {VV$35$430 : [a_awA] | [(len([VV$35$430]) = (1 + len([lq_anf__dwV])));- ((? null([VV$35$430])) <=> false);- (xsListSelector([VV$35$430]) = lq_anf__dwV);- (xListSelector([VV$35$430]) = x$35$awo);- (len([VV$35$430]) >= 0)]}-bind 76 VV$35$253 : {VV$35$253 : a_awA | [$k__254[lq_tmp_x_252:=lq_anf__dwV][lq_tmp_x_248:=VV$35$430][lq_tmp_x_251:=x$35$awo]]}-bind 77 lq_tmp_x_180 : {VV : a_awA | []}-bind 78 VV$35$253 : {VV$35$253 : a_awA | [$k__257[lq_tmp_x_252:=lq_anf__dwV][VV$35$256:=VV$35$253][lq_tmp_x_248:=VV$35$430][lq_tmp_x_259:=lq_tmp_x_180][lq_tmp_x_247:=lq_tmp_x_180][lq_tmp_x_251:=x$35$awo]]}-bind 79 VV$35$436 : {VV$35$436 : [a_awA] | [(VV$35$436 = lq_anf__dwV);- (len([VV$35$436]) >= 0)]}-bind 80 VV$35$436 : {VV$35$436 : [a_awA] | [(VV$35$436 = lq_anf__dwV);- (len([VV$35$436]) >= 0)]}-bind 81 VV$35$237 : {VV$35$237 : a_awA | [$k__238[lq_tmp_x_262:=VV$35$436][lq_tmp_x_189:=xs$35$awp][VV$35$184:=VV$35$436][lq_tmp_x_190:=ys$35$awn];- $k__178[lq_tmp_x_262:=VV$35$436][lq_tmp_x_187:=xs$35$awp][lq_tmp_x_189:=xs$35$awp][ds_dwT:=xs$35$awp][VV$35$177:=VV$35$237][lq_tmp_x_188:=ys$35$awn][ys$35$awn:=ys$35$awn][VV$35$184:=VV$35$436][lq_tmp_x_190:=ys$35$awn]]}-bind 82 lq_tmp_x_245 : {VV : a_awA | []}-bind 83 VV$35$237 : {VV$35$237 : a_awA | [$k__182[lq_tmp_x_262:=VV$35$436][lq_tmp_x_187:=xs$35$awp][lq_tmp_x_189:=xs$35$awp][ds_dwT:=xs$35$awp][VV$35$181:=VV$35$237][lq_tmp_x_261:=lq_tmp_x_245][lq_tmp_x_188:=ys$35$awn][ys$35$awn:=ys$35$awn][lq_tmp_x_180:=lq_tmp_x_245][VV$35$184:=VV$35$436][lq_tmp_x_190:=ys$35$awn]]}-bind 84 VV : {VV : a_awA | [(VV = x$35$awo)]}-bind 85 VV$35$443 : {VV$35$443 : [a_awA] | [(VV$35$443 = ys$35$awn);- (len([VV$35$443]) >= 0)]}-bind 86 VV$35$443 : {VV$35$443 : [a_awA] | [(VV$35$443 = ys$35$awn);- (len([VV$35$443]) >= 0)]}-bind 87 VV : {VV : a_awA | [$k__168[lq_tmp_x_187:=ds_dwT][VV$35$167:=VV][lq_tmp_x_189:=ds_dwT][ds_dwT:=ds_dwT][lq_tmp_x_243:=VV$35$443][VV$35$174:=VV$35$443]]}-bind 88 lq_tmp_x_170 : {VV : a_awA | []}-bind 89 VV : {VV : a_awA | [$k__172[lq_tmp_x_187:=ds_dwT][lq_tmp_x_189:=ds_dwT][lq_tmp_x_242:=lq_tmp_x_170][ds_dwT:=ds_dwT][lq_tmp_x_243:=VV$35$443][lq_tmp_x_170:=lq_tmp_x_170][VV$35$174:=VV$35$443][VV$35$171:=VV]]}-bind 90 VV$35$449 : {VV$35$449 : [a_awA] | [(VV$35$449 = xs$35$awp);- (len([VV$35$449]) >= 0)]}-bind 91 VV$35$449 : {VV$35$449 : [a_awA] | [(VV$35$449 = xs$35$awp);- (len([VV$35$449]) >= 0)]}-bind 92 VV : {VV : a_awA | [$k__158[lq_tmp_x_215:=x$35$awo][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_208:=lq_anf__dwU][lq_tmp_x_241:=VV$35$449][lq_tmp_x_195:=lq_anf__dwU][VV$35$157:=VV];- $k__162[lq_tmp_x_215:=x$35$awo][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_207:=x$35$awo][lq_tmp_x_208:=lq_anf__dwU][VV$35$161:=VV][lq_tmp_x_160:=x$35$awo][lq_tmp_x_241:=VV$35$449][lq_tmp_x_195:=lq_anf__dwU][lq_tmp_x_194:=x$35$awo]]}-bind 93 lq_tmp_x_160 : {VV : a_awA | []}-bind 94 VV : {VV : a_awA | [$k__162[lq_tmp_x_215:=x$35$awo][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_207:=lq_tmp_x_160][lq_tmp_x_208:=lq_anf__dwU][VV$35$161:=VV][lq_tmp_x_160:=lq_tmp_x_160][lq_tmp_x_241:=VV$35$449][lq_tmp_x_217:=lq_tmp_x_160][lq_tmp_x_195:=lq_anf__dwU][lq_tmp_x_240:=lq_tmp_x_160][lq_tmp_x_194:=lq_tmp_x_160]]}-bind 95 VV$35$455 : {VV$35$455 : [a_awA] | [(VV$35$455 = ys$35$awn);- (len([VV$35$455]) >= 0)]}-bind 96 VV$35$455 : {VV$35$455 : [a_awA] | [(VV$35$455 = ys$35$awn);- (len([VV$35$455]) >= 0)]}-bind 97 VV : {VV : a_awA | [$k__168[lq_tmp_x_187:=ds_dwT][VV$35$167:=VV][lq_tmp_x_189:=ds_dwT][lq_tmp_x_206:=VV$35$455][ds_dwT:=ds_dwT][VV$35$174:=VV$35$455]]}-bind 98 lq_tmp_x_180 : {VV : a_awA | []}-bind 99 VV : {VV : a_awA | [$k__172[lq_tmp_x_187:=ds_dwT][lq_tmp_x_189:=ds_dwT][lq_tmp_x_206:=VV$35$455][ds_dwT:=ds_dwT][lq_tmp_x_205:=lq_tmp_x_180][lq_tmp_x_170:=lq_tmp_x_180][VV$35$174:=VV$35$455][VV$35$171:=VV]]}-bind 100 VV$35$355 : {VV$35$355 : int | [$k__356]}-bind 101 VV$35$334 : {VV$35$334 : int | [$k__335]}-bind 102 VV$35$330 : {VV$35$330 : int | [$k__331]}-bind 103 VV$35$316 : {VV$35$316 : int | [$k__317]}-bind 104 VV$35$312 : {VV$35$312 : int | [$k__313]}-bind 105 VV$35$293 : {VV$35$293 : int | [$k__294]}-bind 106 VV$35$289 : {VV$35$289 : int | [$k__290]}-bind 107 VV$35$275 : {VV$35$275 : int | [$k__276]}-bind 108 VV$35$271 : {VV$35$271 : int | [$k__272]}-bind 109 VV$35$164 : {VV$35$164 : [a_awA] | [$k__165;- (len([VV$35$164]) >= 0)]}-bind 110 lq_tmp_x_160 : {VV : a_awA | []}-bind 111 ds_dwT : {VV$35$164 : [a_awA] | [$k__165;- (len([VV$35$164]) >= 0)]}-bind 112 VV$35$174 : {VV$35$174 : [a_awA] | [$k__175;- (len([VV$35$174]) >= 0)]}-bind 113 lq_tmp_x_170 : {VV : a_awA | []}-bind 114 ys$35$awn : {VV$35$174 : [a_awA] | [$k__175;- (len([VV$35$174]) >= 0)]}-bind 115 VV$35$184 : {VV$35$184 : [a_awA] | [$k__185;- (len([VV$35$184]) >= 0)]}-bind 116 lq_tmp_x_180 : {VV : a_awA | []}-----constraint:- env [0; 64; 1; 2; 3; 67; 4; 20; 68; 5; 6; 22; 7; 8]- lhs {VV$35$F16 : int | [$k__276[VV$35$421:=VV$35$F16][lq_tmp_x_269:=lq_tmp_x_281][VV$35$275:=VV$35$F16][lq_tmp_x_274:=VV$35$F16][lq_tmp_x_301:=VV$35$F16][VV$35$F:=VV$35$F16][lq_tmp_x_302:=VV$35$414][lq_tmp_x_300:=lq_tmp_x_281][lq_tmp_x_278:=lq_tmp_x_281][lq_tmp_x_270:=VV$35$414]]}- rhs {VV$35$F16 : int | [$k__294[VV$35$421:=VV$35$F16][lq_tmp_x_282:=VV$35$414][VV$35$F:=VV$35$F16][VV$35$293:=VV$35$F16][lq_tmp_x_292:=VV$35$F16][lq_tmp_x_296:=lq_tmp_x_281][lq_tmp_x_287:=lq_anf__dwW]]}- id 16 tag [2]- // META constraint id 16 : tests/pos/listqual.hs:10:1-3---constraint:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 7; 8; 24; 25; 27; 29; 31]- lhs {VV$35$F1 : [int] | [$k__185[lq_tmp_x_354:=lq_anf__dx1][lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$F:=VV$35$F1][lq_tmp_x_350:=VV$35$F1][VV$35$368:=VV$35$F1][lq_tmp_x_188:=lq_anf__dx1][ys$35$awn:=lq_anf__dx1][VV$35$184:=VV$35$F1][lq_tmp_x_190:=lq_anf__dx1];- (len([VV$35$F1]) >= 0)]}- rhs {VV$35$F1 : [int] | [(len([VV$35$F1]) = 2)]}- id 1 tag [2]- // META constraint id 1 : tests/pos/listqual.hs:10:1-20---constraint:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 70; 7; 8]- lhs {VV$35$F17 : int | [(VV$35$F17 = lq_anf__dwW)]}- rhs {VV$35$F17 : int | [$k__290[VV$35$424:=VV$35$F17][VV$35$289:=VV$35$F17][VV$35$F:=VV$35$F17][lq_tmp_x_292:=VV$35$F17]]}- id 17 tag [2]- // META constraint id 17 : tests/pos/listqual.hs:10:15---constraint:- env [0; 16; 1; 17; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 91; 92; 14; 15]- lhs {VV$35$F33 : a_awA | [$k__158[lq_tmp_x_215:=x$35$awo][VV:=VV$35$F33][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_208:=lq_anf__dwU][lq_tmp_x_241:=VV$35$449][VV$35$F:=VV$35$F33][lq_tmp_x_195:=lq_anf__dwU][VV$35$157:=VV$35$F33];- $k__162[lq_tmp_x_215:=x$35$awo][VV:=VV$35$F33][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_207:=x$35$awo][lq_tmp_x_208:=lq_anf__dwU][VV$35$161:=VV$35$F33][lq_tmp_x_160:=x$35$awo][lq_tmp_x_241:=VV$35$449][VV$35$F:=VV$35$F33][lq_tmp_x_195:=lq_anf__dwU][lq_tmp_x_194:=x$35$awo]]}- rhs {VV$35$F33 : a_awA | [$k__158[VV$35$164:=VV$35$449][VV$35$F:=VV$35$F33][VV$35$237:=VV$35$F33][VV$35$157:=VV$35$F33]]}- id 33 tag [1]- // META constraint id 33 : tests/pos/listqual.hs:6:31-32---constraint:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 38; 7; 8; 24; 25; 27; 29]- lhs {VV$35$F2 : [int] | [(VV$35$F2 = lq_anf__dx1);- (len([VV$35$F2]) >= 0)]}- rhs {VV$35$F2 : [int] | [$k__175[lq_tmp_x_187:=lq_anf__dwY][lq_tmp_x_189:=lq_anf__dwY][lq_tmp_x_353:=lq_anf__dwY][ds_dwT:=lq_anf__dwY][VV$35$F:=VV$35$F2][lq_tmp_x_348:=VV$35$F2][VV$35$174:=VV$35$F2][VV$35$378:=VV$35$F2]]}- id 2 tag [2]- // META constraint id 2 : tests/pos/listqual.hs:10:18-20---constraint:- env [0; 16; 1; 17; 2; 18; 3; 4; 5; 6; 7; 8; 9; 10; 74; 11; 14; 15]- lhs {VV$35$F18 : [a_awA] | [(len([VV$35$F18]) = (1 + len([lq_anf__dwV])));- ((? null([VV$35$F18])) <=> false);- (xsListSelector([VV$35$F18]) = lq_anf__dwV);- (xListSelector([VV$35$F18]) = x$35$awo);- (len([VV$35$F18]) >= 0)]}- rhs {VV$35$F18 : [a_awA] | [$k__185[lq_tmp_x_187:=ds_dwT][lq_tmp_x_189:=ds_dwT][VV$35$430:=VV$35$F18][ds_dwT:=ds_dwT][VV$35$F:=VV$35$F18][lq_tmp_x_188:=ys$35$awn][ys$35$awn:=ys$35$awn][VV$35$184:=VV$35$F18][lq_tmp_x_190:=ys$35$awn]]}- id 18 tag [1]- // META constraint id 18 : tests/pos/listqual.hs:6:20-35---constraint:- env [0;- 16;- 1;- 17;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 93;- 14;- 94;- 15]- lhs {VV$35$F34 : a_awA | [$k__162[lq_tmp_x_215:=x$35$awo][VV:=VV$35$F34][lq_tmp_x_218:=VV$35$449][VV$35$164:=lq_anf__dwU][lq_tmp_x_207:=lq_tmp_x_160][lq_tmp_x_208:=lq_anf__dwU][VV$35$161:=VV$35$F34][lq_tmp_x_160:=lq_tmp_x_160][lq_tmp_x_241:=VV$35$449][VV$35$F:=VV$35$F34][lq_tmp_x_217:=lq_tmp_x_160][lq_tmp_x_195:=lq_anf__dwU][lq_tmp_x_240:=lq_tmp_x_160][lq_tmp_x_194:=lq_tmp_x_160]]}- rhs {VV$35$F34 : a_awA | [$k__162[VV$35$164:=VV$35$449][VV$35$161:=VV$35$F34][VV$35$F:=VV$35$F34][VV$35$237:=VV$35$F34]]}- id 34 tag [1]- // META constraint id 34 : tests/pos/listqual.hs:6:31-32---constraint:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 95]- lhs {VV$35$F35 : [a_awA] | [(VV$35$F35 = ys$35$awn);- (len([VV$35$F35]) >= 0)]}- rhs {VV$35$F35 : [a_awA] | [$k__185[lq_tmp_x_187:=ds_dwT][lq_tmp_x_189:=ds_dwT][ds_dwT:=ds_dwT][VV$35$F:=VV$35$F35][VV$35$455:=VV$35$F35][lq_tmp_x_188:=ys$35$awn][ys$35$awn:=ys$35$awn][VV$35$184:=VV$35$F35][lq_tmp_x_190:=ys$35$awn]]}- id 35 tag [1]- // META constraint id 35 : tests/pos/listqual.hs:5:20-21---constraint:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 7; 8; 24; 25; 27; 29; 45]- lhs {VV$35$F6 : [int] | [(VV$35$F6 = lq_anf__dwY);- (len([VV$35$F6]) >= 0)]}- rhs {VV$35$F6 : [int] | [$k__165[VV$35$164:=VV$35$F6][VV$35$F:=VV$35$F6][lq_tmp_x_346:=VV$35$F6][VV$35$388:=VV$35$F6]]}- id 6 tag [2]- // META constraint id 6 : tests/pos/listqual.hs:10:14-16---constraint:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 7; 8; 24; 25; 27; 29; 46; 47]- lhs {VV$35$F8 : int | [$k__290[VV$35$289:=VV$35$F8][lq_tmp_x_288:=lq_anf__dwX][VV$35$F:=VV$35$F8][lq_tmp_x_292:=VV$35$F8][lq_tmp_x_362:=VV$35$388][lq_tmp_x_359:=VV$35$F8][lq_tmp_x_284:=VV$35$388][VV$35$391:=VV$35$F8][lq_tmp_x_287:=lq_anf__dwW]]}- rhs {VV$35$F8 : int | [$k__158[VV$35$164:=VV$35$388][VV$35$F:=VV$35$F8][lq_tmp_x_346:=VV$35$388][VV$35$157:=VV$35$F8][lq_tmp_x_358:=VV$35$F8][VV$35$391:=VV$35$F8]]}- id 8 tag [2]- // META constraint id 8 : tests/pos/listqual.hs:10:14-16---constraint:- env [0; 1; 49; 2; 50; 3; 4; 20; 5; 6; 22; 7; 8; 24; 25; 27; 29; 46]- lhs {VV$35$F9 : int | [$k__294[lq_tmp_x_361:=VV$35$F9][lq_tmp_x_288:=lq_anf__dwX][VV$35$F:=VV$35$F9][lq_tmp_x_360:=lq_tmp_x_345][VV$35$293:=VV$35$F9][lq_tmp_x_292:=VV$35$F9][VV$35$395:=VV$35$F9][lq_tmp_x_362:=VV$35$388][lq_tmp_x_296:=lq_tmp_x_345][lq_tmp_x_283:=lq_tmp_x_345][lq_tmp_x_284:=VV$35$388][lq_tmp_x_287:=lq_anf__dwW]]}- rhs {VV$35$F9 : int | [$k__162[VV$35$164:=VV$35$388][VV$35$161:=VV$35$F9][lq_tmp_x_160:=lq_tmp_x_345][VV$35$F:=VV$35$F9][lq_tmp_x_346:=VV$35$388][VV$35$395:=VV$35$F9][lq_tmp_x_358:=VV$35$F9]]}- id 9 tag [2]- // META constraint id 9 : tests/pos/listqual.hs:10:14-16---constraint:- env [0; 16; 1; 17; 2; 3; 4; 5; 85; 6; 7; 8; 9; 10; 11; 14; 15]- lhs {VV$35$F25 : [a_awA] | [(VV$35$F25 = ys$35$awn);- (len([VV$35$F25]) >= 0)]}- rhs {VV$35$F25 : [a_awA] | [$k__175[lq_tmp_x_187:=xs$35$awp][lq_tmp_x_189:=xs$35$awp][ds_dwT:=xs$35$awp][VV$35$F:=VV$35$F25][VV$35$174:=VV$35$F25][VV$35$443:=VV$35$F25]]}- id 25 tag [1]- // META constraint id 25 : tests/pos/listqual.hs:6:34-35---constraint:- env [0; 16; 1; 17; 2; 3; 4; 5; 6; 7; 8; 9; 10; 90; 11; 14; 15]- lhs {VV$35$F29 : [a_awA] | [(VV$35$F29 = xs$35$awp);- (len([VV$35$F29]) >= 0)]}- rhs {VV$35$F29 : [a_awA] | [$k__165[VV$35$164:=VV$35$F29][VV$35$F:=VV$35$F29][VV$35$449:=VV$35$F29]]}- id 29 tag [1]- // META constraint id 29 : tests/pos/listqual.hs:6:31-32---constraint:- env [0; 64; 1; 65; 2; 3; 4; 20; 5; 6; 22; 7; 8]- lhs {VV$35$F14 : int | [$k__272[lq_tmp_x_274:=VV$35$F14][VV$35$271:=VV$35$F14][VV$35$F:=VV$35$F14][lq_tmp_x_302:=VV$35$414][VV$35$417:=VV$35$F14][lq_tmp_x_299:=VV$35$F14][lq_tmp_x_270:=VV$35$414]]}- rhs {VV$35$F14 : int | [$k__290[lq_tmp_x_282:=VV$35$414][VV$35$289:=VV$35$F14][VV$35$F:=VV$35$F14][VV$35$417:=VV$35$F14][lq_tmp_x_292:=VV$35$F14][lq_tmp_x_287:=lq_anf__dwW]]}- id 14 tag [2]- // META constraint id 14 : tests/pos/listqual.hs:10:1-3---constraint:- env [0; 16; 1; 17; 2; 3; 4; 5; 6; 7; 8; 9; 10; 90; 11; 14; 15]- lhs {VV$35$F30 : [a_awA] | [(VV$35$F30 = xs$35$awp);- (len([VV$35$F30]) >= 0)]}- rhs {VV$35$F30 : [a_awA] | [(len([VV$35$F30]) < len([ds_dwT]))]}- id 30 tag [1]- // META constraint id 30 : tests/pos/listqual.hs:6:31-32---constraint:- env [0; 64; 1; 65; 2; 3; 4; 20; 5; 6; 22; 7; 8]- lhs {VV$35$F15 : int | [$k__272[lq_tmp_x_274:=VV$35$F15][VV$35$271:=VV$35$F15][VV$35$F:=VV$35$F15][lq_tmp_x_302:=VV$35$414][VV$35$417:=VV$35$F15][lq_tmp_x_299:=VV$35$F15][lq_tmp_x_270:=VV$35$414]]}- rhs {VV$35$F15 : int | [$k__294[lq_tmp_x_282:=VV$35$414][VV$35$F:=VV$35$F15][VV$35$417:=VV$35$F15][VV$35$293:=VV$35$F15][lq_tmp_x_292:=VV$35$F15][lq_tmp_x_296:=lq_anf__dwW][lq_tmp_x_287:=lq_anf__dwW]]}- id 15 tag [2]- // META constraint id 15 : tests/pos/listqual.hs:10:1-3---constraint:- env [0; 16; 1; 17; 2; 3; 4; 5; 6; 7; 8; 9; 10; 90; 11; 14; 15]- lhs {VV$35$F31 : [a_awA] | [(VV$35$F31 = xs$35$awp);- (len([VV$35$F31]) >= 0)]}- rhs {VV$35$F31 : [a_awA] | [(len([VV$35$F31]) >= 0)]}- id 31 tag [1]- // META constraint id 31 : tests/pos/listqual.hs:6:31-32-----wf:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 7; 23; 8]- reft {VV$35$293 : int | [$k__294]}- - // META wf : tests/pos/listqual.hs:10:1-3---wf:- env [0; 1; 2; 3; 4; 20; 5; 6; 22; 7; 8]- reft {VV$35$289 : int | [$k__290]}- - // META wf : tests/pos/listqual.hs:10:1-3---wf:- env [0; 1; 2; 3; 4; 20; 5; 21; 6; 7; 8]- reft {VV$35$275 : int | [$k__276]}- - // META wf : tests/pos/listqual.hs:10:1-3---wf:- env [0; 1; 2; 3; 4; 20; 5; 6; 7; 8]- reft {VV$35$271 : int | [$k__272]}- - // META wf : tests/pos/listqual.hs:10:1-3---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8]- reft {VV$35$164 : [a_awA] | [$k__165]}- - // META wf : <no location info>---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 109]- reft {VV$35$157 : a_awA | [$k__158]}- - // META wf : <no location info>---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 110]- reft {VV$35$161 : a_awA | [$k__162]}- - // META wf : <no location info>---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 111]- reft {VV$35$174 : [a_awA] | [$k__175]}- - // META wf : <no location info>---wf:- env [0; 1; 2; 114; 3; 4; 5; 6; 7; 8; 111]- reft {VV$35$184 : [a_awA] | [$k__185]}- - // META wf : <no location info>-------
+ tests/pos/lit00.fq view
@@ -0,0 +1,18 @@+// Config {srcFile = "/Users/rjhala/research/stack/liquidhaskell/tests/pos/lit00.hs", cores = Nothing, minPartSize = 500, maxPartSize = 700, solver = z3, linear = False, stringTheory = False, defunction = False, allowHO = False, allowHOqs = False, eliminate = some, elimBound = Nothing, elimStats = False, solverStats = False, metadata = False, stats = False, parts = False, save = True, minimize = False, minimizeQs = False, minimizeKs = False, minimalSol = False, gradual = False, ginteractive = False, extensionality = False, alphaEquivalence = False, betaEquivalence = False, normalForm = False, autoKuts = False, nonLinCuts = True, noslice = False, rewriteAxioms = True, arithmeticAxioms = False}++constant Zero : (Peano) +constant One : (Peano) ++distinct Zero : (Peano) +distinct One : (Peano) +++bind 0 xZero : {v : Peano | v = Zero } +bind 1 xOne : {v : Peano | v = One } ++constraint:+ env [0; 1]+ lhs {v:int | true} + rhs {v:int | xZero /= xOne } + id 1 tag []+
+ tests/pos/poly_inst.fq view
@@ -0,0 +1,11 @@++constant mkEmp : func(1, [int; @(0)])++bind 0 junk : {v:bool | v = mkEmp 0 }+bind 1 punk : {v:int | v = mkEmp 0 }++constraint:+ env [0; 1]+ lhs {v:int | v = mkEmp 10 }+ rhs {v:int | v = mkEmp 10 }+ id 0 tag []
+ tests/pos/real00.fq view
@@ -0,0 +1,9 @@+bind 0 xZero : {v : real | v = 0.0 } +bind 1 xOne : {v : real | v = 1.0 } ++constraint:+ env [0; 1]+ lhs {v:int | true} + rhs {v:int | xZero /= xOne } + id 1 tag []+
− tests/pos/test00.hs.fq
@@ -1,1021 +0,0 @@--qualif IsEmp(v:GHC.Types.Bool, xs: [a]) : (Prop(v) <=> len([xs]) > 0)-qualif IsEmp(v:GHC.Types.Bool, xs: [a]) : (Prop(v) <=> len([xs]) = 0)-qualif ListZ(v: [a]) : len([v]) = 0 -qualif ListZ(v: [a]) : len([v]) >= 0 -qualif ListZ(v: [a]) : len([v]) > 0 -qualif CmpLen(v:[a], xs:[b]) : len([v]) = len([xs]) -qualif CmpLen(v:[a], xs:[b]) : len([v]) >= len([xs]) -qualif CmpLen(v:[a], xs:[b]) : len([v]) > len([xs]) -qualif CmpLen(v:[a], xs:[b]) : len([v]) <= len([xs]) -qualif CmpLen(v:[a], xs:[b]) : len([v]) < len([xs]) -qualif EqLen(v:int, xs: [a]): v = len([xs]) -qualif LenEq(v:[a], x: int) : x = len([v]) -qualif LenDiff(v:[a], x:int): len([v]) = x + 1-qualif LenDiff(v:[a], x:int): len([v]) = x - 1-qualif LenAcc(v:int, xs:[a], n: int): (v = len([xs]) + n)--qualif Bot(v:obj): 0 = 1 -qualif Bot(v:a): 0 = 1 -qualif Bot(v:bool): 0 = 1 -qualif Bot(v:int): 0 = 1 -qualif CmpZ(v:a): (v < 0)-qualif CmpZ(v:a): (v <= 0)-qualif CmpZ(v:a): (v > 0)-qualif CmpZ(v:a): (v >= 0)-qualif CmpZ(v:a): (v = 0)-qualif CmpZ(v:a): (v != 0)--qualif Cmp(v:a, x:a): (v < x)-qualif Cmp(v:a, x:a): (v <= x)-qualif Cmp(v:a, x:a): (v > x)-qualif Cmp(v:a, x:a): (v >= x)-qualif Cmp(v:a, x:a): (v = x)-qualif Cmp(v:a, x:a): (v != x)--qualif One(v:int) : v = 1-qualif True(v:bool) : (? v) -qualif False(v:bool) : ~ (? v) -qualif True1(v:GHC.Types.Bool): (Prop(v))-qualif False1(v:GHC.Types.Bool): (~ Prop(v))-qualif Papp(v:a, p:Pred a) : (papp1(p, v))--constant papp1 : func(1, [Pred @(0); @(0); bool])--qualif Papp2(v:a,x:b,p:Pred a b) : papp2(p, v, x)-constant papp2 : func(4, [Pred @(0) @(1); @(2); @(3); bool])--qualif Papp3(v:a,x:b, y:c, p:Pred a b c) : papp3(p, v, x, y)-constant papp3 : func(6, [Pred @(0) @(1) @(2); @(3); @(4); @(5); bool])--qualif Papp4(v:a,x:b, y:c, z:d, p:Pred a b c d) : papp4(p, v, x, y, z)-constant papp4 : func(8, [Pred @(0) @(1) @(2) @(6); @(3); @(4); @(5); @(7); bool])----constant Prop : func(0, [GHC.Types.Bool; bool])-qualif Fst(v : @(1), fix##126#Y : @(0)): (v = fst([fix##126#Y])) // "/Users/rjhala/research/liquid/liquidhaskell/.cabal-sandbox/share/x86_64-osx-ghc-7.8.3/liquidhaskell-0.3.1.0/include/GHC/Base.spec" (line 26, column 8)-qualif Snd(v : @(1), fix##126#Y : @(0)): (v = snd([fix##126#Y])) // "/Users/rjhala/research/liquid/liquidhaskell/.cabal-sandbox/share/x86_64-osx-ghc-7.8.3/liquidhaskell-0.3.1.0/include/GHC/Base.spec" (line 27, column 8)--constant Prop : func(0, [GHC.Types.Bool; bool])-constant x_Tuple54 : func(5, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4);- @(3)])-constant x_Tuple44 : func(4, [FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3);- @(3)])-constant xListSelector : func(1, [[@(0)]; @(0)])-constant x_Tuple41 : func(4, [FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3);- @(0)])-constant x_Tuple76 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(5)])-constant addrLen : func(0, [int; int])-constant x_Tuple65 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(4)])-constant x_Tuple52 : func(5, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4);- @(1)])-constant GHC.Types.False#68 : (GHC.Types.Bool)-constant x_Tuple64 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(3)])-constant x_Tuple33 : func(3, [FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2);- @(2)])-constant fst : func(2, [FAppTy (FAppTy fix##40##41# @(0)) @(1);- @(0)])-constant x_Tuple31 : func(3, [FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2);- @(0)])-constant x_Tuple43 : func(4, [FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3);- @(2)])-constant x_Tuple71 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(0)])-constant x_Tuple32 : func(3, [FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2);- @(1)])-constant x_Tuple72 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(1)])-constant x_Tuple63 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(2)])-constant x_Tuple75 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(4)])-constant x_Tuple51 : func(5, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4);- @(0)])-constant len : func(1, [[@(0)]; int])-constant xsListSelector : func(1, [[@(0)]; [@(0)]])-constant null : func(1, [[@(0)]; bool])-constant x_Tuple53 : func(5, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4);- @(2)])-constant x_Tuple22 : func(2, [FAppTy (FAppTy fix##40##41# @(0)) @(1);- @(1)])-constant fromJust : func(1, [FAppTy Data.Maybe.Maybe @(0); @(0)])-constant snd : func(2, [FAppTy (FAppTy fix##40##41# @(0)) @(1);- @(1)])-constant x_Tuple73 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(2)])-constant x_Tuple62 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(1)])-constant x_Tuple55 : func(5, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4);- @(4)])-constant x_Tuple74 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(3)])-constant cmp : func(0, [GHC.Types.Ordering; GHC.Types.Ordering])-constant x_Tuple42 : func(4, [FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3);- @(1)])-constant x_Tuple21 : func(2, [FAppTy (FAppTy fix##40##41# @(0)) @(1);- @(0)])-constant x_Tuple61 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(0)])-constant isJust : func(1, [FAppTy Data.Maybe.Maybe @(0); bool])-constant x_Tuple66 : func(6, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5);- @(5)])-constant GHC.Types.True#6u : (GHC.Types.Bool)-constant x_Tuple77 : func(7, [FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy (FAppTy fix##40##41# @(0)) @(1)) @(2)) @(3)) @(4)) @(5)) @(6);- @(6)])-bind 0 GHC.Types.False#68 : {VV#171 : GHC.Types.Bool | []}-bind 1 GHC.Types.I##6c : {VV : func(0, [int; int]) | []}-bind 2 GHC.Types.True#6u : {VV#173 : GHC.Types.Bool | []}-bind 3 fix#GHC.Classes.#36#fOrdInt#35#rhx : {VV#175 : FAppTy GHC.Classes.Ord int | []}-bind 4 fix#GHC.Num.#36#fNumInt#35#rhy : {VV#176 : FAppTy GHC.Num.Num int | []}-bind 5 Language.Haskell.Liquid.Prelude.liquidAssertB#rpD : {VV : func(0, [GHC.Types.Bool;- GHC.Types.Bool]) | []}-bind 6 Language.Haskell.Liquid.Prelude.choose#rpK : {VV : func(0, [int;- int]) | []}-bind 7 GHC.Types.EQ#6U : {VV#179 : GHC.Types.Ordering | []}-bind 8 GHC.Types.LT#6S : {VV#180 : GHC.Types.Ordering | []}-bind 9 GHC.Types.GT#6W : {VV#181 : GHC.Types.Ordering | []}-bind 10 GHC.Types.True#6u : {v : GHC.Types.Bool | [(? Prop([v]))]}-bind 11 GHC.Types.False#68 : {v : GHC.Types.Bool | [(~ ((? Prop([v]))))]}-bind 12 Language.Haskell.Liquid.Prelude.plus#rou : {VV : func(0, [int;- int;- int]) | []}-bind 13 Language.Haskell.Liquid.Prelude.minus#rpv : {VV : func(0, [int;- int;- int]) | []}-bind 14 Language.Haskell.Liquid.Prelude.times#rpw : {VV : func(0, [int;- int;- int]) | []}-bind 15 Language.Haskell.Liquid.Prelude.eq#rpx : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 16 Language.Haskell.Liquid.Prelude.neq#rpy : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 17 Language.Haskell.Liquid.Prelude.leq#rpz : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 18 Language.Haskell.Liquid.Prelude.geq#rpA : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 19 Language.Haskell.Liquid.Prelude.lt#rpB : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 20 Language.Haskell.Liquid.Prelude.gt#rpC : {VV : func(0, [int;- int;- GHC.Types.Bool]) | []}-bind 21 Language.Haskell.Liquid.Prelude.liquidAssertB#rpD : {VV : func(0, [GHC.Types.Bool;- GHC.Types.Bool]) | []}-bind 22 Language.Haskell.Liquid.Prelude.isEven#rpL : {VV : func(0, [int;- GHC.Types.Bool]) | []}-bind 23 Language.Haskell.Liquid.Prelude.isOdd#rpM : {VV : func(0, [int;- GHC.Types.Bool]) | []}-bind 24 GHC.Integer.Type.smallInteger#0Z : {VV : func(0, [int;- int]) | []}-bind 25 GHC.Types.I##6c : {VV : func(0, [int; int]) | []}-bind 26 fix#GHC.Prim.#43##35##35#98 : {VV : func(0, [int;- int;- int]) | []}-bind 27 fix#GHC.Prim.#45##35##35#99 : {VV : func(0, [int;- int;- int]) | []}-bind 28 fix#GHC.Prim.#61##61##35##35#9o : {VV : func(0, [int;- int;- int]) | []}-bind 29 fix#GHC.Prim.#62##61##35##35#9n : {VV : func(0, [int;- int;- int]) | []}-bind 30 fix#GHC.Prim.#60##61##35##35#9r : {VV : func(0, [int;- int;- int]) | []}-bind 31 fix#GHC.Prim.#60##35##35#9q : {VV : func(0, [int;- int;- int]) | []}-bind 32 fix#GHC.Prim.#62##35##35#9m : {VV : func(0, [int;- int;- int]) | []}-bind 33 GHC.Types.EQ#6U : {VV#220 : GHC.Types.Ordering | [(cmp([VV#220]) = GHC.Types.EQ#6U)]}-bind 34 GHC.Types.LT#6S : {VV#222 : GHC.Types.Ordering | [(cmp([VV#222]) = GHC.Types.LT#6S)]}-bind 35 GHC.Types.GT#6W : {VV#223 : GHC.Types.Ordering | [(cmp([VV#223]) = GHC.Types.GT#6W)]}-bind 36 fix##36#dOrd_a165 : {VV#232 : FAppTy GHC.Classes.Ord a_a164 | []}-bind 37 fix##36#dNum_a166 : {VV#233 : FAppTy GHC.Num.Num a_a164 | []}-bind 38 a_a164 : {VV : num | []}-bind 39 gooberding#a15N : {VV#234 : a_a164 | [$k_235]}-bind 40 lq_anf__d16w : {lq_tmp_x241 : int | [(lq_tmp_x241 = 0)]}-bind 41 lq_anf__d16x : {VV : a_a164 | [(VV = lq_anf__d16w)]}-bind 42 lq_anf__d16y : {lq_tmp_x254 : GHC.Types.Bool | [((? Prop([lq_tmp_x254])) <=> (gooberding#a15N >= lq_anf__d16x))]}-bind 43 lq_anf__d16z : {lq_tmp_x276 : int | [(lq_tmp_x276 = (0 : int))]}-bind 44 Test0.x#r12i : {VV#272 : int | [$k_273]}-bind 45 lq_anf__d16A : {lq_tmp_x291 : int | [(lq_tmp_x291 = (0 : int))]}-bind 46 lq_anf__d16B : {lq_tmp_x297 : GHC.Types.Bool | [((? Prop([lq_tmp_x297])) <=> (Test0.x#r12i > lq_anf__d16A))]}-bind 47 lq_anf__d16C : {lq_tmp_x313 : GHC.Types.Bool | [((? Prop([lq_tmp_x313])) <=> (Test0.x#r12i > lq_anf__d16A));- (lq_tmp_x313 = lq_anf__d16B)]}-bind 48 lq_anf__d16C : {lq_tmp_x315 : GHC.Types.Bool | [((? Prop([lq_tmp_x315])) <=> (Test0.x#r12i > lq_anf__d16A));- (lq_tmp_x315 = lq_anf__d16B)]}-bind 49 lq_anf__d16C : {lq_tmp_x315 : GHC.Types.Bool | [((? Prop([lq_tmp_x315])) <=> (Test0.x#r12i > lq_anf__d16A));- (lq_tmp_x315 = lq_anf__d16B);- (~ ((? Prop([lq_tmp_x315]))));- (~ ((? Prop([lq_tmp_x315]))))]}-bind 50 lq_anf__d16C : {lq_tmp_x321 : GHC.Types.Bool | [((? Prop([lq_tmp_x321])) <=> (Test0.x#r12i > lq_anf__d16A));- (lq_tmp_x321 = lq_anf__d16B)]}-bind 51 lq_anf__d16C : {lq_tmp_x321 : GHC.Types.Bool | [((? Prop([lq_tmp_x321])) <=> (Test0.x#r12i > lq_anf__d16A));- (lq_tmp_x321 = lq_anf__d16B);- (? Prop([lq_tmp_x321]));- (? Prop([lq_tmp_x321]))]}-bind 52 Test0.prop_abs#r12j : {VV#287 : GHC.Types.Bool | [$k_288]}-bind 53 VV#343 : {VV#343 : GHC.Types.Bool | [$k_239[VV#238:=VV#343][fix##36#dOrd_a165:=fix#GHC.Classes.#36#fOrdInt#35#rhx][fix##36#dNum_a166:=fix#GHC.Num.#36#fNumInt#35#rhy][gooberding#a15N:=Test0.x#r12i][lq_tmp_x332:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x333:=fix#GHC.Num.#36#fNumInt#35#rhy][lq_tmp_x334:=Test0.x#r12i][lq_tmp_x328:=VV#343]]}-bind 54 VV#343 : {VV#343 : GHC.Types.Bool | [$k_239[VV#238:=VV#343][fix##36#dOrd_a165:=fix#GHC.Classes.#36#fOrdInt#35#rhx][fix##36#dNum_a166:=fix#GHC.Num.#36#fNumInt#35#rhy][gooberding#a15N:=Test0.x#r12i][lq_tmp_x332:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x333:=fix#GHC.Num.#36#fNumInt#35#rhy][lq_tmp_x334:=Test0.x#r12i][lq_tmp_x328:=VV#343]]}-bind 55 VV#346 : {VV#346 : int | [$k_273[VV#272:=VV#346][lq_tmp_x341:=VV#346];- (VV#346 = Test0.x#r12i)]}-bind 56 VV#346 : {VV#346 : int | [$k_273[VV#272:=VV#346][lq_tmp_x341:=VV#346];- (VV#346 = Test0.x#r12i)]}-bind 57 VV#349 : {VV#349 : GHC.Types.Bool | [(~ ((? Prop([VV#349]))));- (VV#349 = GHC.Types.False#68)]}-bind 58 VV#349 : {VV#349 : GHC.Types.Bool | [(~ ((? Prop([VV#349]))));- (VV#349 = GHC.Types.False#68)]}-bind 59 VV#352 : {VV#352 : int | [(VV#352 = (0 : int));- (VV#352 = lq_anf__d16A)]}-bind 60 VV#352 : {VV#352 : int | [(VV#352 = (0 : int));- (VV#352 = lq_anf__d16A)]}-bind 61 VV#355 : {VV#355 : int | [$k_273[VV#272:=VV#355][lq_tmp_x310:=VV#355];- (VV#355 = Test0.x#r12i)]}-bind 62 VV#355 : {VV#355 : int | [$k_273[VV#272:=VV#355][lq_tmp_x310:=VV#355];- (VV#355 = Test0.x#r12i)]}-bind 63 VV#358 : {VV#358 : int | [(VV#358 = 0)]}-bind 64 VV#358 : {VV#358 : int | [(VV#358 = 0)]}-bind 65 VV#361 : {VV#361 : int | []}-bind 66 VV#361 : {VV#361 : int | []}-bind 67 VV#364 : {VV#364 : int | [(VV#364 = (0 : int));- (VV#364 = lq_anf__d16z)]}-bind 68 VV#364 : {VV#364 : int | [(VV#364 = (0 : int));- (VV#364 = lq_anf__d16z)]}-bind 69 VV#367 : {VV#367 : int | [(VV#367 = 0)]}-bind 70 VV#367 : {VV#367 : int | [(VV#367 = 0)]}-bind 71 VV#370 : {VV#370 : GHC.Types.Bool | [(? Prop([VV#370]))]}-bind 72 VV#370 : {VV#370 : GHC.Types.Bool | [(? Prop([VV#370]))]}-bind 73 VV#373 : {VV#373 : GHC.Types.Bool | [((? Prop([VV#373])) <=> (gooberding#a15N >= lq_anf__d16x));- (VV#373 = lq_anf__d16y)]}-bind 74 VV#373 : {VV#373 : GHC.Types.Bool | [((? Prop([VV#373])) <=> (gooberding#a15N >= lq_anf__d16x));- (VV#373 = lq_anf__d16y)]}-bind 75 VV : {VV : a_a164 | [(VV = lq_anf__d16w);- (VV = lq_anf__d16x)]}-bind 76 VV#234 : {VV#234 : a_a164 | [$k_235;- (VV#234 = gooberding#a15N)]}-bind 77 VV#378 : {VV#378 : int | [(VV#378 = 0);- (VV#378 = lq_anf__d16w)]}-bind 78 VV#378 : {VV#378 : int | [(VV#378 = 0);- (VV#378 = lq_anf__d16w)]}-bind 79 VV#304 : {VV#304 : int | [$k_305]}-bind 80 VV#287 : {VV#287 : GHC.Types.Bool | [$k_288]}-bind 81 VV#272 : {VV#272 : int | [$k_273]}-bind 82 VV#238 : {VV#238 : GHC.Types.Bool | [$k_239]}---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 50;- 3;- 19;- 35;- 51;- 4;- 20;- 5;- 21;- 53;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 45;- 14;- 30;- 46;- 15;- 31;- 47]- lhs {VV#F1 : GHC.Types.Bool | [$k_239[VV#238:=VV#F1][fix##36#dOrd_a165:=fix#GHC.Classes.#36#fOrdInt#35#rhx][fix##36#dNum_a166:=fix#GHC.Num.#36#fNumInt#35#rhy][gooberding#a15N:=Test0.x#r12i][lq_tmp_x332:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x333:=fix#GHC.Num.#36#fNumInt#35#rhy][lq_tmp_x334:=Test0.x#r12i][lq_tmp_x328:=VV#F1][VV#343:=VV#F1][VV#F:=VV#F1]]}- rhs {VV#F1 : GHC.Types.Bool | [$k_288[VV#287:=VV#F1][VV#343:=VV#F1][VV#F:=VV#F1]]}- id 1 tag [3]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 50;- 3;- 19;- 35;- 51;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 55;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 45;- 14;- 30;- 46;- 15;- 31;- 47]- lhs {VV#F2 : int | [$k_273[VV#272:=VV#F2][lq_tmp_x341:=VV#F2][VV#346:=VV#F2][VV#F:=VV#F2];- (VV#F2 = Test0.x#r12i)]}- rhs {VV#F2 : int | [$k_235[fix##36#dOrd_a165:=fix#GHC.Classes.#36#fOrdInt#35#rhx][fix##36#dNum_a166:=fix#GHC.Num.#36#fNumInt#35#rhy][VV#234:=VV#F2][lq_tmp_x332:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x333:=fix#GHC.Num.#36#fNumInt#35#rhy][lq_tmp_x336:=VV#F2][VV#346:=VV#F2][VV#F:=VV#F2]]}- id 2 tag [3]---constraint:- env [0;- 16;- 32;- 48;- 1;- 17;- 33;- 49;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 57;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 45;- 14;- 30;- 46;- 15;- 31;- 47]- lhs {VV#F3 : GHC.Types.Bool | [(~ ((? Prop([VV#F3]))));- (VV#F3 = GHC.Types.False#68)]}- rhs {VV#F3 : GHC.Types.Bool | [$k_288[VV#287:=VV#F3][VV#349:=VV#F3][VV#F:=VV#F3]]}- id 3 tag [3]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 59;- 12;- 28;- 44;- 13;- 29;- 45;- 14;- 30;- 15;- 31]- lhs {VV#F4 : int | [(VV#F4 = (0 : int)); (VV#F4 = lq_anf__d16A)]}- rhs {VV#F4 : int | [$k_305[VV#304:=VV#F4][lq_tmp_x301:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x302:=Test0.x#r12i][lq_tmp_x307:=VV#F4][VV#352:=VV#F4][VV#F:=VV#F4]]}- id 4 tag [3]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 45;- 61;- 14;- 30;- 15;- 31]- lhs {VV#F5 : int | [$k_273[VV#272:=VV#F5][lq_tmp_x310:=VV#F5][VV#355:=VV#F5][VV#F:=VV#F5];- (VV#F5 = Test0.x#r12i)]}- rhs {VV#F5 : int | [$k_305[VV#304:=VV#F5][lq_tmp_x301:=fix#GHC.Classes.#36#fOrdInt#35#rhx][lq_tmp_x307:=VV#F5][VV#355:=VV#F5][VV#F:=VV#F5]]}- id 5 tag [3]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 65;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 43;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV#F6 : int | []}- rhs {VV#F6 : int | [$k_273[VV#272:=VV#F6][VV#361:=VV#F6][VV#F:=VV#F6]]}- id 6 tag [2]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 71;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 42;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV#F7 : GHC.Types.Bool | [(? Prop([VV#F7]))]}- rhs {VV#F7 : GHC.Types.Bool | [$k_239[VV#238:=VV#F7][VV#370:=VV#F7][VV#F:=VV#F7]]}- id 7 tag [1]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 73;- 10;- 26;- 42;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV#F8 : GHC.Types.Bool | [((? Prop([VV#F8])) <=> (gooberding#a15N >= lq_anf__d16x));- (VV#F8 = lq_anf__d16y)]}- rhs {VV#F8 : GHC.Types.Bool | [(? Prop([VV#F8]))]}- id 8 tag [1]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 11;- 27;- 75;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV#F9 : a_a164 | [(VV#F9 = lq_anf__d16w);- (VV#F9 = lq_anf__d16x)]}- rhs {VV#F9 : a_a164 | [$k_262[lq_tmp_x258:=fix##36#dOrd_a165][lq_tmp_x259:=gooberding#a15N][VV#261:=VV#F9][VV#F:=VV#F9]]}- id 9 tag [1]---constraint:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 11;- 27;- 12;- 28;- 76;- 13;- 29;- 14;- 30;- 15;- 31]- lhs {VV#F10 : a_a164 | [$k_235[VV#234:=VV#F10][VV#F:=VV#F10];- (VV#F10 = gooberding#a15N)]}- rhs {VV#F10 : a_a164 | [$k_262[lq_tmp_x258:=fix##36#dOrd_a165][VV#261:=VV#F10][VV#F:=VV#F10]]}- id 10 tag [1]---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 45;- 14;- 30;- 15;- 31]- reft {VV#304 : int | [$k_305]}- ---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 44;- 13;- 29;- 14;- 30;- 15;- 31]- reft {VV#287 : GHC.Types.Bool | [$k_288]}- ---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 5;- 21;- 6;- 22;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- reft {VV#272 : int | [$k_273]}- ---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- reft {VV#234 : a_a164 | [$k_235]}- ---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 40;- 9;- 25;- 41;- 10;- 26;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- reft {VV#261 : a_a164 | [$k_262]}- ---wf:- env [0;- 16;- 32;- 1;- 17;- 33;- 2;- 18;- 34;- 3;- 19;- 35;- 4;- 20;- 36;- 5;- 21;- 37;- 6;- 22;- 38;- 7;- 23;- 39;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 28;- 13;- 29;- 14;- 30;- 15;- 31]- reft {VV#238 : GHC.Types.Bool | [$k_239]}-
− tests/pos/test000.hs.fq
@@ -1,489 +0,0 @@-qualif Fst(v : @(1), y : @(0)): (v = fst([y])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.spec" (line 29, column 8)-qualif Snd(v : @(1), y : @(0)): (v = snd([y])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.spec" (line 30, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) > 0)) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 13, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): ((? Prop([v])) <=> (len([xs]) = 0)) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 14, column 8)-qualif ListZ(v : [@(0)]): (len([v]) = 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 16, column 8)-qualif ListZ(v : [@(0)]): (len([v]) >= 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 17, column 8)-qualif ListZ(v : [@(0)]): (len([v]) > 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 18, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) = len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 20, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) >= len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 21, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) > len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 22, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) <= len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 23, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (len([v]) < len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 24, column 8)-qualif EqLen(v : int, xs : [@(0)]): (v = len([xs])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 26, column 8)-qualif LenEq(v : [@(0)], x : int): (x = len([v])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 27, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x + 1)) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 28, column 8)-qualif LenDiff(v : [@(0)], x : int): (len([v]) = (x - 1)) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 29, column 8)-qualif LenAcc(v : int, xs : [@(0)], n : int): (v = (len([xs]) + n)) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/GHC/Base.hquals" (line 30, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 3, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 4, column 8)-qualif Bot(v : @(0)): (0 = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 5, column 8)-qualif Bot(v : bool): (0 = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 6, column 8)-qualif Bot(v : int): (0 = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 7, column 8)-qualif CmpZ(v : @(0)): (v < 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 9, column 8)-qualif CmpZ(v : @(0)): (v <= 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 10, column 8)-qualif CmpZ(v : @(0)): (v > 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 11, column 8)-qualif CmpZ(v : @(0)): (v >= 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 12, column 8)-qualif CmpZ(v : @(0)): (v = 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 13, column 8)-qualif CmpZ(v : @(0)): (v != 0) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 14, column 8)-qualif Cmp(v : @(0), x : @(0)): (v < x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 16, column 8)-qualif Cmp(v : @(0), x : @(0)): (v <= x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 17, column 8)-qualif Cmp(v : @(0), x : @(0)): (v > x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 18, column 8)-qualif Cmp(v : @(0), x : @(0)): (v >= x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 19, column 8)-qualif Cmp(v : @(0), x : @(0)): (v = x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 20, column 8)-qualif Cmp(v : @(0), x : @(0)): (v != x) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 21, column 8)-qualif One(v : int): (v = 1) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 28, column 8)-qualif True(v : bool): (? v) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 29, column 8)-qualif False(v : bool): (~ ((? v))) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 30, column 8)-qualif True1(v : GHC.Types.Bool): (? Prop([v])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 31, column 8)-qualif False1(v : GHC.Types.Bool): (~ ((? Prop([v])))) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 32, column 8)-qualif Papp(v : @(0), p : (Pred @(0))): (? papp1([p;- v])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 35, column 8)-qualif Papp2(v : @(1), x : @(0), p : (Pred @(1) @(0))): (? papp2([p;- v;- x])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 38, column 8)-qualif Papp3(v : @(2), x : @(0), y : @(1), p : (Pred @(2) @(0) @(1))): (? papp3([p;- v;- x;- y])) // "/Users/benjamin/UCSDrepos/liquidhaskell/include/Prelude.hquals" (line 41, column 8)-----constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant addrLen : (func(0, [int; int]))-constant xsListSelector : (func(1, [[@(0)]; [@(0)]]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant GHC.Types.False$35$68 : (GHC.Types.Bool)-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(6));- @(3);- @(4);- @(5);- @(7);- bool]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant autolen : (func(1, [@(0); int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant null : (func(1, [[@(0)]; bool]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant len : (func(2, [(@(0) @(1)); int]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant xListSelector : (func(1, [[@(0)]; @(0)]))-constant strLen : (func(0, [int; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant Prop : (func(0, [GHC.Types.Bool; bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(1, [(Pred @(0)); @(0); bool]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant GHC.Types.I$35$$35$6c : (func(0, [int; int]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))-constant GHC.Types.True$35$6u : (GHC.Types.Bool)---bind 0 GHC.Types.False$35$68 : {VV$35$170 : GHC.Types.Bool | []}-bind 1 GHC.Types.True$35$6u : {VV$35$172 : GHC.Types.Bool | []}-bind 2 GHC.Num.$36$fNumInt$35$rma : {VV$35$178 : (GHC.Num.Num int) | []}-bind 3 GHC.Classes.$36$fOrdInt$35$rni : {VV$35$179 : (GHC.Classes.Ord int) | []}-bind 4 GHC.Types.EQ$35$6U : {VV$35$180 : GHC.Types.Ordering | [(VV$35$180 = GHC.Types.EQ$35$6U)]}-bind 5 GHC.Types.LT$35$6S : {VV$35$181 : GHC.Types.Ordering | [(VV$35$181 = GHC.Types.LT$35$6S)]}-bind 6 GHC.Types.GT$35$6W : {VV$35$182 : GHC.Types.Ordering | [(VV$35$182 = GHC.Types.GT$35$6W)]}-bind 7 GHC.Types.True$35$6u : {v_4 : GHC.Types.Bool | [(? Prop([v_4]))]}-bind 8 GHC.Types.False$35$68 : {v_5 : GHC.Types.Bool | [(~ ((? Prop([v_5]))))]}-bind 9 GHC.Types.False$35$68 : {v_5 : GHC.Types.Bool | [(~ ((? Prop([v_5]))))]}-bind 10 GHC.Types.$91$$93$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 11 GHC.Types.True$35$6u : {v_4 : GHC.Types.Bool | [(? Prop([v_4]))]}-bind 12 GHC.Types.GT$35$6W : {VV$35$227 : GHC.Types.Ordering | [(cmp([VV$35$227]) = GHC.Types.GT$35$6W)]}-bind 13 GHC.Types.LT$35$6S : {VV$35$228 : GHC.Types.Ordering | [(cmp([VV$35$228]) = GHC.Types.LT$35$6S)]}-bind 14 GHC.Types.EQ$35$6U : {VV$35$229 : GHC.Types.Ordering | [(cmp([VV$35$229]) = GHC.Types.EQ$35$6U)]}-bind 15 GHC.Base.Nothing$35$r1d : {VV : func(1, [(GHC.Base.Maybe @(0))]) | []}-bind 16 lq_anf__d12p : {lq_tmp_x_238 : int | [(lq_tmp_x_238 = (0 : int))]}-bind 17 lq_anf__d12q : {lq_tmp_x_244 : int | []}-bind 18 lq_anf__d12r : {lq_tmp_x_250 : int | [(lq_tmp_x_250 = (10 : int))]}-bind 19 Test0.toss$35$rYP : {VV$35$234 : GHC.Types.Bool | [$k__235]}-bind 20 lq_anf__d12s : {lq_tmp_x_275 : GHC.Types.Bool | [(lq_tmp_x_275 = Test0.toss$35$rYP)]}-bind 21 lq_anf__d12s : {lq_tmp_x_277 : GHC.Types.Bool | [(lq_tmp_x_277 = Test0.toss$35$rYP)]}-bind 22 lq_anf__d12s : {lq_tmp_x_277 : GHC.Types.Bool | [(lq_tmp_x_277 = Test0.toss$35$rYP);- (~ ((? Prop([lq_tmp_x_277]))));- (~ ((? Prop([lq_tmp_x_277]))));- (~ ((? Prop([lq_tmp_x_277]))))]}-bind 23 lq_anf__d12s : {lq_tmp_x_283 : GHC.Types.Bool | [(lq_tmp_x_283 = Test0.toss$35$rYP)]}-bind 24 lq_anf__d12s : {lq_tmp_x_283 : GHC.Types.Bool | [(lq_tmp_x_283 = Test0.toss$35$rYP);- (? Prop([lq_tmp_x_283]));- (? Prop([lq_tmp_x_283]));- (? Prop([lq_tmp_x_283]))]}-bind 25 lq_anf__d12t : {lq_tmp_x_288 : GHC.Types.Bool | [(lq_tmp_x_288 = lq_anf__d12s)]}-bind 26 lq_anf__d12t : {lq_tmp_x_290 : GHC.Types.Bool | [(lq_tmp_x_290 = lq_anf__d12s)]}-bind 27 lq_anf__d12t : {lq_tmp_x_290 : GHC.Types.Bool | [(lq_tmp_x_290 = lq_anf__d12s);- (~ ((? Prop([lq_tmp_x_290]))));- (~ ((? Prop([lq_tmp_x_290]))));- (~ ((? Prop([lq_tmp_x_290]))))]}-bind 28 lq_anf__d12t : {lq_tmp_x_296 : GHC.Types.Bool | [(lq_tmp_x_296 = lq_anf__d12s)]}-bind 29 lq_anf__d12t : {lq_tmp_x_296 : GHC.Types.Bool | [(lq_tmp_x_296 = lq_anf__d12s);- (? Prop([lq_tmp_x_296]));- (? Prop([lq_tmp_x_296]));- (? Prop([lq_tmp_x_296]))]}-bind 30 Test0.prop_abs$35$r10h : {VV$35$272 : GHC.Types.Bool | [$k__273]}-bind 31 x$35$a11A : {VV$35$307 : int | [$k__308]}-bind 32 lq_anf__d12u : {lq_tmp_x_315 : int | [(lq_tmp_x_315 = (0 : int))]}-bind 33 lq_anf__d12v : {lq_tmp_x_321 : GHC.Types.Bool | [((? Prop([lq_tmp_x_321])) <=> (x$35$a11A > lq_anf__d12u))]}-bind 34 lq_anf__d12w : {lq_tmp_x_345 : int | [$k__343[lq_tmp_x_340:=lq_anf__d12v][VV$35$342:=lq_tmp_x_345][lq_tmp_x_341:=x$35$a11A]]}-bind 35 lq_anf__d12x : {lq_tmp_x_350 : int | [(lq_tmp_x_350 = (1 : int))]}-bind 36 lq_anf__d12y : {lq_tmp_x_373 : int | [(lq_tmp_x_373 = (12 : int))]}-bind 37 Test0.goo$35$r10j : {VV$35$369 : int | [$k__370]}-bind 38 zzz$35$a11B : {VV$35$384 : int | [$k__385]}-bind 39 lq_anf__d12z : {lq_tmp_x_392 : int | [(lq_tmp_x_392 = (1 : int))]}-bind 40 lq_anf__d12A : {lq_tmp_x_415 : int | [(lq_tmp_x_415 = (29 : int))]}-bind 41 Test0.zoo$35$r10l : {VV$35$411 : int | [$k__412]}-bind 42 VV$35$426 : {VV$35$426 : int | [$k__389[lq_tmp_x_423:=lq_anf__d12A][lq_tmp_x_421:=VV$35$426][zzz$35$a11B:=lq_anf__d12A][VV$35$388:=VV$35$426]]}-bind 43 VV$35$426 : {VV$35$426 : int | [$k__389[lq_tmp_x_423:=lq_anf__d12A][lq_tmp_x_421:=VV$35$426][zzz$35$a11B:=lq_anf__d12A][VV$35$388:=VV$35$426]]}-bind 44 VV$35$429 : {VV$35$429 : int | [(VV$35$429 = lq_anf__d12A)]}-bind 45 VV$35$429 : {VV$35$429 : int | [(VV$35$429 = lq_anf__d12A)]}-bind 46 VV$35$432 : {VV$35$432 : int | [(VV$35$432 = 29)]}-bind 47 VV$35$432 : {VV$35$432 : int | [(VV$35$432 = 29)]}-bind 48 VV$35$435 : {VV$35$435 : int | [(VV$35$435 = (zzz$35$a11B + lq_anf__d12z))]}-bind 49 VV$35$435 : {VV$35$435 : int | [(VV$35$435 = (zzz$35$a11B + lq_anf__d12z))]}-bind 50 VV$35$438 : {VV$35$438 : int | [(VV$35$438 = lq_anf__d12z)]}-bind 51 VV$35$438 : {VV$35$438 : int | [(VV$35$438 = lq_anf__d12z)]}-bind 52 VV$35$441 : {VV$35$441 : int | [(VV$35$441 = zzz$35$a11B)]}-bind 53 VV$35$441 : {VV$35$441 : int | [(VV$35$441 = zzz$35$a11B)]}-bind 54 VV$35$444 : {VV$35$444 : int | [(VV$35$444 = 1)]}-bind 55 VV$35$444 : {VV$35$444 : int | [(VV$35$444 = 1)]}-bind 56 VV$35$447 : {VV$35$447 : int | [$k__312[VV$35$311:=VV$35$447][lq_tmp_x_381:=lq_anf__d12y][x$35$a11A:=lq_anf__d12y][lq_tmp_x_379:=VV$35$447]]}-bind 57 VV$35$447 : {VV$35$447 : int | [$k__312[VV$35$311:=VV$35$447][lq_tmp_x_381:=lq_anf__d12y][x$35$a11A:=lq_anf__d12y][lq_tmp_x_379:=VV$35$447]]}-bind 58 VV$35$450 : {VV$35$450 : int | [(VV$35$450 = lq_anf__d12y)]}-bind 59 VV$35$450 : {VV$35$450 : int | [(VV$35$450 = lq_anf__d12y)]}-bind 60 VV$35$453 : {VV$35$453 : int | [(VV$35$453 = 12)]}-bind 61 VV$35$453 : {VV$35$453 : int | [(VV$35$453 = 12)]}-bind 62 VV$35$456 : {VV$35$456 : int | [(VV$35$456 = (lq_anf__d12w + lq_anf__d12x))]}-bind 63 VV$35$456 : {VV$35$456 : int | [(VV$35$456 = (lq_anf__d12w + lq_anf__d12x))]}-bind 64 VV$35$459 : {VV$35$459 : int | [(VV$35$459 = lq_anf__d12x)]}-bind 65 VV$35$459 : {VV$35$459 : int | [(VV$35$459 = lq_anf__d12x)]}-bind 66 VV$35$462 : {VV$35$462 : int | [(VV$35$462 = lq_anf__d12w)]}-bind 67 VV$35$462 : {VV$35$462 : int | [(VV$35$462 = lq_anf__d12w)]}-bind 68 VV$35$465 : {VV$35$465 : int | [(VV$35$465 = 1)]}-bind 69 VV$35$465 : {VV$35$465 : int | [(VV$35$465 = 1)]}-bind 70 VV$35$468 : {VV$35$468 : int | [(VV$35$468 = x$35$a11A)]}-bind 71 VV$35$468 : {VV$35$468 : int | [(VV$35$468 = x$35$a11A)]}-bind 72 VV$35$471 : {VV$35$471 : GHC.Types.Bool | [(VV$35$471 = lq_anf__d12v)]}-bind 73 VV$35$471 : {VV$35$471 : GHC.Types.Bool | [(VV$35$471 = lq_anf__d12v)]}-bind 74 VV$35$474 : {VV$35$474 : int | [(VV$35$474 = lq_anf__d12u)]}-bind 75 VV$35$474 : {VV$35$474 : int | [(VV$35$474 = lq_anf__d12u)]}-bind 76 VV$35$477 : {VV$35$477 : int | [(VV$35$477 = x$35$a11A)]}-bind 77 VV$35$477 : {VV$35$477 : int | [(VV$35$477 = x$35$a11A)]}-bind 78 VV$35$480 : {VV$35$480 : int | [(VV$35$480 = 0)]}-bind 79 VV$35$480 : {VV$35$480 : int | [(VV$35$480 = 0)]}-bind 80 VV$35$483 : {VV$35$483 : GHC.Types.Bool | [(? Prop([VV$35$483]))]}-bind 81 VV$35$483 : {VV$35$483 : GHC.Types.Bool | [(? Prop([VV$35$483]))]}-bind 82 VV$35$486 : {VV$35$486 : GHC.Types.Bool | [(VV$35$486 = lq_anf__d12t)]}-bind 83 VV$35$486 : {VV$35$486 : GHC.Types.Bool | [(VV$35$486 = lq_anf__d12t)]}-bind 84 VV$35$489 : {VV$35$489 : GHC.Types.Bool | [(VV$35$489 = GHC.Types.False$35$68)]}-bind 85 VV$35$489 : {VV$35$489 : GHC.Types.Bool | [(VV$35$489 = GHC.Types.False$35$68)]}-bind 86 VV$35$492 : {VV$35$492 : GHC.Types.Bool | [(VV$35$492 = GHC.Types.False$35$68)]}-bind 87 VV$35$492 : {VV$35$492 : GHC.Types.Bool | [(VV$35$492 = GHC.Types.False$35$68)]}-bind 88 VV$35$495 : {VV$35$495 : GHC.Types.Bool | [((? Prop([VV$35$495])) <=> (lq_anf__d12q > lq_anf__d12r))]}-bind 89 VV$35$495 : {VV$35$495 : GHC.Types.Bool | [((? Prop([VV$35$495])) <=> (lq_anf__d12q > lq_anf__d12r))]}-bind 90 VV$35$498 : {VV$35$498 : int | [(VV$35$498 = lq_anf__d12r)]}-bind 91 VV$35$498 : {VV$35$498 : int | [(VV$35$498 = lq_anf__d12r)]}-bind 92 VV$35$501 : {VV$35$501 : int | [(VV$35$501 = lq_anf__d12q)]}-bind 93 VV$35$501 : {VV$35$501 : int | [(VV$35$501 = lq_anf__d12q)]}-bind 94 VV$35$504 : {VV$35$504 : int | [(VV$35$504 = 10)]}-bind 95 VV$35$504 : {VV$35$504 : int | [(VV$35$504 = 10)]}-bind 96 VV$35$507 : {VV$35$507 : int | [(VV$35$507 = lq_anf__d12p)]}-bind 97 VV$35$507 : {VV$35$507 : int | [(VV$35$507 = lq_anf__d12p)]}-bind 98 VV$35$510 : {VV$35$510 : int | [(VV$35$510 = 0)]}-bind 99 VV$35$510 : {VV$35$510 : int | [(VV$35$510 = 0)]}-bind 100 VV$35$411 : {VV$35$411 : int | [$k__412]}-bind 101 VV$35$384 : {VV$35$384 : int | [$k__385]}-bind 102 VV$35$388 : {VV$35$388 : int | [$k__389]}-bind 103 VV$35$369 : {VV$35$369 : int | [$k__370]}-bind 104 VV$35$307 : {VV$35$307 : int | [$k__308]}-bind 105 VV$35$342 : {VV$35$342 : int | [$k__343]}-bind 106 VV$35$328 : {VV$35$328 : int | [$k__329]}-bind 107 VV$35$311 : {VV$35$311 : int | [$k__312]}-bind 108 VV$35$272 : {VV$35$272 : GHC.Types.Bool | [$k__273]}-bind 109 VV$35$263 : {VV$35$263 : int | [$k__264]}-bind 110 VV$35$234 : {VV$35$234 : GHC.Types.Bool | [$k__235]}-----constraint:- env [0;- 1;- 2;- 3;- 19;- 4;- 36;- 5;- 6;- 7;- 8;- 9;- 10;- 58;- 11;- 12;- 13;- 14;- 30;- 15]- lhs {VV$35$F5 : int | [(VV$35$F5 = lq_anf__d12y)]}- rhs {VV$35$F5 : int | [$k__308[VV$35$307:=VV$35$F5][VV$35$F:=VV$35$F5][VV$35$450:=VV$35$F5][lq_tmp_x_378:=VV$35$F5]]}- id 5 tag [4]- // META constraint id 5 : tests/pos/test000.hs:16:11-12---constraint:- env [0;- 32;- 1;- 33;- 2;- 3;- 19;- 4;- 5;- 6;- 7;- 8;- 72;- 9;- 10;- 11;- 12;- 13;- 14;- 30;- 15;- 31]- lhs {VV$35$F8 : GHC.Types.Bool | [(VV$35$F8 = lq_anf__d12v)]}- rhs {VV$35$F8 : GHC.Types.Bool | [(? Prop([VV$35$F8]))]}- id 8 tag [3]- // META constraint id 8 : tests/pos/test000.hs:14:23-29---constraint:- env [0;- 80;- 1;- 2;- 3;- 19;- 4;- 20;- 5;- 6;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 11;- 12;- 28;- 13;- 29;- 14;- 15]- lhs {VV$35$F11 : GHC.Types.Bool | [(? Prop([VV$35$F11]))]}- rhs {VV$35$F11 : GHC.Types.Bool | [$k__273[VV$35$272:=VV$35$F11][VV$35$F:=VV$35$F11][VV$35$483:=VV$35$F11]]}- id 11 tag [6]- // META constraint id 11 : tests/pos/test000.hs:10:33-50---constraint:- env [0;- 1;- 2;- 82;- 3;- 19;- 4;- 20;- 5;- 6;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 11;- 12;- 28;- 13;- 29;- 14;- 15]- lhs {VV$35$F12 : GHC.Types.Bool | [(VV$35$F12 = lq_anf__d12t)]}- rhs {VV$35$F12 : GHC.Types.Bool | [(? Prop([VV$35$F12]))]}- id 12 tag [6]- // META constraint id 12 : tests/pos/test000.hs:10:47-50---constraint:- env [0;- 1;- 2;- 3;- 19;- 4;- 20;- 84;- 5;- 6;- 7;- 23;- 8;- 24;- 9;- 25;- 10;- 26;- 11;- 27;- 12;- 13;- 14;- 15]- lhs {VV$35$F13 : GHC.Types.Bool | [(VV$35$F13 = GHC.Types.False$35$68)]}- rhs {VV$35$F13 : GHC.Types.Bool | [$k__273[VV$35$272:=VV$35$F13][VV$35$489:=VV$35$F13][VV$35$F:=VV$35$F13]]}- id 13 tag [6]- // META constraint id 13 : tests/pos/test000.hs:10:57-61---constraint:- env [0;- 1;- 2;- 3;- 19;- 4;- 20;- 5;- 21;- 6;- 22;- 86;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 15]- lhs {VV$35$F14 : GHC.Types.Bool | [(VV$35$F14 = GHC.Types.False$35$68)]}- rhs {VV$35$F14 : GHC.Types.Bool | [$k__273[VV$35$272:=VV$35$F14][VV$35$F:=VV$35$F14][VV$35$492:=VV$35$F14]]}- id 14 tag [6]- // META constraint id 14 : tests/pos/test000.hs:11:19-23---constraint:- env [0;- 16;- 1;- 17;- 2;- 18;- 3;- 4;- 5;- 6;- 7;- 8;- 88;- 9;- 10;- 11;- 12;- 13;- 14;- 15]- lhs {VV$35$F15 : GHC.Types.Bool | [((? Prop([VV$35$F15])) <=> (lq_anf__d12q > lq_anf__d12r))]}- rhs {VV$35$F15 : GHC.Types.Bool | [$k__235[VV$35$F:=VV$35$F15][VV$35$495:=VV$35$F15][VV$35$234:=VV$35$F15]]}- id 15 tag [5]- // META constraint id 15 : tests/pos/test000.hs:6:1-22-----wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15]- reft {VV$35$234 : GHC.Types.Bool | [$k__235]}- // META wf : <no location info>---wf:- env [0; 1; 2; 3; 19; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 30; 15]- reft {VV$35$307 : int | [$k__308]}- // META wf : <no location info>---wf:- env [0; 1; 2; 3; 19; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15]- reft {VV$35$272 : GHC.Types.Bool | [$k__273]}- // META wf : tests/pos/test000.hs:(9,1)-(11,23)-------
− tests/smt2/Smt.hs
@@ -1,28 +0,0 @@--- just fire up ghci, :load Smt.hs and run `go file.smt2`--module Smt where--import qualified Data.Text.Lazy.IO as T--import Language.Fixpoint.Types.Config (SMTSolver (..))-import Language.Fixpoint.Parse-import Language.Fixpoint.SmtLib2-import System.Environment--main = do f:_ <- getArgs- _ <- go f- return ()--runFile f- = readFile f >>= runString--runString str- = runCommands $ rr str--runCommands cmds - = do me <- makeContext Z3- mapM_ (T.putStrLn . smt2) cmds- zs <- mapM (command me) cmds- return zs--
tests/test.hs view
@@ -1,8 +1,19 @@-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main where +import qualified Control.Concurrent.STM as STM+import qualified Data.Functor.Compose as Functor+import qualified Data.IntMap as IntMap+import qualified Data.Map as Map+import qualified Control.Monad.State as State+import Control.Monad.Trans.Class (lift)++import Data.Char+import Data.Maybe (fromMaybe)+import Data.Monoid (Sum(..), (<>)) import Control.Applicative import System.Directory import System.Exit@@ -11,22 +22,57 @@ import System.IO import System.IO.Error import System.Process+import Text.Printf+ import Test.Tasty import Test.Tasty.HUnit-import Text.Printf+import Test.Tasty.Ingredients.Rerun+import Test.Tasty.Options+import Test.Tasty.Runners+import Test.Tasty.Runners.AntXML main :: IO ()-main = defaultMain =<< group "Tests" [unitTests]+main = run =<< group "Tests" [unitTests]+ where+ run = defaultMainWithIngredients [+ testRunner+ -- , includingOptions [ Option (Proxy :: Proxy NumThreads)+ -- , Option (Proxy :: Proxy LiquidOpts)+ -- , Option (Proxy :: Proxy SmtSolver) ]+ ] +testRunner :: Ingredient+testRunner = rerunningTests+ [ listingTests+ , combineReporters myConsoleReporter antXMLRunner+ , myConsoleReporter+ ]++myConsoleReporter :: Ingredient+myConsoleReporter = combineReporters consoleTestReporter loggingTestReporter++-- | Combine two @TestReporter@s into one.+--+-- Runs the reporters in sequence, so it's best to start with the one+-- that will produce incremental output, e.g. 'consoleTestReporter'.+combineReporters :: Ingredient -> Ingredient -> Ingredient+combineReporters (TestReporter opts1 run1) (TestReporter opts2 run2)+ = TestReporter (opts1 ++ opts2) $ \opts tree -> do+ f1 <- run1 opts tree+ f2 <- run2 opts tree+ return $ \smap -> f1 smap >> f2 smap+combineReporters _ _ = error "combineReporters needs TestReporters"+ unitTests = group "Unit" [ testGroup "native-pos" <$> dirTests nativeCmd "tests/pos" skipNativePos ExitSuccess- , testGroup "native-neg" <$> dirTests nativeCmd "tests/neg" [] (ExitFailure 1)+ , testGroup "native-neg" <$> dirTests nativeCmd "tests/neg" ["float.fq"] (ExitFailure 1) , testGroup "elim-crash" <$> dirTests nativeCmd "tests/crash" [] (ExitFailure 2) , testGroup "elim-pos1" <$> dirTests elimCmd "tests/pos" [] ExitSuccess , testGroup "elim-pos2" <$> dirTests elimCmd "tests/elim" [] ExitSuccess- , testGroup "elim-neg" <$> dirTests elimCmd "tests/neg" [] (ExitFailure 1)+ , testGroup "elim-neg" <$> dirTests elimCmd "tests/neg" ["float.fq"] (ExitFailure 1) , testGroup "elim-crash" <$> dirTests elimCmd "tests/crash" [] (ExitFailure 2)+ , testGroup "proof" <$> dirTests elimCmd "tests/proof" [] ExitSuccess ] skipNativePos :: [FilePath]@@ -249,3 +295,108 @@ concatMapM :: Applicative m => (a -> m [b]) -> [a] -> m [b] concatMapM _ [] = pure [] concatMapM f (x:xs) = (++) <$> f x <*> concatMapM f xs++++-- this is largely based on ocharles' test runner at+-- https://github.com/ocharles/tasty-ant-xml/blob/master/Test/Tasty/Runners/AntXML.hs#L65+loggingTestReporter :: Ingredient+loggingTestReporter = TestReporter [] $ \opts tree -> Just $ \smap -> do+ let+ runTest _ testName _ = Traversal $ Functor.Compose $ do+ i <- State.get++ summary <- lift $ STM.atomically $ do+ status <- STM.readTVar $+ fromMaybe (error "Attempted to lookup test by index outside bounds") $+ IntMap.lookup i smap++ let mkSuccess time = [(testName, time, True)]+ mkFailure time = [(testName, time, False)]++ case status of+ -- If the test is done, generate a summary for it+ Done result+ | resultSuccessful result+ -> pure (mkSuccess (resultTime result))+ | otherwise+ -> pure (mkFailure (resultTime result))+ -- Otherwise the test has either not been started or is currently+ -- executing+ _ -> STM.retry++ Const summary <$ State.modify (+ 1)++ runGroup group children = Traversal $ Functor.Compose $ do+ Const soFar <- Functor.getCompose $ getTraversal children+ pure $ Const $ map (\(n,t,s) -> (group</>n,t,s)) soFar++ computeFailures :: StatusMap -> IO Int+ computeFailures = fmap getSum . getApp . foldMap (\var -> Ap $+ (\r -> Sum $ if resultSuccessful r then 0 else 1) <$> getResultFromTVar var)++ getResultFromTVar :: STM.TVar Status -> IO Result+ getResultFromTVar var =+ STM.atomically $ do+ status <- STM.readTVar var+ case status of+ Done r -> return r+ _ -> STM.retry++ (Const summary, _tests) <-+ flip State.runStateT 0 $ Functor.getCompose $ getTraversal $+ foldTestTree+ trivialFold { foldSingle = runTest, foldGroup = runGroup }+ opts+ tree++ return $ \_elapsedTime -> do+ -- get some semblance of a hostname+ host <- takeWhile (/='.') . takeWhile (not . isSpace) <$> readProcess "hostname" [] []+ -- don't use the `time` package, major api differences between ghc 708 and 710+ time <- head . lines <$> readProcess "date" ["+%Y-%m-%dT%H-%M-%S"] []+ -- build header+ ref <- gitRef+ timestamp <- gitTimestamp+ epochTime <- gitEpochTimestamp+ hash <- gitHash+ let hdr = unlines [ref ++ " : " ++ hash,+ "Timestamp: " ++ timestamp,+ "Epoch Timestamp: " ++ epochTime,+ headerDelim,+ "test, time(s), result"]++ let dir = "tests" </> "logs" </> host ++ "-" ++ time+ let smry = "tests" </> "logs" </> "cur" </> "summary.csv"+ writeFile smry $ unlines+ $ hdr+ : map (\(n, t, r) -> printf "%s, %0.4f, %s" n t (show r)) summary+ -- system $ "cp -r tests/logs/cur " ++ dir+ (==0) <$> computeFailures smap+++gitTimestamp :: IO String+gitTimestamp = do+ res <- readProcess "git" ["show", "--format=\"%ci\"", "--quiet"] []+ return $ filter notNoise res++gitEpochTimestamp :: IO String+gitEpochTimestamp = do+ res <- readProcess "git" ["show", "--format=\"%ct\"", "--quiet"] []+ return $ filter notNoise res++gitHash :: IO String+gitHash = do+ res <- readProcess "git" ["show", "--format=\"%H\"", "--quiet"] []+ return $ filter notNoise res++gitRef :: IO String+gitRef = do+ res <- readProcess "git" ["show", "--format=\"%d\"", "--quiet"] []+ return $ filter notNoise res++notNoise :: Char -> Bool+notNoise a = a /= '\"' && a /= '\n' && a /= '\r'++headerDelim :: String+headerDelim = replicate 80 '-'
tests/testParser.hs view
@@ -2,9 +2,11 @@ module Main where +import Language.Fixpoint.Types (showFix) import Language.Fixpoint.Parse import Test.Tasty import Test.Tasty.HUnit+import Data.List (intercalate) main :: IO () main = defaultMain $ parserTests@@ -12,11 +14,11 @@ parserTests :: TestTree parserTests = testGroup "Tests"- [- testSortP+ [ testSortP , testFunAppP , testExpr0P , testPredP+ , testDeclP ] -- ---------------------------------------------------------------------@@ -123,7 +125,7 @@ exprFunCommas = -simpleApp = +simpleApp = -} testFunAppP :: TestTree testFunAppP =@@ -250,8 +252,9 @@ , testCase "PFalse" $ show (doParse' predP "test" "false") @?= "POr []" -- pattern for PFalse - , testCase "PGrad / ??" $- show (doParse' predP "test" "??") @?= "PGrad $\"\\\"test\\\" (line 1, column 3)\" (PAnd [])"+ -- , testCase "PGrad / ??" $+ -- show (doParse' predP "test" "??") @?= "PGrad $\"\\\"test\\\" (line 1, column 3)\" (PAnd [])"+ -- "PGrad $\"\\\"test\\\" (line 1, column 3)\" (GradInfo {gsrc = SS {sp_start = \"test\" (line 1, column 3), sp_stop = \"test\" (line 1, column 3)}, gused = Nothing}) (PAnd [])" , testCase "kvarPred empty" $ show (doParse' predP "test" "$foo") @?= "PKVar $\"foo\" "@@ -306,3 +309,36 @@ , testCase "|| 2" $ show (doParse' predP "test" "|| [x;y]") @?= "POr [EVar \"x\",EVar \"y\"]" ]+++{-++data Vec 1 = [+ Nil {}+ | Cons { vHead : @(0), vTail : Vec @(0)}+ ]++-}++testDeclP :: TestTree+testDeclP = testGroup "dataDeclP"+ [ mkT "fld0" dataFieldP fld0+ , mkT "fld1" dataFieldP fld1+ , mkT "fld2" dataFieldP fld2+ , mkT "ctor0" dataCtorP ctor0+ , mkT "ctor1" dataCtorP ctor1+ , mkT "decl0" dataDeclP decl0+ ]+ where+ mkT name p t = testCase name $ showFix (doParse' p "test" t) @?= t+ fld0 = "vHead : int"+ fld1 = "vHead : @(0)"+ fld2 = "vTail : (Vec @(0))"+ ctor0 = "nil {}"+ ctor1 = "cons {vHead : @(0), vTail : (Vec @(0))}"+ decl0 = intercalate "\n"+ [ "Vec 1 = ["+ , " | nil {}"+ , " | cons {vHead : @(0), vTail : Vec}"+ , "]"+ ]
− tests/todo/MergeSort.fq
@@ -1,3234 +0,0 @@-qualif Fst(v : @(1), y : @(0)): ((v = (fst y))) // "tests/todo/MergeSort.new.min.fq" (line 1, column 8)-qualif Snd(v : @(1), y : @(0)): ((v = (snd y))) // "tests/todo/MergeSort.new.min.fq" (line 2, column 8)-qualif Auto(VV : @(0), fld##0 : @(0)): ((VV >= fld##0)) // "tests/todo/MergeSort.new.min.fq" (line 3, column 8)-qualif Auto(VV : @(0), fld##0 : @(0)): ((VV >= fld##0)) // "tests/todo/MergeSort.new.min.fq" (line 4, column 8)-qualif Auto(VV : [@(0)], xs : [@(0)], ys : [@(0)]): (((len VV) = ((len xs) + (len ys)))) // "tests/todo/MergeSort.new.min.fq" (line 5, column 8)-qualif Auto(VV : @(0), fld##0 : @(0)): ((VV >= fld##0)) // "tests/todo/MergeSort.new.min.fq" (line 6, column 8)-qualif Auto(VV : [@(0)], xs : [@(0)]): (((len VV) = (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 7, column 8)-qualif Auto(VV : @(0), fld##0 : @(0)): ((VV >= fld##0)) // "tests/todo/MergeSort.new.min.fq" (line 8, column 8)-qualif Auto(v##0 : (Tuple [@(0)] [@(0)]), xs : [@(0)]): ((((len (fst v##0)) + (len (snd v##0))) = (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 9, column 8)-qualif Auto(v##0 : [@(0)], xs : [@(0)]): ((((len v##0) > 1) => ((len v##0) < (len xs)))) // "tests/todo/MergeSort.new.min.fq" (line 10, column 8)-qualif Auto(v##0 : [@(0)], xs : [@(0)]): ((((len v##0) > 1) => ((len v##0) < (len xs)))) // "tests/todo/MergeSort.new.min.fq" (line 11, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): (((Prop v) <=> ((len xs) > 0))) // "tests/todo/MergeSort.new.min.fq" (line 12, column 8)-qualif IsEmp(v : GHC.Types.Bool, xs : [@(0)]): (((Prop v) <=> ((len xs) = 0))) // "tests/todo/MergeSort.new.min.fq" (line 13, column 8)-qualif ListZ(v : [@(0)]): (((len v) = 0)) // "tests/todo/MergeSort.new.min.fq" (line 14, column 8)-qualif ListZ(v : [@(0)]): (((len v) >= 0)) // "tests/todo/MergeSort.new.min.fq" (line 15, column 8)-qualif ListZ(v : [@(0)]): (((len v) > 0)) // "tests/todo/MergeSort.new.min.fq" (line 16, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) = (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 17, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) >= (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 18, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) > (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 19, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) <= (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 20, column 8)-qualif CmpLen(v : [@(1)], xs : [@(0)]): (((len v) < (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 21, column 8)-qualif EqLen(v : int, xs : [@(0)]): ((v = (len xs))) // "tests/todo/MergeSort.new.min.fq" (line 22, column 8)-qualif LenEq(v : [@(0)], x : int): ((x = (len v))) // "tests/todo/MergeSort.new.min.fq" (line 23, column 8)-qualif LenDiff(v : [@(0)], x : int): (((len v) = (x + 1))) // "tests/todo/MergeSort.new.min.fq" (line 24, column 8)-qualif LenDiff(v : [@(0)], x : int): (((len v) = (x - 1))) // "tests/todo/MergeSort.new.min.fq" (line 25, column 8)-qualif LenAcc(v : int, xs : [@(0)], n : int): ((v = ((len xs) + n))) // "tests/todo/MergeSort.new.min.fq" (line 26, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "tests/todo/MergeSort.new.min.fq" (line 27, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "tests/todo/MergeSort.new.min.fq" (line 28, column 8)-qualif Bot(v : @(0)): ((0 = 1)) // "tests/todo/MergeSort.new.min.fq" (line 29, column 8)-qualif Bot(v : bool): ((0 = 1)) // "tests/todo/MergeSort.new.min.fq" (line 30, column 8)-qualif Bot(v : int): ((0 = 1)) // "tests/todo/MergeSort.new.min.fq" (line 31, column 8)-qualif CmpZ(v : @(0)): ((v < 0)) // "tests/todo/MergeSort.new.min.fq" (line 32, column 8)-qualif CmpZ(v : @(0)): ((v <= 0)) // "tests/todo/MergeSort.new.min.fq" (line 33, column 8)-qualif CmpZ(v : @(0)): ((v > 0)) // "tests/todo/MergeSort.new.min.fq" (line 34, column 8)-qualif CmpZ(v : @(0)): ((v >= 0)) // "tests/todo/MergeSort.new.min.fq" (line 35, column 8)-qualif CmpZ(v : @(0)): ((v = 0)) // "tests/todo/MergeSort.new.min.fq" (line 36, column 8)-qualif CmpZ(v : @(0)): ((v != 0)) // "tests/todo/MergeSort.new.min.fq" (line 37, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v < x)) // "tests/todo/MergeSort.new.min.fq" (line 38, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v <= x)) // "tests/todo/MergeSort.new.min.fq" (line 39, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v > x)) // "tests/todo/MergeSort.new.min.fq" (line 40, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v >= x)) // "tests/todo/MergeSort.new.min.fq" (line 41, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v = x)) // "tests/todo/MergeSort.new.min.fq" (line 42, column 8)-qualif Cmp(v : @(0), x : @(0)): ((v != x)) // "tests/todo/MergeSort.new.min.fq" (line 43, column 8)-qualif One(v : int): ((v = 1)) // "tests/todo/MergeSort.new.min.fq" (line 44, column 8)-qualif True1(v : GHC.Types.Bool): ((Prop v)) // "tests/todo/MergeSort.new.min.fq" (line 45, column 8)-qualif False1(v : GHC.Types.Bool): ((~ ((Prop v)))) // "tests/todo/MergeSort.new.min.fq" (line 46, column 8)-qualif Papp(v : @(0), p : (Pred @(0))): ((papp1 p v)) // "tests/todo/MergeSort.new.min.fq" (line 47, column 8)-qualif Papp2(v : @(1), x : @(0), p : (Pred @(1) @(0))): ((papp2 p v x)) // "tests/todo/MergeSort.new.min.fq" (line 48, column 8)-qualif Papp3(v : @(2), x : @(0), y : @(1), p : (Pred @(2) @(0) @(1))): ((papp3 p v x y)) // "tests/todo/MergeSort.new.min.fq" (line 49, column 8)---cut $k_##795-cut $k_##1160-cut $k_##1118-cut $k_##753-cut $k_##1115-cut $k_##792-cut $k_##750-cut $k_##746-cut $k_##1111-cut $k_##1153-cut $k_##788-cut $k_##1157---pack $k_##686 : 0-pack $k_##671 : 0-pack $k_##655 : 0-pack $k_##679 : 0-pack $k_##667 : 0-pack $k_##659 : 0-pack $k_##662 : 0-pack $k_##674 : 0-pack $k_##683 : 0-pack $k_##572 : 1-pack $k_##560 : 1-pack $k_##556 : 1-pack $k_##584 : 1-pack $k_##575 : 1-pack $k_##587 : 1-pack $k_##563 : 1-pack $k_##568 : 1-pack $k_##580 : 1-pack $k_##883 : 2-pack $k_##907 : 2-pack $k_##890 : 2-pack $k_##914 : 2-pack $k_##899 : 2-pack $k_##902 : 2-pack $k_##911 : 2-pack $k_##895 : 2-pack $k_##887 : 2-pack $k_##314 : 3-pack $k_##321 : 3-pack $k_##318 : 3-pack $k_##753 : 4-pack $k_##750 : 4-pack $k_##746 : 4-pack $k_##1020 : 5-pack $k_##1017 : 5-pack $k_##540 : 6-pack $k_##543 : 6-pack $k_##639 : 7-pack $k_##642 : 7-pack $k_##971 : 8-pack $k_##968 : 8-pack $k_##168 : 9-pack $k_##175 : 9-pack $k_##172 : 9-pack $k_##1118 : 10-pack $k_##1115 : 10-pack $k_##1111 : 10-pack $k_##256 : 11-pack $k_##259 : 11-pack $k_##252 : 11-pack $k_##1037 : 12-pack $k_##1040 : 12-pack $k_##237 : 13-pack $k_##241 : 13-pack $k_##244 : 13-pack $k_##467 : 14-pack $k_##470 : 14-pack $k_##415 : 15-pack $k_##418 : 15-pack $k_##1160 : 16-pack $k_##1153 : 16-pack $k_##1157 : 16-pack $k_##387 : 17-pack $k_##390 : 17-pack $k_##867 : 18-pack $k_##864 : 18-pack $k_##844 : 19-pack $k_##841 : 19-pack $k_##1076 : 20-pack $k_##1080 : 20-pack $k_##1083 : 20-pack $k_##338 : 21-pack $k_##335 : 21-pack $k_##795 : 22-pack $k_##792 : 22-pack $k_##788 : 22---constant runFun : (func(2, [(Arrow @(0) @(1)); @(0); @(1)]))-constant addrLen : (func(0, [int; int]))-constant lit$36$$47$Users$47$rjhala$47$research$47$stack$47$liquidhaskell$47$tests$47$pos$47$MergeSort.hs$58$$40$48$44$1$41$$45$$40$52$44$41$41$$124$function$32$merge : (Str)-constant papp5 : (func(10, [(Pred @(0) @(1) @(2) @(3) @(4));- @(5);- @(6);- @(7);- @(8);- @(9);- bool]))-constant x_Tuple21 : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant GHC.Types.False##68 : (GHC.Types.Bool)-constant x_Tuple65 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(4)]))-constant x_Tuple55 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(4)]))-constant x_Tuple33 : (func(3, [(Tuple @(0) @(1) @(2)); @(2)]))-constant x_Tuple77 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(6)]))-constant papp3 : (func(6, [(Pred @(0) @(1) @(2));- @(3);- @(4);- @(5);- bool]))-constant GHC.Types.True##6u : (GHC.Types.Bool)-constant x_Tuple63 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(2)]))-constant x_Tuple41 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(0)]))-constant GHC.Types.LT##6S : (GHC.Types.Ordering)-constant papp4 : (func(8, [(Pred @(0) @(1) @(2) @(3));- @(4);- @(5);- @(6);- @(7);- bool]))-constant x_Tuple64 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(3)]))-constant GHC.Types.GT##6W : (GHC.Types.Ordering)-constant GHC.Types.$58$$35$$35$64 : (func(1, [@(0);- [@(0)];- [@(0)]]))-constant autolen : (func(1, [@(0); int]))-constant x_Tuple52 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(1)]))-constant head : (func(1, [[@(0)]; @(0)]))-constant MergeSort.split##rlx : (func(1, [[@(0)];- (Tuple [@(0)] [@(0)])]))-constant null : (func(1, [[@(0)]; bool]))-constant GHC.Classes.$60$$61$$35$$35$r4 : (func(1, [@(0);- @(0);- GHC.Types.Bool]))-constant papp2 : (func(4, [(Pred @(0) @(1)); @(2); @(3); bool]))-constant x_Tuple62 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(1)]))-constant GHC.Tuple.$40$$44$$41$$35$$35$74 : (func(2, [@(0);- @(1);- (Tuple @(0) @(1))]))-constant fromJust : (func(1, [(GHC.Base.Maybe @(0)); @(0)]))-constant papp7 : (func(14, [(Pred @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(7);- @(8);- @(9);- @(10);- @(11);- @(12);- @(13);- bool]))-constant MergeSort.sort##rjG : (func(1, [[@(0)]; [@(0)]]))-constant x_Tuple53 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(2)]))-constant x_Tuple71 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(0)]))-constant x_Tuple74 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(3)]))-constant len : (func(2, [(@(0) @(1)); int]))-constant papp6 : (func(12, [(Pred @(0) @(1) @(2) @(3) @(4) @(5));- @(6);- @(7);- @(8);- @(9);- @(10);- @(11);- bool]))-constant x_Tuple22 : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant x_Tuple66 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(5)]))-constant x_Tuple44 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(3)]))-constant strLen : (func(0, [int; int]))-constant x_Tuple72 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(1)]))-constant isJust : (func(1, [(GHC.Base.Maybe @(0)); bool]))-constant Prop : (func(0, [GHC.Types.Bool; bool]))-constant x_Tuple31 : (func(3, [(Tuple @(0) @(1) @(2)); @(0)]))-constant x_Tuple75 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(4)]))-constant papp1 : (func(2, [(Pred @(0)); @(1); bool]))-constant x_Tuple61 : (func(6, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5));- @(0)]))-constant x_Tuple43 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(2)]))-constant tail : (func(1, [[@(0)]; [@(0)]]))-constant GHC.Types.EQ##6U : (GHC.Types.Ordering)-constant Control.Exception.Base.patError##0e : (func(1, [int;- @(0)]))-constant MergeSort.merge##rly : (func(1, [[@(0)]; [@(0)]; [@(0)]]))-constant x_Tuple51 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(0)]))-constant x_Tuple73 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(2)]))-constant GHC.Types.$91$$93$$35$$35$6m : (func(1, [[@(0)]]))-constant x_Tuple54 : (func(5, [(Tuple @(0) @(1) @(2) @(3) @(4));- @(3)]))-constant cmp : (func(0, [GHC.Types.Ordering; GHC.Types.Ordering]))-constant x_Tuple32 : (func(3, [(Tuple @(0) @(1) @(2)); @(1)]))-constant x_Tuple76 : (func(7, [(Tuple @(0) @(1) @(2) @(3) @(4) @(5) @(6));- @(5)]))-constant snd : (func(2, [(Tuple @(0) @(1)); @(1)]))-constant fst : (func(2, [(Tuple @(0) @(1)); @(0)]))-constant x_Tuple42 : (func(4, [(Tuple @(0) @(1) @(2) @(3));- @(1)]))-constant GHC.Prim.void###0l : (GHC.Prim.Void#)---bind 0 GHC.Prim.void###0l : {VV##84 : GHC.Prim.Void# | []}-bind 1 GHC.Types.False##68 : {VV##86 : GHC.Types.Bool | []}-bind 2 GHC.Types.$91$$93$$35$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 3 GHC.Types.True##6u : {VV##88 : GHC.Types.Bool | []}-bind 4 GHC.Types.EQ##6U : {VV##91 : GHC.Types.Ordering | [(VV##91 = GHC.Types.EQ##6U)]}-bind 5 GHC.Types.LT##6S : {VV##92 : GHC.Types.Ordering | [(VV##92 = GHC.Types.LT##6S)]}-bind 6 GHC.Types.GT##6W : {VV##93 : GHC.Types.Ordering | [(VV##93 = GHC.Types.GT##6W)]}-bind 7 GHC.Types.True##6u : {v##4 : GHC.Types.Bool | [(Prop v##4)]}-bind 8 GHC.Types.False##68 : {v##5 : GHC.Types.Bool | [(~ ((Prop v##5)))]}-bind 9 GHC.Types.False##68 : {v##5 : GHC.Types.Bool | [(~ ((Prop v##5)))]}-bind 10 GHC.Types.$91$$93$$35$$35$6m : {VV : func(1, [[@(0)]]) | []}-bind 11 GHC.Types.True##6u : {v##4 : GHC.Types.Bool | [(Prop v##4)]}-bind 12 fix$36$$36$dOrd_azK : {VV##119 : (GHC.Classes.Ord a_azo) | []}-bind 13 xs##ayP : {VV##120 : [a_azo] | [((len VV##120) >= 0)]}-bind 14 ds_dMl : {VV##121 : [a_azo] | [((len VV##121) >= 0)]}-bind 15 lq_anf$##dMK : {lq_tmp$x##123 : [a_azo] | [((len lq_tmp$x##123) >= 0);- (lq_tmp$x##123 = ds_dMl);- ((len lq_tmp$x##123) >= 0)]}-bind 16 lq_anf$##dMK : {lq_tmp$x##127 : [a_azo] | [((len lq_tmp$x##127) >= 0);- (lq_tmp$x##127 = ds_dMl);- ((len lq_tmp$x##127) >= 0);- ((len lq_tmp$x##127) >= 0)]}-bind 17 lq_anf$##dMK : {lq_tmp$x##127 : [a_azo] | [((len lq_tmp$x##127) >= 0);- (lq_tmp$x##127 = ds_dMl);- ((len lq_tmp$x##127) >= 0);- ((len lq_tmp$x##127) = 0);- ((null lq_tmp$x##127) <=> true);- (lq_tmp$x##127 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##127) = 0);- ((null lq_tmp$x##127) <=> true);- ((len lq_tmp$x##127) >= 0)]}-bind 18 lq_anf$##dMK : {lq_tmp$x##140 : [a_azo] | [((len lq_tmp$x##140) >= 0);- (lq_tmp$x##140 = ds_dMl);- ((len lq_tmp$x##140) >= 0);- ((len lq_tmp$x##140) >= 0)]}-bind 19 lq_anf$##dMU : {VV : a_azo | []}-bind 20 lq_anf$##dMV : {lq_tmp$x##154 : [a_azo] | [((len lq_tmp$x##154) >= 0)]}-bind 21 lq_anf$##dMK : {lq_tmp$x##140 : [a_azo] | [((len lq_tmp$x##140) >= 0);- (lq_tmp$x##140 = ds_dMl);- ((len lq_tmp$x##140) >= 0);- ((len lq_tmp$x##140) = (1 + (len lq_anf$##dMV)));- ((null lq_tmp$x##140) <=> false);- ((tail lq_tmp$x##140) = lq_anf$##dMV);- ((head lq_tmp$x##140) = lq_anf$##dMU);- (lq_tmp$x##140 = (GHC.Types.$58$$35$$35$64 lq_anf$##dMU lq_anf$##dMV));- ((len lq_tmp$x##140) = (1 + (len lq_anf$##dMV)));- ((null lq_tmp$x##140) <=> false);- ((tail lq_tmp$x##140) = lq_anf$##dMV);- ((head lq_tmp$x##140) = lq_anf$##dMU);- ((len lq_tmp$x##140) >= 0)]}-bind 22 ds_dMr : {VV##163 : GHC.Prim.Void# | [$k_##164]}-bind 23 lq_anf$##dML : {lq_tmp$x##178 : [a_azo] | [((len lq_tmp$x##178) >= 0);- (lq_tmp$x##178 = xs##ayP);- ((len lq_tmp$x##178) >= 0)]}-bind 24 lq_anf$##dML : {lq_tmp$x##182 : [a_azo] | [((len lq_tmp$x##182) >= 0);- (lq_tmp$x##182 = xs##ayP);- ((len lq_tmp$x##182) >= 0);- ((len lq_tmp$x##182) >= 0)]}-bind 25 lq_anf$##dML : {lq_tmp$x##182 : [a_azo] | [((len lq_tmp$x##182) >= 0);- (lq_tmp$x##182 = xs##ayP);- ((len lq_tmp$x##182) >= 0);- ((len lq_tmp$x##182) = 0);- ((null lq_tmp$x##182) <=> true);- (lq_tmp$x##182 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##182) = 0);- ((null lq_tmp$x##182) <=> true);- ((len lq_tmp$x##182) >= 0)]}-bind 26 lq_anf$##dML : {lq_tmp$x##195 : [a_azo] | [((len lq_tmp$x##195) >= 0);- (lq_tmp$x##195 = xs##ayP);- ((len lq_tmp$x##195) >= 0);- ((len lq_tmp$x##195) >= 0)]}-bind 27 x##ayR : {VV : a_azo | []}-bind 28 xs##ayS : {lq_tmp$x##209 : [a_azo] | [((len lq_tmp$x##209) >= 0)]}-bind 29 lq_anf$##dML : {lq_tmp$x##195 : [a_azo] | [((len lq_tmp$x##195) >= 0);- (lq_tmp$x##195 = xs##ayP);- ((len lq_tmp$x##195) >= 0);- ((len lq_tmp$x##195) = (1 + (len xs##ayS)));- ((null lq_tmp$x##195) <=> false);- ((tail lq_tmp$x##195) = xs##ayS);- ((head lq_tmp$x##195) = x##ayR);- (lq_tmp$x##195 = (GHC.Types.$58$$35$$35$64 x##ayR xs##ayS));- ((len lq_tmp$x##195) = (1 + (len xs##ayS)));- ((null lq_tmp$x##195) <=> false);- ((tail lq_tmp$x##195) = xs##ayS);- ((head lq_tmp$x##195) = x##ayR);- ((len lq_tmp$x##195) >= 0)]}-bind 30 lq_anf$##dMM : {lq_tmp$x##219 : [a_azo] | [((len lq_tmp$x##219) >= 0);- (lq_tmp$x##219 = ds_dMl);- ((len lq_tmp$x##219) >= 0)]}-bind 31 lq_anf$##dMM : {lq_tmp$x##223 : [a_azo] | [((len lq_tmp$x##223) >= 0);- (lq_tmp$x##223 = ds_dMl);- ((len lq_tmp$x##223) >= 0);- ((len lq_tmp$x##223) >= 0)]}-bind 32 lq_anf$##dMM : {lq_tmp$x##223 : [a_azo] | [((len lq_tmp$x##223) >= 0);- (lq_tmp$x##223 = ds_dMl);- ((len lq_tmp$x##223) >= 0);- ((len lq_tmp$x##223) = 0);- ((null lq_tmp$x##223) <=> true);- (lq_tmp$x##223 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##223) = 0);- ((null lq_tmp$x##223) <=> true);- ((len lq_tmp$x##223) >= 0)]}-bind 33 ds_dMn : {VV##232 : GHC.Prim.Void# | [$k_##233]}-bind 34 lq_anf$##dMN : {lq_tmp$x##246 : int | [(lq_tmp$x##246 ~~ lit$36$$47$Users$47$rjhala$47$research$47$stack$47$liquidhaskell$47$tests$47$pos$47$MergeSort.hs$58$$40$48$44$1$41$$45$$40$52$44$41$41$$124$function$32$merge);- ((strLen lq_tmp$x##246) = 95)]}-bind 35 lq_anf$##dMM : {lq_tmp$x##266 : [a_azo] | [((len lq_tmp$x##266) >= 0);- (lq_tmp$x##266 = ds_dMl);- ((len lq_tmp$x##266) >= 0);- ((len lq_tmp$x##266) >= 0)]}-bind 36 y##ayT : {VV : a_azo | []}-bind 37 ys##ayU : {lq_tmp$x##280 : [a_azo] | [((len lq_tmp$x##280) >= 0)]}-bind 38 lq_anf$##dMM : {lq_tmp$x##266 : [a_azo] | [((len lq_tmp$x##266) >= 0);- (lq_tmp$x##266 = ds_dMl);- ((len lq_tmp$x##266) >= 0);- ((len lq_tmp$x##266) = (1 + (len ys##ayU)));- ((null lq_tmp$x##266) <=> false);- ((tail lq_tmp$x##266) = ys##ayU);- ((head lq_tmp$x##266) = y##ayT);- (lq_tmp$x##266 = (GHC.Types.$58$$35$$35$64 y##ayT ys##ayU));- ((len lq_tmp$x##266) = (1 + (len ys##ayU)));- ((null lq_tmp$x##266) <=> false);- ((tail lq_tmp$x##266) = ys##ayU);- ((head lq_tmp$x##266) = y##ayT);- ((len lq_tmp$x##266) >= 0)]}-bind 39 lq_anf$##dMO : {lq_tmp$x##290 : GHC.Types.Bool | [((Prop lq_tmp$x##290) <=> (x##ayR <= y##ayT))]}-bind 40 lq_anf$##dMP : {lq_tmp$x##302 : GHC.Types.Bool | [((Prop lq_tmp$x##302) <=> (x##ayR <= y##ayT));- (lq_tmp$x##302 = lq_anf$##dMO)]}-bind 41 lq_anf$##dMP : {lq_tmp$x##304 : GHC.Types.Bool | [((Prop lq_tmp$x##304) <=> (x##ayR <= y##ayT));- (lq_tmp$x##304 = lq_anf$##dMO)]}-bind 42 lq_anf$##dMP : {lq_tmp$x##304 : GHC.Types.Bool | [((Prop lq_tmp$x##304) <=> (x##ayR <= y##ayT));- (lq_tmp$x##304 = lq_anf$##dMO);- (~ ((Prop lq_tmp$x##304)));- (~ ((Prop lq_tmp$x##304)));- (~ ((Prop lq_tmp$x##304)))]}-bind 43 ds_dMp : {VV##309 : GHC.Prim.Void# | [$k_##310]}-bind 44 lq_tmp$x##340 : {VV : a_azo | []}-bind 45 lq_anf$##dMQ : {lq_tmp$x##326 : [a_azo] | [((len lq_tmp$x##326) = (1 + (len xs##ayS)));- ((null lq_tmp$x##326) <=> false);- ((tail lq_tmp$x##326) = xs##ayS);- ((head lq_tmp$x##326) = x##ayR);- ((len lq_tmp$x##326) >= 0)]}-bind 46 lq_anf$##dMR : {VV##374 : [a_azo] | [((len VV##374) = ((len lq_anf$##dMQ) + (len ys##ayU)));- ((len VV##374) >= 0)]}-bind 47 lq_tmp$x##392 : {VV : a_azo | []}-bind 48 lq_anf$##dMP : {lq_tmp$x##398 : GHC.Types.Bool | [((Prop lq_tmp$x##398) <=> (x##ayR <= y##ayT));- (lq_tmp$x##398 = lq_anf$##dMO)]}-bind 49 lq_anf$##dMP : {lq_tmp$x##398 : GHC.Types.Bool | [((Prop lq_tmp$x##398) <=> (x##ayR <= y##ayT));- (lq_tmp$x##398 = lq_anf$##dMO);- (Prop lq_tmp$x##398);- (Prop lq_tmp$x##398);- (Prop lq_tmp$x##398)]}-bind 50 lq_tmp$x##420 : {VV : a_azo | []}-bind 51 lq_anf$##dMS : {lq_tmp$x##406 : [a_azo] | [((len lq_tmp$x##406) = (1 + (len ys##ayU)));- ((null lq_tmp$x##406) <=> false);- ((tail lq_tmp$x##406) = ys##ayU);- ((head lq_tmp$x##406) = y##ayT);- ((len lq_tmp$x##406) >= 0)]}-bind 52 lq_anf$##dMT : {VV##454 : [a_azo] | [((len VV##454) = ((len xs##ayS) + (len lq_anf$##dMS)));- ((len VV##454) >= 0)]}-bind 53 lq_tmp$x##472 : {VV : a_azo | []}-bind 54 ds_dMs : {VV##521 : [a_azx] | [((len VV##521) >= 0)]}-bind 55 lq_anf$##dMW : {lq_tmp$x##523 : [a_azx] | [((len lq_tmp$x##523) >= 0);- (lq_tmp$x##523 = ds_dMs);- ((len lq_tmp$x##523) >= 0)]}-bind 56 lq_anf$##dMW : {lq_tmp$x##527 : [a_azx] | [((len lq_tmp$x##527) >= 0);- (lq_tmp$x##527 = ds_dMs);- ((len lq_tmp$x##527) >= 0);- ((len lq_tmp$x##527) >= 0)]}-bind 57 lq_anf$##dMW : {lq_tmp$x##527 : [a_azx] | [((len lq_tmp$x##527) >= 0);- (lq_tmp$x##527 = ds_dMs);- ((len lq_tmp$x##527) >= 0);- ((len lq_tmp$x##527) = 0);- ((null lq_tmp$x##527) <=> true);- (lq_tmp$x##527 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##527) = 0);- ((null lq_tmp$x##527) <=> true);- ((len lq_tmp$x##527) >= 0)]}-bind 58 lq_tmp$x##545 : {VV : a_azx | []}-bind 59 lq_anf$##dMX : {lq_tmp$x##537 : [a_azx] | [((len lq_tmp$x##537) = 0);- ((null lq_tmp$x##537) <=> true);- ((len lq_tmp$x##537) >= 0)]}-bind 60 lq_tmp$x##589 : {VV##590 : [a_azx] | [((len VV##590) >= 0)]}-bind 61 lq_anf$##dMW : {lq_tmp$x##598 : [a_azx] | [((len lq_tmp$x##598) >= 0);- (lq_tmp$x##598 = ds_dMs);- ((len lq_tmp$x##598) >= 0);- ((len lq_tmp$x##598) >= 0)]}-bind 62 x##ayC : {VV : a_azx | []}-bind 63 ds_dMt : {lq_tmp$x##612 : [a_azx] | [((len lq_tmp$x##612) >= 0)]}-bind 64 lq_anf$##dMW : {lq_tmp$x##598 : [a_azx] | [((len lq_tmp$x##598) >= 0);- (lq_tmp$x##598 = ds_dMs);- ((len lq_tmp$x##598) >= 0);- ((len lq_tmp$x##598) = (1 + (len ds_dMt)));- ((null lq_tmp$x##598) <=> false);- ((tail lq_tmp$x##598) = ds_dMt);- ((head lq_tmp$x##598) = x##ayC);- (lq_tmp$x##598 = (GHC.Types.$58$$35$$35$64 x##ayC ds_dMt));- ((len lq_tmp$x##598) = (1 + (len ds_dMt)));- ((null lq_tmp$x##598) <=> false);- ((tail lq_tmp$x##598) = ds_dMt);- ((head lq_tmp$x##598) = x##ayC);- ((len lq_tmp$x##598) >= 0)]}-bind 65 lq_anf$##dMY : {lq_tmp$x##622 : [a_azx] | [((len lq_tmp$x##622) >= 0);- (lq_tmp$x##622 = ds_dMt);- ((len lq_tmp$x##622) >= 0)]}-bind 66 lq_anf$##dMY : {lq_tmp$x##626 : [a_azx] | [((len lq_tmp$x##626) >= 0);- (lq_tmp$x##626 = ds_dMt);- ((len lq_tmp$x##626) >= 0);- ((len lq_tmp$x##626) >= 0)]}-bind 67 lq_anf$##dMY : {lq_tmp$x##626 : [a_azx] | [((len lq_tmp$x##626) >= 0);- (lq_tmp$x##626 = ds_dMt);- ((len lq_tmp$x##626) >= 0);- ((len lq_tmp$x##626) = 0);- ((null lq_tmp$x##626) <=> true);- (lq_tmp$x##626 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##626) = 0);- ((null lq_tmp$x##626) <=> true);- ((len lq_tmp$x##626) >= 0)]}-bind 68 lq_tmp$x##644 : {VV : a_azx | []}-bind 69 lq_anf$##dMZ : {lq_tmp$x##636 : [a_azx] | [((len lq_tmp$x##636) = 0);- ((null lq_tmp$x##636) <=> true);- ((len lq_tmp$x##636) >= 0)]}-bind 70 lq_tmp$x##688 : {VV##689 : [a_azx] | [((len VV##689) >= 0)]}-bind 71 lq_anf$##dMY : {lq_tmp$x##697 : [a_azx] | [((len lq_tmp$x##697) >= 0);- (lq_tmp$x##697 = ds_dMt);- ((len lq_tmp$x##697) >= 0);- ((len lq_tmp$x##697) >= 0)]}-bind 72 y##ayD : {VV : a_azx | []}-bind 73 zs##ayE : {lq_tmp$x##711 : [a_azx] | [((len lq_tmp$x##711) >= 0)]}-bind 74 lq_anf$##dMY : {lq_tmp$x##697 : [a_azx] | [((len lq_tmp$x##697) >= 0);- (lq_tmp$x##697 = ds_dMt);- ((len lq_tmp$x##697) >= 0);- ((len lq_tmp$x##697) = (1 + (len zs##ayE)));- ((null lq_tmp$x##697) <=> false);- ((tail lq_tmp$x##697) = zs##ayE);- ((head lq_tmp$x##697) = y##ayD);- (lq_tmp$x##697 = (GHC.Types.$58$$35$$35$64 y##ayD zs##ayE));- ((len lq_tmp$x##697) = (1 + (len zs##ayE)));- ((null lq_tmp$x##697) <=> false);- ((tail lq_tmp$x##697) = zs##ayE);- ((head lq_tmp$x##697) = y##ayD);- ((len lq_tmp$x##697) >= 0)]}-bind 75 ds_dMw : {v##0 : (Tuple [a_azx] [a_azx]) | [(((len (fst v##0)) + (len (snd v##0))) = (len zs##ayE))]}-bind 76 ds_dMw : {lq_tmp$x##762 : (Tuple [a_azx] [a_azx]) | [(((len (fst lq_tmp$x##762)) + (len (snd lq_tmp$x##762))) = (len zs##ayE))]}-bind 77 xs##aA4 : {lq_tmp$x##756 : [a_azx] | [(((len lq_tmp$x##756) > 1) => ((len lq_tmp$x##756) < (len zs##ayE)));- ((len lq_tmp$x##756) >= 0)]}-bind 78 ys##XAl : {lq_tmp$x##758 : [a_azx] | [((len lq_tmp$x##758) >= 0)]}-bind 79 ds_dMw : {lq_tmp$x##762 : (Tuple [a_azx] [a_azx]) | [(((len (fst lq_tmp$x##762)) + (len (snd lq_tmp$x##762))) = (len zs##ayE));- ((snd lq_tmp$x##762) = ys##XAl);- ((fst lq_tmp$x##762) = xs##aA4);- ((x_Tuple22 lq_tmp$x##762) = ys##XAl);- ((x_Tuple21 lq_tmp$x##762) = xs##aA4);- (lq_tmp$x##762 = (GHC.Tuple.$40$$44$$41$$35$$35$74 xs##aA4 ys##XAl));- ((snd lq_tmp$x##762) = ys##XAl);- ((fst lq_tmp$x##762) = xs##aA4);- ((x_Tuple22 lq_tmp$x##762) = ys##XAl);- ((x_Tuple21 lq_tmp$x##762) = xs##aA4)]}-bind 80 xs##aA4 : {VV##752 : [a_azx] | [$k_##753;- ((len VV##752) >= 0)]}-bind 81 ds_dMw : {lq_tmp$x##804 : (Tuple [a_azx] [a_azx]) | [(((len (fst lq_tmp$x##804)) + (len (snd lq_tmp$x##804))) = (len zs##ayE))]}-bind 82 xs##aA4 : {lq_tmp$x##798 : [a_azx] | [((len lq_tmp$x##798) >= 0)]}-bind 83 ys##aA5 : {lq_tmp$x##800 : [a_azx] | [(((len lq_tmp$x##800) > 1) => ((len lq_tmp$x##800) < (len zs##ayE)));- ((len lq_tmp$x##800) >= 0)]}-bind 84 ds_dMw : {lq_tmp$x##804 : (Tuple [a_azx] [a_azx]) | [(((len (fst lq_tmp$x##804)) + (len (snd lq_tmp$x##804))) = (len zs##ayE));- ((snd lq_tmp$x##804) = ys##aA5);- ((fst lq_tmp$x##804) = xs##aA4);- ((x_Tuple22 lq_tmp$x##804) = ys##aA5);- ((x_Tuple21 lq_tmp$x##804) = xs##aA4);- (lq_tmp$x##804 = (GHC.Tuple.$40$$44$$41$$35$$35$74 xs##aA4 ys##aA5));- ((snd lq_tmp$x##804) = ys##aA5);- ((fst lq_tmp$x##804) = xs##aA4);- ((x_Tuple22 lq_tmp$x##804) = ys##aA5);- ((x_Tuple21 lq_tmp$x##804) = xs##aA4)]}-bind 85 ys##aA5 : {VV##794 : [a_azx] | [$k_##795;- ((len VV##794) >= 0)]}-bind 86 lq_tmp$x##846 : {VV : a_azx | []}-bind 87 lq_anf$##dN0 : {lq_tmp$x##832 : [a_azx] | [((len lq_tmp$x##832) = (1 + (len xs##aA4)));- ((null lq_tmp$x##832) <=> false);- ((tail lq_tmp$x##832) = xs##aA4);- ((head lq_tmp$x##832) = x##ayC);- ((len lq_tmp$x##832) >= 0)]}-bind 88 lq_tmp$x##869 : {VV : a_azx | []}-bind 89 lq_anf$##dN1 : {lq_tmp$x##855 : [a_azx] | [((len lq_tmp$x##855) = (1 + (len ys##aA5)));- ((null lq_tmp$x##855) <=> false);- ((tail lq_tmp$x##855) = ys##aA5);- ((head lq_tmp$x##855) = y##ayD);- ((len lq_tmp$x##855) >= 0)]}-bind 90 lq_tmp$x##916 : {VV##917 : [a_azx] | [((len VV##917) >= 0)]}-bind 91 fix$36$$36$dOrd_aAe : {VV##948 : (GHC.Classes.Ord a_azJ) | []}-bind 92 ds_dMB : {VV##949 : [a_azJ] | [((len VV##949) >= 0)]}-bind 93 lq_anf$##dN2 : {lq_tmp$x##951 : [a_azJ] | [((len lq_tmp$x##951) >= 0);- (lq_tmp$x##951 = ds_dMB);- ((len lq_tmp$x##951) >= 0)]}-bind 94 lq_anf$##dN2 : {lq_tmp$x##955 : [a_azJ] | [((len lq_tmp$x##955) >= 0);- (lq_tmp$x##955 = ds_dMB);- ((len lq_tmp$x##955) >= 0);- ((len lq_tmp$x##955) >= 0)]}-bind 95 lq_anf$##dN2 : {lq_tmp$x##955 : [a_azJ] | [((len lq_tmp$x##955) >= 0);- (lq_tmp$x##955 = ds_dMB);- ((len lq_tmp$x##955) >= 0);- ((len lq_tmp$x##955) = 0);- ((null lq_tmp$x##955) <=> true);- (lq_tmp$x##955 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##955) = 0);- ((null lq_tmp$x##955) <=> true);- ((len lq_tmp$x##955) >= 0)]}-bind 96 lq_tmp$x##973 : {VV : a_azJ | []}-bind 97 lq_anf$##dN2 : {lq_tmp$x##976 : [a_azJ] | [((len lq_tmp$x##976) >= 0);- (lq_tmp$x##976 = ds_dMB);- ((len lq_tmp$x##976) >= 0);- ((len lq_tmp$x##976) >= 0)]}-bind 98 x##ayy : {VV : a_azJ | []}-bind 99 ds_dMC : {lq_tmp$x##990 : [a_azJ] | [((len lq_tmp$x##990) >= 0)]}-bind 100 lq_anf$##dN2 : {lq_tmp$x##976 : [a_azJ] | [((len lq_tmp$x##976) >= 0);- (lq_tmp$x##976 = ds_dMB);- ((len lq_tmp$x##976) >= 0);- ((len lq_tmp$x##976) = (1 + (len ds_dMC)));- ((null lq_tmp$x##976) <=> false);- ((tail lq_tmp$x##976) = ds_dMC);- ((head lq_tmp$x##976) = x##ayy);- (lq_tmp$x##976 = (GHC.Types.$58$$35$$35$64 x##ayy ds_dMC));- ((len lq_tmp$x##976) = (1 + (len ds_dMC)));- ((null lq_tmp$x##976) <=> false);- ((tail lq_tmp$x##976) = ds_dMC);- ((head lq_tmp$x##976) = x##ayy);- ((len lq_tmp$x##976) >= 0)]}-bind 101 lq_anf$##dN3 : {lq_tmp$x##1000 : [a_azJ] | [((len lq_tmp$x##1000) >= 0);- (lq_tmp$x##1000 = ds_dMC);- ((len lq_tmp$x##1000) >= 0)]}-bind 102 lq_anf$##dN3 : {lq_tmp$x##1004 : [a_azJ] | [((len lq_tmp$x##1004) >= 0);- (lq_tmp$x##1004 = ds_dMC);- ((len lq_tmp$x##1004) >= 0);- ((len lq_tmp$x##1004) >= 0)]}-bind 103 lq_anf$##dN3 : {lq_tmp$x##1004 : [a_azJ] | [((len lq_tmp$x##1004) >= 0);- (lq_tmp$x##1004 = ds_dMC);- ((len lq_tmp$x##1004) >= 0);- ((len lq_tmp$x##1004) = 0);- ((null lq_tmp$x##1004) <=> true);- (lq_tmp$x##1004 = GHC.Types.$91$$93$$35$$35$6m);- ((len lq_tmp$x##1004) = 0);- ((null lq_tmp$x##1004) <=> true);- ((len lq_tmp$x##1004) >= 0)]}-bind 104 lq_tmp$x##1022 : {VV : a_azJ | []}-bind 105 lq_anf$##dN6 : {lq_tmp$x##1014 : [a_azJ] | [((len lq_tmp$x##1014) = 0);- ((null lq_tmp$x##1014) <=> true);- ((len lq_tmp$x##1014) >= 0)]}-bind 106 lq_tmp$x##1042 : {VV : a_azJ | []}-bind 107 lq_anf$##dN3 : {lq_tmp$x##1048 : [a_azJ] | [((len lq_tmp$x##1048) >= 0);- (lq_tmp$x##1048 = ds_dMC);- ((len lq_tmp$x##1048) >= 0);- ((len lq_tmp$x##1048) >= 0)]}-bind 108 lq_anf$##dN7 : {VV : a_azJ | []}-bind 109 lq_anf$##dN8 : {lq_tmp$x##1062 : [a_azJ] | [((len lq_tmp$x##1062) >= 0)]}-bind 110 lq_anf$##dN3 : {lq_tmp$x##1048 : [a_azJ] | [((len lq_tmp$x##1048) >= 0);- (lq_tmp$x##1048 = ds_dMC);- ((len lq_tmp$x##1048) >= 0);- ((len lq_tmp$x##1048) = (1 + (len lq_anf$##dN8)));- ((null lq_tmp$x##1048) <=> false);- ((tail lq_tmp$x##1048) = lq_anf$##dN8);- ((head lq_tmp$x##1048) = lq_anf$##dN7);- (lq_tmp$x##1048 = (GHC.Types.$58$$35$$35$64 lq_anf$##dN7 lq_anf$##dN8));- ((len lq_tmp$x##1048) = (1 + (len lq_anf$##dN8)));- ((null lq_tmp$x##1048) <=> false);- ((tail lq_tmp$x##1048) = lq_anf$##dN8);- ((head lq_tmp$x##1048) = lq_anf$##dN7);- ((len lq_tmp$x##1048) >= 0)]}-bind 111 ds_dMJ : {VV##1071 : GHC.Prim.Void# | [$k_##1072]}-bind 112 ds_dMD : {lq_tmp$x##1094 : (Tuple [a_azJ] [a_azJ]) | [(((len (fst lq_tmp$x##1094)) + (len (snd lq_tmp$x##1094))) = (len ds_dMB))]}-bind 113 ds_dMD : {lq_tmp$x##1127 : (Tuple [a_azJ] [a_azJ]) | [(((len (fst lq_tmp$x##1127)) + (len (snd lq_tmp$x##1127))) = (len ds_dMB))]}-bind 114 xs1##aAj : {lq_tmp$x##1121 : [a_azJ] | [(((len lq_tmp$x##1121) > 1) => ((len lq_tmp$x##1121) < (len ds_dMB)));- ((len lq_tmp$x##1121) >= 0)]}-bind 115 xs2##XAw : {lq_tmp$x##1123 : [a_azJ] | [((len lq_tmp$x##1123) >= 0)]}-bind 116 ds_dMD : {lq_tmp$x##1127 : (Tuple [a_azJ] [a_azJ]) | [(((len (fst lq_tmp$x##1127)) + (len (snd lq_tmp$x##1127))) = (len ds_dMB));- ((snd lq_tmp$x##1127) = xs2##XAw);- ((fst lq_tmp$x##1127) = xs1##aAj);- ((x_Tuple22 lq_tmp$x##1127) = xs2##XAw);- ((x_Tuple21 lq_tmp$x##1127) = xs1##aAj);- (lq_tmp$x##1127 = (GHC.Tuple.$40$$44$$41$$35$$35$74 xs1##aAj xs2##XAw));- ((snd lq_tmp$x##1127) = xs2##XAw);- ((fst lq_tmp$x##1127) = xs1##aAj);- ((x_Tuple22 lq_tmp$x##1127) = xs2##XAw);- ((x_Tuple21 lq_tmp$x##1127) = xs1##aAj)]}-bind 117 xs1##aAj : {VV##1117 : [a_azJ] | [$k_##1118;- ((len VV##1117) >= 0)]}-bind 118 ds_dMD : {lq_tmp$x##1169 : (Tuple [a_azJ] [a_azJ]) | [(((len (fst lq_tmp$x##1169)) + (len (snd lq_tmp$x##1169))) = (len ds_dMB))]}-bind 119 xs1##aAj : {lq_tmp$x##1163 : [a_azJ] | [((len lq_tmp$x##1163) >= 0)]}-bind 120 xs2##aAk : {lq_tmp$x##1165 : [a_azJ] | [(((len lq_tmp$x##1165) > 1) => ((len lq_tmp$x##1165) < (len ds_dMB)));- ((len lq_tmp$x##1165) >= 0)]}-bind 121 ds_dMD : {lq_tmp$x##1169 : (Tuple [a_azJ] [a_azJ]) | [(((len (fst lq_tmp$x##1169)) + (len (snd lq_tmp$x##1169))) = (len ds_dMB));- ((snd lq_tmp$x##1169) = xs2##aAk);- ((fst lq_tmp$x##1169) = xs1##aAj);- ((x_Tuple22 lq_tmp$x##1169) = xs2##aAk);- ((x_Tuple21 lq_tmp$x##1169) = xs1##aAj);- (lq_tmp$x##1169 = (GHC.Tuple.$40$$44$$41$$35$$35$74 xs1##aAj xs2##aAk));- ((snd lq_tmp$x##1169) = xs2##aAk);- ((fst lq_tmp$x##1169) = xs1##aAj);- ((x_Tuple22 lq_tmp$x##1169) = xs2##aAk);- ((x_Tuple21 lq_tmp$x##1169) = xs1##aAj)]}-bind 122 xs2##aAk : {VV##1159 : [a_azJ] | [$k_##1160;- ((len VV##1159) >= 0)]}-bind 123 lq_anf$##dN4 : {VV##1213 : [a_azJ] | [((len VV##1213) = (len xs1##aAj));- ((len VV##1213) >= 0)]}-bind 124 lq_anf$##dN5 : {VV##1233 : [a_azJ] | [((len VV##1233) = (len xs2##aAk));- ((len VV##1233) >= 0)]}-bind 125 fix$36$$36$dOrd_aAe : {VV##1277 : (GHC.Classes.Ord a_azJ) | []}-bind 126 VV##1278 : {VV##1278 : [a_azJ] | [((len VV##1278) >= 0)]}-bind 127 lq_tmp$x##945 : {VV : a_azJ | []}-bind 128 lq_tmp$x##1270 : {VV##1281 : [a_azJ] | [((len VV##1281) >= 0)]}-bind 129 VV##1282 : {VV##1282 : [a_azJ] | [((len VV##1282) >= 0)]}-bind 130 lq_tmp$x##946 : {VV : a_azJ | []}-bind 131 VV##1285 : {VV##1285 : [a_azJ] | [((len VV##1285) >= 0)]}-bind 132 lq_tmp$x##945 : {VV : a_azJ | []}-bind 133 ds_dMB : {VV##1288 : [a_azJ] | [((len VV##1288) >= 0)]}-bind 134 VV##1289 : {VV##1289 : [a_azJ] | [((len VV##1289) >= 0)]}-bind 135 lq_tmp$x##946 : {VV : a_azJ | []}-bind 136 VV##1292 : {VV##1292 : [a_azJ] | [$k_##1083[VV##1082:=VV##1292][ds_dMJ:=GHC.Prim.void###0l];- ((len VV##1292) >= 0)]}-bind 137 lq_tmp$x##946 : {VV : a_azJ | []}-bind 138 VV##1295 : {VV##1295 : GHC.Prim.Void# | [(VV##1295 = GHC.Prim.void###0l)]}-bind 139 VV##1297 : {VV##1297 : [a_azJ] | [((len VV##1297) = ((len lq_anf$##dN4) + (len lq_anf$##dN5)));- ((len VV##1297) >= 0)]}-bind 140 lq_tmp$x##1078 : {VV : a_azJ | []}-bind 141 VV##1300 : {VV##1300 : [a_azJ] | [((len VV##1300) = (len xs2##aAk));- ((len VV##1300) >= 0);- (VV##1300 = lq_anf$##dN5);- ((len VV##1300) >= 0)]}-bind 142 lq_tmp$x##1250 : {VV : a_azJ | []}-bind 143 VV##1303 : {VV##1303 : [a_azJ] | [((len VV##1303) = (len xs1##aAj));- ((len VV##1303) >= 0);- (VV##1303 = lq_anf$##dN4);- ((len VV##1303) >= 0)]}-bind 144 lq_tmp$x##1249 : {VV : a_azJ | []}-bind 145 VV##1306 : {VV##1306 : [a_azJ] | [$k_##1160[VV##1159:=VV##1306][lq_tmp$x##1231:=VV##1306];- ((len VV##1306) >= 0);- (VV##1306 = xs2##aAk);- ((len VV##1306) >= 0)]}-bind 146 lq_tmp$x##945 : {VV : a_azJ | []}-bind 147 VV##1309 : {VV##1309 : [a_azJ] | [$k_##1118[VV##1117:=VV##1309][lq_tmp$x##1211:=VV##1309];- ((len VV##1309) >= 0);- (VV##1309 = xs1##aAj);- ((len VV##1309) >= 0)]}-bind 148 lq_tmp$x##945 : {VV : a_azJ | []}-bind 149 VV##1312 : {VV##1312 : [a_azJ] | [(((len VV##1312) > 1) => ((len VV##1312) < (len ds_dMB)));- ((len VV##1312) >= 0);- (VV##1312 = xs2##aAk);- ((len VV##1312) >= 0)]}-bind 150 lq_tmp$x##1155 : {VV : a_azJ | []}-bind 151 VV##1315 : {VV##1315 : [a_azJ] | [(((len VV##1315) > 1) => ((len VV##1315) < (len ds_dMB)));- ((len VV##1315) >= 0);- (VV##1315 = xs1##aAj);- ((len VV##1315) >= 0)]}-bind 152 lq_tmp$x##1113 : {VV : a_azJ | []}-bind 153 VV##1318 : {VV##1318 : [a_azJ] | [((len VV##1318) >= 0);- (VV##1318 = ds_dMB);- ((len VV##1318) >= 0)]}-bind 154 lq_tmp$x##1098 : {VV : a_azJ | []}-bind 155 VV##1321 : {VV##1321 : [a_azJ] | [((len VV##1321) = (1 + (len lq_anf$##dN6)));- ((null VV##1321) <=> false);- ((tail VV##1321) = lq_anf$##dN6);- ((head VV##1321) = x##ayy);- ((len VV##1321) >= 0)]}-bind 156 lq_tmp$x##946 : {VV : a_azJ | []}-bind 157 VV##1324 : {VV##1324 : [a_azJ] | [((len VV##1324) = 0);- ((null VV##1324) <=> true);- ((len VV##1324) >= 0);- (VV##1324 = lq_anf$##dN6);- ((len VV##1324) >= 0)]}-bind 158 lq_tmp$x##1034 : {VV : a_azJ | []}-bind 159 VV##1327 : {VV##1327 : [a_azJ] | [((len VV##1327) = 0);- ((null VV##1327) <=> true);- ((len VV##1327) >= 0)]}-bind 160 lq_tmp$x##946 : {VV : a_azJ | []}-bind 161 VV##1330 : {VV##1330 : [a_azx] | [((len VV##1330) >= 0)]}-bind 162 lq_tmp$x##515 : {VV : a_azx | []}-bind 163 ds_dMs : {VV##1333 : [a_azx] | [((len VV##1333) >= 0)]}-bind 164 VV##1334 : {VV##1334 : (Tuple [a_azx] [a_azx]) | []}-bind 165 VV##1336 : {VV##1336 : [a_azx] | [((len VV##1336) >= 0)]}-bind 166 lq_tmp$x##516 : {VV : a_azx | []}-bind 167 VV##1339 : {VV##1339 : [a_azx] | [((len VV##1339) >= 0)]}-bind 168 lq_tmp$x##517 : {VV : a_azx | []}-bind 169 lq_tmp$x##519 : {VV##1342 : [a_azx] | [((len VV##1342) >= 0)]}-bind 170 VV##1343 : {VV##1343 : [a_azx] | [((len VV##1343) >= 0)]}-bind 171 lq_tmp$x##518 : {VV : a_azx | []}-bind 172 VV##1346 : {VV##1346 : (Tuple [a_azx] [a_azx]) | [((snd VV##1346) = lq_anf$##dN1);- ((fst VV##1346) = lq_anf$##dN0);- ((x_Tuple22 VV##1346) = lq_anf$##dN1);- ((x_Tuple21 VV##1346) = lq_anf$##dN0)]}-bind 173 VV##1348 : {VV##1348 : [a_azx] | [$k_##890[VV##889:=VV##1348][lq_tmp$x##893:=VV##1348][lq_tmp$x##879:=lq_anf$##dN0][lq_tmp$x##880:=lq_anf$##dN1][lq_tmp$x##876:=VV##1346];- ((len VV##1348) >= 0)]}-bind 174 lq_tmp$x##516 : {VV : a_azx | []}-bind 175 VV##1351 : {VV##1351 : [a_azx] | [$k_##902[lq_tmp$x##879:=lq_anf$##dN0][lq_tmp$x##905:=VV##1351][lq_tmp$x##880:=lq_anf$##dN1][VV##901:=VV##1351][lq_tmp$x##876:=VV##1346];- ((len VV##1351) >= 0)]}-bind 176 lq_tmp$x##517 : {VV : a_azx | []}-bind 177 lq_tmp$x##519 : {VV##1354 : [a_azx] | [((len VV##1354) >= 0)]}-bind 178 VV##1355 : {VV##1355 : [a_azx] | [$k_##914[lq_tmp$x##881:=lq_tmp$x##519][VV##913:=VV##1355][lq_tmp$x##879:=lq_anf$##dN0][lq_tmp$x##916:=lq_tmp$x##519][lq_tmp$x##905:=VV##1355][lq_tmp$x##880:=lq_anf$##dN1][lq_tmp$x##876:=VV##1346];- ((len VV##1355) >= 0)]}-bind 179 lq_tmp$x##518 : {VV : a_azx | []}-bind 180 VV##1358 : {VV##1358 : [a_azx] | [((len VV##1358) = (1 + (len ys##aA5)));- ((null VV##1358) <=> false);- ((tail VV##1358) = ys##aA5);- ((head VV##1358) = y##ayD);- ((len VV##1358) >= 0);- (VV##1358 = lq_anf$##dN1);- ((len VV##1358) >= 0)]}-bind 181 lq_tmp$x##904 : {VV : a_azx | []}-bind 182 VV##1361 : {VV##1361 : [a_azx] | [((len VV##1361) = (1 + (len xs##aA4)));- ((null VV##1361) <=> false);- ((tail VV##1361) = xs##aA4);- ((head VV##1361) = x##ayC);- ((len VV##1361) >= 0);- (VV##1361 = lq_anf$##dN0);- ((len VV##1361) >= 0)]}-bind 183 lq_tmp$x##892 : {VV : a_azx | []}-bind 184 VV##1364 : {VV##1364 : [a_azx] | [$k_##795[lq_tmp$x##872:=VV##1364][VV##794:=VV##1364];- ((len VV##1364) >= 0);- (VV##1364 = ys##aA5);- ((len VV##1364) >= 0)]}-bind 185 lq_tmp$x##861 : {VV : a_azx | []}-bind 186 VV##1367 : {VV##1367 : [a_azx] | [$k_##753[VV##752:=VV##1367][lq_tmp$x##849:=VV##1367];- ((len VV##1367) >= 0);- (VV##1367 = xs##aA4);- ((len VV##1367) >= 0)]}-bind 187 lq_tmp$x##838 : {VV : a_azx | []}-bind 188 VV##1370 : {VV##1370 : [a_azx] | [(((len VV##1370) > 1) => ((len VV##1370) < (len zs##ayE)));- ((len VV##1370) >= 0);- (VV##1370 = ys##aA5);- ((len VV##1370) >= 0)]}-bind 189 lq_tmp$x##790 : {VV : a_azx | []}-bind 190 VV##1373 : {VV##1373 : [a_azx] | [(((len VV##1373) > 1) => ((len VV##1373) < (len zs##ayE)));- ((len VV##1373) >= 0);- (VV##1373 = xs##aA4);- ((len VV##1373) >= 0)]}-bind 191 lq_tmp$x##748 : {VV : a_azx | []}-bind 192 VV##1376 : {VV##1376 : [a_azx] | [((len VV##1376) >= 0);- (VV##1376 = zs##ayE);- ((len VV##1376) >= 0)]}-bind 193 lq_tmp$x##515 : {VV : a_azx | []}-bind 194 VV##1379 : {VV##1379 : (Tuple [a_azx] [a_azx]) | [((snd VV##1379) = lq_anf$##dMZ);- ((fst VV##1379) = ds_dMs);- ((x_Tuple22 VV##1379) = lq_anf$##dMZ);- ((x_Tuple21 VV##1379) = ds_dMs)]}-bind 195 VV##1381 : {VV##1381 : [a_azx] | [$k_##662[lq_tmp$x##652:=lq_anf$##dMZ][lq_tmp$x##665:=VV##1381][lq_tmp$x##648:=VV##1379][lq_tmp$x##651:=ds_dMs][VV##661:=VV##1381];- ((len VV##1381) >= 0)]}-bind 196 lq_tmp$x##516 : {VV : a_azx | []}-bind 197 VV##1384 : {VV##1384 : [a_azx] | [$k_##674[lq_tmp$x##652:=lq_anf$##dMZ][VV##673:=VV##1384][lq_tmp$x##648:=VV##1379][lq_tmp$x##651:=ds_dMs][lq_tmp$x##677:=VV##1384];- ((len VV##1384) >= 0)]}-bind 198 lq_tmp$x##517 : {VV : a_azx | []}-bind 199 lq_tmp$x##519 : {VV##1387 : [a_azx] | [((len VV##1387) >= 0)]}-bind 200 VV##1388 : {VV##1388 : [a_azx] | [$k_##686[lq_tmp$x##652:=lq_anf$##dMZ][lq_tmp$x##688:=lq_tmp$x##519][lq_tmp$x##648:=VV##1379][VV##685:=VV##1388][lq_tmp$x##651:=ds_dMs][lq_tmp$x##653:=lq_tmp$x##519][lq_tmp$x##677:=VV##1388];- ((len VV##1388) >= 0)]}-bind 201 lq_tmp$x##518 : {VV : a_azx | []}-bind 202 VV##1391 : {VV##1391 : [a_azx] | [((len VV##1391) = 0);- ((null VV##1391) <=> true);- ((len VV##1391) >= 0);- (VV##1391 = lq_anf$##dMZ);- ((len VV##1391) >= 0)]}-bind 203 lq_tmp$x##676 : {VV : a_azx | []}-bind 204 VV##1394 : {VV##1394 : [a_azx] | [((len VV##1394) >= 0);- (VV##1394 = ds_dMs);- ((len VV##1394) >= 0)]}-bind 205 lq_tmp$x##664 : {VV : a_azx | []}-bind 206 VV##1397 : {VV##1397 : (Tuple [a_azx] [a_azx]) | [((snd VV##1397) = lq_anf$##dMX);- ((fst VV##1397) = ds_dMs);- ((x_Tuple22 VV##1397) = lq_anf$##dMX);- ((x_Tuple21 VV##1397) = ds_dMs)]}-bind 207 VV##1399 : {VV##1399 : [a_azx] | [$k_##563[lq_tmp$x##553:=lq_anf$##dMX][lq_tmp$x##566:=VV##1399][lq_tmp$x##552:=ds_dMs][VV##562:=VV##1399][lq_tmp$x##549:=VV##1397];- ((len VV##1399) >= 0)]}-bind 208 lq_tmp$x##516 : {VV : a_azx | []}-bind 209 VV##1402 : {VV##1402 : [a_azx] | [$k_##575[VV##574:=VV##1402][lq_tmp$x##553:=lq_anf$##dMX][lq_tmp$x##578:=VV##1402][lq_tmp$x##552:=ds_dMs][lq_tmp$x##549:=VV##1397];- ((len VV##1402) >= 0)]}-bind 210 lq_tmp$x##517 : {VV : a_azx | []}-bind 211 lq_tmp$x##519 : {VV##1405 : [a_azx] | [((len VV##1405) >= 0)]}-bind 212 VV##1406 : {VV##1406 : [a_azx] | [$k_##587[lq_tmp$x##554:=lq_tmp$x##519][lq_tmp$x##553:=lq_anf$##dMX][lq_tmp$x##589:=lq_tmp$x##519][lq_tmp$x##578:=VV##1406][VV##586:=VV##1406][lq_tmp$x##552:=ds_dMs][lq_tmp$x##549:=VV##1397];- ((len VV##1406) >= 0)]}-bind 213 lq_tmp$x##518 : {VV : a_azx | []}-bind 214 VV##1409 : {VV##1409 : [a_azx] | [((len VV##1409) = 0);- ((null VV##1409) <=> true);- ((len VV##1409) >= 0);- (VV##1409 = lq_anf$##dMX);- ((len VV##1409) >= 0)]}-bind 215 lq_tmp$x##577 : {VV : a_azx | []}-bind 216 VV##1412 : {VV##1412 : [a_azx] | [((len VV##1412) >= 0);- (VV##1412 = ds_dMs);- ((len VV##1412) >= 0)]}-bind 217 lq_tmp$x##565 : {VV : a_azx | []}-bind 218 fix$36$$36$dOrd_azK : {VV##1415 : (GHC.Classes.Ord a_azo) | []}-bind 219 VV##1416 : {VV##1416 : [a_azo] | [((len VV##1416) >= 0)]}-bind 220 lq_tmp$x##115 : {VV : a_azo | []}-bind 221 lq_tmp$x##495 : {VV##1419 : [a_azo] | [((len VV##1419) >= 0)]}-bind 222 VV##1420 : {VV##1420 : [a_azo] | [((len VV##1420) >= 0)]}-bind 223 lq_tmp$x##116 : {VV : a_azo | []}-bind 224 lq_tmp$x##499 : {VV##1423 : [a_azo] | [((len VV##1423) >= 0)]}-bind 225 VV##1424 : {VV##1424 : [a_azo] | [((len VV##1424) >= 0)]}-bind 226 lq_tmp$x##117 : {VV : a_azo | []}-bind 227 VV##1427 : {VV##1427 : [a_azo] | [((len VV##1427) >= 0)]}-bind 228 lq_tmp$x##115 : {VV : a_azo | []}-bind 229 xs##ayP : {VV##1430 : [a_azo] | [((len VV##1430) >= 0)]}-bind 230 VV##1431 : {VV##1431 : [a_azo] | [((len VV##1431) >= 0)]}-bind 231 lq_tmp$x##116 : {VV : a_azo | []}-bind 232 lq_tmp$x##487 : {VV##1434 : [a_azo] | [((len VV##1434) >= 0)]}-bind 233 VV##1435 : {VV##1435 : [a_azo] | [((len VV##1435) >= 0)]}-bind 234 lq_tmp$x##117 : {VV : a_azo | []}-bind 235 VV##1438 : {VV##1438 : [a_azo] | [((len VV##1438) >= 0)]}-bind 236 lq_tmp$x##116 : {VV : a_azo | []}-bind 237 ds_dMl : {VV##1441 : [a_azo] | [((len VV##1441) >= 0)]}-bind 238 VV##1442 : {VV##1442 : [a_azo] | [((len VV##1442) >= 0)]}-bind 239 lq_tmp$x##117 : {VV : a_azo | []}-bind 240 VV##1445 : {VV##1445 : [a_azo] | [$k_##175[VV##174:=VV##1445][ds_dMr:=GHC.Prim.void###0l];- ((len VV##1445) >= 0)]}-bind 241 lq_tmp$x##117 : {VV : a_azo | []}-bind 242 VV##1448 : {VV##1448 : GHC.Prim.Void# | [(VV##1448 = GHC.Prim.void###0l)]}-bind 243 VV##1450 : {VV##1450 : [a_azo] | [((len VV##1450) = (1 + (len lq_anf$##dMT)));- ((null VV##1450) <=> false);- ((tail VV##1450) = lq_anf$##dMT);- ((head VV##1450) = x##ayR);- ((len VV##1450) >= 0)]}-bind 244 lq_tmp$x##170 : {VV : a_azo | []}-bind 245 VV##1453 : {VV##1453 : [a_azo] | [((len VV##1453) = ((len xs##ayS) + (len lq_anf$##dMS)));- ((len VV##1453) >= 0);- (VV##1453 = lq_anf$##dMT);- ((len VV##1453) >= 0)]}-bind 246 lq_tmp$x##464 : {VV : a_azo | []}-bind 247 VV##1456 : {VV##1456 : [a_azo] | [((len VV##1456) = (1 + (len ys##ayU)));- ((null VV##1456) <=> false);- ((tail VV##1456) = ys##ayU);- ((head VV##1456) = y##ayT);- ((len VV##1456) >= 0);- (VV##1456 = lq_anf$##dMS);- ((len VV##1456) >= 0)]}-bind 248 lq_tmp$x##116 : {VV : a_azo | []}-bind 249 VV##1459 : {VV##1459 : [a_azo] | [((len VV##1459) >= 0);- (VV##1459 = xs##ayS);- ((len VV##1459) >= 0)]}-bind 250 lq_tmp$x##115 : {VV : a_azo | []}-bind 251 VV##1462 : {VV##1462 : [a_azo] | [((len VV##1462) >= 0);- (VV##1462 = ys##ayU);- ((len VV##1462) >= 0)]}-bind 252 lq_tmp$x##412 : {VV : a_azo | []}-bind 253 VV##1465 : {VV##1465 : [a_azo] | [$k_##321[VV##320:=VV##1465][ds_dMp:=GHC.Prim.void###0l];- ((len VV##1465) >= 0)]}-bind 254 lq_tmp$x##170 : {VV : a_azo | []}-bind 255 VV##1468 : {VV##1468 : GHC.Prim.Void# | [(VV##1468 = GHC.Prim.void###0l)]}-bind 256 VV##1470 : {VV##1470 : [a_azo] | [((len VV##1470) = (1 + (len lq_anf$##dMR)));- ((null VV##1470) <=> false);- ((tail VV##1470) = lq_anf$##dMR);- ((head VV##1470) = y##ayT);- ((len VV##1470) >= 0)]}-bind 257 lq_tmp$x##316 : {VV : a_azo | []}-bind 258 VV##1473 : {VV##1473 : [a_azo] | [((len VV##1473) = ((len lq_anf$##dMQ) + (len ys##ayU)));- ((len VV##1473) >= 0);- (VV##1473 = lq_anf$##dMR);- ((len VV##1473) >= 0)]}-bind 259 lq_tmp$x##384 : {VV : a_azo | []}-bind 260 VV##1476 : {VV##1476 : [a_azo] | [((len VV##1476) >= 0);- (VV##1476 = ys##ayU);- ((len VV##1476) >= 0)]}-bind 261 lq_tmp$x##116 : {VV : a_azo | []}-bind 262 VV##1479 : {VV##1479 : [a_azo] | [((len VV##1479) = (1 + (len xs##ayS)));- ((null VV##1479) <=> false);- ((tail VV##1479) = xs##ayS);- ((head VV##1479) = x##ayR);- ((len VV##1479) >= 0);- (VV##1479 = lq_anf$##dMQ);- ((len VV##1479) >= 0)]}-bind 263 lq_tmp$x##115 : {VV : a_azo | []}-bind 264 VV##1482 : {VV##1482 : [a_azo] | [((len VV##1482) >= 0);- (VV##1482 = xs##ayS);- ((len VV##1482) >= 0)]}-bind 265 lq_tmp$x##332 : {VV : a_azo | []}-bind 266 VV##1485 : {VV##1485 : [a_azo] | [$k_##244[ds_dMn:=GHC.Prim.void###0l][VV##243:=VV##1485];- ((len VV##1485) >= 0)]}-bind 267 lq_tmp$x##170 : {VV : a_azo | []}-bind 268 VV##1488 : {VV##1488 : GHC.Prim.Void# | [(VV##1488 = GHC.Prim.void###0l)]}-bind 269 VV##1490 : {VV##1490 : [a_azo] | [$k_##259[VV##258:=VV##1490][lq_tmp$x##262:=VV##1490][lq_tmp$x##250:=lq_anf$##dMN];- ((len VV##1490) >= 0)]}-bind 270 lq_tmp$x##239 : {VV : a_azo | []}-bind 271 VV##1493 : {VV##1493 : int | [(VV##1493 ~~ lit$36$$47$Users$47$rjhala$47$research$47$stack$47$liquidhaskell$47$tests$47$pos$47$MergeSort.hs$58$$40$48$44$1$41$$45$$40$52$44$41$41$$124$function$32$merge);- ((strLen VV##1493) = 95);- (VV##1493 = lq_anf$##dMN)]}-bind 272 VV##1495 : {VV##1495 : [a_azo] | [((len VV##1495) >= 0);- (VV##1495 = ds_dMl);- ((len VV##1495) >= 0)]}-bind 273 lq_tmp$x##170 : {VV : a_azo | []}-bind 274 VV##1498 : {VV##1498 : [a_azo] | [((len VV##1498) >= 0);- (VV##1498 = xs##ayP);- ((len VV##1498) >= 0)]}-bind 275 lq_tmp$x##117 : {VV : a_azo | []}-bind 276 VV##1071 : {VV##1071 : GHC.Prim.Void# | [$k_##1072]}-bind 277 VV##1159 : {VV##1159 : [a_azJ] | [$k_##1160;- ((len VV##1159) >= 0)]}-bind 278 lq_tmp$x##1155 : {VV : a_azJ | []}-bind 279 VV##1117 : {VV##1117 : [a_azJ] | [$k_##1118;- ((len VV##1117) >= 0)]}-bind 280 lq_tmp$x##1113 : {VV : a_azJ | []}-bind 281 VV##1082 : {VV##1082 : [a_azJ] | [$k_##1083;- ((len VV##1082) >= 0)]}-bind 282 lq_tmp$x##1078 : {VV : a_azJ | []}-bind 283 VV##913 : {VV##913 : [a_azx] | [$k_##914;- ((len VV##913) >= 0)]}-bind 284 lq_tmp$x##909 : {VV : a_azx | []}-bind 285 VV##901 : {VV##901 : [a_azx] | [$k_##902;- ((len VV##901) >= 0)]}-bind 286 lq_tmp$x##897 : {VV : a_azx | []}-bind 287 VV##889 : {VV##889 : [a_azx] | [$k_##890;- ((len VV##889) >= 0)]}-bind 288 lq_tmp$x##885 : {VV : a_azx | []}-bind 289 VV##794 : {VV##794 : [a_azx] | [$k_##795;- ((len VV##794) >= 0)]}-bind 290 lq_tmp$x##790 : {VV : a_azx | []}-bind 291 VV##752 : {VV##752 : [a_azx] | [$k_##753;- ((len VV##752) >= 0)]}-bind 292 lq_tmp$x##748 : {VV : a_azx | []}-bind 293 VV##685 : {VV##685 : [a_azx] | [$k_##686;- ((len VV##685) >= 0)]}-bind 294 lq_tmp$x##681 : {VV : a_azx | []}-bind 295 VV##673 : {VV##673 : [a_azx] | [$k_##674;- ((len VV##673) >= 0)]}-bind 296 lq_tmp$x##669 : {VV : a_azx | []}-bind 297 VV##661 : {VV##661 : [a_azx] | [$k_##662;- ((len VV##661) >= 0)]}-bind 298 lq_tmp$x##657 : {VV : a_azx | []}-bind 299 VV##586 : {VV##586 : [a_azx] | [$k_##587;- ((len VV##586) >= 0)]}-bind 300 lq_tmp$x##582 : {VV : a_azx | []}-bind 301 VV##574 : {VV##574 : [a_azx] | [$k_##575;- ((len VV##574) >= 0)]}-bind 302 lq_tmp$x##570 : {VV : a_azx | []}-bind 303 VV##562 : {VV##562 : [a_azx] | [$k_##563;- ((len VV##562) >= 0)]}-bind 304 lq_tmp$x##558 : {VV : a_azx | []}-bind 305 VV##163 : {VV##163 : GHC.Prim.Void# | [$k_##164]}-bind 306 VV##309 : {VV##309 : GHC.Prim.Void# | [$k_##310]}-bind 307 VV##320 : {VV##320 : [a_azo] | [$k_##321;- ((len VV##320) >= 0)]}-bind 308 lq_tmp$x##316 : {VV : a_azo | []}-bind 309 VV##232 : {VV##232 : GHC.Prim.Void# | [$k_##233]}-bind 310 VV##258 : {VV##258 : [a_azo] | [$k_##259;- ((len VV##258) >= 0)]}-bind 311 lq_tmp$x##254 : {VV : a_azo | []}-bind 312 VV##243 : {VV##243 : [a_azo] | [$k_##244;- ((len VV##243) >= 0)]}-bind 313 lq_tmp$x##239 : {VV : a_azo | []}-bind 314 VV##174 : {VV##174 : [a_azo] | [$k_##175;- ((len VV##174) >= 0)]}-bind 315 lq_tmp$x##170 : {VV : a_azo | []}-----constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 80;- 82;- 83;- 84]- lhs {VV##50 : [a_azx] | [(((len VV##50) > 1) => ((len VV##50) < (len zs##ayE)));- ((len VV##50) >= 0);- (VV##50 = ys##aA5);- ((len VV##50) >= 0)]}- rhs {VV##50 : [a_azx] | [$k_##795[VV##794:=VV##50][VV##1370:=VV##50][VV##F:=VV##50][VV##F##50:=VV##50]]}- id 50 tag [2]- // META constraint id 50 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 77;- 78;- 79]- lhs {VV##53 : [a_azx] | [(((len VV##53) > 1) => ((len VV##53) < (len zs##ayE)));- ((len VV##53) >= 0);- (VV##53 = xs##aA4);- ((len VV##53) >= 0)]}- rhs {VV##53 : [a_azx] | [$k_##753[VV##752:=VV##53][VV##1373:=VV##53][VV##F##53:=VV##53][VV##F:=VV##53]]}- id 53 tag [2]- // META constraint id 53 : ()---constraint:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89]- lhs {VV##30 : (Tuple [a_azx] [a_azx]) | [((snd VV##30) = lq_anf$##dN1);- ((fst VV##30) = lq_anf$##dN0);- ((x_Tuple22 VV##30) = lq_anf$##dN1);- ((x_Tuple21 VV##30) = lq_anf$##dN0)]}- rhs {VV##30 : (Tuple [a_azx] [a_azx]) | [(((len (fst VV##30)) + (len (snd VV##30))) = (len ds_dMs))]}- id 30 tag [2]- // META constraint id 30 : ()-----wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 70]- reft {VV##685 : [a_azx] | [$k_##686]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 49]- reft {VV##414 : a_azo | [$k_##415]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 302]- reft {VV##571 : a_azx | [$k_##572]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 296]- reft {VV##670 : a_azx | [$k_##671]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 86]- reft {VV##843 : a_azx | [$k_##844]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 19; 20; 21]- reft {VV##163 : GHC.Prim.Void# | [$k_##164]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 287]- reft {VV##882 : a_azx | [$k_##883]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80]- reft {VV##794 : [a_azx] | [$k_##795]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 304]- reft {VV##559 : a_azx | [$k_##560]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 303]- reft {VV##555 : a_azx | [$k_##556]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117;- 122;- 123]- reft {VV##1226 : a_azJ | [$k_##1227]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 90;- 283]- reft {VV##906 : a_azx | [$k_##907]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 307]- reft {VV##313 : a_azo | [$k_##314]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 297]- reft {VV##654 : a_azx | [$k_##655]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33;- 312]- reft {VV##236 : a_azo | [$k_##237]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117]- reft {VV##1159 : [a_azJ] | [$k_##1160]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112]- reft {VV##1117 : [a_azJ] | [$k_##1118]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89]- reft {VV##889 : [a_azx] | [$k_##890]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75]- reft {VV##752 : [a_azx] | [$k_##753]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 88]- reft {VV##866 : a_azx | [$k_##867]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33;- 34;- 311]- reft {VV##255 : a_azo | [$k_##256]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 60; 300]- reft {VV##583 : a_azx | [$k_##584]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 90]- reft {VV##913 : [a_azx] | [$k_##914]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110]- reft {VV##1071 : GHC.Prim.Void# | [$k_##1072]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 62; 63; 64; 67]- reft {VV##638 : a_azx | [$k_##639]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 280]- reft {VV##1114 : a_azJ | [$k_##1115]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 290]- reft {VV##791 : a_azx | [$k_##792]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59]- reft {VV##574 : [a_azx] | [$k_##575]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 314]- reft {VV##167 : a_azo | [$k_##168]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87]- reft {VV##863 : a_azx | [$k_##864]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 60]- reft {VV##586 : [a_azx] | [$k_##587]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42]- reft {VV##309 : GHC.Prim.Void# | [$k_##310]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32]- reft {VV##232 : GHC.Prim.Void# | [$k_##233]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 292]- reft {VV##749 : a_azx | [$k_##750]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 291]- reft {VV##745 : a_azx | [$k_##746]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 49;- 51]- reft {VV##444 : a_azo | [$k_##445]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 103;- 105]- reft {VV##1036 : a_azJ | [$k_##1037]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 49;- 51;- 52]- reft {VV##466 : a_azo | [$k_##467]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74]- reft {VV##738 : a_azx | [$k_##739]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117;- 122;- 123;- 124]- reft {VV##1252 : a_azJ | [$k_##1253]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 49;- 50]- reft {VV##417 : a_azo | [$k_##418]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59]- reft {VV##562 : [a_azx] | [$k_##563]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 62; 63; 64; 67; 68]- reft {VV##641 : a_azx | [$k_##642]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 279]- reft {VV##1110 : a_azJ | [$k_##1111]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43]- reft {VV##320 : [a_azo] | [$k_##321]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 286]- reft {VV##898 : a_azx | [$k_##899]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 44]- reft {VV##337 : a_azo | [$k_##338]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 70;- 293]- reft {VV##678 : a_azx | [$k_##679]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 45]- reft {VV##364 : a_azo | [$k_##365]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 281]- reft {VV##1075 : a_azJ | [$k_##1076]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 103;- 104]- reft {VV##1019 : a_azJ | [$k_##1020]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 49;- 51;- 52;- 53]- reft {VV##469 : a_azo | [$k_##470]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 301]- reft {VV##567 : a_azx | [$k_##568]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89]- reft {VV##901 : [a_azx] | [$k_##902]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38]- reft {VV##297 : a_azo | [$k_##298]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22]- reft {VV##174 : [a_azo] | [$k_##175]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33;- 34]- reft {VV##258 : [a_azo] | [$k_##259]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117;- 277]- reft {VV##1152 : a_azJ | [$k_##1153]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 90;- 284]- reft {VV##910 : a_azx | [$k_##911]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 282]- reft {VV##1079 : a_azJ | [$k_##1080]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57]- reft {VV##539 : a_azx | [$k_##540]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111]- reft {VV##1103 : a_azJ | [$k_##1104]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 315]- reft {VV##171 : a_azo | [$k_##172]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 45;- 46]- reft {VV##386 : a_azo | [$k_##387]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117;- 122]- reft {VV##1206 : a_azJ | [$k_##1207]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 285]- reft {VV##894 : a_azx | [$k_##895]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 295]- reft {VV##666 : a_azx | [$k_##667]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 103]- reft {VV##1016 : a_azJ | [$k_##1017]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 91; 92; 95; 96]- reft {VV##970 : a_azJ | [$k_##971]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85;- 87;- 89;- 288]- reft {VV##886 : a_azx | [$k_##887]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 91; 92; 95]- reft {VV##967 : a_azJ | [$k_##968]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 289]- reft {VV##787 : a_azx | [$k_##788]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33;- 313]- reft {VV##240 : a_azo | [$k_##241]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 308]- reft {VV##317 : a_azo | [$k_##318]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 298]- reft {VV##658 : a_azx | [$k_##659]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33]- reft {VV##243 : [a_azo] | [$k_##244]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 58]- reft {VV##542 : a_azx | [$k_##543]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 62; 63; 64; 67; 69]- reft {VV##661 : [a_azx] | [$k_##662]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111;- 112;- 117;- 278]- reft {VV##1156 : a_azJ | [$k_##1157]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43;- 45;- 46;- 47]- reft {VV##389 : a_azo | [$k_##390]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 108;- 109;- 110;- 111]- reft {VV##1082 : [a_azJ] | [$k_##1083]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 57; 59; 60; 299]- reft {VV##579 : a_azx | [$k_##580]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 91;- 92;- 98;- 99;- 100;- 103;- 105;- 106]- reft {VV##1039 : a_azJ | [$k_##1040]}- // META wf : ()---wf:- env [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 54; 62; 63; 64; 67; 69]- reft {VV##673 : [a_azx] | [$k_##674]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 36;- 37;- 38;- 39;- 42;- 43]- reft {VV##334 : a_azo | [$k_##335]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 72;- 73;- 74;- 75;- 80;- 85]- reft {VV##840 : a_azx | [$k_##841]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 54;- 62;- 63;- 64;- 67;- 69;- 70;- 294]- reft {VV##682 : a_azx | [$k_##683]}- // META wf : ()---wf:- env [0;- 1;- 2;- 3;- 4;- 5;- 6;- 7;- 8;- 9;- 10;- 11;- 12;- 13;- 14;- 19;- 20;- 21;- 22;- 27;- 28;- 29;- 32;- 33;- 34;- 310]- reft {VV##251 : a_azo | [$k_##252]}- // META wf : ()-------
− tests/todo/baz.fq
@@ -1,22 +0,0 @@-// Uncommenting the WF renders the constraints "unsafe" but right now its SAFE-// which is bad. We should fail with "missing WF" or somesuch.---bind 0 x : {v: int | $k1 }--constraint:- env []- lhs {v : int | [v = 6] }- rhs {v : int | $k1 }- id 0 tag []--constraint:- env [0]- lhs {v : int | [v = x] }- rhs {v : int | v = 0 }- id 0 tag []--// wf:-// env []-// reft {v: int | $k1 }-
− tests/todo/poly.fq
@@ -1,14 +0,0 @@--// This definition works fine ...-// constant offset : (func(0, [int ; int ; (BitVec Size32) ]))--// But this crashes as 'offset 0' is embedded as int not bv...-constant offset : (func(1, [int; int; @(0)]))--bind 0 x : {VV : (BitVec Size32) | [ VV = offset 0 0 ]}--constraint:- env [0]- lhs {VV : (BitVec Size32) | [ VV = x ] }- rhs {VV : (BitVec Size32) | [ VV = x ] }- id 1 tag [1]
− tests/todo/wl01.fq
@@ -1,39 +0,0 @@-qualif Nat(v:int) : (0 <= v)--bind 0 x : {v: int | [$k0]}-bind 1 y : {v: int | [$k0]}-bind 2 z : {v: int | [$k1]}--constraint:- env [ ]- lhs {v : int | [v = 10]}- rhs {v : int | [$k0]}- id 1 tag [0]--constraint:- env [ 0 ]- lhs {v : int | [v = x + x]}- rhs {v : int | [$k0]}- id 2 tag [0]--constraint:- env [ 0; 1 ]- lhs {v : int | [v = x + y ]}- rhs {v : int | [$k1]}- id 3 tag [0]---constraint:- env [ 1 ]- lhs {v : int | [v = z]}- rhs {v : int | [0 <= v]}- id 4 tag [0]--wf:- env [ ]- reft {v: int | [$k0]}---wf:- env [ ]- reft {v: int | [$k1]}
unix/Language/Fixpoint/Utils/Progress.hs view
@@ -39,7 +39,7 @@ , pgTotal = toInteger n , pgFormat = "Working :percent [:bar]" , pgPendingChar = '.'- , pgOnCompletion = Just "Done solving." -- :percent."+ , pgOnCompletion = Nothing -- Just "Done solving." -- :percent." } progressTick :: IO ()