00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <iostream>
00039
00040 using namespace std;
00041
00042 int main()
00043 {
00044 size_t sizes[] = {8, 16, 32, 64};
00045 size_t nSizes = sizeof(sizes)/sizeof(size_t);
00046
00047 for(size_t i=0; i < nSizes; i++) {
00048 size_t theSize = sizes[i];
00049 cout << "(definstance (Integral int" << theSize
00050 << ") preludeID)"
00051 << endl;
00052 cout << "(definstance (Integral uint" << theSize
00053 << ") preludeID)"
00054 << endl;
00055 }
00056 cout << endl;
00057
00058 for(size_t i=0; i < nSizes; i++) {
00059 size_t theSize = sizes[i];
00060 cout << "(definstance (Integral (mutable int" << theSize
00061 << ")) preludeID)"
00062 << endl;
00063 cout << "(definstance (Integral (mutable uint" << theSize
00064 << ")) preludeID)"
00065 << endl;
00066 }
00067 cout << endl;
00068
00069 for(size_t i=0; i < nSizes; i++) {
00070 size_t theSize = sizes[i];
00071 for(size_t j=1; j <= theSize; j++) {
00072 cout << "(definstance (Integral (bitfield int" << theSize
00073 << " " << j << ")) preludeID)"
00074 << endl;
00075 cout << "(definstance (Integral (bitfield uint" << theSize
00076 << " " << j << ")) preludeID)"
00077 << endl;
00078 }
00079 cout << endl;
00080
00081 }
00082 cout << endl;
00083
00084 for(size_t i=0; i < nSizes; i++) {
00085 size_t theSize = sizes[i];
00086 for(size_t j=1; j <= theSize; j++) {
00087 cout << "(definstance (Integral (mutable (bitfield int" << theSize
00088 << " " << j << "))) preludeID)"
00089 << endl;
00090 cout << "(definstance (Integral (mutable (bitfield uint" << theSize
00091 << " " << j << "))) preludeID)"
00092 << endl;
00093 }
00094 cout << endl;
00095 }
00096 cout << endl;
00097 }