copar.cabal 14.3 KB
Newer Older
1
name:                copar
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
2 3 4
version:             0.1.0.0
-- synopsis:
-- description:
5 6
license:             GPL-3
license-file:        LICENSE
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
7 8 9 10
author:              Hans-Peter Deifel
maintainer:          hans-peter.deifel@fau.de
-- copyright:
-- category:
11 12
build-type:          Simple
cabal-version:       >=2.0
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
13

14 15 16 17
flag release
  description:         Disable sanity checks for more speed and less safety
  default:             False

18 19 20 21
flag benchmark-generators
  description:         Build executables used to generated/convert various benchmark suites
  default:             False

Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
22 23 24
library
  hs-source-dirs:      src
  exposed-modules:     Data.MorphismEncoding
25 26
                     , Data.RefinablePartition
                     , Data.Vector.Unboxed.Mutable.Utils
27
                     , Data.Vector.Utils
28
                     , Data.Algorithm.PossibleMajorityCandidate
29
                     , Data.BlockQueue
30
                     , Data.Partition
31
                     , Data.Partition.Common
32
                     , Data.OpenUnion
33
                     , Data.Float.Utils
34
                     , Data.List.Utils
35
                     , Data.Text.Prettyprint
36
                     , Data.SumBag
37
                     , Data.Bits.Monoid
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
                     , Copar.RefinementInterface
                     , Copar.Functors
                     , Copar.FunctorDescription
                     , Copar.Functors.Powerset
                     , Copar.Functors.Bag
                     , Copar.Functors.GroupValued
                     , Copar.Functors.MonoidValued
                     , Copar.Functors.Distribution
                     , Copar.Functors.Polynomial
                     , Copar.Functors.AbsorbingPolynomial
                     , Copar.Functors.SomeFunctor
                     , Copar.Parser
                     , Copar.Parser.Lexer
                     , Copar.Parser.Types
                     , Copar.Algorithm
                     , Copar.Algorithm.Types
                     , Copar.Algorithm.Initialize
                     , Copar.Algorithm.Split
                     , Copar.FunctorExpression.Type
                     , Copar.FunctorExpression.Parser
                     , Copar.FunctorExpression.Pretty
                     , Copar.FunctorExpression.Sorts
                     , Copar.FunctorExpression.Desorting
                     , Copar.FunctorExpression.Transform
                     , Copar.Coalgebra.Parser
                     , Copar.Coalgebra.Parser.Class
                     , Copar.Coalgebra.Parser.Internal
                     , Copar.PartitionPrinter
                     , Copar.Dot
                     , Copar.PrettyShow
                     , Copar.RewriteFunctors
69
                     , Copar.Timing
70 71 72 73 74 75 76 77 78
  default-extensions:  GADTs
                     , StandaloneDeriving
                     , DeriveFunctor
                     , DeriveFoldable
                     , DeriveTraversable
                     , TypeFamilies
                     , InstanceSigs
                     , OverloadedStrings
                     , TupleSections
79
                     , LambdaCase
80 81 82
                     , ScopedTypeVariables
                     , TypeApplications
                     , RankNTypes
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
83
  default-language:    Haskell2010
84
  build-depends:       base >= 4.11
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
85
                     , bytestring
86
                     , containers
87
                     , deepseq
88
                     , deriving-compat
89
                     , extra
90
                     , ieee754 >= 0.8.0 && <0.9
91
                     , megaparsec >= 7 && <9
92 93 94 95 96 97
                     , microlens
                     , microlens-platform
                     , microlens-th
                     , mtl
                     , prettyprinter >= 1.2.1
                     , prettyprinter-ansi-terminal >= 1.1.1.2
98
                     , primitive >= 0.6.4 && <0.8
99
                     , scientific >= 0.3.6 && < 0.4
100 101 102 103 104
                     , text
                     , unordered-containers
                     , vector
                     , vector-algorithms
                     , vector-th-unbox >= 0.2 && <0.3
105
  ghc-options:         -Wall -Wno-name-shadowing
106
  if flag(release)
107
    cpp-options:       -DRELEASE
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
108

109
executable copar
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
110
  main-is:             Main.hs
111
  build-depends:       base >=4.11 && <4.13
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
112 113
  hs-source-dirs:      src/main
  default-language:    Haskell2010
114
  build-depends:       copar
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
115 116 117 118
                     , containers
                     , text
                     , vector
                     , bytestring
119
                     , deepseq
120
                     , optparse-applicative
121
                     , json
122
                     , scientific >= 0.3.6 && < 0.4
123 124 125
                     , prettyprinter
                     , prettyprinter-ansi-terminal
                     , prettyprinter-convert-ansi-wl-pprint
126
                     , pretty-show >= 1.7 && <1.10
127 128 129 130 131 132 133

