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

[ bsd3, formal-methods, library, symbolic-computation ] [ Propose Tags ]

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]
Versions [faq] 0.1.0.0
Change log ChangeLog.md
Dependencies base (==4.10.*), 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 Sun Jun 30 03:12:47 UTC 2019
Distributions NixOS:0.1.0.0
Downloads 44 total (12 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2019-06-30 [all 2 reports]

Modules

  • G2Q
    • G2Q.Interface

Downloads

Maintainer's Corner

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 |]