packages feed

set-cover-0.1.2: set-cover.cabal

Cabal-Version:    2.2
Name:             set-cover
Version:          0.1.2
License:          BSD-3-Clause
License-File:     LICENSE
Author:           Henning Thielemann, Helmut Podhaisky
Maintainer:       Henning Thielemann <haskell@henning-thielemann.de>
Homepage:         https://hub.darcs.net/thielema/set-cover/
Category:         Math, Algorithms
Synopsis:         Solve exact set cover problems like Sudoku, 8 Queens, Soma Cube, Tetris Cube
Description:
  Solver for exact set cover problems.
  Included examples:
  Sudoku, Nonogram, 8 Queens, Domino tiling, Mastermind,
  Alphametics, Graph coloring,
  Soma Cube, Tetris Cube, Cube of L's,
  Logika's Baumeister puzzle, Lonpos pyramid, Conway's puzzle.
  The generic algorithm allows to choose between
  slow but flexible @Set@ from @containers@ package
  and fast but cumbersome bitvectors.
  .
  For getting familiar with the package
  I propose to study the Queen8 example along with "Math.SetCover.Exact".
  .
  The Sudoku and Nonogram examples also demonstrate
  how to interpret the set-cover solution in a human-friendly way.
  .
  Build examples with @cabal install -fbuildExamples@.
  .
  The package needs only Haskell 98.
  There is also an experimental implementation using LLVM and @knead@.
  Do not rely on that interface in released packages.
Tested-With:      GHC==7.4.2, GHC==7.6.3, GHC==7.8.2
Build-Type:       Simple
Extra-Source-Files:
  Makefile

Extra-Doc-Files:
  Changes.md

Flag buildExamples
  Description: Build example executables
  Default:     False

Flag llvm
  Description: Enable efficient array processing using LLVM
  Manual:      True
  Default:     False

Source-Repository this
  Tag:         0.1.2
  Type:        darcs
  Location:    https://hub.darcs.net/thielema/set-cover/

Source-Repository head
  Type:        darcs
  Location:    https://hub.darcs.net/thielema/set-cover/

Library
  Build-Depends:
    psqueues >=0.2 && <0.3,
    enummapset >=0.1 && <0.8,
    transformers >=0.2 && <0.7,
    array >=0.4 && <0.6,
    containers >=0.4 && <0.9,
    non-empty >=0.2 && <0.4,
    semigroups >=0.1 && <1,
    utility-ht >=0.0.12 && <0.1,
    prelude-compat ==0.*,
    base >=4 && <5

  Default-Language: Haskell98
  GHC-Options:      -Wall
  Hs-Source-Dirs:   src
  Exposed-Modules:
    Math.SetCover.Bit
    Math.SetCover.BitSet
    Math.SetCover.BitPosition
    Math.SetCover.BitPriorityQueue
    Math.SetCover.Queue
    Math.SetCover.Exact
    Math.SetCover.Exact.Priority
    Math.SetCover.Exact.UArray
    Math.SetCover.Cuboid
  Other-Modules:
    Math.SetCover.BitMap
    Math.SetCover.EnumMap
    Math.SetCover.Queue.Set
    Math.SetCover.Queue.Map
    Math.SetCover.Queue.Bit
    Math.SetCover.Queue.BitPriorityQueue
    Math.SetCover.Exact.Block

  If flag(llvm)
    Build-Depends:
      knead >=1.0 && <1.1,
      llvm-dsl >=0.2 && <0.3,
      llvm-extra >=0.12.1 && <0.14,
      llvm-tf >=9.2 && <21.1,
      tfp >=1.0 && <1.1,
      comfort-array >=0.3 && <0.6,
      storable-record >=0.0.5 && <0.1,
      storable-endian >=0.2.5 && <0.3,
      bool8 >=0.0 && <0.1,
      lazyio >=0.1 && <0.2
    Exposed-Modules:
      Math.SetCover.Exact.Knead
      Math.SetCover.Exact.Knead.Vector
      Math.SetCover.Exact.Knead.Saturated
    Other-Modules:
      Math.SetCover.Exact.Knead.Symbolic

Test-Suite set-cover-test
  Type: exitcode-stdio-1.0
  Build-Depends:
    set-cover,
    transformers >=0.2 && <0.7,
    enummapset,
    enumset,
    containers,
    array >=0.1 && <0.6,
    utility-ht,
    doctest-exitcode-stdio >=0.0 && <0.1,
    doctest-lib >=0.1.1 && <0.2,
    QuickCheck >=2.5 && <3.0,
    base
  Main-Is: Test.hs
  Hs-Source-Dirs: test, example
  If flag(llvm)
    Hs-Source-Dirs: test/knead
  Else
    Hs-Source-Dirs: test/plain
  Default-Language: Haskell98
  GHC-Options:      -Wall
  Other-Modules:
    Mastermind.Test
    Mastermind.Guess
    Mastermind.Utility
    DocTest.GraphColoring.CutEnumSet, GraphColoring.CutEnumSet
    DocTest.GraphColoring.Solve, GraphColoring.Solve
    DocTest.Main
    Test.Knead
    Test.Utility

