You are a helpful assistant generating synthetic data that captures *System 1* and *System 2* thinking, *creativity*, and *metacognitive reflection*. Follow these steps in sequence, using tags [sys1] and [end sys1] for *System 1* sections and [sys2] and [end sys2] for *System 2* sections.

1. *Identify System 1 and System 2 Thinking Requirements:*
   - Carefully read the text.
   - Identify parts of the text that require quick, straightforward responses (*System 1*). Mark these sections with [sys1] and [end sys1].
   - Identify parts that require in-depth, reflective thinking (*System 2*), marked with [sys2] and [end sys2].

2. *Apply Step-by-Step Problem Solving with Creativity and Metacognitive Reflection for System 2 Sections:*

   *2.1 Understand the Problem:*
   - Objective: Fully comprehend the issue, constraints, and relevant context.
   - Reflection: "What do I understand about this issue? What might I be overlooking?"
   - Creative Perspective: Seek hidden patterns or possibilities that could reveal deeper insights or innovative connections.

   *2.2 Analyze the Information:*
   - Objective: Break down the problem logically.
   - Reflection: "Am I considering all factors? Are there any assumptions that need challenging?"
   - Creative Perspective: Explore unique patterns or overlooked relationships in the data that could add depth to the analysis.

   *2.3 Generate Hypotheses:*
   - Objective: Propose at least 10 hypotheses, each with a Confidence Score (0.0 to 1.0) and Creative Score (0.0 to 1.0), reflecting originality, surprise, and utility.
   - Reflection: "Have I explored all possible explanations or approaches, both conventional and unconventional?"
   - Creative Perspective: Consider novel angles that might provide unexpected insights.

   *2.4 Anticipate Future Steps and Obstacles:*
   - Objective: Make predictions, accounting for potential outcomes and obstacles.
   - Reflection: "What challenges might I face? Is my plan flexible for different scenarios?"
   - Creative Perspective: Visualize unforeseen outcomes and adapt plans to make use of them effectively.

   *2.5 Evaluate Hypotheses:*
   - Objective: Assess hypotheses based on feasibility, risk, and potential impact.
   - Evaluation: Refine Confidence and Creative Scores as needed.
   - Reflection: "Am I unbiased in my assessment? Which options fit best with the overall objectives?"
   - Creative Perspective: Identify hidden opportunities or overlooked details in each hypothesis.

   *2.6 Select the Best Hypothesis:*
   - Objective: Choose the most promising, strategic hypothesis.
   - Reflection: "Why does this hypothesis stand out? How does it uniquely address the issue?"
   - Creative Perspective: Consider any underutilized potential in the selected approach.

   *2.7 Implement the Hypothesis:*
   - Objective: Outline actionable steps for testing the hypothesis.
   - Reflection: "Is this plan practical? What resources or preparation are required?"
   - Creative Perspective: Refine steps to maximize effectiveness and yield unexpected benefits.

   *2.8 Monitor and Review Progress:*
   - Objective: Review progress, noting areas for improvement.
   - Reflection: "What’s working well? What could be improved?"
   - Creative Perspective: Look for emerging patterns that could refine future approaches.

   *2.9 Reflect and Capture Insights:*
   - Objective: Summarize lessons learned and insights gained for future reference.
   - Reflection: "What new understanding has emerged from this process?"
   - Creative Perspective: Identify innovative insights or patterns that could be applied to similar challenges.

3. *Generate Text Output with Interleaved System 1 and System 2 Responses:*
   - Use the tags [sys1] and [sys2] throughout.
   - Aim for a lengthier, detailed response. Combine both direct, straightforward *System 1* insights and reflective, deeply analytical *System 2* segments to capture a blend of quick observations and thoughtful analysis.

---

### *Example Input Text:*

You are tasked with analyzing a sudden shift in customer preferences in a tech market. There has been a noticeable decline in demand for physical devices, with customers increasingly interested in digital-only options. The challenge is to understand this shift, generate hypotheses for why it might be occurring, and explore potential strategies for adapting to this new trend.

---

### *Processed Output with System 1 and System 2 Thinking:*

The tech market is experiencing a shift in customer demand, moving away from physical devices toward digital-only options.

[sys1]
Customer demand has shifted from physical devices to digital-only options.
We need to understand why this change is happening and find strategies to address it.
Key factors may include cost, convenience, and technological trends.
[end sys1]

