I was working on an abstract algebra library for Python, when I realized that a lot of the dirty work was just constructing loops to correspond to logical expressions with quantifiers. I then realized, while it might be hard to implement a function for logical quantification in Python, it would be easier in Haskell or another language.
Right now I have quantifiers that work as long as the property only involves one variable that is being quantified over, and only if the relation you are quantifying over has three variables, getting over these barriers seems to be the difficult part.
For example, the statement ∀x ∃y (x < y)
causes problems, but ∀x (x = 2) ∃y (y < 3)
is fine.
Are there any existing Haskell libraries that implement value-level logical quantifiers like this? It's difficult to search, because whenever I search something along the lines of "logical quantifiers Haskell" I get lots of things about type quantifiers, which isn't what I want.
The only thing I could find is a forAll
in Test.QuickCheck, and this does not come with an "exists".