# Multi-Pattern DMT Framework

The multi-pattern DMT framework is used to construct traits and relationships between traits based on Bitcoin block data, through the use of pattern sets. The framework was developed for use in ICPBunny.

Individual pattern search functions are grouped into **pattern sets.** Pattern sets are used to construct relationships between traits. Three types of pattern sets are demonstrated in ICPBunny: **exclusive**, **nested**, and **intersectional**.

Exclusive pattern sets can be used to establish relationships in which traits cannot coexist with other traits in the set. In the example given below, each pattern search function is tied to the values of 3rd digit of the "blk" string. No two functions can be true simultaneously. Together, these patterns form a pattern set that controls "tail holding", as variations of this trait should not occur together.

| Pattern Function | Tail Trait        | Rarity      | Example Block |
| ---------------- | ----------------- | ----------- | ------------- |
| digit 3 = 0      | 🌸 Cherry Blossom | 800 (9.9%)  | 123**0**25    |
| digit 3 = 1      | 🌼 Blossom        | 800 (9.9%)  | 624**1**22    |
| digit 3 = 2      | 🌹 Rose           | 800 (9.9%)  | 43**2**92     |
| digit 3 = 3      | 🎀 Ribbon         | 804 (10.0%) | 42**3**42     |
| digit 3 = 4      | 🌶️ Hot Pepper    | 816 (10.1%) | 42**4**42     |
| ...              | ​                 | ​           | ​             |

Nested pattern sets can be used to establish dependencies between traits, or variations of a trait.

In the example below, the pattern "contains 420" will only ever occur when the pattern “contains 4 and 0" occurs also. This relationship is therefore considered nested, and allows for the trait “Golden Necklace with 🩸 pendant” (c420) to be treated as a child of the parent trait “cigarette” (c4&0).

<table data-header-hidden><thead><tr><th width="203"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Pattern Function</td><td>Trait</td><td>Frequency</td><td>Example Block</td></tr><tr><td>contains "4" and "0"</td><td>🚬  Cigarette</td><td>1446 (17.9%)</td><td>42340</td></tr><tr><td>contains "420"</td><td>Pendant🩸  +  Golden Necklace</td><td>8 (0.09%)</td><td>124203</td></tr></tbody></table>

**Intersectional Pattern Sets** Pattern sets containing patterns that will occur together sometimes, but not always, can be considered intersectional. These pattern sets can be used when a variety of trait combinations is desired.

In the example below, the trait "Nose" is applied when “multiple of 13” is true, and the trait "Clown Nose 🔴 " is applied when “multiple of 69” is true.&#x20;

| Pattern Function  | Trait         | Frequency    | Example Block |
| ----------------- | ------------- | ------------ | ------------- |
| is multiple of 13 | Blue Nose     | 622  (7.71%) | 10010         |
| is multiple of 69 | 🔴 Clown Nose | 118  (1.46%) | 10005         |
| -                 | both traits   | 7 (<0.1%)    | 10764         |

**DO NOT USE THE ABOVE EXAMPLE FOR MINTING**
