@@ -205,7 +205,7 @@ private K infer(K term, KLabel collectionLabel) {
205
205
public K apply (KApply k ) {
206
206
if (k .klabel ().equals (wrappedLabel )) {
207
207
KLabel elementLabel = KLabel (m .attributesFor ().apply (collectionLabel ).<String >get ("element" ).get ());
208
- return KApply (elementLabel , super .apply (k ));
208
+ return KORE . KApply (elementLabel , super .apply (k ));
209
209
}
210
210
return super .apply (k );
211
211
}
@@ -302,11 +302,11 @@ private K convertList(KApply k, KLabel collectionLabel, List<K> components) {
302
302
if (elementsRight .size () == 0 && matchOnConsList ) {
303
303
K tail ;
304
304
if (frame == null ) {
305
- tail = KApply (KLabel (m .attributesFor ().apply (collectionLabel ).<String >get (Attribute .UNIT_KEY ).get ()));
305
+ tail = KORE . KApply (KLabel (m .attributesFor ().apply (collectionLabel ).<String >get (Attribute .UNIT_KEY ).get ()));
306
306
} else {
307
307
tail = frame ;
308
308
}
309
- list = Lists .reverse (elementsLeft ).stream ().map (e -> (K ) KApply (elementLabel , e )).reduce (tail , (res , el ) -> KApply (collectionLabel , el , res ));
309
+ list = Lists .reverse (elementsLeft ).stream ().map (e -> (K ) KORE . KApply (elementLabel , e )).reduce (tail , (res , el ) -> KORE . KApply (collectionLabel , el , res ));
310
310
} else {
311
311
list = newDotVariable (m .productionsFor ().get (collectionLabel ).get ().head ().sort ());
312
312
// Ctx[ListItem(5) Frame ListItem(X) ListItem(foo(Y))] => Ctx [L]
@@ -318,29 +318,29 @@ private K convertList(KApply k, KLabel collectionLabel, List<K> components) {
318
318
list = k ;
319
319
} else {
320
320
if (frame != null ) {
321
- state .add (KApply (KLabel ("#match" ), frame , KApply (KLabel ("List:range" ), list ,
321
+ state .add (KORE . KApply (KLabel ("#match" ), frame , KORE . KApply (KLabel ("List:range" ), list ,
322
322
KToken (Integer .toString (elementsLeft .size ()), Sorts .Int ()),
323
323
KToken (Integer .toString (elementsRight .size ()), Sorts .Int ()))));
324
324
} else {
325
325
KLabel unit = KLabel (m .attributesFor ().apply (collectionLabel ).<String >get ("unit" ).get ());
326
326
// Ctx[.List] => Ctx[L] requires L ==K range(L, 0, 0)
327
- state .add (KApply (KLabel ("_==K_" ), KApply (unit ), KApply (KLabel ("List:range" ), list ,
327
+ state .add (KORE . KApply (KLabel ("_==K_" ), KORE . KApply (unit ), KORE . KApply (KLabel ("List:range" ), list ,
328
328
KToken (Integer .toString (elementsLeft .size ()), Sorts .Int ()),
329
329
KToken (Integer .toString (elementsRight .size ()), Sorts .Int ()))));
330
330
}
331
331
}
332
332
KLabel elementWrapper = KLabel (m .attributesFor ().apply (collectionLabel ).<String >get ("element" ).get ());
333
333
for (int i = 0 ; i < elementsLeft .size (); i ++) {
334
- state .add (KApply (
334
+ state .add (KORE . KApply (
335
335
KLabel ("#match" ),
336
- KApply (elementWrapper , elementsLeft .get (i )),
337
- KApply (KLabel ("List:get" ), list , KToken (Integer .toString (i ), Sorts .Int ()))));
336
+ KORE . KApply (elementWrapper , elementsLeft .get (i )),
337
+ KORE . KApply (KLabel ("List:get" ), list , KToken (Integer .toString (i ), Sorts .Int ()))));
338
338
}
339
339
for (int i = 0 ; i < elementsRight .size (); i ++) {
340
- state .add (KApply (
340
+ state .add (KORE . KApply (
341
341
KLabel ("#match" ),
342
- KApply (elementWrapper , elementsRight .get (i )),
343
- KApply (KLabel ("List:get" ), list , KToken (Integer .toString (i - elementsRight .size ()), Sorts .Int ()))));
342
+ KORE . KApply (elementWrapper , elementsRight .get (i )),
343
+ KORE . KApply (KLabel ("List:get" ), list , KToken (Integer .toString (i - elementsRight .size ()), Sorts .Int ()))));
344
344
}
345
345
}
346
346
if (lhsOf == null && RewriteToTop .hasRewrite (k )) {
@@ -394,17 +394,17 @@ private K convertMap(KApply k, KLabel collectionLabel, List<K> components, Multi
394
394
KVariable map = newDotVariable (m .productionsFor ().get (collectionLabel ).get ().head ().sort ());
395
395
// K1,Ctx[K1 |-> K2 K3] => K1,Ctx[M] requires K3 := M[K1<-undef] andBool K1 := choice(M) andBool K2 := M[K1]
396
396
if (frame != null ) {
397
- state .add (KApply (KLabel ("#match" ), frame , elements .keySet ().stream ().reduce (map , (a1 , a2 ) -> KApply (KLabel ("_[_<-undef]" ), a1 , a2 ))));
397
+ state .add (KORE . KApply (KLabel ("#match" ), frame , elements .keySet ().stream ().reduce (map , (a1 , a2 ) -> KORE . KApply (KLabel ("_[_<-undef]" ), a1 , a2 ))));
398
398
} else {
399
399
KLabel unit = KLabel (m .attributesFor ().apply (collectionLabel ).<String >get ("unit" ).get ());
400
- state .add (KApply (KLabel ("_==K_" ), KApply (unit ), elements .keySet ().stream ().reduce (map , (a1 , a2 ) -> KApply (KLabel ("_[_<-undef]" ), a1 , a2 ))));
400
+ state .add (KORE . KApply (KLabel ("_==K_" ), KORE . KApply (unit ), elements .keySet ().stream ().reduce (map , (a1 , a2 ) -> KORE . KApply (KLabel ("_[_<-undef]" ), a1 , a2 ))));
401
401
}
402
402
for (Map .Entry <K , K > element : elements .entrySet ()) {
403
403
// TODO(dwightguth): choose better between lookup and choice.
404
404
if (element .getKey () instanceof KVariable && varConstraints .count (element .getKey ()) == 1 ) {
405
- state .add (KApply (KLabel ("#mapChoice" ), element .getKey (), map ));
405
+ state .add (KORE . KApply (KLabel ("#mapChoice" ), element .getKey (), map ));
406
406
}
407
- state .add (KApply (KLabel ("#match" ), element .getValue (), KApply (KLabel (KLabels .MAP_LOOKUP ), map , element .getKey ())));
407
+ state .add (KORE . KApply (KLabel ("#match" ), element .getValue (), KORE . KApply (KLabel (KLabels .MAP_LOOKUP ), map , element .getKey ())));
408
408
}
409
409
if (lhsOf == null && RewriteToTop .hasRewrite (k )) {
410
410
// An outermost map may contain nested rewrites, so the term
@@ -468,18 +468,18 @@ private K convertSet(KApply k, KLabel collectionLabel, List<K> components, Multi
468
468
Multiset <KVariable > vars = HashMultiset .create ();
469
469
gatherVars (element , vars );
470
470
if (vars .isEmpty () || (element instanceof KVariable && varConstraints .count (element ) != 1 )) {
471
- state .add (KApply (KLabel ("Set:in" ), element , accum ));
471
+ state .add (KORE . KApply (KLabel ("Set:in" ), element , accum ));
472
472
} else {
473
473
//set choice
474
- state .add (KApply (KLabel ("#setChoice" ), element , accum ));
474
+ state .add (KORE . KApply (KLabel ("#setChoice" ), element , accum ));
475
475
}
476
- accum = KApply (KLabel ("Set:difference" ), accum , KApply (elementLabel , element ));
476
+ accum = KORE . KApply (KLabel ("Set:difference" ), accum , KORE . KApply (elementLabel , element ));
477
477
}
478
478
KLabel unit = KLabel (m .attributesFor ().apply (collectionLabel ).<String >get ("unit" ).get ());
479
479
if (frame != null ) {
480
- state .add (KApply (KLabel ("#match" ), frame , accum ));
480
+ state .add (KORE . KApply (KLabel ("#match" ), frame , accum ));
481
481
} else {
482
- state .add (KApply (KLabel ("_==K_" ), KApply (unit ), accum ));
482
+ state .add (KORE . KApply (KLabel ("_==K_" ), KORE . KApply (unit ), accum ));
483
483
}
484
484
if (lhsOf == null && RewriteToTop .hasRewrite (k )) {
485
485
// An outermost set may contain nested rewrites, so the term
0 commit comments