Common example
  Default-Language: Haskell98
  GHC-Options:    -Wall
  Hs-Source-Dirs: example
  Build-Depends:
    set-cover,
    utility-ht,
    base

Executable tetris-cube
  Import: example
  If flag(buildExamples)
    Build-Depends:
      haha >=0.3.1 && <0.4,
      pooled-io >=0.0 && <0.1,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: TetrisCube.hs
  Other-Modules:
    Utility

Executable soma-cube
  Import: example
  If flag(buildExamples)
    Build-Depends:
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: Soma.hs

Executable queen8
  Import: example
  If flag(buildExamples)
    Build-Depends:
      array >=0.1 && <0.6,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: Queen8.hs

Executable sudoku-setcover
  Import: example
  If flag(buildExamples)
    Build-Depends:
      haha >=0.3.1 && <0.4,
      random >=1.0 && <1.4,
      transformers >=0.2 && <0.7,
      array >=0.1 && <0.6,
      containers
  Else
    Buildable: False
  GHC-Options:      -rtsopts -threaded
  Main-Is: Sudoku.hs
  Other-Modules: Random, Mastermind.Utility

Executable lcube
  Import: example
  If flag(buildExamples)
    Build-Depends:
      pooled-io >=0.0 && <0.1,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: LCube.hs
  Other-Modules:
    Utility

Executable baumeister
  Import: example
  If flag(buildExamples)
    Build-Depends:
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: Baumeister.hs
  Other-Modules:
    Utility

Executable lonpos-pyramid
  Import: example
  If flag(buildExamples)
    Build-Depends:
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: LonposPyramid.hs
  Other-Modules:
    Utility

Executable alphametics
  Import: example
  If flag(buildExamples)
    Build-Depends:
      non-empty >=0.2 && <0.4,
      transformers >=0.2 && <0.7,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: Alphametics.hs

Executable domino
  Import: example
  If flag(buildExamples)
    Build-Depends:
      unicode >=0.0 && <0.1,
      semigroups,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: Domino.hs

Executable nonogram
  Import: example
  If flag(buildExamples)
    Build-Depends:
      non-empty >=0.2 && <0.4,
      psqueues,
      enummapset,
      containers
  Else
    Buildable: False
  Main-Is: Nonogram.hs
  Other-Modules:
    Nonogram.Example
    Nonogram.Encoding.Combinatoric
    Nonogram.Encoding.BlackWhite
    Nonogram.Encoding.Plug
    Nonogram.Encoding.Naive
    Nonogram.Base

Executable mastermind-setcover
  Import: example
  If flag(buildExamples)
    Build-Depends:
      random >=1.0 && <1.4,
      transformers >=0.2 && <0.7,
      array >=0.1 && <0.6,
      enummapset,
      containers
  Else
    Buildable: False
  Main-Is: Mastermind.hs
  Other-Modules:
    Mastermind.Utility
    Mastermind.Guess
    Mastermind.Distinguish
    Mastermind.Example
    Random

Executable mastermind-knead
  Import: example
  If flag(buildExamples) && flag(llvm)
    GHC-Prof-Options: -rtsopts -auto-all
    Build-Depends:
      haha >=0.3.1 && <0.4,
      random >=1.0 && <1.4,
      lazyio,
      transformers >=0.2 && <0.7,
      array >=0.1 && <0.6,
      enummapset,
      containers
  Else
    Buildable: False
  Extra-Libraries: stdc++
  Main-Is: MastermindKnead.hs
  Other-Modules:
    Mastermind.Utility
    Mastermind.Guess
    Mastermind.Distinguish
    Mastermind.Example
    Random

Benchmark mastermind-benchmark
  Import: example
  Type: exitcode-stdio-1.0
  Build-Depends:
    timeit,
    QuickCheck >=2.5 && <3.0,
    random >=1.0 && <1.4,
    transformers >=0.2 && <0.7,
    array >=0.1 && <0.6,
    enummapset,
    containers
  Main-Is: Mastermind/Benchmark.hs
  Other-Modules:
    Mastermind.Test
    Mastermind.Guess
    Mastermind.Utility

Executable pangram
  Import: example
  If flag(buildExamples)
    Build-Depends:
      containers
  Else
    Buildable: False
  Main-Is: Pangram.hs

Executable conway-puzzle
  Import: example
  If flag(buildExamples)
    Build-Depends:
      pooled-io >=0.0 && <0.1,
      transformers,
      non-empty,
      containers
  Else
    Buildable: False
  GHC-Options:    -rtsopts -threaded
  Main-Is: ConwayPuzzle.hs
  Other-Modules:
    Utility

Executable graph-coloring
  Import: example
  If flag(buildExamples)
    Build-Depends:
      timeit >=0.9 && <3,
      enumset >=0.1 && <0.2,
      enummapset,
      containers
  Else
    Buildable: False
  Main-Is: GraphColoring.hs
  Other-Modules:
    GraphColoring.Solve
    GraphColoring.CutSet
    GraphColoring.CutEnumSet

Executable pythagoras-coloring
  Import: example
  If flag(buildExamples)
    Build-Depends:
      containers
  Else
    Buildable: False
  Main-Is: PythagorasColoring.hs