@Override
	protected void doCorrelate(VTMatchSet matchSet, TaskMonitor monitor) throws CancelledException {
		ToolOptions options = getOptions();
		LSHMemoryModel model = options.getEnum(BSimProgramCorrelatorFactory.MEMORY_MODEL,
			BSimProgramCorrelatorFactory.MEMORY_MODEL_DEFAULT);

		double confThreshold = options.getDouble(BSimProgramCorrelatorFactory.SEED_CONF_THRESHOLD,
			BSimProgramCorrelatorFactory.SEED_CONF_THRESHOLD_DEFAULT);
		double impThreshold = options.getDouble(BSimProgramCorrelatorFactory.IMPLICATION_THRESHOLD,
			BSimProgramCorrelatorFactory.IMPLICATION_THRESHOLD_DEFAULT);

		boolean useAcceptedMatchesAsSeeds =
			options.getBoolean(BSimProgramCorrelatorFactory.USE_ACCEPTED_MATCHES_AS_SEEDS,
				BSimProgramCorrelatorFactory.USE_ACCEPTED_MATCHES_AS_SEEDS_DEFAULT);

		boolean useNamespace = false;		// By default we don't have namespace info
		boolean useCallRefs = false;		// By default we use decompiler to generate callgraph

		List<FunctionPair> result;
		try {
			LanguageID id1 = getSourceProgram().getLanguageID();
			LanguageID id2 = getDestinationProgram().getLanguageID();
			//Use special weights for LSHCosineVectors
			ResourceFile defaultWeightsFile = GenSignatures.getWeightsFile(id1, id2);
			if (defaultWeightsFile == null) {

				// known limitation; hoped to be fixed in the future
				Msg.showWarn(this, null, "Cannot Compare Programs",
					"<html>Cannot currently compare programs with such different architectures.<br>" +
						"Source program is " + id1.getIdAsString() + "<br>" +
						"Destination program is " + id2.getIdAsString());
				return;
			}
			if (defaultWeightsFile.getName().contains("cpool")) {
				// With constant pool languages (Dalvik, JVM)
				useNamespace = true;			// We have reliable namespace info
				useCallRefs = true;				// We don't have absolute calls, use references
			}
			InputStream input = defaultWeightsFile.getInputStream();
			XmlPullParser parser = new NonThreadedXmlPullParserImpl(input, "Vector weights parser",
				SpecXmlUtils.getXmlHandler(), false);
			vectorFactory.readWeights(parser);
			input.close();

			monitor.setMessage("Generating source dictionary");
			List<FunctionNode> rawSourceNodes =
				generateNodes(getSourceProgram(), getSourceAddressSet(), useCallRefs, monitor);
			FunctionNodeContainer sourceNodes =
				new FunctionNodeContainer(getSourceProgram(), rawSourceNodes);

			monitor.setMessage("Generating destination dictionary");
			List<FunctionNode> rawDestNodes = generateNodes(getDestinationProgram(),
				getDestinationAddressSet(), useCallRefs, monitor);
			FunctionNodeContainer destNodes =
				new FunctionNodeContainer(getDestinationProgram(), rawDestNodes);

			BSimProgramCorrelatorMatching omni =
				new BSimProgramCorrelatorMatching(sourceNodes, destNodes, vectorFactory,
					confThreshold, impThreshold, SIMILARITY_THRESHOLD, useNamespace, model);
			omni.discoverPotentialMatches(monitor);
			if (!omni.generateSeeds(matchSet, useAcceptedMatchesAsSeeds, monitor)) {
				Msg.info(this, "BSim Program Correlator could not find any seeds");
			}
			result = omni.doMatching(monitor);		//Do the matching!
		}
		catch (InterruptedException e) {
			Msg.error(this, "Error Correlating", e.getCause());
			CancelledException cancelledException = new CancelledException();
			cancelledException.initCause(e);
			throw cancelledException;
		}
		catch (CancelledException ce) {
			throw ce;
		}
		catch (Exception e) {
			Msg.error(this, "Error Correlating", e.getCause());
			CancelledException cancelledException = new CancelledException();
			cancelledException.initCause(e);
			throw cancelledException;
		}

		wrapUp(result, matchSet, monitor);					// Display matches, print stuff, etc.

		return;
	}
Correlator which discovers functional matches by comparing data-flow feature vectors.
An initial seed set of high confidence matches are chosen.  The match set is extended
from the seeds by using local neighborhoods around the accepted match to efficiently
discover new matches.
Ghidra/Features/VersionTrackingBSim/src/main/java/ghidra/feature/vt/api/BSimProgramCorrelator.java