test-suite spec
  type:                exitcode-stdio-1.0
  hs-source-dirs:      tests
  main-is:             Spec.hs
  other-modules:       Data.RefinablePartitionSpec
                     , Data.Vector.Unboxed.Mutable.UtilsSpec
134
                     , Data.Algorithm.PossibleMajorityCandidateSpec
135
                     , Data.BlockQueueSpec
136
                     , Data.PartitionSpec
137
                     , Data.OpenUnionSpec
138
                     , Data.List.UtilsSpec
139
                     , Data.Float.UtilsSpec
140
                     , Data.SumBagSpec
141
                     , Data.Bits.MonoidSpec
142 143 144 145 146 147 148 149 150 151 152
                     , Copar.Functors.PowersetSpec
                     , Copar.Functors.GroupValuedSpec
                     , Copar.Functors.BagSpec
                     , Copar.Functors.DistributionSpec
                     , Copar.Functors.PolynomialSpec
                     , Copar.Functors.MonoidValuedSpec
                     , Copar.Functors.AbsorbingPolynomialSpec
                     , Copar.FunctorExpression.ParserSpec
                     , Copar.FunctorExpression.PrettySpec
                     , Copar.FunctorExpression.SortsSpec
                     , Copar.Coalgebra.ParserSpec
153
                     , Copar.ParserSpec
154 155 156
                     , Copar.Parser.LexerSpec
                     , Copar.Algorithm.InitializeSpec
                     , Copar.Algorithm.SplitSpec
157
                     , TestHelpers
158
  default-language:    Haskell2010
159 160 161 162 163 164 165 166 167
  default-extensions:  GADTs
                     , StandaloneDeriving
                     , DeriveFunctor
                     , DeriveFoldable
                     , DeriveTraversable
                     , TypeFamilies
                     , InstanceSigs
                     , OverloadedStrings
                     , TupleSections
168 169 170
                     , ScopedTypeVariables
                     , TypeApplications
                     , RankNTypes
171
  build-depends:       base >= 4.11
172 173
                     , hspec
                     , QuickCheck
174
                     , quickcheck-classes >= 0.6 && <0.7
175
                     , vector
176
                     , vector-algorithms
177 178
                     , bytestring
                     , text
179 180
                     , megaparsec >= 7 && <9
                     , hspec-megaparsec ^>= 2.0 || ^>= 2.1
181
                     , microlens-platform
182 183
                     , unordered-containers
                     , containers
184
                     , mtl
185
                     , copar
186
  build-tool-depends: hspec-discover:hspec-discover ==2.*
187

188 189 190 191 192 193 194 195 196 197 198 199 200

-- FIXME: doctests are currently disabled because cabal-doctest requires a
-- custom build-type and cabal 2.4 doesn't support custom bulid types together
-- with multiple internal libraries.
--
-- test-suite doctests
--   type:                exitcode-stdio-1.0
--   hs-source-dirs:      tests
--   main-is:             DocTests.hs
--   default-language:    Haskell2010
--   build-depends:       base >= 4.11
--                      , copar
--                      , doctest
201 202 203 204 205 206

test-suite examples
  type:                exitcode-stdio-1.0
  hs-source-dirs:      tests
  main-is:             Examples.hs
  default-language:    Haskell2010
207
  build-depends:       base >= 4.11
208
                     , copar
209 210 211
                     , hspec
                     , directory
                     , text
212
                     , extra
213 214 215 216 217

benchmark bench
  type:                exitcode-stdio-1.0
  hs-source-dirs:      bench
  main-is:             BenchMain.hs
218 219 220
  other-modules:       Copar.Coalgebra.BenchParser
                     , Copar.Functors.BenchGroupValued
                     , Copar.Parser.BenchLexer
221
                     , Data.List.BenchUtils
222
                     , Copar.Algorithm.BenchInitialize
223
                     , Data.BenchRefinablePartition
224
                     , Data.BenchBlockQueue
225
                     , Data.BenchSumBag
226 227 228 229 230 231 232 233 234 235 236 237
  default-extensions:  GADTs
                     , StandaloneDeriving
                     , DeriveFunctor
                     , DeriveFoldable
                     , DeriveTraversable
                     , TypeFamilies
                     , InstanceSigs
                     , OverloadedStrings
                     , TupleSections
                     , ScopedTypeVariables
                     , TypeApplications
                     , RankNTypes
238
  build-depends:       base >= 4.11
239
                     , copar
240 241
                     , criterion
                     , text
242
                     , megaparsec >= 7 && <9
243
                     , deepseq
244 245
                     , vector
                     , mtl
246 247
  default-language:    Haskell2010
  ghc-options:         -Wall
248

249
library prism-converter-lib
250
  hs-source-dirs:      src/prism-converter/lib
251
  exposed-modules:     Parser
252
                     , MarkovChain
253
                     , Mdp
254
                     , Mdp.Types
255
                     , StatesFile
256
                     , Mdp.Mcrl2
257
  default-language:    Haskell2010
