Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
(This is a part of MIOS.) Basic data types used throughout mios.
Synopsis
- type SolverResult = Either SolverException Certificate
- data Certificate
- data SolverException
- data CNFDescription = CNFDescription {
- _numberOfVariables :: !Int
- _numberOfClauses :: !Int
- _pathname :: !FilePath
- data MiosConfiguration = MiosConfiguration {
- variableDecayRate :: !Double
- clauseDecayRate :: !Double
- dumpSolverStatMode :: !Int
- emaCoeffs :: !(Int, Int)
- restartExpansion :: !Double
- restartStep :: !Double
- defaultConfiguration :: MiosConfiguration
- module SAT.Mios.Vec
- type Var = Int
- bottomVar :: Var
- int2var :: Int -> Int
- type Lit = Int
- lit2int :: Lit -> Int
- int2lit :: Int -> Lit
- bottomLit :: Lit
- positiveLit :: Lit -> Bool
- lit2var :: Lit -> Var
- var2lit :: Var -> Bool -> Lit
- negateLit :: Lit -> Lit
- type LiftedBool = Int
- lit2lbool :: Lit -> LiftedBool
- data Int where
- class VarOrder o where
- type EMA = (Double', Maybe Double', Double)
- newEMA :: Bool -> Int -> IO EMA
- getEMA :: EMA -> IO Double
- updateEMA :: EMA -> Double -> IO Double
- data StatIndex
- data DumpMode
Interface to caller
type SolverResult = Either SolverException Certificate Source #
the type that Mios returns This captures the following three cases: * solved with a satisfiable assigment, * proved that it's an unsatisfiable problem, and * aborted due to Mios specification or an internal error
data Certificate Source #
terminate and find an SAT/UNSAT answer
Instances
Eq Certificate Source # | |
Defined in SAT.Mios.Types (==) :: Certificate -> Certificate -> Bool # (/=) :: Certificate -> Certificate -> Bool # | |
Ord Certificate Source # | |
Defined in SAT.Mios.Types compare :: Certificate -> Certificate -> Ordering # (<) :: Certificate -> Certificate -> Bool # (<=) :: Certificate -> Certificate -> Bool # (>) :: Certificate -> Certificate -> Bool # (>=) :: Certificate -> Certificate -> Bool # max :: Certificate -> Certificate -> Certificate # min :: Certificate -> Certificate -> Certificate # | |
Read Certificate Source # | |
Defined in SAT.Mios.Types readsPrec :: Int -> ReadS Certificate # readList :: ReadS [Certificate] # readPrec :: ReadPrec Certificate # readListPrec :: ReadPrec [Certificate] # | |
Show Certificate Source # | |
Defined in SAT.Mios.Types showsPrec :: Int -> Certificate -> ShowS # show :: Certificate -> String # showList :: [Certificate] -> ShowS # |
data SolverException Source #
abnormal termination flags
Instances
data CNFDescription Source #
Misc information on a CNF
CNFDescription | |
|
Instances
Eq CNFDescription Source # | |
Defined in SAT.Mios.Types (==) :: CNFDescription -> CNFDescription -> Bool # (/=) :: CNFDescription -> CNFDescription -> Bool # | |
Ord CNFDescription Source # | |
Defined in SAT.Mios.Types compare :: CNFDescription -> CNFDescription -> Ordering # (<) :: CNFDescription -> CNFDescription -> Bool # (<=) :: CNFDescription -> CNFDescription -> Bool # (>) :: CNFDescription -> CNFDescription -> Bool # (>=) :: CNFDescription -> CNFDescription -> Bool # max :: CNFDescription -> CNFDescription -> CNFDescription # min :: CNFDescription -> CNFDescription -> CNFDescription # | |
Read CNFDescription Source # | |
Defined in SAT.Mios.Types readsPrec :: Int -> ReadS CNFDescription # readList :: ReadS [CNFDescription] # | |
Show CNFDescription Source # | |
Defined in SAT.Mios.Types showsPrec :: Int -> CNFDescription -> ShowS # show :: CNFDescription -> String # showList :: [CNFDescription] -> ShowS # |
Solver Configuration
data MiosConfiguration Source #
Solver's parameters; random decision rate was dropped.
MiosConfiguration | |
|
Instances
Eq MiosConfiguration Source # | |
Defined in SAT.Mios.Types (==) :: MiosConfiguration -> MiosConfiguration -> Bool # (/=) :: MiosConfiguration -> MiosConfiguration -> Bool # | |
Ord MiosConfiguration Source # | |
Defined in SAT.Mios.Types compare :: MiosConfiguration -> MiosConfiguration -> Ordering # (<) :: MiosConfiguration -> MiosConfiguration -> Bool # (<=) :: MiosConfiguration -> MiosConfiguration -> Bool # (>) :: MiosConfiguration -> MiosConfiguration -> Bool # (>=) :: MiosConfiguration -> MiosConfiguration -> Bool # max :: MiosConfiguration -> MiosConfiguration -> MiosConfiguration # min :: MiosConfiguration -> MiosConfiguration -> MiosConfiguration # | |
Read MiosConfiguration Source # | |
Defined in SAT.Mios.Types | |
Show MiosConfiguration Source # | |
Defined in SAT.Mios.Types showsPrec :: Int -> MiosConfiguration -> ShowS # show :: MiosConfiguration -> String # showList :: [MiosConfiguration] -> ShowS # |
defaultConfiguration :: MiosConfiguration Source #
dafault configuration
- Minisat-1.14 uses
(0.95, 0.999, 0.2 = 20 / 1000)
. - Minisat-2.20 uses
(0.95, 0.999, 0)
. - Gulcose-4.0 uses
(0.8 , 0.999, 0)
. - Mios-1.2 uses
(0.95, 0.999, 0)
.
internal structure
module SAT.Mios.Vec
Variable
int2var :: Int -> Int Source #
converts a usual Int as literal to an internal Var
presentation.
>>>
int2var 1
1 -- the first literal is the first variable>>>
int2var 2
2 -- literal @2@ is variable 2>>>
int2var (-2)
2 -- literal @-2@ is corresponding to variable 2
Internal encoded Literal
The literal data has an index
method which converts the literal to
a "small" integer suitable for array indexing. The var
method returns
the underlying variable of the literal, and the sign
method if the literal
is signed (False for x and True for -x).
positiveLit :: Lit -> Bool Source #
returns True
if the literal is positive
var2lit :: Var -> Bool -> Lit Source #
converts a Var
to the corresponing literal.
>>>
var2lit 1 True
2>>>
var2lit 1 False
3>>>
var2lit 2 True
4>>>
var2lit 2 False
5
negateLit :: Lit -> Lit Source #
negates literal
>>>
negateLit 2
3>>>
negateLit 3
2>>>
negateLit 4
5>>>
negateLit 5
4
Assignment on the lifted Bool domain
type LiftedBool = Int Source #
Lifted Boolean domain (p.7) that extends Bool
with "⊥" means undefined
design note: _|_ should be null = 0; True literals are coded to even numbers. So it should be 2.
lit2lbool :: Lit -> LiftedBool Source #
returns the value of a literal as a LiftedBool
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]
.
The exact range for a given implementation can be determined by using
minBound
and maxBound
from the Bounded
class.
pattern LiftedF :: Int | FALSE on the Lifted Bool domain |
pattern LiftedT :: Int | TRUE on the Lifted Bool domain |
pattern LBottom :: Int | UNDEFINED on the Lifted Bool domain |
pattern Conflict :: Int | CONFLICT on the Lifted Bool domain |
Instances
class VarOrder o where Source #
Assisting ADT for the dynamic variable ordering of the solver.
The constructor takes references to the assignment vector and the activity
vector of the solver. The method select
will return the unassigned variable
with the highest activity.
newEMA :: Bool -> Int -> IO EMA Source #
returns a new EMA from a flag (slow or fast) and a window size
statistics
stat index
NumOfBackjump | the number of backjump |
NumOfRestart | the number of restart |
NumOfBlockRestart | the number of blacking start |
NumOfGeometricRestart | the number of classic restart |
NumOfPropagation | the number of propagation |
NumOfReduction | the number of reduction |
NumOfClause | the number of |
NumOfLearnt | the number of |
NumOfVariable | the number of |
NumOfAssigned | the number of assigned variables |
EndOfStatIndex | Don't use this dummy. |
Instances
Bounded StatIndex Source # | |
Enum StatIndex Source # | |
Defined in SAT.Mios.Types succ :: StatIndex -> StatIndex # pred :: StatIndex -> StatIndex # fromEnum :: StatIndex -> Int # enumFrom :: StatIndex -> [StatIndex] # enumFromThen :: StatIndex -> StatIndex -> [StatIndex] # enumFromTo :: StatIndex -> StatIndex -> [StatIndex] # enumFromThenTo :: StatIndex -> StatIndex -> StatIndex -> [StatIndex] # | |
Eq StatIndex Source # | |
Ord StatIndex Source # | |
Defined in SAT.Mios.Types | |
Read StatIndex Source # | |
Show StatIndex Source # | |
formats of state dump
Instances
Bounded DumpMode Source # | |
Enum DumpMode Source # | |
Eq DumpMode Source # | |
Ord DumpMode Source # | |
Defined in SAT.Mios.Types | |
Read DumpMode Source # | |
Show DumpMode Source # | |