g2q: G2Q allows constraint programming, via writing Haskell predicates.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

G2Q allows constraint programming, via writing Haskell predicates. A quasiquoter, g2, is provided which can take concrete arguments at runtime, and solve for unknown symbolic arguments.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.10 && <4.11), g2 (>=0.1.0.1 && <0.1.1.0) [details]
License BSD-3-Clause
Author William Hallahan, Anton Xue
Maintainer william.hallahan@yale.edu
Category Formal Methods, Symbolic Computation
Source repo head: git clone https://github.com/BillHallahan/G2Q.git
Uploaded by WilliamHallahan at 2019-06-30T03:11:28Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for g2q-0.1.0.0

[back to package description]

G2Q


About

G2Q allows constraint programming, via writing Haskell predicates. A quasiquoter, g2, is provided which can take concrete arguments at runtime, and solve for unknown symbolic arguments.

For example, to find inputs from a list xs which sum to a given number n, you can write:

sumToN :: Int -> [Int] -> IO (Maybe [Int])
sumToN = [g2| \(n :: Int) (xs :: [Int]) ->
              ?(ys :: [Int])
            |  sum ys == n
            && all (\e -> e `elem` xs) ys
            && length ys >= 1 |]