/// <summary>
        /// SearchForAnswer
        /// </summary>
        /// <param name="element"></param>
        /// <param name="question"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        private bool SearchForAnswer(Element element, Question question, bool value)
        {
            foreach (RuleArgument ruleArgument in question.Rule.Arguments)
            {
                Fact fact = Facts.Find(f => ruleArgument.Id == f.Id);
                logger.CheckingForArgument(fact);

                FactAboutElement factAboutElement = FindFactAboutElementWhichIsRuleArgument(element, ruleArgument);

                if (factAboutElement == null)
                {
                    Question answeringQuestion = FindQuestionForGivenFact(ruleArgument.Id);

                    if (answeringQuestion == null)
                    {
                        return false;
                    }

                    logger.SearchingForAnswer(element, answeringQuestion);
                    if (SearchForAnswer(element, answeringQuestion, ruleArgument.RequiredValue))
                    {
                        factAboutElement = FindFactAboutElementWhichIsRuleArgument(element, ruleArgument);
                    }
                }

                if (factAboutElement.Value != ruleArgument.RequiredValue)
                {
                    logger.ArgumentDoesNotMatch(ruleArgument);
                    return false;
                }
                logger.ArgumentMatch(ruleArgument);
            }

            FactAboutElement factAboutElementNew = new FactAboutElement
            {
                Id = question.Rule.Target.Id,
                Name = question.Rule.Target.Name,
                Value = value
            };

            logger.AddingFact(factAboutElementNew);
            element.Facts.Add(factAboutElementNew);
            logger.EnfOfCheckingIfFactCanBeAdded();
            return true;
        }
        /// <summary>
        /// Check if element is good for a given answer to a question
        /// </summary>
        /// <param name="element"></param>
        /// <param name="question"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        private bool Answer(Element element, Question question, bool value)
        {
            logger.LookingForFact(question);
            var factAboutElement = FindFactAboutElementWhichIsQuestionSubject(element, question);

            if (factAboutElement != default(FactAboutElement))
            {
                logger.ElementHasAnswer(element, question);
                return value == factAboutElement.Value;
            }

            logger.ElementDoesnotHaveAnswer(element, question);
            logger.CheckingIfElementCanBeCreated();
            return SearchForAnswer(element, question, value);
        }
 /// <summary>
 /// finds fact about element
 /// </summary>
 /// <param name="element"></param>
 /// <param name="question"></param>
 /// <returns></returns>
 private FactAboutElement FindFactAboutElementWhichIsQuestionSubject(Element element, Question question)
 {
     return element.Facts.Find(f => f.Id == question.Rule.Target.Id);
 }
 public void SearchingForAnswer(Element element, Question question)
 {
     IncreaseIndent();
     stringBuilder.AppendLine(Indent() + string.Format("Szukanie, czy element {0} posiada odpowiedź na pytanie {1}", element.Name, question.Rule.Name));
 }
 public void ElementHasAnswer(Element element, Question question)
 {
     stringBuilder.AppendLine(Indent() + string.Format("Element posiada fakt: {0}", question.Rule.Target.Name));
     DecreaseIndent();
 }
 public void LookingForFact(Question question)
 {
     stringBuilder.AppendLine(Indent() + string.Format("Szukanie faktu: {0}", question.Rule.Target.Name));
     IncreaseIndent();
 }
 public void LookingForFact(Question question)
 {
 }
 public void ElementHasAnswer(Element element, Question question)
 {
 }
 public void ElementDoesnotHaveAnswer(Element element, Question question)
 {
 }
 public void SearchingForAnswer(Element element, Question question)
 {
 }