Beispiel #1
0
        /// <summary>
        /// Checks if this zinc type is equal to the given zinc type.
        /// </summary>
        /// <returns><see langword="true"/>, if the types where equal, <see langword="false"/> otherwise.</returns>
        /// <param name="other">The <see cref="IZincFundamentalType"/> to match this type against.</param>
        public bool GenericEquals(IMiniZincType other)
        {
            var zst = other as MiniZincSetType;

            if (zst != null)
            {
                return(this.elementType.GenericEquals(zst.elementType));
            }
            return(false);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZincOxide.MiniZinc.Types.Fundamental.ZincFundamentalTypeInst"/> class with a specified
 /// instantiation and fundamental type.
 /// </summary>
 /// <param name="instantiation">The instantiation of the type-instance.</param>
 /// <param name="type">The type of the type-instance.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="type"/> is not effective.</exception>
 public MiniZincTypeInst(ZincVarPar instantiation, IMiniZincType type)
 {
     this.Instantiation = instantiation;
     this.Type = type;
 }
 public bool GenericEquals(IMiniZincType other)
 {
     throw new NotImplementedException ();
 }
Beispiel #4
0
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The zinc type to compare with.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     return((other as MiniZincAnnotationType) != null);
 }
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The zinc type to compare with.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     MiniZincArrayType zat = other as MiniZincArrayType;
     return zat != null && this.IndexType.GenericEquals (zat.IndexType) && this.ElementType.GenericEquals (zat.ElementType);
 }
Beispiel #6
0
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if the types where equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The <see cref="IZincFundamentalType"/> to match this type against.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     var zst = other as MiniZincSetType;
     if (zst != null) {
         return this.elementType.GenericEquals (zst.elementType);
     }
     return false;
 }
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if the types where equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The <see cref="IZincFundamentalType"/> to match this type against.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     MiniZincTupleType ztt = other as MiniZincTupleType;
     return ztt != null && EnumerableUtils.All (this.itemTypes, ztt.ItemTypes, (x, y) => x.GenericEquals (y));
 }
Beispiel #8
0
        /// <summary>
        /// Checks if this zinc type is equal to the given zinc type.
        /// </summary>
        /// <returns><see langword="true"/>, if the types where equal, <see langword="false"/> otherwise.</returns>
        /// <param name="other">The <see cref="IZincFundamentalType"/> to match this type against.</param>
        public bool GenericEquals(IMiniZincType other)
        {
            MiniZincTupleType ztt = other as MiniZincTupleType;

            return(ztt != null && EnumerableUtils.All(this.itemTypes, ztt.ItemTypes, (x, y) => x.GenericEquals(y)));
        }
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The zinc type to compare with.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     return (other as MiniZincAnnotationType) != null;
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZincOxide.MiniZinc.Types.Fundamental.ZincFundamentalTypeInst"/> class with a specified
 /// instantiation and fundamental type.
 /// </summary>
 /// <param name="instantiation">The instantiation of the type-instance.</param>
 /// <param name="type">The type of the type-instance.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="type"/> is not effective.</exception>
 public MiniZincTypeInst(ZincVarPar instantiation, IMiniZincType type)
 {
     this.Instantiation = instantiation;
     this.Type          = type;
 }
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The zinc type to compare with.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     MiniZincTypeInstanceVariable mztiv = other as MiniZincTypeInstanceVariable;
     return (mztiv != null);
 }
Beispiel #12
0
 public bool GenericEquals(IMiniZincType other)
 {
     throw new NotImplementedException();
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZincOxide.MiniZinc.Types.Fundamental.ZincFundamentalTypeInst"/> class with
 /// a specified fundamental type.
 /// </summary>
 /// <param name="type">The type of the type-instance.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="type"/> is not effective.</exception>
 public MiniZincTypeInst(IMiniZincType type) : this(DefaultInstantiation, type)
 {
 }
 /// <summary>
 /// Checks if this zinc type is equal to the given zinc type.
 /// </summary>
 /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
 /// <param name="other">The zinc type to compare with.</param>
 public bool GenericEquals(IMiniZincType other)
 {
     MiniZincScalarTypeEntry mzste = other as MiniZincScalarTypeEntry;
     return mzste != null && this.ScalarType == mzste.ScalarType;
 }
Beispiel #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZincOxide.MiniZinc.Types.Fundamental.ZincFundamentalTypeInst"/> class with
 /// a specified fundamental type.
 /// </summary>
 /// <param name="type">The type of the type-instance.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="type"/> is not effective.</exception>
 public MiniZincTypeInst(IMiniZincType type)
     : this(DefaultInstantiation, type)
 {
 }
        /// <summary>
        /// Checks if this zinc type is equal to the given zinc type.
        /// </summary>
        /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
        /// <param name="other">The zinc type to compare with.</param>
        public bool GenericEquals(IMiniZincType other)
        {
            MiniZincScalarTypeEntry mzste = other as MiniZincScalarTypeEntry;

            return(mzste != null && this.ScalarType == mzste.ScalarType);
        }
Beispiel #17
0
        /// <summary>
        /// Checks if this zinc type is equal to the given zinc type.
        /// </summary>
        /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
        /// <param name="other">The zinc type to compare with.</param>
        public bool GenericEquals(IMiniZincType other)
        {
            MiniZincArrayType zat = other as MiniZincArrayType;

            return(zat != null && this.IndexType.GenericEquals(zat.IndexType) && this.ElementType.GenericEquals(zat.ElementType));
        }
        /// <summary>
        /// Checks if this zinc type is equal to the given zinc type.
        /// </summary>
        /// <returns><see langword="true"/>, if both types are equal, <see langword="false"/> otherwise.</returns>
        /// <param name="other">The zinc type to compare with.</param>
        public bool GenericEquals(IMiniZincType other)
        {
            MiniZincTypeInstanceVariable mztiv = other as MiniZincTypeInstanceVariable;

            return(mztiv != null);
        }