Browse Source

added game monad

threadPool
Andrea Bellandi 9 years ago
parent
commit
cc14162e87
8 changed files with 865 additions and 0 deletions
  1. +0
    -0
      doc/ICFP2015_aposteriori.listing
  2. +611
    -0
      doc/ICFP2015_aposteriori.log
  3. BIN
      doc/ICFP2015_aposteriori.pdf
  4. +95
    -0
      doc/ICFP2015_aposteriori.pyg
  5. +0
    -0
      doc/ICFP2015_aposteriori.synctex.gz
  6. +28
    -0
      doc/ICFP2015_aposteriori.tex
  7. +82
    -0
      src/MonadicGame.hs
  8. +49
    -0
      src/parMapParallelization.hs

+ 0
- 0
doc/ICFP2015_aposteriori.listing View File


+ 611
- 0
doc/ICFP2015_aposteriori.log View File

@ -0,0 +1,611 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) (preloaded format=pdflatex 2015.1.27) 13 AUG 2015 02:09
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**ICFP2015_aposteriori.tex
(./ICFP2015_aposteriori.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 34 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/report.cls
Document Class: report 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
Package: geometry 2010/09/12 v5.6 Page Geometry
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/05/08 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty
Package: ifvtex 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
Package ifvtex Info: VTeX not detected.
)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
\Gm@cnth=\count88
\Gm@cntv=\count89
\c@Gm@tempcnt=\count90
\Gm@bindingoffset=\dimen103
\Gm@wd@mp=\dimen104
\Gm@odd@mp=\dimen105
\Gm@even@mp=\dimen106
\Gm@layoutwidth=\dimen107
\Gm@layoutheight=\dimen108
\Gm@layouthoffset=\dimen109
\Gm@layoutvoffset=\dimen110
\Gm@dimlist=\toks15
)
(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
\lst@mode=\count91
\lst@gtempboxa=\box26
\lst@token=\toks16
\lst@length=\count92
\lst@currlwidth=\dimen111
\lst@column=\count93
\lst@pos=\count94
\lst@lostspace=\dimen112
\lst@width=\dimen113
\lst@newlines=\count95
\lst@lineno=\count96
\lst@maxwidth=\dimen114
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
File: lstmisc.sty 2014/09/06 1.5e (Carsten Heinz)
\c@lstnumber=\count97
\lst@skipnumbers=\count98
\lst@framebox=\box27
)
(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
File: listings.cfg 2014/09/06 1.5e listings configuration
))
Package: listings 2014/09/06 1.5e (Carsten Heinz)
(/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
Package: tcolorbox 2014/10/10 version 3.21 text color boxes
(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
\pgfutil@everybye=\toks17
\pgfutil@tempdima=\dimen115
\pgfutil@tempdimb=\dimen116
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t
ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
\pgfutil@abb=\box28
(/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty
Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
Package: pgfrcs 2013/12/20 v3.0.0 (rcs-revision 1.28)
))
Package: pgf 2013/12/18 v3.0.0 (rcs-revision 1.14)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
)
Package graphics Info: Driver file: pdftex.def on input line 91.
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count99
))
\Gin@req@height=\dimen117
\Gin@req@width=\dimen118
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
Package: pgfsys 2013/11/30 v3.0.0 (rcs-revision 1.47)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
\pgfkeys@pathtoks=\toks18
\pgfkeys@temptoks=\toks19
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t
ex
\pgfkeys@tmptoks=\toks20
))
\pgf@x=\dimen119
\pgf@y=\dimen120
\pgf@xa=\dimen121
\pgf@ya=\dimen122
\pgf@xb=\dimen123
\pgf@yb=\dimen124
\pgf@xc=\dimen125
\pgf@yc=\dimen126
\w@pgf@writea=\write3
\r@pgf@reada=\read1
\c@pgf@counta=\count100
\c@pgf@countb=\count101
\c@pgf@countc=\count102
\c@pgf@countd=\count103
\t@pgf@toka=\toks21
\t@pgf@tokb=\toks22
\t@pgf@tokc=\toks23
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
File: pgf.cfg 2008/05/14 (rcs-revision 1.7)
)
Driver file for pgf: pgfsys-pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
File: pgfsys-pdftex.def 2013/07/18 (rcs-revision 1.33)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de
f
File: pgfsys-common-pdf.def 2013/10/10 (rcs-revision 1.13)
)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.
tex
File: pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
\pgfsyssoftpath@smallbuffer@items=\count104
\pgfsyssoftpath@bigbuffer@items=\count105
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.
tex
File: pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
Package: pgfcore 2010/04/11 v3.0.0 (rcs-revision 1.7)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
\pgfmath@dimen=\dimen127
\pgfmath@count=\count106
\pgfmath@box=\box29
\pgfmath@toks=\toks24
\pgfmath@stack@operand=\toks25
\pgfmath@stack@operation=\toks26
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet
ric.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod
e.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison
.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari
thmetics.code.tex)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
\c@pgfmathroundto@lastzeros=\count107
))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te
x
File: pgfcorepoints.code.tex 2013/10/07 (rcs-revision 1.27)
\pgf@picminx=\dimen128
\pgf@picmaxx=\dimen129
\pgf@picminy=\dimen130
\pgf@picmaxy=\dimen131
\pgf@pathminx=\dimen132
\pgf@pathmaxx=\dimen133
\pgf@pathminy=\dimen134
\pgf@pathmaxy=\dimen135
\pgf@xx=\dimen136
\pgf@xy=\dimen137
\pgf@yx=\dimen138
\pgf@yy=\dimen139
\pgf@zx=\dimen140
\pgf@zy=\dimen141
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.
code.tex
File: pgfcorepathconstruct.code.tex 2013/10/07 (rcs-revision 1.29)
\pgf@path@lastx=\dimen142
\pgf@path@lasty=\dimen143
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code
.tex
File: pgfcorepathusage.code.tex 2013/12/13 (rcs-revision 1.23)
\pgf@shorten@end@additional=\dimen144
\pgf@shorten@start@additional=\dimen145
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.te
x
File: pgfcorescopes.code.tex 2013/10/09 (rcs-revision 1.44)
\pgfpic=\box30
\pgf@hbox=\box31
\pgf@layerbox@main=\box32
\pgf@picture@serial@count=\count108
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.c
ode.tex
File: pgfcoregraphicstate.code.tex 2013/09/19 (rcs-revision 1.11)
\pgflinewidth=\dimen146
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformation
s.code.tex
File: pgfcoretransformations.code.tex 2013/10/10 (rcs-revision 1.17)
\pgf@pt@x=\dimen147
\pgf@pt@y=\dimen148
\pgf@pt@temp=\dimen149
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
File: pgfcorequick.code.tex 2008/10/09 (rcs-revision 1.3)
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.t
ex
File: pgfcoreobjects.code.tex 2006/10/11 (rcs-revision 1.2)
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing
.code.tex
File: pgfcorepathprocessing.code.tex 2013/09/09 (rcs-revision 1.9)
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.te
x
File: pgfcorearrows.code.tex 2013/11/07 (rcs-revision 1.40)
\pgfarrowsep=\dimen150
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
File: pgfcoreshade.code.tex 2013/07/15 (rcs-revision 1.15)
\pgf@max=\dimen151
\pgf@sys@shading@range@num=\count109
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
File: pgfcoreimage.code.tex 2013/07/15 (rcs-revision 1.18)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.
tex
File: pgfcoreexternal.code.tex 2013/07/15 (rcs-revision 1.20)
\pgfexternal@startupbox=\box33
))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te
x
File: pgfcorelayers.code.tex 2013/07/18 (rcs-revision 1.7)
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.c
ode.tex
File: pgfcoretransparency.code.tex 2013/09/30 (rcs-revision 1.5)
)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.
tex
File: pgfcorepatterns.code.tex 2013/11/07 (rcs-revision 1.5)
)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
File: pgfmoduleshapes.code.tex 2013/10/31 (rcs-revision 1.34)
\pgfnodeparttextbox=\box34
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
File: pgfmoduleplot.code.tex 2013/07/31 (rcs-revision 1.12)
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65
.sty
Package: pgfcomp-version-0-65 2007/07/03 v3.0.0 (rcs-revision 1.7)
\pgf@nodesepstart=\dimen152
\pgf@nodesepend=\dimen153
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18
.sty
Package: pgfcomp-version-1-18 2007/07/23 v3.0.0 (rcs-revision 1.1)
)) (/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty
Package: verbatim 2014/10/28 v1.5q LaTeX2e package for verbatim enhancements
\every@verbatim=\toks27
\verbatim@line=\toks28
\verbatim@in@stream=\read2
)
(/usr/share/texlive/texmf-dist/tex/latex/environ/environ.sty
Package: environ 2014/05/04 v0.3 A new way to define environments
(/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
)
\@envbody=\toks29
)
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2011/01/03 v2.1 e-TeX tools for LaTeX
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty
Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)
\et@xins=\count110
)
\etb@tempcnta=\count111
)
\tcb@titlebox=\box35
\tcb@upperbox=\box36
\tcb@lowerbox=\box37
\tcb@phantombox=\box38
\c@tcbbreakpart=\count112
\c@tcblayer=\count113
\tcb@temp=\box39
\tcb@temp=\box40
\tcb@temp=\box41
\tcb@temp=\box42
\tcb@out=\write4
)
(/usr/share/texlive/texmf-dist/tex/latex/minted/minted.sty
Package: minted 2011/09/17 v1.7 Yet another Pygments shim for LaTeX
(/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Package: fancyvrb 2008/02/07
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)
\FV@CodeLineNo=\count114
\FV@InFile=\read3
\FV@TabBox=\box43
\c@FancyVerbLine=\count115
\FV@StepNumber=\count116
\FV@OutFile=\write5
) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count117
\float@exts=\toks30
\float@box=\box44
\@float@everytoks=\toks31
\@floatcapt=\box45
)
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty
Package: calc 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count118
\calc@Bcount=\count119
\calc@Adimen=\dimen154
\calc@Bdimen=\dimen155
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 75.
LaTeX Info: Redefining \addtolength on input line 76.
\calc@Ccount=\count120
\calc@Cskip=\skip45
)
(/usr/share/texlive/texmf-dist/tex/latex/ifplatform/ifplatform.sty
Package: ifplatform 2010/10/22 v0.4 Testing for the operating system
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/catchfile.sty
Package: catchfile 2011/03/01 v1.6 Catch the contents of a file (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
))
runsystem(uname -s > "ICFP2015_aposteriori.w18")...executed.
(./ICFP2015_aposteriori.w18)
runsystem(rm -- "ICFP2015_aposteriori.w18")...executed.
)
\minted@bgbox=\box46
\minted@code=\write6
\@float@every@listing=\toks32
\c@listing=\count121
)
runsystem(which pygmentize && touch ICFP2015_aposteriori.aex)...executed.
runsystem(rm ICFP2015_aposteriori.aex)...executed.
(./ICFP2015_aposteriori.aux)
\openout1 = `ICFP2015_aposteriori.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: a4paper
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes:
* h-part:(L,W,R)=(71.13188pt, 455.24411pt, 71.13188pt)
* v-part:(T,H,B)=(101.40665pt, 591.5302pt, 152.11pt)
* \paperwidth=597.50787pt
* \paperheight=845.04684pt
* \textwidth=455.24411pt
* \textheight=591.5302pt
* \oddsidemargin=-1.1381pt
* \evensidemargin=-1.1381pt
* \topmargin=-7.86334pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=10.0pt
* \footskip=30.0pt
* \marginparwidth=57.0pt
* \marginparsep=11.0pt
* \columnsep=10.0pt
* \skip\footins=9.0pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
\c@lstlisting=\count122
ABD: EveryShipout initializing macros
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count123
\scratchdimen=\dimen156
\scratchbox=\box47
\nofMPsegments=\count124
\nofMParguments=\count125
\everyMPshowfont=\toks33
\MPscratchCnt=\count126
\MPscratchDim=\dimen157
\MPnumerator=\count127
\makeMPintoPDFobject=\count128
\everyMPtoPDFconversion=\toks34
) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
))
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 452.
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
runsystem(pygmentize -S default -f latex > ICFP2015_aposteriori.pyg)...executed
.
(./ICFP2015_aposteriori.pyg)
! LaTeX Error: Environment haskellcode undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.9 \begin{haskellcode}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
! You can't use `macro parameter character #' in horizontal mode.
l.11 {-#
LANGUAGE QuasiQuotes #-}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! You can't use `macro parameter character #' in horizontal mode.
l.11 {-# LANGUAGE QuasiQuotes #
-}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! LaTeX Error: \begin{document} ended by \end{haskellcode}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.27 \end{haskellcode}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
(./ICFP2015_aposteriori.aux) )
Here is how much of TeX's memory you used:
12949 strings out of 494329
244860 string characters out of 6162864
292374 words of memory out of 5000000
15986 multiletter control sequences out of 15000+600000
3640 words of font info for 14 fonts, out of 8000000 for 9000
417 hyphenation exceptions out of 8191
54i,5n,73p,842b,219s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/share/texlive/texmf-dist/fonts/type1/public
/amsfonts/cm/cmr10.pfb>
Output written on ICFP2015_aposteriori.pdf (1 page, 19840 bytes).
PDF statistics:
15 PDF objects out of 1000 (max. 8388607)
10 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
13 words of extra memory for PDF output out of 10000 (max. 10000000)

