Korman Center 104C
For this homework, you will write property-based tests for interval sets.
Please download the file
PropertyTests.hs here and
add it to your existing
You may build a binary
property-tests that will execute your property-based
tests by typing make property-tests. Run the resulting binary, named
property-tests, to run your property-based tests.
Your code must run on
tux under the version of
ghc that we provide.
Be sure to commit your work to the repository.
This assignment is worth 50 points. There are 51 possible points.
Makefile we distributed for Homework 6, please change the line
SRC = $(wildcard src/*.hs)
SRC = $(wildcard *.hs)
You must complete the implementations of the following QuickCheck properties in
PropertyTests.hs. Each test is worth 10 points.
We have provided an
Arbitrary instance that you can use for testing and a
model, that takes a value of type
IntSet and returns a model of
IntSet. This model consists of a sorted list of integers in the
IntSet. This model is an inefficient way to implement a set of integers, but
it is easy to reason about. Your tests should use
model to relate operations
on values of type
IntSet to operations on lists of integers.
You will likely want to use the functions
sort, which sorts a list, and
which removes duplicate entries from a list.
For example, consider the
prop_insert test. It should test that the model of
IntSet obtained by inserting a value
x into an
s is the same as
inserting the value
x into the list that is the model of
How long did it take you to complete each problem? Please tell us in a comment
PropertyTests.hs. You must tell us how long each problem took you,
expressed as a quantitative measure of time, to receive the point.