/** * Get a substitution that we can apply to term, such that it will not use given * varsInUse. * * @param varsToBeMadeUnique * vars that have to be renamed if occurring iin the varsInUse list. * @param varsInUse * set of {@link Var}s that are in use * @return A substitution that will standardize apart variables. */ // TODO: Move this method to KR interface? #3430. This is quick fix. private Substitution makeTermVarsUnique(Set<Var> varsToBeMadeUnique, Set<Var> varsInUse) { Set<Var> varsToRename = getSharedVariables(varsToBeMadeUnique, varsInUse); Map<Var, Term> subst = new LinkedHashMap<>(varsToRename.size()); for (Var var : varsToRename) { subst.put(var, var.getVariant(varsInUse)); } return this.program.getKRInterface().getSubstitution(subst); }