@Override
public Function<Module, Module> specificationSteps(Definition def) {
Module mod = def.mainModule();
ConfigurationInfoFromModule configInfo = new ConfigurationInfoFromModule(mod);
LabelInfo labelInfo = new LabelInfoFromModule(mod);
SortInfo sortInfo = SortInfo.fromModule(mod);
ModuleTransformer resolveAnonVars = ModuleTransformer.fromSentenceTransformer(
new ResolveAnonVar()::resolve,
"resolving \"_\" vars");
ModuleTransformer resolveSemanticCasts = ModuleTransformer.fromSentenceTransformer(
new ResolveSemanticCasts(true)::resolve,
"resolving semantic casts");
ModuleTransformer subsortKItem = ModuleTransformer.from(Kompile::subsortKItem, "subsort all sorts to KItem");
ModuleTransformer addImplicitComputationCell = ModuleTransformer.fromSentenceTransformer(
new AddImplicitComputationCell(configInfo, labelInfo),
"concretizing configuration");
Function1<Module, Module> resolveFreshConstants = d -> ModuleTransformer.from(new ResolveFreshConstants(def, true)::resolve, "resolving !Var variables").apply(d);
ModuleTransformer concretizeCells = ModuleTransformer.fromSentenceTransformer(
new ConcretizeCells(configInfo, labelInfo, sortInfo, mod)::concretize,
"concretizing configuration");
return m -> resolveAnonVars
.andThen(resolveSemanticCasts)
.andThen(addImplicitComputationCell)
.andThen(resolveFreshConstants)
.andThen(concretizeCells)
.andThen(subsortKItem)
.apply(m);
}