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

Safe HaskellNone
LanguageHaskell98

Language.Fixpoint.Types.Constraints

Contents

Description

This module contains the top-level query data types and elements, including (Horn) implication & well-formedness constraints and sets.

Synopsis

Top-level Queries

type FInfo a = GInfo SubC a Source

Top-level Queries

type SInfo a = GInfo SimpC a Source

data GInfo c a Source

Constructors

FI 

Fields

cm :: HashMap Integer (c a)
 
ws :: HashMap KVar (WfC a)
 
bs :: !BindEnv
 
lits :: !(SEnv Sort)
 
kuts :: Kuts
 
quals :: ![Qualifier]
 
bindInfo :: HashMap BindId a
 
fileName :: FilePath
 
allowHO :: !Bool
 

Instances

Functor c => Functor (GInfo c) Source 
PTable (SInfo a) Source 
SymConsts (FInfo a) Source 
Inputable (FInfo ()) Source 
(Eq a, Eq (c a)) => Eq (GInfo c a) Source 
(Show a, Show (c a), Fixpoint a) => Show (GInfo c a) Source 
Generic (GInfo c a) Source 
Monoid (GInfo c a) Source 
(Binary (c a), Binary a) => Binary (GInfo c a) Source 
(NFData (c a), NFData a) => NFData (GInfo c a) Source 
type Rep (GInfo c a) Source 

convertFormat :: Fixpoint a => FInfo a -> SInfo a Source

Query Conversions: FInfo to SInfo

type Solver a = Config -> FInfo a -> IO (Result (Integer, a)) Source

Top level Solvers ----------------------------------------------------

Serializing

toFixpoint :: (Fixpoint a, Fixpoint (c a)) => Config -> GInfo c a -> Doc Source

Rendering Queries

writeFInfo :: (Fixpoint a, Fixpoint (c a)) => Config -> GInfo c a -> FilePath -> IO () Source

Constructing Queries

fi :: [SubC a] -> [WfC a] -> BindEnv -> SEnv Sort -> Kuts -> [Qualifier] -> HashMap BindId a -> FilePath -> Bool -> GInfo SubC a Source

Constructing Queries

Constraints

data WfC a Source

Constructors

WfC 

Fields

wenv :: !IBindEnv
 
wrft :: (Symbol, Sort, KVar)
 
winfo :: !a
 

Instances

subcId :: TaggedC c a => c a -> Integer Source

wfC :: Fixpoint a => IBindEnv -> SortedReft -> a -> [WfC a] Source

"Smart Constructors" for Constraints ---------------------------------

data SimpC a Source

Constructors

SimpC 

Fields

_cenv :: !IBindEnv
 
_crhs :: !Expr
 
_cid :: !(Maybe Integer)
 
_ctag :: !Tag
 
_cinfo :: !a
 

type Tag = [Int] Source

Constraints ---------------------------------------------------------------

class TaggedC c a where Source

Methods

senv :: c a -> IBindEnv Source

sid :: c a -> Maybe Integer Source

stag :: c a -> Tag Source

sinfo :: c a -> a Source

clhs :: BindEnv -> c a -> [(Symbol, SortedReft)] Source

crhs :: c a -> Expr Source

Accessing Constraints

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

Qualifiers

data Qualifier Source

Qualifiers ----------------------------------------------------------------

Constructors

Q 

Fields

q_name :: Symbol

Name

q_params :: [(Symbol, Sort)]

Parameters

q_body :: Expr

Predicate

q_pos :: !SourcePos

Source Location

data EQual Source

Solutions (Instantiated Qualfiers )----------------------------------------

Constructors

EQL 

Fields

eqQual :: !Qualifier
 
eqPred :: !Expr
 
eqArgs :: ![Expr]
 

Results

type FixSolution = HashMap KVar Expr Source

Solutions and Results

data Result a Source

Constructors

Result 

Instances

Solutions

data Cube Source

Constructors

Cube 

Fields

cuBinds :: IBindEnv
 
cuSubst :: Subst
 

type QBind = [EQual] Source

type Cand a = [(Expr, a)] Source

data Sol a Source

Constructors

Sol 

Fields

sMap :: HashMap KVar a
 
sHyp :: HashMap KVar Hyp
 

Instances

type Solution = Sol QBind Source

Types ---------------------------------------------------------------------

solFromList :: [(KVar, a)] -> [(KVar, Hyp)] -> Sol a Source

Create a Solution ---------------------------------------------------------

solInsert :: KVar -> a -> Sol a -> Sol a Source

solLookup :: Solution -> KVar -> QBind Source

Read / Write Solution at KVar ---------------------------------------------

Cut KVars

newtype Kuts Source

Constraint Cut Sets -------------------------------------------------------

Constructors

KS 

Fields

ksVars :: HashSet KVar