• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

msakai / toysolver / 517

24 Nov 2024 02:02PM UTC coverage: 69.746% (-0.7%) from 70.447%
517

push

github

web-flow
Merge pull request #123 from msakai/feature/reduce-transformers-2

Change SimplifyMaxSAT2Info and SAT3ToMaxSAT2Info to be synonyms of TseitinInfo

5 of 5 new or added lines in 1 file covered. (100.0%)

127 existing lines in 13 files now uncovered.

9816 of 14074 relevant lines covered (69.75%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.0
/src/ToySolver/Data/DNF.hs
1
{-# OPTIONS_HADDOCK show-extensions #-}
2
{-# LANGUAGE MultiParamTypeClasses #-}
3
-----------------------------------------------------------------------------
4
-- |
5
-- Module      :  ToySolver.Data.DNF
6
-- Copyright   :  (c) Masahiro Sakai 2011-2013
7
-- License     :  BSD-style
8
--
9
-- Maintainer  :  masahiro.sakai@gmail.com
10
-- Stability   :  provisional
11
-- Portability :  non-portable
12
--
13
-- Disjunctive Normal Form
14
--
15
-----------------------------------------------------------------------------
16
module ToySolver.Data.DNF
17
  ( DNF (..)
18
  ) where
19

20
import ToySolver.Data.Boolean
21

22
-- | Disjunctive normal form
23
newtype DNF lit
24
  = DNF
25
  { unDNF :: [[lit]] -- ^ list of conjunction of literals
1✔
26
  } deriving (Show)
×
27

28
instance Complement lit => Complement (DNF lit) where
29
  notB (DNF xs) = DNF . sequence . map (map notB) $ xs
×
30

31
instance MonotoneBoolean (DNF lit) where
×
32
  true  = DNF [[]]
1✔
33
  false = DNF []
×
34
  DNF xs .||. DNF ys = DNF (xs++ys)
×
35
  DNF xs .&&. DNF ys = DNF [x++y | x<-xs, y<-ys]
1✔
36

37
instance Complement lit => IfThenElse (DNF lit) (DNF lit) where
38
  ite = iteBoolean
×
39

40
instance Complement lit => Boolean (DNF lit)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc