@@ -183,30 +183,30 @@ impl SymEntityData {
183
183
match EntitySchemaEntry :: of_schema ( ety, validator_ety, schema) {
184
184
// Corresponds to `SymEntityData.ofStandardEntityType` in Lean
185
185
EntitySchemaEntry :: Standard ( sch) => {
186
- let attrs_uuf = Uuf ( op:: Uuf {
187
- id : format ! ( "attrs[{ety}]" ) ,
186
+ let attrs_uuf = Uuf ( Arc :: new ( op:: Uuf {
187
+ id : format ! ( "attrs[{ety}]" ) . into ( ) ,
188
188
arg : entity ( ety. clone ( ) ) , // more efficient than the Lean: avoids `TermType::of_type()` and constructs the `TermType` directly
189
189
out : TermType :: of_type ( & record ( sch. attrs ) ) ?,
190
- } ) ;
190
+ } ) ) ;
191
191
let ancs_uuf = |anc_ty : & EntityType | {
192
- Uuf ( op:: Uuf {
193
- id : format ! ( "ancs[{ety}, {anc_ty}]" ) ,
192
+ Uuf ( Arc :: new ( op:: Uuf {
193
+ id : format ! ( "ancs[{ety}, {anc_ty}]" ) . into ( ) ,
194
194
arg : entity ( ety. clone ( ) ) , // more efficient than the Lean: avoids `TermType::of_type()` and constructs the `TermType` directly
195
195
out : TermType :: set_of ( entity ( anc_ty. clone ( ) ) ) , // more efficient than the Lean: avoids `TermType::of_type()` and constructs the `TermType` directly
196
- } )
196
+ } ) )
197
197
} ;
198
198
let sym_tags = |tag_ty : Type | -> Result < SymTags , CompileError > {
199
199
Ok ( SymTags {
200
- keys : Uuf ( op:: Uuf {
201
- id : format ! ( "tagKeys[{ety}]" ) ,
200
+ keys : Uuf ( Arc :: new ( op:: Uuf {
201
+ id : format ! ( "tagKeys[{ety}]" ) . into ( ) ,
202
202
arg : entity ( ety. clone ( ) ) , // more efficient than the Lean: avoids `TermType::of_type()` and constructs the `TermType` directly
203
203
out : TermType :: set_of ( TermType :: String ) ,
204
- } ) ,
205
- vals : Uuf ( op:: Uuf {
206
- id : format ! ( "tagVals[{ety}]" ) ,
204
+ } ) ) ,
205
+ vals : Uuf ( Arc :: new ( op:: Uuf {
206
+ id : format ! ( "tagVals[{ety}]" ) . into ( ) ,
207
207
arg : TermType :: tag_for ( ety. clone ( ) ) , // record representing the pair type (ety, .string)
208
208
out : TermType :: of_type ( & tag_ty) ?,
209
- } ) ,
209
+ } ) ) ,
210
210
} )
211
211
} ;
212
212
@@ -227,14 +227,14 @@ impl SymEntityData {
227
227
228
228
// Corresponds to `SymEntityData.ofEnumEntityType` in Lean
229
229
EntitySchemaEntry :: Enum ( eids) => {
230
- let attrs_udf = Udf ( function:: Udf {
230
+ let attrs_udf = Udf ( Arc :: new ( function:: Udf {
231
231
arg : entity ( ety. clone ( ) ) ,
232
232
out : TermType :: Record {
233
233
rty : Arc :: new ( BTreeMap :: new ( ) ) ,
234
234
} ,
235
- table : BTreeMap :: new ( ) ,
235
+ table : Arc :: new ( BTreeMap :: new ( ) ) ,
236
236
default : Term :: Record ( Arc :: new ( BTreeMap :: new ( ) ) ) ,
237
- } ) ;
237
+ } ) ) ;
238
238
Ok ( SymEntityData {
239
239
attrs : attrs_udf,
240
240
ancestors : BTreeMap :: new ( ) ,
@@ -251,14 +251,14 @@ impl SymEntityData {
251
251
schema : & ValidatorSchema ,
252
252
) -> Self {
253
253
let sch = ActionSchemaEntries :: of_schema ( schema) ;
254
- let attrs_udf = Udf ( function:: Udf {
254
+ let attrs_udf = Udf ( Arc :: new ( function:: Udf {
255
255
arg : entity ( act_ty. clone ( ) ) ,
256
256
out : TermType :: Record {
257
257
rty : Arc :: new ( BTreeMap :: new ( ) ) ,
258
258
} ,
259
- table : BTreeMap :: new ( ) ,
259
+ table : Arc :: new ( BTreeMap :: new ( ) ) ,
260
260
default : Term :: Record ( Arc :: new ( BTreeMap :: new ( ) ) ) ,
261
- } ) ;
261
+ } ) ) ;
262
262
let term_of_type = |ety : EntityType , uid : EntityUID | -> Option < Term > {
263
263
if uid. type_name ( ) == & ety {
264
264
Some ( Term :: Prim ( TermPrim :: Entity ( uid) ) )
@@ -277,23 +277,24 @@ impl SymEntityData {
277
277
}
278
278
} ;
279
279
let ancs_udf = |anc_ty : & EntityType | -> UnaryFunction {
280
- Udf ( function:: Udf {
280
+ Udf ( Arc :: new ( function:: Udf {
281
281
arg : entity ( act_ty. clone ( ) ) ,
282
282
out : TermType :: set_of ( entity ( anc_ty. clone ( ) ) ) ,
283
- table : sch
284
- . iter ( )
285
- . filter_map ( |( uid, entry) | {
286
- Some ( (
287
- term_of_type ( act_ty. clone ( ) , uid. clone ( ) ) ?,
288
- ancs_term ( anc_ty, & entry. ancestors ) ,
289
- ) )
290
- } )
291
- . collect ( ) ,
283
+ table : Arc :: new (
284
+ sch. iter ( )
285
+ . filter_map ( |( uid, entry) | {
286
+ Some ( (
287
+ term_of_type ( act_ty. clone ( ) , uid. clone ( ) ) ?,
288
+ ancs_term ( anc_ty, & entry. ancestors ) ,
289
+ ) )
290
+ } )
291
+ . collect ( ) ,
292
+ ) ,
292
293
default : Term :: Set {
293
294
elts : Arc :: new ( BTreeSet :: new ( ) ) ,
294
295
elts_ty : entity ( anc_ty. clone ( ) ) ,
295
296
} ,
296
- } )
297
+ } ) )
297
298
} ;
298
299
let acts = sch
299
300
. iter ( )
0 commit comments