#include "set.h" #include Set_t Empty_set() { return( 0 ); } Set_t Union_set(Set_t A, Set_t B){ return( A | B ); } Set_t Inter_set(Set_t A, Set_t B){ return( A & B ); } Set_t Diff_set(Set_t A, Set_t B) { return( A & (~B) ); } Set_t Comp_set(Set_t A) { return( ~A ); } boolean Is_elem_out_of_range (Elem_t x) { return( (x<0) || (x >= 8*sizeof(Set_t)) ); } boolean Is_elem_in_set (Elem_t x , Set_t A) { return( (A & Singleton_set(x)) != 0 ); } boolean Is_empty_set (Set_t A){ return( A==0 ); } Set_t Singleton_set(Elem_t x){ if (Is_elem_out_of_range(x)) { fprintf(printout, "ERROR : out of range element (%d) ignored\n",x); return(Empty_set()); } else return((Set_t)1<