internal bool HasConstraint(SymbolicValueConstraint constraint) { SymbolicValueConstraint storedConstraint; return(constraints.TryGetValue(constraint.GetType(), out storedConstraint) && storedConstraint == constraint); }
internal SymbolicValueConstraints WithoutConstraint(SymbolicValueConstraint constraint) { var constraintsCopy = new Dictionary <Type, SymbolicValueConstraint>(constraints); if (constraintsCopy.Remove(constraint.GetType())) { return(new SymbolicValueConstraints(constraintsCopy)); } return(this); }
private static void SetConstraint(SymbolicValueConstraint constraint, Dictionary <Type, SymbolicValueConstraint> constraints) { constraints[constraint.GetType()] = constraint; if (constraint is BoolConstraint) { constraints[typeof(ObjectConstraint)] = ObjectConstraint.NotNull; if (constraints.ContainsKey(typeof(NullableValueConstraint))) { constraints[typeof(NullableValueConstraint)] = NullableValueConstraint.HasValue; } } }