private void assignMandatoryVariables(final List<Variable> mandatoryVars,
			final Map<Variable, Expression> varAssignments)
	throws VerifyException {
		final int size = mandatoryStack.size();
		if (mandatoryVars.size() != size) {
			try {
				feed.reject("Statement has wrong number of mandatory variables in proof");
			} catch (ScannerException ignored) {
				logger.error("Statement has wrong number of mandatory variables in proof");
			}
			logger.debug("Required number of variables: " + mandatoryVars.size());
			logger.debug("Terms present:                " + size);
			throw new VerifyException("Statement has wrong number of mandatory variables");
		}
		for (int i = 0; i != size; ++i) {
			final Variable var = mandatoryVars.get(i);
			final Expression expr = mandatoryStack.get(i);
			final Kind varKind = var.getKind();
			final Kind exprKind = expr.getKind();
			if (!varKind.equals(exprKind)) {
				try {
					feed.reject("Kind mismatch");
				} catch (ScannerException ignored) {
					logger.error("Kind mismatch");
				}
				logger.debug("Affected expression: " + expr);
				logger.debug("Kind of expression:  " + exprKind);
				logger.debug("Required kind:       " + varKind);
				throw new VerifyException("Kind mismatch");
			}
			varAssignments.put(var, expr);
		}
		mandatoryStack.clear();
	}