public void initialize(DefinitionToOcaml serialized, CompiledDefinition def) { mainModule = serialized.mainModule; collectionFor = serialized.collectionFor; filteredMapConstructors = serialized.filteredMapConstructors; matchThreadSet = serialized.matchThreadSet; rewriteThreadSet = serialized.rewriteThreadSet; makeStuck = serialized.makeStuck; makeUnstuck = serialized.makeUnstuck; functions = serialized.functions; anywhereKLabels = serialized.anywhereKLabels; options = serialized.options; constants = serialized.constants; realStepFunctions = serialized.realStepFunctions; if (serialized.expandMacros == null) { serialized.expandMacros = new ExpandMacros(def.executionModule(), files, kompileOptions, false); } if (serialized.convertDataStructure == null) { serialized.convertDataStructure = new ConvertDataStructureToLookup(def.executionModule(), true); } expandMacros = serialized.expandMacros; convertDataStructure = serialized.convertDataStructure; threadCellExists = serialized.threadCellExists; if (serialized.exitCodePattern == null) { serialized.exitCodePattern = def.exitCodePattern; } exitCodePattern = serialized.exitCodePattern; sortHooks = userSortHooks; klabelsForEachPredicate = serialized.klabelsForEachPredicate; }
public Rule convert(Rule r) { Function1<Sentence, Sentence> convertLookups = new ConvertDataStructureToLookup(this.convertDataStructure)::convert; Function1<Sentence, Sentence> liftToKSequence = new LiftToKSequence()::lift; Function1<Sentence, Sentence> deconstructInts = new DeconstructIntegerAndFloatLiterals()::convert; Function1<Sentence, Sentence> expandMacros = this.expandMacros::expand; return (Rule) convertLookups .andThen(deconstructInts) .andThen(expandMacros) .andThen(liftToKSequence) .apply(r); }
public void initialize(CompiledDefinition def) { Function1<Module, Module> generatePredicates = new GenerateSortPredicateRules(false)::gen; this.convertDataStructure = new ConvertDataStructureToLookup(def.executionModule(), true); ModuleTransformer convertLookups = ModuleTransformer.fromSentenceTransformer(convertDataStructure::convert, "convert data structures to lookups"); ModuleTransformer liftToKSequence = ModuleTransformer.fromSentenceTransformer(new LiftToKSequence()::lift, "lift K into KSequence");