Ejemplo n.º 1
0
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     _expression = TryToFindExpression(formula);
     if (_expression == null)
     {
         throw new Exception("stateFormula not found");
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///   Visits the <paramref name="formula." />
        /// </summary>
        public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
        {
            if (TryToFindFormulaInFormulasToCheck(formula))
            {
                return;
            }

            throw new Exception($"Neither formula nor any of its parents could be found in {nameof(_formulasToCheck)}");
        }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     // If this fails, new model is incomparable with old one, because "formula" is not
     // contained in exectutableModel.AtomarPropositionFormulas.
     // To solve this issue, perhaps the createModel method must be created in a way
     // that it is aware of formula.
     // (example in S#: When createModel is created by Serializer(ModelBase,formulas), formula is
     // in formulas (directly or as leaf in one element)
     CurrentFormula = LabelToFormula[formula.Label];
 }
        /// <summary>
        ///   Visits the <paramref name="formula." />
        /// </summary>
        public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
        {
            var faultFormula = formula as FaultFormula;

            if (faultFormula != null)
            {
                Func <bool> formulaEvaluatesToTrue = () => faultFormula.Fault.IsActivated;
                _expression = Expression.Invoke(Expression.Constant(formulaEvaluatesToTrue));
            }
            else
            {
                _expression = _exectutableModel.CreateExecutableExpressionFromAtomarPropositionFormula(formula);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///   Visits the <paramref name="formula." />
        /// </summary>
        public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
        {
            var referenceFormula = _referenceFormula as AtomarPropositionFormula;

            if (referenceFormula == null)
            {
                IsEqual = false;
            }
            else
            {
                if (formula.Label != referenceFormula.Label)
                {
                    IsEqual = false;
                }
            }
        }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     _builder.Append(formula.Label);
 }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     IsFormulaReturningBoolValue = true;
 }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     AtomarPropositionFormulas.Add(formula);
 }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     IsReturningRewardResult = false;
 }
Ejemplo n.º 10
0
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     IsCompilable            = true;
     MaximalNestedOnceInside = 0;
 }
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     IsCompilable = true;
 }
Ejemplo n.º 12
0
 /// <summary>
 ///   Visits the <paramref name="formula." />
 /// </summary>
 public override void VisitAtomarPropositionFormula(AtomarPropositionFormula formula)
 {
     _expression = _exectutableModel.CreateExecutableExpressionFromAtomarPropositionFormula(formula);
 }