typedef unsigned long long Set_t; // Type Ensemble = uint64_t sans doute typedef int Elem_t; // elements from 0 to 2^sizeof(Set_t) -1 typedef int boolean; // boolean pour les fonctions Is_* /* "Impression d'ensemble" */ #define printout stdout // file descriptor for Print_set() void Print_set (Set_t A); // Imprime l'ensemble A sur "printout" void Println_set(Set_t A); // Idem avec retour-charriot /* Operation ensembliste */ Set_t Union_set(Set_t A, Set_t B); // returns : A Union B Set_t Inter_set(Set_t A, Set_t B); // returns : A Inter B Set_t Diff_set (Set_t A, Set_t B); // returns : Difference A / B Set_t Comp_set (Set_t A); // returns : Complementaire de A /* Construction d'un ensemble */ Set_t Empty_set (); // returns : {} Set_t Singleton_set(Elem_t x); // returns : {x}; ou {} si x est hors borne Set_t Add_elem_set (Elem_t x , Set_t A); // returns : {x} Union A, ou A si x hors borne /* quelques tests */ boolean Is_empty_set (Set_t A); // test A == {} boolean Is_elem_in_set (Elem_t x , Set_t A);// test x appartient a boolean Is_elem_out_of_range (Elem_t x); // test si x est hors borne pour l'implementation // NB: le test Is_elem_out_of_range est deja integré dans // les fonctions prenant un "Elem_t" en argument