/
ADPfusion.cabal
468 lines (424 loc) · 13 KB
/
ADPfusion.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
cabal-version: 2.2
name: ADPfusion
version: 0.6.0.0
author: Christian Hoener zu Siederdissen, 2011-2023
copyright: Christian Hoener zu Siederdissen, 2011-2023
homepage: https://github.com/choener/ADPfusion
bug-reports: https://github.com/choener/ADPfusion/issues
maintainer: choener@bioinf.uni-leipzig.de
category: Algorithms, Data Structures, Bioinformatics, Formal Languages
license: BSD-3-Clause
license-file: LICENSE
build-type: Simple
stability: experimental
tested-with: GHC == 9.2.7
synopsis: Efficient, high-level dynamic programming.
description:
<http://www.bioinf.uni-leipzig.de/Software/gADP/ generalized Algebraic Dynamic Programming>
.
ADPfusion combines stream-fusion (using the stream interface provided by the vector
library) and type-level programming to provide highly efficient dynamic programming
combinators.
.
ADPfusion allows writing dynamic programs for single- and multi-tape problems.
Inputs can be sequences, or sets. New input types can be defined, without having to
rewrite this library thanks to the open-world assumption of ADPfusion.
.
The library provides the machinery for Outside and Ensemble algorithms as well.
Ensemble algorithms combine Inside and Outside calculations.
.
Starting with version 0.4.1 we support writing multiple context-free grammars
(interleaved syntactic variables). Such grammars have applications in bioinformatics
and linguistics.
.
The homepage provides a number of tutorial-style examples, with linear and
context-free grammars over sequence and set inputs.
.
The formal background for generalized algebraic dynamic programming and ADPfusion is
described in a number of papers. These can be found on the gADP homepage and in the
README.
.
Note: The core @ADPfusion@ library only provides machinery for linear language over
sequences. The add-ons @ADPfusionSubword@, @ADPfusionForest@, and others provide
specialized machinery for other types of formal languages.
Extra-Source-Files:
README.md
changelog.md
flag debugdump
description: Enable dumping intermediate / core files
default: False
manual: True
flag dump-core
description: Dump HTML for the core generated by GHC during compilation
default: False
manual: True
flag examples
description: build the examples
default: False
manual: True
flag examplenw
description: build the example NeedlemanWunsch
default: False
manual: True
flag examplesparse
description: build the sparse NeedlemanWunsch
default: False
manual: True
flag spectest
description: build the spec-ctor test case
default: False
manual: True
flag llvm
description: use llvm
default: False
manual: True
common deps
build-depends: base >= 4.7
, bits >= 0.4
, containers
, deepseq
, ghc-prim
, mmorph >= 1.0
, mtl >= 2.0
, primitive >= 0.5.4
, QuickCheck >= 2.7
, singletons >= 3.0
, singletons-base
, strict >= 0.3
, template-haskell >= 2.0
, th-orphans >= 0.12
, transformers >= 0.3
, tuple >= 0.3
, vector >= 0.11
, th-abstraction >= 0.4
--
, DPutils == 0.1.1.*
, OrderedBits == 0.0.2.*
, PrimitiveArray == 0.10.2.*
default-extensions: BangPatterns
, ConstraintKinds
, CPP
, DataKinds
, DefaultSignatures
, DeriveAnyClass
, DeriveDataTypeable
, DeriveGeneric
, DerivingStrategies
, FlexibleContexts
, FlexibleInstances
, GADTs
, GeneralizedNewtypeDeriving
, KindSignatures
, MagicHash
, MultiParamTypeClasses
-- PolyKinds is very important to get GHC to pick up all
-- the instances correctly.
, PolyKinds
, RankNTypes
, RecordWildCards
, ScopedTypeVariables
, StandaloneDeriving
, TemplateHaskell
, TupleSections
, TypeApplications
, TypeFamilies
, TypeOperators
, TypeSynonymInstances
, UndecidableInstances
, UnicodeSyntax
default-language:
Haskell2010
ghc-options:
-O2 -funbox-strict-fields
if flag(debugdump)
ghc-options:
-ddump-to-file
-ddump-simpl
-dsuppress-all
if flag(dump-core)
build-depends: dump-core
ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html
library
import:
deps
exposed-modules:
-- core system
ADPfusion.Core
ADPfusion.Core.Apply
ADPfusion.Core.Classes
ADPfusion.Core.Multi
ADPfusion.Core.SynVar.Array
ADPfusion.Core.SynVar.Array.Type
ADPfusion.Core.SynVar.Axiom
ADPfusion.Core.SynVar.Backtrack
ADPfusion.Core.SynVar.Fill
ADPfusion.Core.SynVar.FillTyLvl
ADPfusion.Core.SynVar.Indices
ADPfusion.Core.SynVar.Recursive.Type
ADPfusion.Core.SynVar.Split.Type
ADPfusion.Core.SynVar.Split
ADPfusion.Core.SynVar.TableWrap
ADPfusion.Core.Term.Chr
ADPfusion.Core.Term.Deletion
ADPfusion.Core.Term.Edge
ADPfusion.Core.Term.Epsilon
ADPfusion.Core.Term.MultiChr
ADPfusion.Core.Term.PeekIndex
ADPfusion.Core.Term.Str
ADPfusion.Core.Term.Switch
ADPfusion.Core.TH
ADPfusion.Core.TH.Backtrack
ADPfusion.Core.TH.Common
ADPfusion.Core.TyLvlIx
-- -- Point L
ADPfusion.PointL
ADPfusion.PointL.Core
ADPfusion.PointL.SynVar
ADPfusion.PointL.SynVar.Indices
ADPfusion.PointL.SynVar.Split
-- ADP.Fusion.PointL.SynVar.Recursive
ADPfusion.PointL.Term.Chr
ADPfusion.PointL.Term.Deletion
ADPfusion.PointL.Term.Epsilon
ADPfusion.PointL.Term.MultiChr
ADPfusion.PointL.Term.PeekIndex
ADPfusion.PointL.Term.Str
ADPfusion.PointL.Term.Switch
-- -- Point R
ADPfusion.PointR
ADPfusion.PointR.Core
ADPfusion.PointR.SynVar.Indices
ADPfusion.PointR.Term.Chr
ADPfusion.PointR.Term.Deletion
ADPfusion.PointR.Term.Epsilon
ADPfusion.PointR.Term.MultiChr
-- Unit
ADPfusion.Unit
ADPfusion.Unit.Core
ADPfusion.Unit.SynVar.Indices
ADPfusion.Unit.Term.Deletion
ADPfusion.Unit.Term.Epsilon
-- -- tutorials
-- ADP.Fusion.Tutorial.NeedlemanWunsch
test-suite properties
import:
deps
type:
exitcode-stdio-1.0
main-is:
properties.hs
other-modules:
QuickCheck.Common
QuickCheck.Point
ghc-options:
-threaded -rtsopts -with-rtsopts=-N
hs-source-dirs:
tests
cpp-options:
-DADPFUSION_TEST_SUITE_PROPERTIES
build-depends: ADPfusion
, tasty >= 0.11
, tasty-quickcheck >= 0.8
, tasty-th >= 0.1
-- Very simple two-sequence alignment.
executable NeedlemanWunsch
if flag(examples) || flag(examplenw)
buildable:
True
build-depends: base
, ADPfusion
, primitive
, PrimitiveArray
, template-haskell
, vector
, DPutils
else
buildable:
False
hs-source-dirs:
src
main-is:
NeedlemanWunsch.hs
default-language:
Haskell2010
default-extensions: BangPatterns
, DataKinds
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, PartialTypeSignatures
, PolyKinds
, RecordWildCards
, TemplateHaskell
, TypeApplications
, TypeFamilies
, TypeOperators
, UnicodeSyntax
ghc-options:
-O2
-funbox-strict-fields
-flate-dmd-anal
-fspec-constr-count=20
-fspec-constr-keen
-fspec-constr-recursive=20
-fspec-constr-threshold=20
if flag(debugdump)
ghc-options:
-ddump-to-file
-ddump-simpl
-dsuppress-all
if flag(llvm)
ghc-options:
-fllvm
-optlo-O3
if flag(dump-core)
build-depends: dump-core
ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html
executable SmithWaterman
if flag(examples)
buildable:
True
build-depends: base
, ADPfusion
, primitive
, PrimitiveArray
, template-haskell
, vector
, DPutils
else
buildable:
False
hs-source-dirs:
src
main-is:
SmithWaterman.hs
default-language:
Haskell2010
default-extensions: BangPatterns
, DataKinds
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, PartialTypeSignatures
, PolyKinds
, RecordWildCards
, TemplateHaskell
, TypeApplications
, TypeFamilies
, TypeOperators
, UnicodeSyntax
ghc-options:
-O2
-funbox-strict-fields
-- these parameters do well enough with GHC 8.2
-- for larger programs, we may have to increase the number of worker
-- arguments.
-flate-dmd-anal
-fspec-constr-count=20
-fspec-constr-keen
-fspec-constr-recursive=20
-fspec-constr-threshold=20
if flag(debugdump)
ghc-options:
-ddump-to-file
-ddump-simpl
-dsuppress-all
if flag(llvm)
ghc-options:
-fllvm
-optlo-O3
if flag(dump-core)
build-depends: dump-core
ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html
executable Sparse
if flag(examples) || flag(examplesparse)
buildable:
True
build-depends: base
, ADPfusion
, primitive
, PrimitiveArray
, template-haskell
, vector
, DPutils
else
buildable:
False
hs-source-dirs:
src
main-is:
Sparse.hs
default-language:
Haskell2010
default-extensions: BangPatterns
, DataKinds
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, PartialTypeSignatures
, PolyKinds
, RecordWildCards
, ScopedTypeVariables
, TemplateHaskell
, TypeApplications
, TypeFamilies
, TypeOperators
, UnicodeSyntax
ghc-options:
-O2
-funbox-strict-fields
-- these parameters do well enough with GHC 8.2
-- for larger programs, we may have to increase the number of worker
-- arguments.
-flate-dmd-anal
-fspec-constr-count=20
-fspec-constr-keen
-fspec-constr-recursive=20
-fspec-constr-threshold=20
if flag(debugdump)
ghc-options:
-ddump-to-file
-ddump-simpl
-dsuppress-all
if flag(llvm)
ghc-options:
-fllvm
-optlo-O3
if flag(dump-core)
build-depends: dump-core
ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html
-- Very simple two-sequence alignment.
executable spectest
if flag(spectest)
buildable:
True
build-depends: base
, ADPfusion
, PrimitiveArray
, template-haskell
, vector
else
buildable:
False
hs-source-dirs:
src
main-is:
SpecTest.hs
default-language:
Haskell2010
default-extensions: BangPatterns
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, RecordWildCards
, TemplateHaskell
, TypeFamilies
, TypeOperators
ghc-options:
-O2
-funbox-strict-fields
-funfolding-use-threshold1000
-funfolding-keeness-factor1000
source-repository head
type: git
location: git://github.com/choener/ADPfusion