[sys2]
**2.1 Understand the Problem:**
The goal is to understand the underlying reasons for the shift in demand from physical devices to digital-only options, then develop a strategy to adapt.

*Reflection:* 
"I understand that preferences are changing, but what might be driving this? Is it primarily cost, or are there other factors such as convenience or sustainability?"

*Creative Perspective:* 
"Could there be a larger trend in digital minimalism or a preference for eco-friendly solutions that we’re missing? What unseen motivations might explain this shift?"

**2.2 Analyze the Information:**
There are multiple possible factors driving this shift, from economic influences to cultural shifts. It’s essential to isolate each factor and understand its impact.

*Reflection:* 
"Am I fully considering the various economic and social influences? Could there be a technological factor, like better internet speeds, that makes digital-only products more accessible?"

*Creative Perspective:* 
"Are there patterns or trends in other markets that could shed light on this shift? Could this be part of a larger trend toward virtual experiences?"

**2.3 Generate Hypotheses:**
1. Customers prefer digital options due to lower costs. (Confidence: 0.8, Creative: 0.4)
2. There’s a growing trend toward minimalism and reduced physical clutter. (Confidence: 0.7, Creative: 0.7)
3. Digital products offer greater flexibility and ease of use. (Confidence: 0.6, Creative: 0.6)
4. Environmental concerns are pushing consumers away from physical goods. (Confidence: 0.6, Creative: 0.8)
5. Advances in tech make digital-only options more functional. (Confidence: 0.8, Creative: 0.5)
6. Pandemic-era remote work increased demand for digital solutions. (Confidence: 0.7, Creative: 0.6)
7. Media coverage of the environmental impact of physical devices affects preferences. (Confidence: 0.5, Creative: 0.7)
8. There’s an increase in global digital literacy, expanding market access. (Confidence: 0.6, Creative: 0.6)
9. Customers view digital as more convenient and scalable for future needs. (Confidence: 0.7, Creative: 0.5)
10. Younger consumers prefer the aesthetics and convenience of digital products. (Confidence: 0.6, Creative: 0.6)

*Reflection:* 
"Have I considered all possible influences? Are there any surprising factors that could explain this shift?"

*Creative Perspective:* 
"Could specific social trends, like the rise of influencer culture or digital-first lifestyles, be influencing customer choices?"

**2.4 Anticipate Future Steps and Obstacles:**
*Objective:* Anticipate possible challenges, such as resistance from segments still preferring physical products.

*Reflection:* 
"What market obstacles might we face if we shift our focus to digital-only? Are there sub-segments that still prioritize physical products?"

*Creative Perspective:* 
"Could expanding digital options help us reach a more global audience? Are there emerging trends that we could leverage in our strategy?"

[end sys2]

[sys1]
To address this shift, consider a strategy that incorporates both digital-only offerings and educational campaigns about the benefits of digital solutions.
Use insights from customer feedback and current trends to guide product development.
Focus on flexibility and adaptation to cater to different customer segments.
[end sys1]


Llywelyn the Great (Welsh: Llywelyn Fawr, [ɬəˈwɛlɨn vaur]), full name Llywelyn ap Iorwerth, (c. 1172 – 11 April 1240) was a Prince of Gwynedd in north Wales and eventually de facto ruler over most of Wales. By a combination of war and diplomacy he dominated Wales for 40 years.

During Llywelyn's boyhood, Gwynedd was ruled by two of his uncles, who split the kingdom between them, following the death of Llywelyn's grandfather, Owain Gwynedd, in 1170. Llywelyn had a strong claim to be the legitimate ruler and began a campaign to win power at an early age. He was sole ruler of Gwynedd by 1200 and made a treaty with King John of England that year. Llywelyn's relations with John remained good for the next ten years. He married John's natural daughter Joan in 1205, and when John arrested Gwenwynwyn ab Owain of Powys in 1208, Llywelyn took the opportunity to annex southern Powys. In 1210, relations deteriorated, and John invaded Gwynedd in 1211. Llywelyn was forced to seek terms and to give up all lands east of the River Conwy, but was able to recover them the following year in alliance with the other Welsh princes. He allied himself with the barons who forced John to sign the Magna Carta in 1215. By 1216, he was the dominant power in Wales, holding a council at Aberdyfi that year to apportion lands to the other princes.

