(Context-free) grammars in formal language theory

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

GPL-3.0-only licensed by Christian Hoener zu Siederdissen, 2013-2017

Build Status

FormalGrammars: A DSL for formal languages in Haskell

generalized Algebraic Dynamic Programming Homepage

The gADP homepage has a tutorial and example on how to write algorithms / grammars.

Ideas implemented here are described in a couple of papers:

  1. Christian Hoener zu Siederdissen
    Sneaking Around ConcatMap: Efficient Combinators for Dynamic Programming
    2012, Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
    paper preprint
  2. Andrew Farmer, Christian Höner zu Siederdissen, and Andy Gill.
    The HERMIT in the stream: fusing stream fusion’s concatMap
    2014, Proceedings of the ACM SIGPLAN 2014 workshop on Partial evaluation and program manipulation.
  3. Christian Höner zu Siederdissen, Ivo L. Hofacker, and Peter F. Stadler.
    Product Grammars for Alignment and Folding
    2014, IEEE/ACM Transactions on Computational Biology and Bioinformatics. 99
  4. Christian Höner zu Siederdissen, Sonja J. Prohaska, and Peter F. Stadler
    Algebraic Dynamic Programming over General Data Structures
    2015, BMC Bioinformatics
  5. Maik Riechert, Christian Höner zu Siederdissen, and Peter F. Stadler
    Algebraic dynamic programming for multiple context-free languages
    2015, submitted


Christian Hoener zu Siederdissen
Leipzig University, Leipzig, Germany


  • removed most upper bounds, and version bumped stuff

  • This version only works together with ADPfusion-0.5.2, this update improves performance for all grammars.

  • Major change in terminal symbol handling: In 0.2.x.y versions, when you named a terminal (say ‘c’) then each occurance of ‘c’ had the same type. This was independent of the tape the symbol occured on. Starting with if you have a terminal with the same name on different tapes, then you will have to give each type explicitly. This requires a bit more typing for homogenous grammars, but makes heterogenous multi-tape grammars much more flexible.

  • indexed rules and grammars (revamped system)
  • multi-context free grammars available!
  • new travis.yml

  • completely rewritten parsing system
  • makes use of newer ADPfusion 0.4.0
  • travis-ci integration

  • fixed dependencies
  • major version bump
  • new TH code generator using ADPfusion 0.3

  • cleaned up the TH generator. Should be easier now to build more complex auto-generators

  • basic operations on context-free formal grammars.
comments powered byDisqus