liquid-fixpoint-0.4.0.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]
 
bindInfo :: HashMap BindId a
 

Instances

(Show a, Fixpoint a) => Show (FInfo a) 
Monoid (FInfo a) 
Inputable (FInfo ()) 

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

FFrac

numeric kind for Fractional 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

intSort :: Sort Source

Exported Basic Sorts -----------------------------------------------

realSort :: Sort Source

Exported Basic Sorts -----------------------------------------------

propSort :: Sort Source

Exported Basic Sorts -----------------------------------------------

boolSort :: Sort Source

Exported Basic Sorts -----------------------------------------------

strSort :: Sort Source

Exported Basic Sorts -----------------------------------------------

Expressions and Predicates

data SymConst Source

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

Constructors

SL !Text 

Instances

Eq SymConst 
Data SymConst 
Ord SymConst 
Show SymConst 
Generic SymConst 
NFData SymConst 
Hashable SymConst 
Symbolic SymConst

Replace all symbol-representations-of-string-literals with string-literal Used to transform parsed output from fixpoint back into fq.

Fixpoint SymConst 
PPrint SymConst 
SMTLIB2 SymConst 
Typeable * SymConst 
type Rep SymConst 

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

Instances

Symbolic String 
Symbolic Text 
Symbolic InternedText 
Symbolic Symbol 
Symbolic SymConst

Replace all symbol-representations-of-string-literals with string-literal Used to transform parsed output from fixpoint back into fq.

Symbolic a => Symbolic (Located a) 

class Expression a where Source

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

Values that can be viewed as Constants

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 Bv

Construct an Expr using a raw string, e.g. (Bv S32 "#x02000000")

Expression a => Expression (Located a) 

class Predicate a where Source

Values that can be viewed as Predicates

Methods

prop :: a -> Pred Source

Constraints

data WfC a Source

Constructors

WfC 

Fields

wenv :: !IBindEnv
 
wrft :: !SortedReft
 
wid :: !(Maybe Integer)
 
winfo :: !a
 

Instances

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

data SubC a Source

Instances

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

type Tag = [Int] Source

Accessing Constraints

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

sinfo :: SubC a -> a Source

trueSubCKvar :: KVar -> a -> [SubC a] Source

removeLhsKvars :: t -> t1 -> t2 Source

Solutions

data Result a Source

The output of the Solver

Constructors

Result 

Instances

Fixpoint a => Show (Result a) 
Monoid (Result a) 

Environments

data SEnv a Source

Instances

Functor SEnv 
Foldable SEnv 
Traversable SEnv 
NFData FEnv 
Eq a => Eq (SEnv a) 
Data a => Data (SEnv a) 
Fixpoint (SEnv a) => Show (SEnv a) 
Generic (SEnv a) 
Monoid (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

Environments ---------------------------------------------

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

Functions on Result

Cut KVars

newtype Kuts Source

Constructors

KS 

Fields

ksVars :: HashSet KVar
 

Qualifiers

Located Values

data Located a Source

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

Constructors

Loc 

Fields

loc :: !SourcePos

Start Position

locE :: !SourcePos

End Position

val :: a
 

locAt :: String -> a -> Located a Source