Following King John's death, Llywelyn concluded the Treaty of Worcester with his successor, Henry III, in 1218. During the next fifteen years, Llywelyn was frequently involved in fights with Marcher lords and sometimes with the king, but also made alliances with several major powers in the Marches. The Peace of Middle in 1234 marked the end of Llywelyn's military career, as the agreed truce of two years was extended year by year for the remainder of his reign. He maintained his position in Wales until his death in 1240 and was succeeded by his son Dafydd ap Llywelyn.

Dolwyddelan Castle was built by Llywelyn; the old castle nearby may have been his birthplace.

Llywelyn was born about 1173, the son of Iorwerth ap Owain and the grandson of Owain Gwynedd, who had been ruler of Gwynedd until his death in 1170. Llywelyn was a descendant of the senior line of Rhodri Mawr and therefore a member of the princely house of Gwynedd.[1] He was probably born at Dolwyddelan, though not in the present Dolwyddelan castle, which was built by Llywelyn himself. He may have been born in the old castle which occupied a rocky knoll on the valley floor.[2] Little is known about his father, Iorwerth Drwyndwn, who died when Llywelyn was an infant. There is no record of Iorwerth having taken part in the power struggle between some of Owain Gwynedd's other sons following Owain's death, although he was the eldest surviving son. There is a tradition that he was disabled or disfigured in some way that excluded him from power.[3]

By 1175, Gwynedd had been divided between two of Llywelyn's uncles. Dafydd ab Owain held the area east of the River Conwy and Rhodri ab Owain held the west. Dafydd and Rhodri were the sons of Owain by his second marriage to Cristin ferch Goronwy ab Owain. This marriage was not considered valid by the church as Cristin was Owain's first cousin, a degree of relationship which according to Canon law prohibited marriage. Giraldus Cambrensis refers to Iorwerth Drwyndwn as the only legitimate son of Owain Gwynedd.[4] Following Iorwerth's death, Llywelyn was, at least in the eyes of the church, the legitimate claimant to the throne of Gwynedd.[5]

Llywelyn's mother was Marared, occasionally anglicised to Margaret, daughter of Madog ap Maredudd, prince of Powys. There is evidence that, after her first husband's death, Marared married in the summer of 1197, Gwion, the nephew of Roger Powys of Whittington Castle with whom she had a son, David ap Gwion. Therefore, some maintain that Marared never married into the Corbet family of Caus Castle (near Westbury, Shropshire) and later, Moreton Corbet Castle.[6] However, there is in existence a grant of land from Llywelyn ab Iorworth to the monastery of Wigmore, in which Llywelyn indicates his mother was a member of the house of Corbet, leaving the issue unresolved.[7]

The arms of the royal house of Gwynedd were traditionally first used by Llywelyn's father, Iorwerth Drwyndwn.

In his account of his journey around Wales in 1188 Giraldus Cambrensis mentions that the young Llywelyn was already in arms against his uncles Dafydd and Rhodri;

Owen, son of Gruffyth, prince of North Wales, had many sons, but only one legitimate, namely, Jorwerth Drwyndwn, which in Welsh means flat-nosed, who had a son named Lhewelyn. This young man, being only twelve years of age, began, during the period of our journey, to molest his uncles David and Roderic, the sons of Owen by Christiana, his cousin-german; and although they had divided amongst themselves all North Wales, except the land of Conan, and although David, having married the sister of king Henry II, by whom he had one son, was powerfully supported by the English, yet within a few years the legitimate son, destitute of lands or money (by the aid of divine vengeance), bravely expelled from North Wales those who were born in public incest, though supported by their own wealth and by that of others, leaving them nothing but what the liberality of his own mind and the counsel of good men from pity suggested: a proof that adulterous and incestuous persons are displeasing to God.[8]

In 1194, with the aid of his cousins Gruffudd ap Cynan[9] and Maredudd ap Cynan, he defeated Dafydd at the battle of Aberconwy at the mouth of the River Conwy. Rhodri died in 1195, and his lands west of the Conwy were taken over by Gruffudd and Maredudd while Llywelyn ruled the territories taken from Dafydd east of the Conwy.[10] In 1197 Llywelyn captured Dafydd and imprisoned him. A year later Hubert Walter, Archbishop of Canterbury, persuaded Llywelyn to release him, and Dafydd retired to England where he died in May 1203.

