<p>yes it is an array of <code>T</code></p>
<p><strong>the only difference is that it is meant to have unique elements</strong>; which is a constraint that you can't express in the CDDL.</p>
<p>You will see ofthen used as</p>
<pre><code>set&lt;transaction_input&gt;
</code></pre>
<p>where <code>transaction_input</code> is an utxo reference; it is obvious then that it needs to be an array with unique elements (eg you CAN NOT have the same UTxO spent twice)</p>

CC BY-SA 4.0
2023-06-13T10:37:20.947Z
Thanks, is this `set` inbuilt in CDDL specification (RFC 8610), o/w it should be defined somewhere right?
Sourabh
CC BY-SA 4.0
2023-06-13T10:59:22.393Z
no `set` is not part of the CDDL spec, that's why it is defined so
Michele Nuzzi
CC BY-SA 4.0
2023-06-14T07:47:52.913Z
My question was, if it's not part of CDDL spec, then it should be defined somewhere right? Now I know where it is defined, which is [here](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/babbage_extra.cddl#L4). I got earlier misled by the comment at top, _These are definitions ..._ thinking these definitions are for testing purposes but rather, the ones [here](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/mock/extras.cddl) are for testing.
Sourabh
CC BY-SA 4.0
2023-06-14T10:17:39.707Z
yeah, you should assume all CDDL files for a single era to be a single file; if they are referring to a `set` then the definition you found is correct
Michele Nuzzi
CC BY-SA 4.0
2023-06-13T09:27:53.763Z
2023-06-13T09:27:53.763Z
Michele Nuzzi
<p>I see the <code>set</code> generic in <a href="https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/babbage.cddl" rel="nofollow noreferrer"><code>babbage.cddl</code></a> file but couldn't find it's definition. It seems to be defined as <code>set&lt;T&gt; = [ * T]</code></p>

<ledger>
`set` generic meaning in CDDL specification
# `set` generic meaning in CDDL specification

(Asked by: username_0 on 2023-06-13)

I see the `set` generic in [`babbage.cddl`](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/babbage.cddl) file but couldn't find it's definition. It seems to be defined as `set = [ * T]`

**Tags:** ledger

---

## 1 answers

### Answer by username_1 on 2023-06-13. Score: 1

yes it is an array of T
the only difference is that it is meant to have unique elements; which is a constraint that you can't express in the CDDL.
You will see ofthen used as
set

where transaction_input is an utxo reference; it is obvious then that it needs to be an array with unique elements (eg you CAN NOT have the same UTxO spent twice)

> **Comments:**
> **username_0**: Thanks, is this `set` inbuilt in CDDL specification (RFC 8610), o/w it should be defined somewhere right?  
> **username_1**: no `set` is not part of the CDDL spec, that's why it is defined so  
> **username_0**: My question was, if it's not part of CDDL spec, then it should be defined somewhere right? Now I know where it is defined, which is [here](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/babbage_extra.cddl#L4). I got earlier misled by the comment at top, _These are definitions ..._ thinking these definitions are for testing purposes but rather, the ones [here](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/mock/extras.cddl) are for testing.  
> **username_1**: yeah, you should assume all CDDL files for a single era to be a single file; if they are referring to a `set` then the definition you found is correct  

---

