about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--056shape_shifting_recipe.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/056shape_shifting_recipe.cc b/056shape_shifting_recipe.cc
index 5a9aba49..24304892 100644
--- a/056shape_shifting_recipe.cc
+++ b/056shape_shifting_recipe.cc
@@ -118,7 +118,7 @@ bool all_concrete_header_reagents_strictly_match(const instruction& inst, const
   for (int i = 0;  i < min(SIZE(inst.products), SIZE(variant.ingredients));  ++i) {
     if (is_dummy(inst.products.at(i))) continue;
     if (!concrete_type_names_strictly_match(variant.products.at(i), inst.products.at(i))) {
-      trace(9993, "transform") << "strict match failed: product " << i << end();
+      trace(9993, "transform") << "concrete-type match failed: product " << i << end();
       return false;
     }
   }
@@ -173,28 +173,6 @@ bool concrete_type_names_strictly_match(reagent/*copy*/ to, reagent/*copy*/ from
   return concrete_type_names_strictly_match(to.type, from.type, from);
 }
 
-int number_of_concrete_type_names(recipe_ordinal r) {
-  const recipe& caller = get(Recipe, r);
-  int result = 0;
-  for (int i = 0;  i < SIZE(caller.ingredients);  ++i)
-    result += number_of_concrete_type_names(caller.ingredients.at(i));
-  for (int i = 0;  i < SIZE(caller.products);  ++i)
-    result += number_of_concrete_type_names(caller.products.at(i));
-  return result;
-}
-
-int number_of_concrete_type_names(const reagent& r) {
-  return number_of_concrete_type_names(r.type);
-}
-
-int number_of_concrete_type_names(const type_tree* type) {
-  if (!type) return 0;
-  if (type->atom)
-    return is_type_ingredient_name(type->name) ? 0 : 1;
-  return number_of_concrete_type_names(type->left)
-       + number_of_concrete_type_names(type->right);
-}
-
 bool concrete_type_names_strictly_match(const type_tree* to, const type_tree* from, const reagent& rhs_reagent) {
   if (!to) return !from;
   if (!from) return !to;
@@ -223,6 +201,28 @@ bool contains_type_ingredient_name(const type_tree* type) {
   return contains_type_ingredient_name(type->left) || contains_type_ingredient_name(type->right);
 }
 
+int number_of_concrete_type_names(recipe_ordinal r) {
+  const recipe& caller = get(Recipe, r);
+  int result = 0;
+  for (int i = 0;  i < SIZE(caller.ingredients);  ++i)
+    result += number_of_concrete_type_names(caller.ingredients.at(i));
+  for (int i = 0;  i < SIZE(caller.products);  ++i)
+    result += number_of_concrete_type_names(caller.products.at(i));
+  return result;
+}
+
+int number_of_concrete_type_names(const reagent& r) {
+  return number_of_concrete_type_names(r.type);
+}
+
+int number_of_concrete_type_names(const type_tree* type) {
+  if (!type) return 0;
+  if (type->atom)
+    return is_type_ingredient_name(type->name) ? 0 : 1;
+  return number_of_concrete_type_names(type->left)
+       + number_of_concrete_type_names(type->right);
+}
+
 recipe_ordinal new_variant(recipe_ordinal exemplar, const instruction& inst, const recipe& caller_recipe) {
   string new_name = next_unused_recipe_name(inst.name);
   assert(!contains_key(Recipe_ordinal, new_name));
00 committer Kartik K. Agaram <vc@akkartik.com> 2015-07-03 19:38:21 -0700 1699 - first-class recipe types' href='/akkartik/mu/commit/037recipe.cc?h=main&id=7f73795cf5a5722dd6c05bee1e7c8c3f8eded8da'>7f73795c ^
1a6c5a0d ^
77d9d785 ^
1a6c5a0d ^



77d9d785 ^
1a6c5a0d ^



77d9d785 ^
1a6c5a0d ^

77d9d785 ^



1a6c5a0d ^


32597844 ^
83d8299d ^
7f73795c ^
77d9d785 ^



























7f73795c ^
af085cf6 ^






1b76245c ^
af085cf6 ^


9dcbec39 ^
af085cf6 ^











4e7186fa ^



af085cf6 ^






60448ff1 ^



1ead3562 ^
60448ff1 ^

1ead3562 ^
60448ff1 ^






63bd37bc ^

1ead3562 ^
b436291f ^

63bd37bc ^
1ead3562 ^
63bd37bc ^



b436291f ^

63bd37bc ^
60448ff1 ^

7afe09fb ^
60448ff1 ^


b24eb476 ^
60448ff1 ^








8d72e565 ^
60448ff1 ^



8d72e565 ^
60448ff1 ^




65c905fe ^
60448ff1 ^
63bd37bc ^
65c905fe ^
63bd37bc ^
65c905fe ^
63bd37bc ^


6dd67576 ^
60448ff1 ^
65c905fe ^
6dd67576 ^
60448ff1 ^


6dd67576 ^







3473c63a ^
c6034af3 ^
65c905fe ^

7afe09fb ^


4f32f024 ^


1ead3562 ^
4f32f024 ^



1ead3562 ^
4f32f024 ^



e0659ab3 ^
7cdd5187 ^


1ead3562 ^
7cdd5187 ^

1ead3562 ^
7cdd5187 ^



e0659ab3 ^
7cdd5187 ^
4d238fd7 ^


1b76245c ^
7cdd5187 ^

4d238fd7 ^

7cdd5187 ^









4f5bb5b6 ^
6dd67576 ^












4f5bb5b6 ^












8d72e565 ^
4f5bb5b6 ^











1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295