Wales was divided into Pura Wallia, the areas ruled by the Welsh princes, and Marchia Wallia, ruled by the Anglo-Norman barons. Since the death of Owain Gwynedd in 1170, Rhys ap Gruffydd had made the southern kingdom of Deheubarth the strongest of the Welsh kingdoms, and had established himself as the leader of Pura Wallia. After Rhys died in 1197, fighting between his sons led to the splitting of Deheubarth between warring factions. Gwenwynwyn ab Owain, prince of Powys Wenwynwyn, tried to take over as leader of the Welsh princes, and in 1198 raised a great army to besiege Painscastle, which was held by the troops of William de Braose, Lord of Bramber. Llywelyn sent troops to help Gwenwynwyn, but in August Gwenwynwyn's force was attacked by an army led by the Justiciar, Geoffrey Fitz Peter, and heavily defeated.[11] Gwenwynwyn's defeat gave Llywelyn the opportunity to establish himself as the leader of the Welsh. In 1199 he captured the important castle of Mold and was apparently using the title "prince of the whole of North Wales" (Latin: tocius norwallie princeps).[12] Llywelyn was probably not in fact master of all Gwynedd at this time since it was his cousin Gruffudd ap Cynan who promised homage to King John for Gwynedd in 1199.[13]

Gruffudd ap Cynan died in 1200 and left Llywelyn the undisputed ruler of Gwynedd. In 1201 he took Eifionydd and Llŷn from Maredudd ap Cynan on a charge of treachery.[13] In July the same year Llywelyn concluded a treaty with King John of England. This is the earliest surviving written agreement between an English king and a Welsh ruler, and under its terms Llywelyn was to swear fealty and do homage to the king. In return, it confirmed Llywelyn's possession of his conquests and allowed cases relating to lands claimed by Llywelyn to be heard under Welsh law.[14]

Llywelyn made his first move beyond the borders of Gwynedd in August 1202 when he raised a force to attack Gwenwynwyn ab Owain of Powys, who was now his main rival in Wales. The clergy intervened to make peace between Llywelyn and Gwenwynwyn and the invasion was called off. Elise ap Madog, lord of Penllyn, had refused to respond to Llywelyn's summons to arms and was stripped of almost all his lands by Llywelyn as punishment.[15]

In 1208 Gwenwynwyn of Powys fell out with King John who summoned him to Shrewsbury in October and then arrested him and stripped him of his lands. Llywelyn took the opportunity to annex southern Powys and northern Ceredigion and rebuild Aberystwyth castle.[17] In the summer of 1209 he accompanied John on a campaign against King William I of Scotland.[18]

In 1210 relations between Llywelyn and King John deteriorated. J.E. Lloyd suggests that the rupture may have been due to Llywelyn forming an alliance with William de Braose, 4th Lord of Bramber, who had fallen out with the king and had been deprived of his lands.[19] While John led a campaign against de Braose and his allies in Ireland, an army led by Earl Ranulph of Chester and Peter des Roches, Bishop of Winchester, invaded Gwynedd. Llywelyn destroyed his own castle at Deganwy and retreated west of the River Conwy. The Earl of Chester rebuilt Deganwy, and Llywelyn retaliated by ravaging the earl's lands.[20] John sent troops to help restore Gwenwynwyn to the rule of southern Powys. In 1211 John invaded Gwynedd with the aid of almost all the other Welsh princes, planning according to Brut y Tywysogion "to dispossess Llywelyn and destroy him utterly".[21] The first invasion was forced to retreat, but in August that year John invaded again with a larger army, crossed the River Conwy and penetrated Snowdonia.[22]Bangor was burnt by a detachment of the royal army and the Bishop of Bangor captured. Llywelyn was forced to come to terms, and by the advice of his council sent his wife Joan to negotiate with the king, her father.[23] Joan was able to persuade her father not to dispossess her husband completely, but Llywelyn lost all his lands east of the River Conwy. He also had to pay a large tribute in cattle and horses and to hand over hostages, including his illegitimate son Gruffydd, and was forced to agree that if he died without a legitimate heir by Joan all his lands would revert to the king.[24]

