add attributes for data structures to sort declaration
@@ -106,6 +106,11 @@ public class ModuleToKORE {
Att att = module.sortAttributesFor().get(sort).getOrElse(() -> KORE.Att());
if (att.contains(Attribute.HOOK_KEY) && !dummyHookedSorts.contains(att.get(Attribute.HOOK_KEY))) {
sb.append("hooked-");
+ } else if (att.contains(Attribute.HOOK_KEY)) {
+ Production concatProd = stream(module.productionsForSort().apply(sort)).filter(p -> p.att().contains("element")).findAny().get();
+ att = att.add("element", K.class, KApply(KLabel(concatProd.att().get("element"))));
+ att = att.add("concat", K.class, KApply(concatProd.klabel().get()));
+ att = att.add("unit", K.class, KApply(KLabel(concatProd.att().get("unit"))));
}
sb.append("sort ");
convert(sort, false);
@@ -922,7 +927,12 @@ public class ModuleToKORE {
Object val = attribute._2;
String strVal = val.toString();
sb.append(conn);
- if (attributes.get(name) != null && attributes.get(name)) {
+ if (cls.equals(K.class)) {
+ convert(name);
+ sb.append("{}(");
+ convert((K) val);
+ sb.append(")");
+ } else if (attributes.get(name) != null && attributes.get(name)) {
convert(name);
sb.append("{}(");
sb.append(StringUtil.enquoteCString(strVal));
