Given a tag for an expression, add it to the 'census'. */
| 43 | /* Given a tag for an expression, add it to the 'census'. |
| 44 | */ |
| 45 | static inline void enumerator(combinator_counters* census, tag_t tag) { |
| 46 | if (!census) return; |
| 47 | switch (tag) { |
| 48 | case COMP: census->comp_cnt++; return; |
| 49 | case ASSERTL: |
| 50 | case ASSERTR: /* Assertions are counted as CASE combinators. */ |
| 51 | case CASE: census->case_cnt++; return; |
| 52 | case PAIR: census->pair_cnt++; return; |
| 53 | case DISCONNECT: census->disconnect_cnt++; return; |
| 54 | case INJL: census->injl_cnt++; return; |
| 55 | case INJR: census->injr_cnt++; return; |
| 56 | case TAKE: census->take_cnt++; return; |
| 57 | case DROP: census->drop_cnt++; return; |
| 58 | |
| 59 | /* These tags are not accounted for in the census. */ |
| 60 | case IDEN: |
| 61 | case UNIT: |
| 62 | case HIDDEN: |
| 63 | case WITNESS: |
| 64 | case JET: |
| 65 | case WORD: |
| 66 | return; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* Returns the number of children that a Simplicity combinator of the 'tag' kind has. |
| 71 | */ |