258
  build-depends:       base >= 4.11
259
                     , containers ^>= 0.6
260
                     , megaparsec ^>= 7 || ^>= 8
261 262 263 264 265 266
                     , microlens ^>= 0.4.10
                     , microlens-platform ^>= 0.3.11
                     , microlens-th ^>= 0.4.2
                     , text ^>= 1.2.3
                     , vector ^>= 0.12
                     , vector-algorithms ^>= 0.8.0.1
267
  ghc-options:         -Wall -Wno-name-shadowing
268 269 270 271
  if !flag(benchmark-generators)
    buildable:       False

executable prism-converter
272
  hs-source-dirs:      src/prism-converter
273 274 275 276 277
  main-is:             Main.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.11
                     , prism-converter-lib
                     , containers ^>= 0.6
278
                     , megaparsec ^>= 7 || ^>= 8
279 280 281 282 283
                     , optparse-applicative ^>= 0.14.3
                     , prettyprinter ^>= 1.2 || ^>= 1.3
                     , prettyprinter-ansi-terminal ^>= 1.1
                     , prettyprinter-convert-ansi-wl-pprint ^>= 1.1
                     , text ^>= 1.2.3
284
  ghc-options:         -Wall -Wno-name-shadowing
285 286 287 288 289 290 291 292 293 294 295 296 297
  if !flag(benchmark-generators)
    buildable:       False

test-suite prism-converter-tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      src/prism-converter
  main-is:             Tests.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.11
                     , hspec >= 2.6 && <2.8
                     , microlens-platform ^>= 0.3.11
                     , prism-converter-lib
                     , vector ^>= 0.12.0.2
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
298
                     , text ^>= 1.2.3
299
  ghc-options:         -Wall -Wno-name-shadowing
300 301
  if !flag(benchmark-generators)
    buildable:       False
302 303 304 305 306 307 308

executable random-dfa
  hs-source-dirs:      src/random-dfa
  main-is:             Main.hs
  other-modules:       Type
                     , CoalgOutput
                     , DotOutput
309
                     , ValmariOutput
310 311 312
  default-language:    Haskell2010
  default-extensions:  OverloadedStrings
                     , LambdaCase
313 314 315
                     , MultiParamTypeClasses
                     , FlexibleInstances
                     , FunctionalDependencies
316
  build-depends:       base >= 4.11
317 318 319 320 321 322
                     , vector
                     , microlens
                     , microlens-th
                     , microlens-platform
                     , random
                     , text
323
                     , optparse-applicative
324 325
  if !flag(benchmark-generators)
    buildable:       False
326 327 328 329
    
library random-wta-lib
  hs-source-dirs:      src/random-wta/lib
  exposed-modules:     Types
330 331
                     , Generator
                     , Output
332
                     , Probability
333
                     , IndexedTransition
334
                     , Hoegberg
335 336 337 338 339 340 341
  default-language:    Haskell2010
  default-extensions:  OverloadedStrings
                     , LambdaCase
                     , MultiParamTypeClasses
                     , FlexibleInstances
                     , FunctionalDependencies
  build-depends:       base >= 4.11
342 343
                     , vector >= 0.12 && <0.13
                     , text >= 1.2 && <1.3
344 345
                     , random >= 1.1 && <1.2
                     , mtl >= 2.2 && <2.3
346
                     , megaparsec >= 7 && <9
347
                     , scientific >= 0.3 && <0.4
348
                     , containers >= 0.6 && <0.7
349 350 351 352 353 354 355 356 357 358 359 360
  ghc-options:         -Wall -Wno-name-shadowing
  if !flag(benchmark-generators)
    buildable:       False

executable random-wta
  hs-source-dirs:      src/random-wta
  main-is:             Main.hs
  default-language:    Haskell2010
  default-extensions:  OverloadedStrings
  build-depends:       base >= 4.11
                     , random-wta-lib
                     , optparse-applicative
361 362 363
                     , prettyprinter >= 1.2.1
                     , prettyprinter-ansi-terminal >= 1.1.1.2
                     , prettyprinter-convert-ansi-wl-pprint
364 365 366
                     , vector >= 0.12 && <0.13
                     , text >= 1.2 && <1.3
                     , random >= 1.1 && <1.2
367
                     , megaparsec >= 7 && <9
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
368
  ghc-options:         -Wall -Wno-name-shadowing
369 370
  if !flag(benchmark-generators)
    buildable:       False
371 372 373 374 375 376 377

test-suite random-wta-tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      src/random-wta
  main-is:             Tests.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.11
378
                     , random-wta-lib
379
                     , vector >= 0.12 && <0.13
380 381
                     , hspec >= 2.6 && <2.8
                     , QuickCheck >= 2.12 && <2.14
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
382
  ghc-options:         -Wall -Wno-name-shadowing
383 384
  if !flag(benchmark-generators)
    buildable:       False