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

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

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]

Modules

  • G2Q
    • G2Q.Interface

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 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:12:47Z
Distributions
Downloads 517 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2019-06-30 [all 2 reports]

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