liquid-fixpoint-0.9.6.3.4: Predicate Abstraction-based Horn-Clause/Implication Constraint Solver
Safe HaskellNone
LanguageHaskell98

Language.Fixpoint.Smt.Interface

Description

This module contains an SMTLIB2 interface for 1. checking the validity, and, 2. computing satisfying assignments for formulas. By implementing a binary interface over the SMTLIB2 format defined at http://www.smt-lib.org/ http://www.grammatech.com/resource/smt/SMTLIBTutorial.pdf

Synopsis

Commands

data Command Source #

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

Commands issued to SMT engine

Instances

Instances details
Show Command Source # 
Instance details

Defined in Language.Fixpoint.Smt.Types

Eq Command Source # 
Instance details

Defined in Language.Fixpoint.Smt.Types

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Inputable Command Source # 
Instance details

Defined in Language.Fixpoint.Parse

SMTLIB2 Command Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

PPrint Command Source # 
Instance details

Defined in Language.Fixpoint.Smt.Types

Inputable [Command] Source # 
Instance details

Defined in Language.Fixpoint.Parse

Methods

rr :: String -> [Command] Source #

rr' :: String -> String -> [Command] Source #

Responses

data Response Source #

Responses received from SMT engine

Constructors

Ok 
Sat 
Unsat 
Unknown 
Values [(Symbol, Text)] 
Error !Text 

Instances

Instances details
Show Response Source # 
Instance details

Defined in Language.Fixpoint.Smt.Types

Eq Response Source # 
Instance details

Defined in Language.Fixpoint.Smt.Types

Typeclass for SMTLIB2 conversion

class SMTLIB2 a where Source #

AST Conversion: Types that can be serialized ------------------------------

Methods

smt2 :: a -> SymM Builder Source #

Instances

Instances details
SMTLIB2 Command Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 LocSymbol Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 Symbol Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 Bop Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: Bop -> SymM Builder Source #

SMTLIB2 Brel Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: Brel -> SymM Builder Source #

SMTLIB2 Constant Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 Expr Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: Expr -> SymM Builder Source #

SMTLIB2 SymConst Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 SmtSort Source # 
Instance details

Defined in Language.Fixpoint.Smt.Theories

SMTLIB2 Int Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: Int -> SymM Builder Source #

SMTLIB2 (Triggered Expr) Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

SMTLIB2 (Symbol, Expr) Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: (Symbol, Expr) -> SymM Builder Source #

SMTLIB2 (Symbol, Sort) Source # 
Instance details

Defined in Language.Fixpoint.Smt.Serialize

Methods

smt2 :: (Symbol, Sort) -> SymM Builder Source #

Creating and killing SMTLIB2 Process

data Context Source #

Additional information around the SMT solver backend

Constructors

Ctx 

Fields

makeContext :: Config -> FilePath -> IO Context Source #

SMT Context ---------------------------------------------------------

cleanupContext :: Context -> IO () Source #

Close file handles and release the solver backend's resources.

Execute Queries

Query API

smtBracket :: String -> SmtM a -> SmtM a Source #

smtBracket adds a new level to the apply stack and saves the last fresh index on the index stack before the action, and reverts these changes after the action.

smtPush :: SmtM () Source #

SMT Commands -----------------------------------------------------------

smtPop :: SmtM () Source #

SMT Commands -----------------------------------------------------------

Check Validity

checkValid :: HasCallStack => Config -> FilePath -> [(Symbol, Sort)] -> Expr -> Expr -> IO Bool Source #

type ClosedPred E = {v:Pred | subset (vars v) (keys E) } checkValid :: e:Env -> ClosedPred e -> ClosedPred e -> IO Bool

checkValids :: Config -> FilePath -> [(Symbol, Sort)] -> [Expr] -> IO [Bool] Source #

If you already HAVE a context, where all the variables have declared types (e.g. if you want to make MANY repeated Queries)

funcSortVars :: Bool -> SymEnv -> [(Text, ([SmtSort], SmtSort))] Source #

See seApplsCur for explanation.