public Module resolve(Module input) { Set<Sentence> rulesToAdd = stream(input.sentences()) .filter(s -> s instanceof Context) .map(s -> (Context) s) .flatMap(c -> this.resolve(c, input)).collect(Collectors.toCollection(HashSet::new)); if (!rulesToAdd.isEmpty()) { rulesToAdd.add(SyntaxSort(Sorts.K())); } return Module(input.name(), input.imports(), (scala.collection.Set<Sentence>) stream(input.localSentences()).filter(s -> !(s instanceof Context)).collect(Collections.toSet()).$bar(immutable(rulesToAdd)), input.att()); }
public Module gen(Module mod) { this.mod = mod; predicateRules = stream(mod.rules()).filter(this::isPredicate).collect(Collectors.toSet()); return Module(mod.name(), mod.imports(), (Set<Sentence>) mod.localSentences().$bar(stream(mod.definedSorts()) .flatMap(this::gen).collect(Collections.toSet())), mod.att()); }
stream((Set<Sentence>) module.localSentences().$bar(ruleSet).$bar(contextSet)).filter(b -> !(b instanceof Bubble)).collect(Collections.toSet()), module.att());
Tuple4<Set<Sentence>, Sort, K, Boolean> myResult = computeSentencesOfWellFormedCell(isLeafCell, isStream, kore, multiplicity, cfgAtt, m, cellName, cellProperties, childResult._2(), childResult._3(), ensures, hasConfigOrRegularVariable(cellContents)); return Tuple4.apply((Set<Sentence>)childResult._1().$bar(myResult._1()), Lists.newArrayList(myResult._2()), myResult._3(), false); accumSentences = (Set<Sentence>)accumSentences.$bar(childResult._1()); sorts.addAll(childResult._2()); initializers.add(childResult._3());
(Set<Sentence>) inputModule.localSentences().$bar(importedConfigurationSortsSubsortedToCell), inputModule.att()); throw KEMException.compilerError("Module Map must be visible at the configuration declaration, in module " + module.name()); return Module(module.name(), (Set<Module>) module.imports().$bar(Set(mapModule)), (Set<Sentence>) module.localSentences().$bar(configDeclSyntax), module.att()); } else { throw KEMException.compilerError("Module Map must be visible at the configuration declaration, in module " + module.name()); return Module(module.name(), (Set<Module>) module.imports().$bar(Set(mapModule)), (Set<Sentence>) module.localSentences().$bar(configDeclRules), module.att());
K generatedTop = KApply(KLabel("#configCell"), topCellToken, KApply(KLabel("#cellPropertyListTerminator")), KApply(KLabels.CELLS, KApply(KLabel("#externalCell"), cellName), freshCell), topCellToken); Set<Sentence> newSentences = GenerateSentencesFromConfigDecl.gen(generatedTop, BooleanUtils.TRUE, Att.empty(), mod.getExtensionModule(), true); sentences = (Set<Sentence>) sentences.$bar(newSentences); ParseInModule mod = RuleGrammarGenerator.getCombinedGrammar(gen.getConfigGrammar(m), true); Set<Sentence> newSentences = GenerateSentencesFromConfigDecl.gen(freshCell, BooleanUtils.TRUE, Att.empty(), mod.getExtensionModule(), true); sentences = (Set<Sentence>) sentences.$bar(newSentences);
public Module gen(Module mod) { Set<Sentence> res = new HashSet<>(); for (Sort sort : iterable(mod.definedSorts())) { Production prod = Production(KLabel("is" + sort.toString()), Sorts.Bool(), Seq(Terminal("is" + sort.toString()), Terminal("("), NonTerminal(Sorts.K()), Terminal(")")), Att().add(Attribute.FUNCTION_KEY).add(Attribute.PREDICATE_KEY, Sort.class, sort)); if (!mod.productions().contains(prod)) res.add(prod); } if (!res.isEmpty()) { res.add(SyntaxSort(Sorts.K())); } return Module(mod.name(), mod.imports(), (scala.collection.Set<Sentence>) mod.localSentences().$bar(immutable(res)), mod.att()); } }
@Override public K apply(KToken k) { if (k.sort().equals(Sorts.KConfigVar())) { if (sort == null || sort.equals(Sorts.K())) { return KApply(KLabel("Map:lookup"), INIT, k); } else { h.sentences = (Set<Sentence>) h.sentences.$bar(genProjection(sort, m)); return KApply(getProjectLbl(sort, m), KApply(KLabel("Map:lookup"), INIT, k)); } } return k; } }.apply(leafContents), h.sentences);
public Module resolve(Module input) { Set<Sentence> contextsToAdd = resolve(stream(input.localSentences()) .filter(s -> s instanceof Production) .map(s -> (Production) s) .filter(p -> p.att().contains("strict") || p.att().contains("seqstrict")).collect(Collectors.toSet())); return Module(input.name(), input.imports(), (scala.collection.Set<Sentence>) input.localSentences().$bar(immutable(contextsToAdd)), input.att()); } }