Beispiel #1
0
        /// <summary>
        /// Method that clones each type variable of a constraint.
        /// Equivalence classes are not cloned (but included in the equivalenceClasses parameter.
        /// </summary>
        /// <param name="typeVariableMappings">Each new type varaiable represent a copy of another existing one.
        /// This parameter is a mapping between them, wher tmpName=old and value=new</param>
        /// <param name="equivalenceClasses">Each equivalence class of all the type variables.</param>
        /// <returns>The new type expression (itself by default)</returns>
        public override Constraint CloneTypeVariables(IDictionary <TypeVariable, TypeVariable> typeVariableMappings, IList <EquivalenceClass> equivalenceClasses)
        {
            ConstraintList newConstraint = new ConstraintList();

            foreach (Constraint constraint in this.constraints)
            {
                newConstraint.Add(constraint.CloneTypeVariables(typeVariableMappings, equivalenceClasses));
            }
            newConstraint.ValidTypeExpression = false;
            return(newConstraint);
        }
 /// <summary>
 /// To add a new constraint list
 /// </summary>
 /// <param name="constraint">The constraint list to be added</param>
 /// <returns>If the constraint parameter had been already added</returns>
 public bool Add(ConstraintList constraint)
 {
     this.ConstraintLists.Add(constraint);
     return(true);
 }