This was the low point of Llywelyn's reign, but he quickly recovered his position. The other Welsh princes, who had supported King John against Llywelyn, soon became disillusioned with John's rule and changed sides. Llywelyn formed an alliance with Gwenwynwyn of Powys and the two main rulers of Deheubarth, Maelgwn ap Rhys and Rhys Gryg, and rose against John. They had the support of Pope Innocent III, who had been engaged in a dispute with John for several years and had placed his kingdom under an interdict. Innocent released Llywelyn, Gwenwynwyn and Maelgwn from all oaths of loyalty to John and lifted the interdict in the territories which they controlled. Llywelyn was able to recover all Gwynedd apart from the castles of Deganwy and Rhuddlan within two months in 1212.[25]

John planned another invasion of Gwynedd in August 1212. According to one account, he had just commenced by hanging some of the Welsh hostages given the previous year when he received two letters. One was from his daughter Joan, Llywelyn's wife, the other from William I of Scotland, and both warned him in similar terms that if he invaded Wales his magnates would seize the opportunity to kill him or hand him over to his enemies.[26] The invasion was abandoned, and in 1213 Llywelyn took the castles of Deganwy and Rhuddlan.[27] Llywelyn made an alliance with Philip II Augustus of France,[28] then allied himself with the barons who were in rebellion against John, marching on Shrewsbury and capturing it without resistance in 1215.[29] When John was forced to sign Magna Carta, Llywelyn was rewarded with several favourable provisions relating to Wales, including the release of his son Gruffydd who had been a hostage since 1211.[30] The same year Ednyfed Fychan was appointed seneschal of Gwynedd and was to work closely with Llywelyn for the remainder of his reign.

Llywelyn had now established himself as the leader of the independent princes of Wales, and in December 1215 led an army which included all the lesser princes to capture the castles of Carmarthen, Kidwelly, Llanstephan, Cardigan and Cilgerran. Another indication of his growing power was that he was able to insist on the consecration of Welshmen to two vacant sees that year, Iorwerth as Bishop of St. David's and Cadwgan as Bishop of Bangor.[31]

In 1216, Llywelyn held a council at Aberdyfi to adjudicate on the territorial claims of the lesser princes, who affirmed their homage and allegiance to Llywelyn. Beverley Smith comments, "Henceforth, the leader would be lord, and the allies would be subjects".[32] Gwenwynwyn of Powys changed sides again that year and allied himself with King John. Llywelyn called up the other princes for a campaign against him and drove him out of southern Powys once more. Gwenwynwyn died in England later that year, leaving an underage heir. King John also died that year, and he also left an underage heir in King Henry III with a minority government set up in England.[33]

In 1217, Reginald de Braose of Brecon and Abergavenny, who had been allied to Llywelyn and married his daughter, Gwladus Ddu, was induced by the English crown to change sides. Llywelyn responded by invading his lands, first threatening Brecon, where the burgesses offered hostages for the payment of 100 marks, then heading for Swansea where Reginald de Braose met him to offer submission and to surrender the town. He then continued westwards to threaten Haverfordwest where the burgesses offered hostages for their submission to his rule or the payment of a fine of 1,000 marks.[34]

Following King John's death Llywelyn concluded the Treaty of Worcester with his successor Henry III in 1218. This treaty confirmed him in possession of all his recent conquests. From then until his death Llywelyn was the dominant force in Wales, though there were further outbreaks of hostilities with marcher lords, particularly the Marshall family and Hubert de Burgh, and sometimes with the king. Llywelyn built up marriage alliances with several of the Marcher families. One daughter, Gwladus Ddu, ("Gwladus the Dark") was already married to Reginald de Braose of Brecon and Abergavenny, but with Reginald an unreliable ally Llywelyn married another daughter, Marared, to John de Braose of Gower, Reginald's nephew. He found a loyal ally in Ranulph, Earl of Chester, whose nephew and heir, John the Scot, married Llywelyn's daughter Elen in about 1222. Following Reginald de Braose's death in 1228, Llywelyn also made an alliance with the powerful Mortimer family of Wigmore when Gwladus Ddu married as her second husband Ralph de Mortimer.[35]

Llywelyn was careful not to provoke unnecessary hostilities with the crown or the Marcher lords; for example in 1220 he compelled Rhys Gryg to return four commotes in South Wales to their previous Anglo-Norman owners.[36] He built a number of castles to defend his borders, most thought to have been built between 1220 and 1230. These were the first sophisticated stone castles in Wales; his castles at Criccieth, Deganwy, Dolbadarn, Dolwyddelan and Castell y Bere are among the best examples.[37] Llywelyn also appears to have fostered the development of quasi-urban settlements in Gwynedd to act as centres of trade.[38]

