//----------------------------------------------------------------------
//  SPECIFICATION FILE (cset.h)
//  This module exports a character set ADT.  A more general module
//  would include additional set operations.
//----------------------------------------------------------------------
#include "bool.h"

// DOMAIN: A CharSet instance is a set of ASCII characters
//         (i.e., any set with elements of type char)

class CharSet {
public:
    Boolean IsEmpty() const;
        // POST: FCTVAL == (set == {})

    Boolean IsFull() const;
        // POST: FCTVAL == (set is full)

    void Insert( /* in */ char ch );
        // PRE:  Assigned(ch)  &&  NOT IsFull()
        // POST: set == set<entry> UNION {ch}

    void Delete( /* in */ char ch );
        // PRE:  Assigned(ch)
        // POST: set == set<entry> - {ch}

    Boolean IsElt( /* in */ char ch ) const;
        // PRE:  Assigned(ch)
        // POST: FCTVAL == (ch is an element of the set)

    CharSet Intersect( /* in */ CharSet set2 ) const;
        // POST: FCTVAL == (this set) INTERSECT set2

    CharSet Union( /* in */ CharSet set2 ) const;
        // POST: FCTVAL == (this set) UNION set2

    CharSet();
        // Constructor
        // POST: Created(set)  &&  set == {}

private:
    Boolean inSet[128];
};

