-----------------------------------------------------------------------------
-- |
-- Module    : Data.SBV.Provers.Z3
-- Copyright : (c) Levent Erkok
-- License   : BSD3
-- Maintainer: erkokl@gmail.com
-- Stability : experimental
--
-- The connection to the MathSAT SMT solver
-----------------------------------------------------------------------------

{-# LANGUAGE ScopedTypeVariables #-}

{-# OPTIONS_GHC -Wall -Werror #-}

module Data.SBV.Provers.Z3(z3) where

import Data.SBV.Core.Data
import Data.SBV.SMT.SMT

-- | The description of the Z3 SMT solver.
-- The default executable is @\"z3\"@, which must be in your path. You can use the @SBV_Z3@ environment variable to point to the executable on your system.
-- The default options are @\"-nw -in -smt2\"@. You can use the @SBV_Z3_OPTIONS@ environment variable to override the options.
z3 :: SMTSolver
z3 :: SMTSolver
z3 = SMTSolver :: Solver
-> String
-> (String -> String)
-> (SMTConfig -> [String])
-> SMTEngine
-> SolverCapabilities
-> SMTSolver
SMTSolver {
           name :: Solver
name         = Solver
Z3
         , executable :: String
executable   = String
"z3"
         , preprocess :: String -> String
preprocess   = String -> String
forall a. a -> a
id
         , options :: SMTConfig -> [String]
options      = [String] -> SMTConfig -> [String]
modConfig [String
"-nw", String
"-in", String
"-smt2"]
         , engine :: SMTEngine
engine       = String -> String -> SMTEngine
standardEngine String
"SBV_Z3" String
"SBV_Z3_OPTIONS"
         , capabilities :: SolverCapabilities
capabilities = SolverCapabilities :: Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Maybe String
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Maybe [String]
-> SolverCapabilities
SolverCapabilities {
                                supportsQuantifiers :: Bool
supportsQuantifiers        = Bool
True
                              , supportsDefineFun :: Bool
supportsDefineFun          = Bool
True
                              , supportsDistinct :: Bool
supportsDistinct           = Bool
True
                              , supportsBitVectors :: Bool
supportsBitVectors         = Bool
True
                              , supportsUninterpretedSorts :: Bool
supportsUninterpretedSorts = Bool
True
                              , supportsUnboundedInts :: Bool
supportsUnboundedInts      = Bool
True
                              , supportsInt2bv :: Bool
supportsInt2bv             = Bool
True
                              , supportsReals :: Bool
supportsReals              = Bool
True
                              , supportsApproxReals :: Bool
supportsApproxReals        = Bool
True
                              , supportsDeltaSat :: Maybe String
supportsDeltaSat           = Maybe String
forall a. Maybe a
Nothing
                              , supportsIEEE754 :: Bool
supportsIEEE754            = Bool
True
                              , supportsSets :: Bool
supportsSets               = Bool
True
                              , supportsOptimization :: Bool
supportsOptimization       = Bool
True
                              , supportsPseudoBooleans :: Bool
supportsPseudoBooleans     = Bool
True
                              , supportsCustomQueries :: Bool
supportsCustomQueries      = Bool
True
                              , supportsGlobalDecls :: Bool
supportsGlobalDecls        = Bool
True
                              , supportsDataTypes :: Bool
supportsDataTypes          = Bool
True
                              , supportsDirectAccessors :: Bool
supportsDirectAccessors    = Bool
False -- Needs ascriptions. (See the CVC4 version of this)
                              , supportsFlattenedModels :: Maybe [String]
supportsFlattenedModels    = [String] -> Maybe [String]
forall a. a -> Maybe a
Just [ String
"(set-option :pp.max_depth      4294967295)"
                                                                  , String
"(set-option :pp.min_alias_size 4294967295)"
                                                                  , String
"(set-option :model.inline_def  true      )"
                                                                  ]
                              }
         }

 where modConfig :: [String] -> SMTConfig -> [String]
       modConfig :: [String] -> SMTConfig -> [String]
modConfig [String]
opts SMTConfig
_cfg = [String]
opts