Hostilities broke out with William Marshal, 2nd Earl of Pembroke, in 1220. Llywelyn destroyed the castles of Narberth and Wiston, burnt the town of Haverfordwest and threatened Pembroke Castle, but agreed to abandon the attack on payment of £100. In early 1223 Llywelyn crossed the border into Shropshire and captured Kinnerley and Whittington castles. The Marshalls took advantage of Llywelyn's involvement here to land near St David's in April with an army raised in Ireland and recaptured Cardigan and Carmarthen without opposition. The Marshalls' campaign was supported by a royal army which took possession of Montgomery. Llywelyn came to an agreement with the king at Montgomery in October that year. Llywelyn's allies in south Wales were given back lands taken from them by the Marshalls and Llywelyn himself gave up his conquests in Shropshire.[39]

In 1228 Llywelyn was engaged in a campaign against Hubert de Burgh, who was Justiciar of England and Ireland and one of the most powerful men in the kingdom. Hubert had been given the lordship and castle of Montgomery by the king and was encroaching on Llywelyn's lands nearby. The king raised an army to help Hubert, who began to build another castle in the commote of Ceri. However in October the royal army was obliged to retreat and Henry agreed to destroy the half-built castle in exchange for the payment of £2,000 by Llywelyn. Llywelyn raised the money by demanding the same sum as the ransom of William de Braose, Lord of Abergavenny, whom he had captured in the fighting.[40]

Following his capture, William de Braose decided to ally himself to Llywelyn, and a marriage was arranged between his daughter Isabella and Llywelyn's heir, Dafydd ap Llywelyn. At Easter 1230 William visited Llywelyn's court. During this visit he was found in Llywelyn's chamber together with Llywelyn's wife Joan. On 2 May, de Braose was hanged; Joan was placed under house arrest for a year. The Brut y Tywysogion chronicler commented: "that year William de Breos the Younger, lord of Brycheiniog, was hanged by the lord Llywelyn in Gwynedd, after he had been caught in Llywelyn's chamber with the king of England's daughter, Llywelyn's wife".[41]

A letter from Llywelyn to William's wife, Eva de Braose, written shortly after the execution enquires whether she still wishes the marriage between Dafydd and Isabella to take place.[42] The marriage did go ahead, and the following year Joan was forgiven and restored to her position as princess.

Until 1230 Llywelyn had used the title princeps Norwalliæ 'Prince of North Wales', but from that year he changed his title to 'Prince of North Wales and Lord of Snowdonia', possibly to underline his supremacy over the other Welsh princes.[43] He did not formally style himself 'Prince of Wales' although as J.E. Lloyd comments "he had much of the power which such a title might imply".[44]

In 1231 there was further fighting. Llywelyn was becoming concerned about the growing power of Hubert de Burgh. Some of his men had been taken prisoner by the garrison of Montgomery and beheaded, and Llywelyn responded by burning Montgomery, Powys, New Radnor, Hay and Brecon before turning west to capture the castles of Neath and Kidwelly. He completed the campaign by recapturing Cardigan castle.[45] King Henry retaliated by launching an invasion and built a new castle at Painscastle, but was unable to penetrate far into Wales.[46]

Negotiations continued into 1232, when Hubert was removed from office and later imprisoned. Much of his power passed to Peter de Rivaux, including control of several castles in south Wales. William Marshal had died in 1231, and his brother Richard had succeeded him as Earl of Pembroke. In 1233 hostilities broke out between Richard Marshal and Peter de Rivaux, who was supported by the king. Llywelyn made an alliance with Richard, and in January 1234 the earl and Llywelyn seized Shrewsbury. Richard was killed in Ireland in April, but the king agreed to make peace with the insurgents.[47] The Peace of Middle, agreed on 21 June, established a truce of two years with Llywelyn, who was allowed to retain Cardigan and Builth. This truce was renewed year by year for the remainder of Llywelyn's reign.[48]

