• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    Haskell
  • License
    BSD 3-Clause "New...
  • Created over 12 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Equational laws for free

QuickSpec: equational laws for free!

QuickSpec takes your Haskell code and, as if by magic, discovers laws about it. You give QuickSpec a collection of Haskell functions; QuickSpec tests your functions with QuickCheck and prints out laws which seem to hold.

For example, give QuickSpec the functions reverse, ++ and [], and it will find six laws:

reverse [] == []
xs ++ [] == xs
[] ++ xs == xs
reverse (reverse xs) == xs
(xs ++ ys) ++ zs == xs ++ (ys ++ zs)
reverse xs ++ reverse ys == reverse (ys ++ xs)

QuickSpec can find equational laws as well as conditional equations. All you need to supply are the functions to test, as well as Ord and Arbitrary instances for QuickSpec to use in testing; the rest is automatic.

For information on how to use QuickSpec, see the documentation. You can also look in the examples directory, for example at List.hs, IntSet.hs, or Parsing.hs. To read about how QuickSpec works, see our paper, Quick specifications for the busy programmer.

More Repositories

1

quickcheck

Automatic testing of Haskell programs.
Haskell
717
star
2

remarkable-fs

A FUSE filesystem wrapper for the reMarkable tablet
Python
78
star
3

twee

An equational theorem prover based on Knuth-Bendix completion
Haskell
45
star
4

equinox

Paradox model finder and equinox theorem prover for first-order logic.
Haskell
18
star
5

jukebox

A theorem prover
Haskell
13
star
6

complexity

Infer complexity of algorithms by testing
Erlang
5
star
7

combinatory-logic-in-shell-script

I was feeling evil one night :)
Shell
4
star
8

quickcheck-with-counterexamples

Get counterexamples out of QuickCheck as Haskell values
Haskell
4
star
9

psx

A PlayStation emulator written in Nim. For fun :) Can boot a couple of games, but not working more than that yet.
Nim
3
star
10

beeby

A BBC Micro emulator
Haskell
3
star
11

puzzle

The Church numerals puzzle from the FP winter meeting.
Haskell
3
star
12

munch

Fast parser combinators
Haskell
3
star
13

faustilogue

Convert Faust DSP files to KORG logue custom oscillators
Python
3
star
14

fusion

Tinkering with list fusion
Haskell
2
star
15

munch-testdata

Test data for munch
Haskell
2
star
16

flashcards

A wee flashcard program
Haskell
2
star
17

haiku-ghc

Instructions+patches for building GHC for Haiku
2
star
18

guess

Guess the definition of a predicate by black-box testing
Haskell
2
star
19

corpora

Tinkering around with corpora queries (nothing to see here yet)
Haskell
2
star
20

example-finding

Haskell
1
star
21

imp

Testing imperative code with QuickSpec
Haskell
1
star
22

fourier-motzkin

A wee solver for linear inequalities based on Fourier-Motzkin elimination.
Haskell
1
star