Copyright | (c) Masahiro Sakai 2016-2018 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
ToySolver.FileFormat.CNF
Description
Reader and Writer for DIMACS CNF and family of similar formats.
Synopsis
- module ToySolver.FileFormat.Base
- data CNF = CNF {
- cnfNumVars :: !Int
- cnfNumClauses :: !Int
- cnfClauses :: [PackedClause]
- data WCNF = WCNF {
- wcnfNumVars :: !Int
- wcnfNumClauses :: !Int
- wcnfTopCost :: !Weight
- wcnfClauses :: [WeightedClause]
- type WeightedClause = (Weight, PackedClause)
- type Weight = Integer
- newtype NewWCNF = NewWCNF {
- nwcnfClauses :: [NewWeightedClause]
- data SomeWCNF
- data GCNF = GCNF {
- gcnfNumVars :: !Int
- gcnfNumClauses :: !Int
- gcnfLastGroupIndex :: !GroupIndex
- gcnfClauses :: [GClause]
- type GroupIndex = Int
- type GClause = (GroupIndex, PackedClause)
- data QDimacs = QDimacs {
- qdimacsNumVars :: !Int
- qdimacsNumClauses :: !Int
- qdimacsPrefix :: [QuantSet]
- qdimacsMatrix :: [PackedClause]
- data Quantifier
- type QuantSet = (Quantifier, [Atom])
- type Atom = Var
- type Lit = Int
- type Clause = [Lit]
- type PackedClause = Vector PackedLit
- packClause :: Clause -> PackedClause
- unpackClause :: PackedClause -> Clause
FileFormat class
module ToySolver.FileFormat.Base
CNF format
DIMACS CNF format
Constructors
CNF | |
Fields
|
WCNF formats
(Old) WCNF format
WCNF format for representing partial weighted Max-SAT problems.
This format is used for for MAX-SAT evaluations.
References:
Constructors
WCNF | |
Fields
|
type WeightedClause = (Weight, PackedClause) Source #
Weighted clauses
New WCNF format
New WCNF file format
This format is used for for MAX-SAT evaluations >=2020.
References:
Constructors
NewWCNF | |
Fields
|
Old or new WCNF
Constructors
SomeWCNFOld WCNF | |
SomeWCNFNew NewWCNF |
GCNF format
Group oriented CNF Input Format
This format is used in Group oriented MUS track of the SAT Competition 2011.
References:
Constructors
GCNF | |
Fields
|
type GroupIndex = Int Source #
Component number between 0 and gcnfLastGroupIndex
type GClause = (GroupIndex, PackedClause) Source #
Clause together with component number
QDIMACS format
QDIMACS format
Quantified boolean expression in prenex normal form,
consisting of a sequence of quantifiers (qdimacsPrefix
) and
a quantifier-free CNF part (qdimacsMatrix
).
References:
- QDIMACS standard Ver. 1.1 http://www.qbflib.org/qdimacs.html
Constructors
QDimacs | |
Fields
|
data Quantifier Source #
Quantifier
Instances
type QuantSet = (Quantifier, [Atom]) Source #
Quantified set of variables
Re-exports
Positive (resp. negative) literals are represented as positive (resp. negative) integers. (DIMACS format).
type PackedClause = Vector PackedLit Source #
packClause :: Clause -> PackedClause Source #
unpackClause :: PackedClause -> Clause Source #