コード例 #1
0
        internal bool AddConstraint(AtlasConstraintValidationQueue queue)
        {
            AtlasConstraint newConstraint = new AtlasConstraint();

            try
            {
                ConstraintValidationStateOne(queue, newConstraint);
                constraints.Add(newConstraint);
                return(true);
            }
            catch (ArgumentException)
            {
                return(false);
            }
        }
コード例 #2
0
 internal void ConstraintValidationStateSix(AtlasConstraintValidationQueue queue, AtlasConstraint constraint)
 {
     if (queue.Peek() != null && queue.Peek().Equals("("))
     {
         queue.Pop();
         constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.LeftBracket));
         ConstraintValidationStateOne(queue, constraint);
         if (queue.Pop().Equals(")"))
         {
             constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.RightBracket));
         }
         else
         {
             throw new ArgumentException("Brackets were not properly closed");
         }
     }
     else
     {
         constraint.Constraints.Add(GetFeature(queue.Pop()));
     }
 }
コード例 #3
0
 internal void ConstraintValidationStateFive(AtlasConstraintValidationQueue queue, AtlasConstraint constraint)
 {
     if (queue.Peek() != null && queue.Peek().Equals("¬"))
     {
         queue.Pop();
         constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.Not));
     }
     ConstraintValidationStateSix(queue, constraint);
 }
コード例 #4
0
 internal void ConstraintValidationStateFour(AtlasConstraintValidationQueue queue, AtlasConstraint constraint)
 {
     ConstraintValidationStateFive(queue, constraint);
     if (queue.Peek() != null && queue.Peek().Equals("∧"))
     {
         queue.Pop();
         constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.And));
         ConstraintValidationStateFour(queue, constraint);
     }
 }
コード例 #5
0
 internal void ConstraintValidationStateTwo(AtlasConstraintValidationQueue queue, AtlasConstraint constraint)
 {
     ConstraintValidationStateThree(queue, constraint);
     if (queue.Peek() != null && queue.Peek().Equals("⇒"))
     {
         queue.Pop();
         constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.Implies));
         ConstraintValidationStateTwo(queue, constraint);
     }
 }
コード例 #6
0
 internal void ConstraintValidationStateOne(AtlasConstraintValidationQueue queue, AtlasConstraint constraint)
 {
     ConstraintValidationStateTwo(queue, constraint);
     if (queue.Peek() != null && queue.Peek().Equals("<=>"))     //TODO Placeholder
     {
         queue.Pop();
         constraint.Constraints.Add(new AtlasConstraintOperator(AtlasLogicalOperator.Iff));
         ConstraintValidationStateOne(queue, constraint);
     }
 }