BIN
doc/ICFP2015_aposteriori.pdf View File


+ 95
- 0
doc/ICFP2015_aposteriori.pyg View File

@ -0,0 +1,95 @@
\makeatletter
\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
\let\PY@ul=\relax \let\PY@tc=\relax%
\let\PY@bc=\relax \let\PY@ff=\relax}
\def\PY@tok#1{\csname PY@tok@#1\endcsname}
\def\PY@toks#1+{\ifx\relax#1\empty\else%
\PY@tok{#1}\expandafter\PY@toks\fi}
\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
\PY@it{\PY@bf{\PY@ff{#1}}}}}}}
\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
\expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf}
\expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
\expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit}
\expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
\expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
\expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
\expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
\expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
\expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PY@tok@mb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
\expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\def\PYZbs{\char`\\}
\def\PYZus{\char`\_}
\def\PYZob{\char`\{}
\def\PYZcb{\char`\}}
\def\PYZca{\char`\^}
\def\PYZam{\char`\&}
\def\PYZlt{\char`\<}
\def\PYZgt{\char`\>}
\def\PYZsh{\char`\#}
\def\PYZpc{\char`\%}
\def\PYZdl{\char`\$}
\def\PYZhy{\char`\-}
\def\PYZsq{\char`\'}
\def\PYZdq{\char`\"}
\def\PYZti{\char`\~}
% for compatibility with earlier versions
\def\PYZat{@}
\def\PYZlb{[}
\def\PYZrb{]}
\makeatother

+ 0
- 0
doc/ICFP2015_aposteriori.synctex.gz View File


+ 28
- 0
doc/ICFP2015_aposteriori.tex View File

@ -0,0 +1,28 @@
\documentclass[a4paper]{report}
\usepackage[left=2.5cm,right=2.5cm]{geometry}
\usepackage{listings}
\usepackage{tcolorbox}
\usepackage{minted}
\begin{document}
\begin{haskellcode}
{-# LANGUAGE QuasiQuotes #-}
import Yesod
data HelloWorld = HelloWorld
mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]
instance Yesod HelloWorld
getHomeR :: Handler Html
getHomeR = defaultLayout [whamlet|Hello World!|]
main :: IO ()
main = warp 3000 HelloWorld
\end{haskellcode}
\end{document}

+ 82
- 0
src/MonadicGame.hs View File

@ -0,0 +1,82 @@
{-# OPTIONS -Wall #-}
import Control.Applicative
import Datatypes.Game
import VM
data MonadicGameInternal = MonadicGameInternal { igame :: Game , inote :: Notes}
data MonadicGame a = MonadicAction {action :: (MonadicGameInternal -> (MonadicGameInternal, a))}
instance Functor MonadicGame where
fmap f (MonadicAction modifierFunction) = (MonadicAction newModifierFunction)
where
newModifierFunction = (\x -> ((fst . modifierFunction) x, (f . snd . modifierFunction) x))
instance Applicative MonadicGame where
(MonadicAction higherOrderModifierFunction) <*> (MonadicAction modifierFunction) = (MonadicAction newModifierFunction)
where
getGameFunction = fst . modifierFunction
getValueFunction = snd . modifierFunction
newGameState = fst . higherOrderModifierFunction . getGameFunction
functionToApply = snd . higherOrderModifierFunction . getGameFunction
newModifierFunction = (\x -> (newGameState x, (functionToApply x) (getValueFunction x)))
pure retData = MonadicAction (\x -> (x, retData))
instance Monad MonadicGame where
(MonadicAction modifierFunction) >>= f = (MonadicAction newModifierFunction)
where
getGameFunction = fst . modifierFunction
getValueFunction = snd . modifierFunction
getParametrizedModifierFunction = action . f . getValueFunction
newModifierFunction = (\x -> getParametrizedModifierFunction x (getGameFunction x))
return = pure
-- Private state modifiers --
modifyGame :: (a -> MonadicGameInternal -> (MonadicGameInternal, b)) -> a -> MonadicGame b
modifyGame accessorFunction param = (MonadicAction (accessorFunction param))
readGame :: (MonadicGameInternal -> a) -> MonadicGame a
readGame readFunction = modifyGame (\_ x -> (x, readFunction x)) ()
writeGame :: (a -> MonadicGameInternal -> MonadicGameInternal) -> a -> MonadicGame ()
writeGame writeFunction = modifyGame (\x y -> (writeFunction x y, ()))
------ Public Functions -----
-- Apply the monad to a Game
executeGame :: Game -> MonadicGame () -> ([Command], Int)
executeGame game (MonadicAction finalFunction) = (history executedGame, score executedGame)
where
executedGame = (igame . fst . finalFunction) (MonadicGameInternal{igame = game, inote = OK})
-- Execute a command
move :: Command -> MonadicGame ()
move command = writeGame applyMove command
where
applyMove param oldGameInternal = newInternals
where
newInternals = MonadicGameInternal {igame = newIgame, inote = newInote}
newIgame = fst $ step (igame oldGameInternal) param
newInote = snd $ step (igame oldGameInternal) param
-- Execute a list of commands
moves :: [Command] -> MonadicGame ()
moves commands = mapM_ move commands
-- Read actual score
readScore :: MonadicGame Int
readScore = readGame (score . igame)
-- Read actual note
readNote :: MonadicGame Notes
readNote = readGame inote
-----------------------------

+ 49
- 0
src/parMapParallelization.hs View File

@ -0,0 +1,49 @@
{-# OPTIONS -Wall #-}
module MonadParParallelization(parallelizedTimed) where
import Control.DeepSeq (deepseq)
import Control.Concurrent.MVar
import Control.Concurrent
import Control.Monad.Par
parallelizedTimed :: (NFData a) => Int -> (a -> a) -> [a] -> IO [a]
parallelizedTimed sec f toCompute = do stopVar <- newMVar False
putStrLn "WORKERS STARTED"
worker <- monadParFork (workerFunction f stopVar) toCompute
putStrLn "CLOCK STARTED"
secWait sec
putStrLn "STOP MESSAGE SENT"
sendStopMessage stopVar
putStrLn "WAITING FOR COMPLETITION"
waitWorkerCompletition worker
putStrLn "RETRIEVE DATA"
retrieveAllData worker
where
secWait = threadDelay . (1000000 * )
sendStopMessage stopMessageC = putMVar stopMessageC True
monadParFork :: ((MVar Bool,MVar [a], [a]) -> IO ()) -> [a] -> IO (MVar Bool,MVar [a])
monadParFork f toCompute = do stopThreadVar <- newMVar False
dataMVar <- newMVar toCompute
_ <- forkIO (f (stopThreadVar, dataMVar, toCompute))
return (stopThreadVar, dataMVar)
workerFunction :: (NFData a) => (a -> a) -> MVar Bool -> (MVar Bool, MVar [a], [a]) -> IO ()
workerFunction f stopVar (threadEndedVar, dataVar, dataEls) = do stopped <- readMVar stopVar
if stopped
then do putMVar dataVar dataEls
putMVar threadEndedVar True
else do let newData = evalf
newData `deepseq` workerFunction f stopVar (threadEndedVar, dataVar, newData)
where
evalf = parMap `deepseq` f dataEls
waitWorkerCompletition :: (MVar Bool, MVar [a]) -> IO ()
waitWorkerCompletition workers = do finished <- readMVar (fst workers)
if finished
then return ()
else waitWorkerCompletition workers
retrieveAllData :: (MVar Bool, MVar [a]) -> IO [a]
retrieveAllData workers = readMVar (snd workers)

Loading…
Cancel
Save