This package accompanies the ICFP '24 paper "Example-Based Reasoning About the Realizability of Polymorphic Programs".
Make sure that the following are installed:
ghc
with version9.8.2
cabal-install
with version3.10.3.0
z3
(tested on versions4.8.10
and4.12.2
)
We suggest using ghcup
to specify specific versions of ghc
and cabal-install
.
To run the benchmarks, use cabal run
.
To run the testsuite, use cabal run -- parametrickery-test
.
Encoding of containers into SMT-LIB is found in Data.SBV
:
Data.SBV.Encode
describes how types not natively supported by SMT-LIB can be encoded by overapproximation using the nearest supertype.Data.SBV.Refine
andData.SBV.Depend
describe how these overapproximations can be resolved for refinement types and dependent types respectively.Data.SBV.Container
describes how the extensions of container functors and container morphisms can be encoded in SMT-LIB.
Data.Container.Core
provides an interface between haskell functors and their encodings. It provides instances for most container functors. Some specialized instances can be found in Data.Container.Specialized
.
Sketching with map
and foldr
is described in Sketch.Map
and Sketch.Foldr
respectively. These modules implement the pipelines as seen in the paper.
In order to use a more stable version of ghc
, we downgraded to 9.8.2
from 9.10.1
. As a result, we had to go back to using TypeApplications
in combination with AllowAmbiguousTypes
in Data.SBV.Refine
and Data.SBV.Depend
, rather than using RequiredTypeArguments
as described in the paper.