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

msakai / toysolver / 496

10 Nov 2024 11:05AM UTC coverage: 69.994% (-1.1%) from 71.113%
496

push

github

web-flow
Merge pull request #117 from msakai/update-coveralls-and-haddock

GitHub Actions: Update coveralls and haddock configuration

9872 of 14104 relevant lines covered (69.99%)

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