ArrayList<Unifier> unifierList = new ArrayList<Unifier>(); //Start with a list of substitutions, which consists of a single empty substitution.
unifierList.add(new Unifier());
for (int i = 0; i < rule.getBody().size(); ++i) {
Predicate predicate = rule.getBody().get(i); //Iterate through all the predicates of the body using select Function
ArrayList<Unifier> localUnifierList = new ArrayList<Unifier>();
for (Unifier unifier : unifierList) { //For each permutation of the list.
Predicate localPredicate = unifier.unifyPredicate(predicate); //Apply it to the predicate.
HashSet<Predicate> tempAnswers;
if (ruleNames.contains(new PredicateIdentifier(predicate))) { //If the predicate occurs in the program as the head rules: //TODO вынести проверку на уровень выше
executeRequest(getRequest(localPredicate)); //Recursively run executeRequest of this predicate.