1. Kento Emoto
  2. GTALib


GTALib / GTALib.cabal

-- GTALib.cabal auto-generated by cabal init. For additional options,
-- see
-- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr.
-- The name of the package.
Name:                GTALib

-- The package version. See the Haskell package versioning policy
-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
-- standards guiding when and how versions should be incremented.
Version:             0.0.5

-- A short (one-line) description of the package.
Synopsis: A library for GTA programming           

-- A longer description of the package.
   This package provides the core functionalities of the GTA (Generate, Test, and Aggregate) programming framework on Haskell (c.f., Kento Emoto, Sebastian Fischer, Zhenjiang Hu: Generate, Test, and Aggregate - A Calculation-based Framework for Systematic Parallel Programming with MapReduce. ESOP 2012: 254-273. The authors' version is available at <http://www.ipl-lab.org/~emoto/ESOP2012.pdf>). 
   The following code is a GTA program to solve the 0-1 Knapsack problem (<http://en.wikipedia.org/wiki/Knapsack_problem>). It /appears to be an exponential cost/ proram in the number of input items, because it appears to generate all item selections by @subsP items@ (/Generate/), discard those with total weight heavier than the knapsack's capacity by @`filterBy` weightlimit capacity@ (/Test/), and take the most valuable selection by @`aggregateBy` maxsumsolutionWith getValue@ (/Aggregate/). However, it /actually runs in a linear time/ owing to our proposed program transformation 'Filter-embedding Semiring Fusion' implemented in the library. In addition, it runs in /parallel/ so that you can get linear speedup.
   > knapsack capacity items = 
   >  subsP items 
   >  `filterBy` weightlimit capacity
   >  `aggregateBy` maxsumsolutionWith getValue
   > getValue (_, v) = v
   > getWeight (w, _) = w
   > weightlimit w = (<=w) <.> weightsum where
   >   weightsum = joinListAlgebra times single nil --workaround for cabal's brace-eating bug
   >   x1 `times` x2  = (   x1 +    x2) `min` (w+1)
   >   single i  = getWeight i `min` (w+1)
   >   nil = 0
   Several examples of GTA programming are found in /examples/ directory at <https://bitbucket.org/emoto/gtalib/src>.

-- URL for the project homepage or repository.
Homepage: https://bitbucket.org/emoto/gtalib

-- The license under which the package is released.
License:             BSD3

-- The file containing the license text.
License-file:        LICENSE

-- The package author(s).
Author:              Kento Emoto

-- An email address to which users can send suggestions, bug reports,
-- and patches.
Maintainer:          emoto@mist.i.u-tokyo.ac.jp

-- A copyright notice.
-- Copyright:           

Category:            Language

Build-type:          Simple

-- Extra files to be distributed with the package, such as examples or
-- a README.
-- Extra-source-files:  

-- Constraint on the version of Cabal needed to build this package.
Cabal-version:       >=1.8
Tested-with:         GHC==7.0.4

source-repository head
  type:    git
  location: https://bitbucket.org/emoto/gtalib.git

  -- Modules exported by the library.
  Exposed-modules:     GTA.Core, GTA.Util.TypeInfo, GTA.Util.GenericSemiringStructureTemplate, GTA.Data.JoinList, GTA.Data.ConsList, GTA.Data.BinTree
  -- Packages needed in order to build this package.
  Build-depends:    base>=4.3 && < 4.6,template-haskell>=2.5 && <2.8,containers>=0.4 && <0.6,parallel >=3.1 && < 3.3, deepseq >=1.1 && < 1.4
  HS-source-dirs:   src/
  --GHC-options:    -Wall   -O
  -- Modules not exported by this package.
  -- Other-modules:       
  -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.
  -- Build-tools:         

Test-Suite unit-test
  HS-source-dirs:      test/
  Type:                exitcode-stdio-1.0
  Main-is:             test.hs
  Build-depends:       base>=4.3 && < 4.6,test-framework>=0.6&&<0.7,GTALib>=0.0.1,HUnit>= &&< 1.3,test-framework-hunit>=0.2.7&&<0.3