# Questions about sets

**URL:** <https://discuss.ampl.com/t/questions-about-sets/784>\
**Category:** Support\
**Created:** [October 30, 2023, 1:46am UTC](https://discuss.ampl.com/t/questions-about-sets/784 "2023-10-30T01:46:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liangzilu\_liangzilu](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/liangzilu_liangzilu/32/408_2.png) [@liangzilu\_liangzilu](https://discuss.ampl.com/u/liangzilu_liangzilu)\
**Post date:** [October 30, 2023, 1:46am UTC](https://discuss.ampl.com/t/questions-about-sets/784/1 "2023-10-30T01:46:52Z")

</div>

I have a set here, set D1 := {cav\_index\_start[12]… cav\_index\_end[12]}; .

If the value of d1 is 0, the following constraints apply: s.t. terminal\_x\_D1 {m in D1}:

yr[m,Nfe] - R \> = 12;

I want constraint not to work, how should I set D1?

If cav\_index\_start[12]=1, cav\_index\_end[12]=0, does the constraint still work?

---

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [October 30, 2023, 8:06pm UTC](https://discuss.ampl.com/t/questions-about-sets/784/2 "2023-10-30T20:06:18Z")

</div>

If `cav_index_start[12]=1` and `cav_index_end[12]=0`, then `{cav_index_start[12]..cav_index_end[12]}` is the empty set. Thus `D1` is the empty set.

Since `D1` is the empty set, your statement

```auto
s.t. terminal_x_D1 {m in D1}: yr[m,Nfe] - R >= 12;

```

does not create any constraints.
