liquid-fixpoint-0.2.1.0: Predicate Abstraction-based Horn-Clause/Implication Constraint Solver

Safe HaskellNone
LanguageHaskell98

Language.Fixpoint.Types

Contents

Description

This module contains the data types, operations and serialization functions for representing Fixpoint's implication (i.e. subtyping) and well-formedness constraints in Haskell. The actual constraint solving is done by the `fixpoint.native` which is written in Ocaml.

Synopsis

Top level serialization

data FInfo a Source

Constructors

FI 

Fields

cm :: HashMap Integer (SubC a)
 
ws :: ![WfC a]
 
bs :: !BindEnv
 
gs :: !FEnv
 
lits :: ![(Symbol, Sort)]
 
kuts :: Kuts
 
quals :: ![Qualifier]
 

Instances

Rendering

traceFix :: Fixpoint a => String -> a -> a Source

Symbols

Creating Symbols

Embedding to Fixpoint Types

data Sort Source

Constructors

FInt 
FReal 
FNum

numeric kind for Num tyvars

FObj Symbol

uninterpreted type

FVar !Int

fixpoint type variable

FFunc !Int ![Sort]

type-var arity, in-ts ++ [out-t]

FApp FTycon [Sort]

constructed type

Expressions and Predicates

data SymConst Source

Uninterpreted constants that are embedded as "constant symbol : Str"

Constructors

SL !Text 

eVar :: Symbolic a => a -> Expr Source

eProp :: Symbolic a => a -> Pred Source

symConstLits :: FInfo a -> [(Symbol, Sort)] Source

String Constants -----------------------------------------

Generalizing Embedding with Typeclasses

class Symbolic a where Source

Values that can be viewed as Symbols

Methods

symbol :: a -> Symbol Source

class Expression a where Source

Generalizing Symbol, Expression, Predicate into Classes -----------

Values that can be viewed as Expressions

Methods

expr :: a -> Expr Source

Instances

Expression Int 
Expression Integer 
Expression Text 
Expression Symbol

The symbol may be an encoding of a SymConst.

Expression Expr 
Expression a => Expression (Located a) 

class Predicate a where Source

Values that can be viewed as Predicates

Methods

prop :: a -> Pred Source

Constraints and Solutions

data SubC a Source

Instances

Show (SubC a) 
Generic (SubC a) 
NFData a => NFData (SubC a) 
(Ord a, Fixpoint a) => Fixpoint (FixResult (SubC a)) 
Fixpoint (SubC a) 
type Rep (SubC a) 

data WfC a Source

Instances

Generic (WfC a) 
NFData a => NFData (WfC a) 
Fixpoint (WfC a) 
type Rep (WfC a) 

type Tag = [Int] Source

addIds :: [SubC a] -> [(Integer, SubC a)] Source

sinfo :: SubC a -> a Source

Environments

data SEnv a Source

Instances

Functor SEnv 
Foldable SEnv 
Traversable SEnv 
NFData FEnv 
Fixpoint FEnv 
Eq a => Eq (SEnv a) 
Data a => Data (SEnv a) 
Fixpoint (SEnv a) => Show (SEnv a) 
Generic (SEnv a) 
Fixpoint a => Fixpoint (SEnv a) 
Typeable (* -> *) SEnv 
type Rep (SEnv a) 

data SESearch a Source

Constructors

Found a 
Alts [Symbol] 

toListSEnv :: SEnv a -> [(Symbol, a)] Source

mapSEnv :: (a1 -> a) -> SEnv a1 -> SEnv a Source

mapSEnvWithKey :: ((Symbol, a1) -> (Symbol, a)) -> SEnv a1 -> SEnv a Source

insertSEnv :: Symbol -> a -> SEnv a -> SEnv a Source

intersectWithSEnv :: (v1 -> v2 -> a) -> SEnv v1 -> SEnv v2 -> SEnv a Source

filterSEnv :: (a -> Bool) -> SEnv a -> SEnv a Source

insertFEnv :: Symbol -> a -> SEnv a -> SEnv a Source

emptyIBindEnv :: IBindEnv Source

Functions for Indexed Bind Environment

insertBindEnv :: Symbol -> SortedReft -> BindEnv -> (BindId, BindEnv) Source

Functions for Global Binder Environment

Refinements

class (Monoid r, Subable r) => Reftable r where Source

A Class Predicates for Valid Refinements Types ---------------------

Minimal complete definition

isTauto, ppTy, bot, toReft, ofReft, params

Methods

isTauto :: r -> Bool Source

ppTy :: r -> Doc -> Doc Source

top :: r -> r Source

bot :: r -> r Source

meet :: r -> r -> r Source

toReft :: r -> Reft Source

ofReft :: Reft -> r Source

params Source

Arguments

:: r 
-> [Symbol]

parameters for Reft, vv + others

Constructing Refinements

isFalse :: Falseable a => a -> Bool Source

Substitutions

class Subable a where Source

Minimal complete definition

syms, substa, substf, subst

Methods

syms :: a -> [Symbol] Source

substa :: (Symbol -> Symbol) -> a -> a Source

substf :: (Symbol -> Expr) -> a -> a Source

subst :: Subst -> a -> a Source

subst1 :: a -> (Symbol, Expr) -> a Source

subst1Except :: Subable a => [Symbol] -> a -> (Symbol, Expr) -> a Source

Visitors

Functions on Result

Cut KVars

newtype Kuts Source

Constructors

KS (HashSet Symbol) 

Instances

Qualifiers

FQ Definitions

data Def a Source

Entities in Query File --------------------------------------------

Instances

Generic (Def a) 
type Rep (Def a) 

Located Values

data Located a Source

Located Values ---------------------------------------------------------

Constructors

Loc 

Fields

loc :: !SourcePos
 
val :: a