public virtual ValueBase Join(ValueBase other) { if (this.GetType() == typeof(SetValue) && other.GetType() == typeof(SetValue)) { // Add sets. SetValue t = (SetValue)this; SetValue o = (SetValue)other; SetValue result = new SetValue(); result.Add(t); result.Add(o); return(result); } else if (this.GetType() == typeof(SetValue)) { SetValue t = (SetValue)this; SetValue result = new SetValue(); result.Add(t); result.Add(other); return(result); } else if (other.GetType() == typeof(SetValue)) { SetValue o = (SetValue)other; SetValue result = new SetValue(); result.Add(o); result.Add(this); return(result); } else if (this.GetType() == typeof(Top)) { return(other); } else if (other.GetType() == typeof(Top)) { return(this); } else if (this.GetType() != other.GetType()) { return(Bottom); } else if (this.GetType().Name.Contains("RValue")) { if (this == other) { return(this); } else { return(Bottom); } } else { return(Bottom); } }
public void Add(ValueBase v) { ValueBase z = _set.Find((ValueBase x) => { if (x.Equals(v)) { return(true); } else { return(false); } }); if (z != null) { return; } _set.Add(v); }
public void Add(SetValue v) { foreach (ValueBase e in v._set) { ValueBase z = _set.Find((ValueBase x) => { if (x.Equals(v)) { return(true); } else { return(false); } }); if (z == null) { _set.Add(e); } } }
public SetValue(ValueBase v) { _set.Add(v); }