@SuppressWarnings("unchecked") public VerificationResult verify() { Quantifier quantifier = criterion.getQuantifiers().get(0); List<Object> firstSet = null; try { firstSet = quantifier.getRightPart().getSet(null); } catch (MappingException e) { e.printStackTrace(); } assert firstSet != null; for (int i = 0; i < firstSet.size(); ++i) { Object o = firstSet.get(i); HistoryItem historyItem = new HistoryItem(); historyItem.getVariableValue().variable = quantifier.getBoundVariable(); historyItem.getVariableValue().value = o; wholeHistory.add(historyItem); verify(historyItem, 1); } // ��� �� ����� // "�������������� �������". // �������� � // �������������� VerificationResult result = analyseHistory(); LOGGER.error(result.toString()); return result; }
// /olololo @SuppressWarnings("unchecked") private void verify(HistoryItem parentHistoryItem, int currentIndex) { assert currentIndex > 0 : "Bad index"; if (currentIndex < criterion.getQuantifiers().size()) { Quantifier quantifier = criterion.getQuantifiers().get(currentIndex); List<Object> set = null; try { set = quantifier.getRightPart().getSet(parentHistoryItem.getPlainHistory()); } catch (MappingException e) { e.printStackTrace(); } assert set != null; if (set.isEmpty()) { // parentHistoryItem.setSuccess(false); HistoryItem historyItem = new HistoryItem(); historyItem.getVariableValue().variable = quantifier.getBoundVariable(); historyItem.getVariableValue().value = null; historyItem.setParent(parentHistoryItem); parentHistoryItem.getChildren().add(historyItem); verify(historyItem, currentIndex + 1); } for (int i = 0; i < set.size(); ++i) { Object o = set.get(i); HistoryItem historyItem = new HistoryItem(); historyItem.getVariableValue().variable = quantifier.getBoundVariable(); historyItem.getVariableValue().value = o; historyItem.setParent(parentHistoryItem); parentHistoryItem.getChildren().add(historyItem); verify(historyItem, currentIndex + 1); } } else { List<VariableValue> currentVariables = parentHistoryItem.getPlainHistory(); boolean result = criterion.getFormula().predict(currentVariables); parentHistoryItem.setSuccess(result); } }