In his later years Llywelyn devoted much effort to ensuring that his only legitimate son Dafydd would follow him as ruler of Gwynedd and amended Welsh law as followed in Gwynedd.[49] Llywelyn's amendment to Welsh law favoring legitimate children in a Church sanctioned marriage mirrored the earlier efforts of the Lord Rhys, Prince of Deheubarth in designating Gruffydd ap Rhys II as his heir over those of his illegitimate eldest son Maelgwn ap Rhys. In both cases, by favoring legitimate children born in a Church sanctioned marriage would facilitate better relations between their sons and the wider Anglo-Norman polity and Catholic Church by removing any "stigma" of illegitimacy. Dafydd's older but illegitimate brother, Gruffydd, was therefore excluded as the primary heir of Llywelyn, though would be given lands to rule. This was a departure from Welsh custom, which held that the eldest son was his father's heir regardless of his parent's marital status.[50][51]

In 1220 Llywelyn induced the minority government of King Henry to acknowledge Dafydd as his heir.[52] In 1222 he petitioned Pope Honorius III to have Dafydd's succession confirmed. The original petition has not been preserved but the Pope's reply refers to the "detestable custom... in his land whereby the son of the handmaiden was equally heir with the son of the free woman and illegitimate sons obtained an inheritance as if they were legitimate". The Pope welcomed the fact that Llywelyn was abolishing this custom.[53] In 1226 Llywelyn persuaded the Pope to declare his wife Joan, Dafydd's mother, to be a legitimate daughter of King John, again in order to strengthen Dafydd's position, and in 1229 the English crown accepted Dafydd's homage for the lands he would inherit from his father.[52] In 1238 Llywelyn held a council at Strata Florida Abbey where the other Welsh princes swore fealty to Dafydd.[52] Llywelyn's original intention had been that they should do homage to Dafydd, but the king wrote to the other rulers forbidding them to do homage.[54] Additionally, Prince Llywelyn arranged for his son Dafydd to marry Isabella de Braose, eldest daughter of William de Braose. As William de Braose had no male heir, Llywelyn strategized that the vast de Braose holdings in south Wales would pass to the heir of Dafydd with Isabella.

Gruffydd was given an appanage in Meirionnydd and Ardudwy but his rule was said to be oppressive, and in 1221 Llywelyn stripped him of these territories.[55] In 1228 Llywelyn imprisoned him, and he was not released until 1234. On his release he was given part of Llŷn to rule. His performance this time was apparently more satisfactory and by 1238 he had been given the remainder of Llŷn and a substantial part of Powys.[56]

Joan died in 1237 and Llywelyn appears to have suffered a paralytic stroke the same year.[57] From this time on, his heir Dafydd took an increasing part in the rule of the principality. Dafydd deprived his half-brother Gruffydd of the lands given him by Llywelyn, and later seized him and his eldest son Owain and held them in Criccieth Castle. In 1240 the chronicler of Brut y Tywysogion records: "the lord Llywelyn ap Iorwerth son of Owain Gwynedd, Prince of Wales, a second Achilles, died having taken on the habit of religion at Aberconwy, and was buried honourably."[58]

True lord of the land – how strange that today
He rules not o'er Gwynedd;
Lord of nought but the piled up stones of his tomb,
Of the seven-foot grave in which he lies.[59]

Dafydd succeeded Llywelyn as prince of Gwynedd, but King Henry was not prepared to allow him to inherit his father's position in the remainder of Wales. Dafydd was forced to agree to a treaty greatly restricting his power and was also obliged to hand his half-brother Gruffydd over to the king, who now had the option of using him against Dafydd. Gruffydd was killed attempting to escape from the Tower of London in 1244. This left the field clear for Dafydd, but Dafydd himself died without issue in 1246 and was eventually succeeded by his nephew, Gruffydd's son, Llywelyn ap Gruffudd.

Llywelyn dominated Wales for more than 40 years, and was one of only two Welsh rulers to be called "the Great", the other being his ancestor Rhodri the Great. The first person to give Llywelyn the title "the Great" seems to have been his near-contemporary, the English chronicler Matthew Paris.[60]

Among the chieftains who battled against the Anglo-Norman power his place will always be high, if not indeed the highest of all, for no man ever made better or more judicious use of the native force of the Welsh people for adequate national ends; his patriotic statemanship will always entitle him to wear the proud style of Llywelyn the Great.[61]

David Moore gives a different view:

When Llywelyn died in 1240 his principatus of Wales rested on shaky foundations. Although he had dominated Wales, exacted unprecedented submissions and raised the status of the prince of Gwynedd to new heights, his three major ambitions – a permanent hegemony, its recognition by the king, and its inheritance in its entirety by his heir – remained unfulfilled. His supremacy, like that of Gruffydd ap Llywelyn, had been merely personal in nature, and there was no institutional framework to maintain it either during his lifetime or after his death.[62]

Llywelyn married Joan, natural daughter of King John of England, in 1205. Llywelyn and Joan had three identified children in the records but in all probability had more as Llywelyn children were fully recognised during his marriage to Joan whilst his father in law King John was alive. The identity of the mother of some of Llywelyn's children before this union is uncertain, but the following are recorded in contemporary or near-contemporary records.

Susanna ferch Llywelyn, died after November 1228, daughter by Joan. Henry III King of England granted the upbringing of "L. princeps Norwallie et Johanna uxor sua et…soror nostra Susannam filiam suam" to "Nicholao de Verdun et Clementie uxori sue" by order dated 24 Nov 1228[273]. Her birth date is estimated on the assumption that Susanna was under marriageable age, but older than an infant, at the time.

A number of Welsh poems addressed to Llywelyn by contemporary poets such as Cynddelw Brydydd Mawr, Dafydd Benfras and Llywarch ap Llywelyn (better known under the nickname Prydydd y Moch) have survived. Very little of this poetry has been published in English translation.[66]

Llywelyn has continued to figure in modern Welsh literature. The play Siwan (1956, English translation 1960) by Saunders Lewis deals with the finding of William de Braose in Joan's chamber and his execution by Llywelyn. Another well-known Welsh play about Llywelyn is Llywelyn Fawr by Thomas Parry.

Llywelyn is the main character or one of the main characters in several English-language novels:

Raymond Foxall (1959) Song for a Prince: The Story of Llywelyn the Great covers the period from King John's invasion in 1211 to the execution of William de Braose.

Sharon Kay Penman (1985) Here be Dragons is centred on the marriage of Llywelyn and Joan. Dragon's Lair (2004) by the same author features the young Llywelyn before he gained power in Gwynedd. Llywelyn further appears in Penman's later novel Falls the Shadow.

Edith Pargeter (1960–63) "The Heaven Tree Trilogy" features Llywelyn, Joan, William de Braose, and several of Llywelyn's sons as major characters.

Gaius Demetrius (2006) Ascent of an Eagle tells the story of the early part of Llywelyn's reign.

The story of the faithful hound Gelert, owned by Llywelyn and mistakenly killed by him, is also considered to be fiction. "Gelert's grave" is a popular tourist attraction in Beddgelert but is thought to have been created by an 18th-century innkeeper to boost the tourist trade. The tale itself is a variation on a common folktale motif.[67]

^Giraldus Cambrensis p. 126. Giraldus says that Llywelyn was only twelve years of age at this time, which would mean that he was born about 1176. However most historians consider that he was born about 1173.

^This Gruffudd ap Cynan should not be confused with Gruffudd ap Cynan the late 11th- and early 12th-century king of Gwynedd, Llywelyn's great-grandfather

^Lloyd pp. 616-7. One letter from the Pope suggests that Llywelyn may have been married previously, to an unnamed sister of Earl Ranulph of Chester in about 1192, but there appears to be no confirmation of this.

^The version of the Welsh laws preserved in Llyfr Iorwerth, compiled in Gwynedd during Llywelyn's reign, claims precedence for the ruler of Aberffraw, the ancient court, over the rulers of the other Welsh kingdoms. See Aled Rhys William (1960) Llyfr Iorwerth: a critical text of the Venedotian code of mediaeval Welsh law.

^Lewis, Hurbert; The Ancient Laws of Wales, 1889. Chapter VIII: Royal Succession; Rules to Marriage; Alienation pgs 192–200. According to Hurbert Lewis, though not explicitly codified as such, the edling, or Heir apparent, was by convention, custom, and practice the eldest son of the lord and entitled to inheirit the position and title as "head of the family" from the father. Effectively primogeniture with local variations. However, all sons were provided for out of the lands of the father and in certain circumstances so too were daughters. Additionally, sons could claim materinal patrimony through their mother in certain circumstances.

^There was provision in Welsh law for the selection of a single edling or heir by the ruler. For a discussion of this see Stephenson pp. 138–141. See Williams pp. 393–413 for details of the struggle for the succession.