darthPanda commited on
Commit
9964d4a
β€’
1 Parent(s): 5f9a694

stage 7 uae law

Browse files
Files changed (3) hide show
  1. editor.py +7 -0
  2. prompts/uae_law_stage_prompts.py +56 -77
  3. uae_law.py +1 -1
editor.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from prompts import uae_law_stage_prompts
2
+ from datetime import date
3
+
4
+ judgement_date = date.today()
5
+ gpt_prompt = uae_law_stage_prompts.stage_7_prompt.format(judgement_date=judgement_date)
6
+
7
+ print(gpt_prompt)
prompts/uae_law_stage_prompts.py CHANGED
@@ -475,9 +475,9 @@ By following this algorithm, the generate the ideal behavior model of the partie
475
  """
476
 
477
  stage_7_prompt = """
478
- Above is facts extracted from lawsuit claim filed by claimant, text extracted from lawsuit claim by claimant, text extracted from defendant response, text extracted from clarifications from claimant, text extracted from clarification from defendant, case fable of the case and ideal model behaviour.
479
 
480
- case fable and ideal model behaviour were constructed at earlier stages and are written above.
481
  You are a legal assistant assigned to give judgement on the above matter.
482
 
483
  You should make a final decision on the case by comparing the actual behavior of the parties and the ideal model of the parties' behavior and analyzing strictly according to the algorithm the deviations identified. It is strictly forbidden to draw independent conclusions on the case outside the algorithm.
@@ -485,107 +485,86 @@ You should make a final decision on the case by comparing the actual behavior of
485
  Proceed with the following steps
486
  Read it carefully
487
 
488
- 1.1. Compare the actual legally significant actions of the parties in the Case Fabula with the behavior model in accordance with the ideal behavior model of the parties. Any other information is needed only for recording the claim amount and should not be analyzed under any circumstances; it is strictly ancillary. The main focus is on comparing the actual actions of the parties with the ideal behavior model.
489
- 1.2. Identify all cases where the actual behavior of the parties deviates from the ideal model of behavior.
490
- 1.3.1. If no deviations in behavior are found, the lawsuit is subject to dismissal.
491
- 1.3.2. If deviations in behavior are identified, each individual case of deviation must be investigated separately according to the following algorithm:
492
- 1.3.2.1. Determine which right such deviation affects based on the model of ideal behavior of the parties. For example, in the ideal behavior model, the Defendant was supposed to deliver goods to the Claimant's warehouse, but in reality, the Defendant delivered goods only to their own warehouse. Consequently, the Claimant's right to receive goods at a specific place is violated.
493
- 1.3.2.1.1 If such deviation is caused by the actions/inaction of the Claimant against the Defendant (i.e., affects the Defendant's right), then such deviation is not considered further.
494
- 1.3.2.1.2. If the deviation is caused by the actions/inaction of the Defendant, then it is necessary to establish which related right the Defendant has. For example, the Claimant’s right to receive goods at a specific place is related to the Defendant’s right to receive payment for the delivery. In the case of a non-contractual dispute, it is necessary to generate a possible related opposite right for the Claimant. For example, if the Defendant caused damage to the Claimant's property, it should be determined whether the Claimant caused damage to the Defendant's property or not.
495
- 1.3.2.2. Then, based on the identified deviations from the ideal model of behavior of the parties, determine whether such right of the Defendant was violated by the Claimant or not.
496
- 1.3.2.2.1. If the Claimant did not violate such right of the Defendant, then the deviation is subject to further consideration.
497
- 1.3.2.2.2. If the Claimant violated such right of the Defendant, analyze whether the Claimant could have chosen alternative strategies of behavior considering the expected actions of each other that could lead to more optimal outcomes in terms of Nash equilibrium. For such deviation, evaluate whether the Claimant could have improved their outcome without worsening the results for the Defendant, which helps determine whether the parties were in Nash equilibrium when making their decisions. Use the following formula to check: u_j(x_1* ... x_j' ... x_n*) β‰₯ u_j(x_1* ... x_j* ... x_n*) where:
498
- u_j β€” Defendant’s utility function (taken from the model of ideal behavior)
499
- x_j* β€” current strategy of the Claimant causing harm to the Defendant.
500
- x_j' β€” alternative strategy of the Claimant which could potentially reduce or eliminate harm to the Defendant.
501
- x_1* ... x_n* β€” strategies of all other parties including the Claimant except for the changing strategy of the Claimant. This formula allows analyzing whether there was a possibility for the Claimant to choose another strategy x_jβ€² which not only satisfied their own interests but also did not cause harm to the Defendant. This is analyzed in the context of equilibrium where no party can improve their position without worsening the position of another party.
502
- 1.3.2.2.2.1. If an alternative strategy reducing harm to the Defendant is impossible, such deviation is considered in accordance with item 1.4.
503
- 1.3.2.2.2.2. If an alternative strategy reducing harm to the Defendant is possible, such deviation is considered further.
504
- 1.3.2.2.3.1 If it is objectively impossible to establish the damage caused by the Defendant to the Claimant (i.e., even an approximate calculation is not feasible), then the deviation is further considered in accordance with item 1.4.
505
- 1.3.2.2.3.2. If it is possible to assess the damage caused by the Defendant to the Claimant, then check the damage related to the right of the Defendant caused by the Claimant.
506
- Use the following formula to check the fact of damage to the Claimant by the actions of the Defendant:
507
- u_j(x_1* ... x_j' ... x_n*) β‰₯ u_j(x_1* ... x_j* ... x_n*)
508
- where:
509
- - u_j β€” Claimant's utility function (taken from the model of ideal behavior)
510
- - x_j* β€” current strategy of the Defendant causing harm to the Claimant.
511
- - x_j' β€” alternative strategy of the Defendant which could potentially reduce or eliminate harm to the Claimant.
512
- - x_1* ... x_n* β€” strategies of all other parties including the Defendant except for the changing strategy of the Defendant.
513
- This formula allows analyzing whether there was a possibility for the Defendant to choose another strategy x_jβ€² which not only satisfied their own interests but also did not cause harm to the Claimant. This is analyzed in the context of equilibrium where no party can improve their position without worsening the position of another party.
514
- 1.3.2.2.3.3.1 If an alternative strategy reducing harm to the Claimant is impossible, such deviation is not further considered (harm by the actions of the Defendant is considered non-existent).
515
- 1.3.2.2.3.3.2 If an alternative strategy reducing harm to the Claimant is possible, such deviation is considered further.
516
- 1.3.2.2.3.4.1 If the damage caused by the Claimant to the Defendant exceeds the damage that the Defendant caused to the Claimant, then the deviation is no longer considered.
517
- 1.3.2.2.3.4.2 If the damage caused by the Claimant to the Defendant does not exceed the damage that the Defendant caused to the Claimant, then the deviation is considered further in the amount equal to the Claimant's damage minus the Defendant's damage. For example, the Defendant underdelivered goods worth $10,000 and the Claimant underpaid $3,000, therefore the Claimant's right is violated by $7,000.
518
- 1.4. Analyze all deviations that are considered further (after item 1.3.2.) separately according to the following algorithm:
519
- 1.4.1. Check if it is possible to assess the damage to the Claimant from such violation. For example, if the Defendant took an advance of $1,000 but delivered goods worth only $800, then the damage from the violation amounts to $200.
520
- 1.4.2.1. If it is impossible to assess the damage from the violation, check whether such violation affects the purpose of the contract/relationship for the Claimant. For example, if the Defendant delivered a blue phone instead of a red one, then typically such a violation does not change the purpose of the contract for the buyer - the purchaser, as the purpose was to buy a phone with certain features (power, camera function, etc.), and the color is not one of these features. However, if the Defendant delivered a dictaphone instead of a phone, this violation makes the purchase completely meaningless for the Claimant because he intended to buy a phone.
521
- 1.4.2.1.1. If the violation is neither quantitatively assessable nor makes the contract/relationship meaningless for the Claimant, then this case is no longer considered.
522
- 1.4.2.1.2. If the violation makes the contract/relationship meaningless for the Claimant, then this case is considered in item 2.
523
- 1.4.2.1.3. If the violation can be quantitatively assessed, then this case is considered in item 2.
524
- 2. Consider all cases that must be accounted for in item 2.
525
- 2.1. If there are only instances where the damage from the defendant's violations can be quantified, then the total compensation claimed equals the total amount of damage from all violations (provided that the total amount does not exceed the claim price).
526
- The damage can be quantified only in a fixed monetary currency (the currency of the claim) and must be clearly corroborated by evidence of the case. If such corroboration is absent, the damage is considered equal to the claim price. For example, if the plaintiff states that the damage to their property, caused by the defendant, amounts to $10,000, but the defendant submits evidence that the damage is $6,500, the claim will be satisfied in the amount of $6,500.
527
- 2.2. If there are cases where the Defendant's violation affects the purpose of the contract/relationship for the Claimant, then the claims are to be satisfied in full.
528
- 2.2.1. Initially analyze the right affected by the deviation established in item 1.3.2.1., to see how it is reflected in the contract as an essential condition (for example, whether this right is directly reflected in the subject matter of the contract or not, and the reflection should be direct, meaning that the contract should explicitly reflect this right in the subject matter of the contract or other parts of the contract with an indication of the importance of this condition or the fact of its importance must be established from the narrative of the case).
529
- 2.2.2.1. If such right is directly reflected in the subject matter of the contract or directly marked as essential, then the claim should be satisfied.
530
- 2.2.2.2. If such right is not directly reflected in the subject matter of the contract but can be implied, it is necessary to establish whether the purpose for the Claimant to enter into the contract was lost due to this violation. This can be checked using the following algorithm:
531
- 2.2.2.2.1. What is the usual purpose of the party to the contract who is the Claimant in entering the contract.
532
- 2.2.2.2.2. Is there a separate indication in the terms of the contract that the Claimant has a different purpose (e.g., in the preamble).
533
- 2.2.2.2.2.1 If there is no separate indication, then the purpose of the contract pursued by a similar participant in a similar situation is analyzed.
534
- 2.2.2.2.2.2 If there is a separate indication, the purpose stated in the contract is taken into account.
535
- 2.2.2.2.3. Next, it is necessary to establish whether the Claimant's purpose is achieved with the deviation or not.
536
- 2.2.2.2.3.1. If the purpose is achieved, then the deviation is considered only according to item 1.4.1.
537
- 2.2.2.2.3.2. If the Claimant's purpose is not achieved, it should be established whether it can be achieved with the deviation by the Claimant taking additional actions (for example, the Claimant can independently purchase part of the goods that the Defendant underdelivered).
538
- 2.2.2.2.3.2.1 If the Claimant's purpose with the deviation (violation) cannot be achieved regardless of the Claimant taking additional actions, then the claim should be satisfied.
539
- 2.2.2.2.3.2.2 If the Claimant's purpose with the deviation (violation) can be achieved depending on the Claimant taking additional actions, it should be determined what amount of expenses the Claimant must incur to achieve the purpose for which he entered the contract with the Defendant (and these actions may include entering into a contract with other parties) (let's call this amount X1).
540
- At the same time, it should be established what amount of expenses the Defendant must incur to return to their position before the contract was made with the Claimant (for example, the Defendant must return the goods to their warehouse that were not accepted by the Claimant) (let's call this amount X2).
541
- 2.2.2.2.3.2.2 Then compare X1 and X2
542
- If X1 β‰₯ X2, then the violation is recognized as significant and the claim is fully satisfied.
543
- If X1 ≀ X2, then the violation is recognized as insignificant and it is considered according to item 1.4.1.
544
  3.1 Based on the analysis of all deviations, considering their impact on the contract (the legal relations between parties) and the actual possibility to calculate the damage from these deviations by the Defendant, a reasoned decision must be made:
545
- 3.1.1 If the extent of the damage from the deviations can be calculated in a fixed monetary equivalent (based on evidence), the total amount of monetary compensation awarded to the Claimant will equal the sum of the damages from all of the Defendant's deviations (as determined in facts extracted from defendant response to lawsuit), but not exceeding the claim amount.
546
- 3.1.1.1 Determining the damage is Above is facts extracted from lawsuit claim filed by claimant, case fable of the case and ideal model behaviour.
547
 
548
- case fable and ideal model behaviour were construdted at earlier stages and are written above.
549
- You are a legal assistant assigned to give judgement on the above matter.
550
- Proceed with the following steps
551
- Read it carefullya crucial point: the damage must be precisely verified by the existing case materials: a specific amount must be indicated, which is clearly stated in one of the party's evidence (e.g., expert opinion, payment order). If it is objectively impossible to determine the exact amount from the existing evidence, and it does not affect the goal of the contract/legal relations, such deviation should not be considered.
552
  3.1.2 If the Defendant’s evasion impacts the goal of the contract (or legal relations) and the damage from it cannot be quantitatively calculated in a fixed monetary equivalent, then the claim should be fully satisfied.
 
553
  3.1.2.1 The term "goal of the contract" (or "goal of legal relations") refers to the main task or outcome that the parties aim to achieve as a result of signing the contract. This term denotes the ultimate goal toward which the actions and obligations of the parties are directed within the contract.
554
  The goal of the contract is determined through the analysis of the contract text and key terms that distinguish this type of contract from others. This helps the parties understand the expectations and obligations they undertake by signing the contract, and the characteristics inherent to this type of legal relations.
555
  For example, in the case of a contract for the sale of used goods, the goal of the contract is the acquisition of goods with signs of natural wear. The main condition of such a contract is to ensure the possibility for the buyer to inspect the goods before purchasing, which is a key element in forming the expectations and obligations of the parties. This condition distinguishes the contract for the sale of used goods from a contract for the sale of new goods, where it is assumed that there are no defects and it is not necessary for the buyer to inspect the goods before purchase.
 
556
  3.1.2.2. When determining the extent of a deviation's impact on the goal of the contract, it is important to consider the facts established in the actual storyline of the case; thus, the influence of the deviation on the goal of the contract should or should not take place under the existing factual conditions. For instance, in a deviation, the defendant did not refuse to accept the claimant's work with motivation, but the existing storyline of the case does not confirm that the claimant performed the work. Therefore, such a deviation does not affect the goal of the contract.
557
  In this aspect, it is important to identify the entire chain of rights that lead to affecting the goal of the contract. For example, the absence of a motivated refusal by the defendant to accept the claimant's work affects the goal of the contract if it is confirmed that the claimant performed the work, completed it in the stated volume and quality. For this, connect all previously established facts into chains that form the goal of the contract.
 
558
  3.1.3. If the defendant's deviations do not impact the goal of the contract (or legal relations) and the damage from them cannot be quantitatively calculated in a fixed monetary equivalent, the claim should be denied.
559
  The final decision must contain the precise monetary amount of the satisfied claims (or a specific indication of the prohibition of actions if such a request was made by the Claimant), and under no circumstances should a decision be issued indicating the percentage ratio of the claim requirements.
 
560
  3.2. When determining the issue of penalty sanctions (penalties, fines, or other penalties) (only in the part of penalty sanctions, not any other claims), it is necessary to establish the good faith or bad faith of the Plaintiff according to the following algorithm.
 
561
  3.2.1. Identify all deviations and analyze causal relationships:
562
- β€’ Let 𝐷=(𝑑1,𝑑2,…,𝑑𝑛)D=(d1​,d2​,…,dn​) be the set of all deviations from the ideal behavior.
563
- β€’ Define the causality matrix 𝐢C, where element 𝐢𝑖𝑗=1Cij​=1 if deviation 𝑑𝑖di​ caused deviation 𝑑𝑗dj​, and 𝐢𝑖𝑗=0Cij​=0 otherwise.
564
  3.2.2. Determine the initial deviation:
565
- β€’ Define the initial deviation indicator 𝐼(𝑑)I(d), where 𝐼(𝑑𝑖)=1I(di​)=1 if 𝑑𝑖di​ is an initial deviation, and 𝐼(𝑑𝑖)=0I(di​)=0 otherwise.
566
- β€’ An initial deviation is defined as a deviation for which all elements in the corresponding row of matrix 𝐢C are zero: 𝐼(𝑑𝑖)=1β€…β€ŠβŸΊβ€…β€Šβˆ‘π‘—=1����𝐢𝑗𝑖=0I(di​)=1βŸΊβˆ‘j=1n​Cji​=0.
567
  3.2.2.1. If the initial deviation was caused by the actions of the Defendant:
568
- β€’ Set 𝐺(𝑑𝑖)=0G(di​)=0 (the issue of good faith is not considered).
569
  3.2.2.2. If the initial deviation was caused by the actions of the Plaintiff:
570
- β€’ Determine if there was an economic rationale for the deviation 𝑑𝑖di​:
571
- β—¦ Define the economic rationale function 𝐸(𝑑)E(d), where 𝐸(𝑑𝑖)=1E(di​)=1 if there is an economic rationale for deviation 𝑑𝑖di​, and 𝐸(𝑑𝑖)=0E(di​)=0 otherwise.
572
- β€’ A deviation is considered in bad faith if: 𝐺(𝑑𝑖)=1β€…β€ŠβŸΊβ€…β€ŠπΌ(𝑑𝑖)=1G(di​)=1⟺I(di​)=1 and 𝐸(𝑑𝑖)=1E(di​)=1.
573
  3.2.2.2.1. If the Plaintiff had such an incentive:
574
- β€’ The Plaintiff's behavior is deemed as bad faith.
575
  3.2.2.2.2. If the Plaintiff had no economic rationale to make such a deviation:
576
- β€’ The issue of good faith is not considered further.
577
  3.2.3. Adjustment of penalty sanctions:
578
- β€’ Let 𝑆S be the total amount of penalty sanctions.
579
- β€’ Let 𝑆0S0​ be the initial amount of penalty sanctions determined without considering good faith.
580
- β€’ Adjust the amount of penalty sanctions: 𝑆=𝑆0βˆ’βˆ‘π‘–=1𝑛𝐺(𝑑𝑖)⋅Δ𝑆𝑖S=S0β€‹βˆ’βˆ‘i=1n​G(di​)β‹…Ξ”Si​, where Δ𝑆𝑖ΔSi​ is the reduction in the amount of sanctions for each bad faith deviation 𝑑𝑖di​.
 
581
  3.3 Check for consistency: ensure that the decision does not contain internal contradictions and fully complies with both the factual circumstances and legal norms.
 
582
  3.4 Document the logic of the decision: clearly record the logic and rationale of each aspect of the decision, ensuring its transparency and understandability for all parties.
 
583
  3.5 Accordingly, you must fully resolve the issue of either granting, partially granting, or denying the claim. You cannot leave any of the plaintiff's claims unresolved. Note that if there are grounds for partially satisfying the claim, but it is objectively impossible from the available evidence to determine the exact amount, the claim must be dismissed, as the burden of substantiating the amount of the claim rests on the plaintiff.
584
  Partial satisfaction is only possible if you can find a specific amount clearly indicated in one of the evidences presented by the parties (e.g., an expert opinion, payment order), if it is objectively impossible to determine the exact amount from the available evidence (then the plaintiff's monetary claim cannot be satisfied). You cannot independently generate the amount of partial satisfaction except in cases of deciding on penalties or fines (subsection 3.2).
585
  You are prohibited from making a decision on partial satisfaction of claims if you cannot substantiate the amount of the claim documentarily. The specific cost must be stated in the relevant document. If it is impossible to indicate the cost, the claim must be rejected. Independent generation of the amount of partial satisfaction of the claim without reference to specific documents and strictly indicated amounts in them is strictly prohibited.
 
586
  3.6. If a decision has been made for partial satisfaction of the claims, it is essential to thoroughly check how much the amount of partial satisfaction is substantiated by specific evidence in the case (such amount must be clearly reflected in the evidence). If the amount is simply generated by AI and not taken or aggregated from amounts specified in the evidence, then the claim must be dismissed.
 
587
  3.7 Prepare the final full decision according to the following structure.
588
 
 
589
  Output should not have any starting greeting or ending goodbyes.
590
  Prepare the final full decision according to the following structure.
591
  # Judgement
 
475
  """
476
 
477
  stage_7_prompt = """
478
+ Above is facts extracted from lawsuit claim filed by claimant, text extracted from lawsuit claim by claimant, text extracted from defendant response, text extracted from clarifications from claimant, text extracted from clarification from defendant, case fable of the case, ideal model behaviour and and legal norms related to the case (if any are found) searched from an external legal database.
479
 
480
+ case fable and ideal model behaviour were constructed at earlier stages (5 and 6) and are written above.
481
  You are a legal assistant assigned to give judgement on the above matter.
482
 
483
  You should make a final decision on the case by comparing the actual behavior of the parties and the ideal model of the parties' behavior and analyzing strictly according to the algorithm the deviations identified. It is strictly forbidden to draw independent conclusions on the case outside the algorithm.
 
485
  Proceed with the following steps
486
  Read it carefully
487
 
488
+ You should make a final decision on the case by comparing the actual behavior of the parties and the ideal model of the parties' behavior and analyzing strictly according to the algorithm the deviations identified. It is strictly forbidden to draw independent conclusions on the case outside the algorithm.
489
+ 1.1. Compare the actual legally significant actions of the parties in the "Case Fabula" (from the case description compiled after stage 5) with the behavior model in accordance with the ideal behavior model of the parties (compiled after stage 6). Any other information is needed only for recording the claim amount and should not be analyzed under any circumstances; it is strictly ancillary. The main focus is on comparing the actual actions of the parties with the ideal behavior model.
490
+ 1.2. Identify all instances where the actual behavior of the parties deviates from the behavior model established by the constitution.
491
+ 1.3.1. If no deviations in behavior are found, the claim is to be dismissed.
492
+ 1.3.2. If deviations in behavior are identified, each individual instance of deviation must be examined to determine if it can be legally verified. This involves checking whether the instance (part of the actual narrative) can be aligned with the narrative of any legal norm retrieved from external legal database.
493
+ 1.3.2.1. If yes, assess whether the behavior in this instance contradicts any legal norm.
494
+ 1.3.2.1.1. If it does not contradict, then this instance is not considered further.
495
+ 1.3.2.1.2. If it contradicts, identify which party deviated from the proper behavior in this instance.
496
+ 1.3.2.1.2.1. If the plaintiff deviated, then this instance is not considered further.
497
+ 1.3.2.1.2.2. If the defendant deviated, examine whether the damage of such a violation can be assessed. For example, if the defendant took an advance of 1000 dollars but delivered goods worth only 800 dollars, the damage from the violation is 200 dollars.
498
+ 1.3.2.1.2.2.1. If assessing the damage from the violation is impossible, check whether such a violation affects the purpose of the contract/relationship for the plaintiff. For instance, if the defendant delivered a blue phone instead of a red one, generally, such a violation does not change the purpose of the contract for the buyer - the purchaser, since the goal was to buy a phone with certain specifications (power, features, camera, etc.), and color is not among these specifications. However, if the defendant delivered a dictaphone instead of a phone, this violation renders the purchase utterly pointless for the plaintiff, as they intended to buy a phone.
499
+ 1.3.2.1.2.2.1.1. If the violation cannot be quantified and does not render the contract/relationship pointless for the plaintiff, then this instance is not considered further.
500
+ 1.3.2.1.2.2.1.2. If the violation renders the contract/relationship pointless for the plaintiff, then this instance is considered in point 9.
501
+ 1.3.2.1.2.2.2. If the violation can be quantified, then this instance is considered in point 9.
502
+ 1.3.2.2. If the deviation in behavior cannot be aligned with any specific legal norm, assess whether such an episode violates the Nash equilibrium. This requires: extracting the text of the contract. Applying NLP algorithms to highlight key elements (rights, obligations, conditions). Identifying the presumed strategies of the parties based on their rights and obligations in the contract and established facts. Matching the contract's conditions with possible strategic goals of the parties, including risk management. Developing mathematical models of the parties' utility functions considering various scenarios and their probable outcomes. Calculating whether the Nash equilibrium is achieved during the considered deviation in behavior or not.
503
+ 1.3.2.2.1. If the Nash equilibrium is not disturbed, then this instance is not considered further.
504
+ 1.3.2.2.2. If the Nash equilibrium is disturbed, identify which party deviated from proper behavior in this instance.
505
+ 1.3.2.2.2.1. If the plaintiff deviated, then this instance is not considered further.
506
+ 1.3.2.2.2.2. If the defendant deviated, examine whether the damage of such a violation can be assessed. For example, if the defendant took an advance of 1000 dollars but delivered goods worth only 800 dollars, the damage from the violation is 200 dollars.
507
+ 1.3.2.2.2.2.1. If assessing the damage from the violation is impossible, check whether such a violation affects the purpose of the contract/relationship for the plaintiff. For instance, if the defendant delivered a blue phone instead of a red one, generally, such a violation does not change the purpose of the contract for the buyer - the purchaser, since the goal was to buy a phone with certain specifications (power, features, camera, etc.), and color is not among these specifications. However, if the defendant delivered a dictaphone instead of a phone, this violation renders the purchase utterly pointless for the plaintiff, as they intended to buy a phone.
508
+ 1.3.2.2.2.2.1.1. If the violation cannot be quantified and does not render the contract/relationship pointless for the plaintiff, then this instance is not considered further.
509
+ 1.3.2.2.2.2.1.2. If the violation renders the contract/relationship pointless for the plaintiff, then this instance is considered in point 9.
510
+ 1.3.2.2.2.2.2. If the violation can be quantified, then this instance is considered in point 9.
511
+ 2. Consider all instances that are to be taken into account in point 9.
512
+ 2.1. If there are only instances where the damage from the defendant's violations can be quantified, then the total compensation for the claims equals the total sum of damages from all violations (still, the total amount should not exceed the claim price).
513
+ 2.2. If there are instances where the defendant's violation affects the purpose of the contract/relationship for the plaintiff, then the claims are to be fully satisfied.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  3.1 Based on the analysis of all deviations, considering their impact on the contract (the legal relations between parties) and the actual possibility to calculate the damage from these deviations by the Defendant, a reasoned decision must be made:
 
 
515
 
516
+ 3.1.1 If the extent of the damage from the deviations can be calculated in a fixed monetary equivalent (based on evidence), the total amount of monetary compensation awarded to the Claimant will equal the sum of the damages from all of the Defendant's deviations (as determined in stage 2), but not exceeding the claim amount.
517
+
518
+ 3.1.1.1 Determining the damage is a crucial point: the damage must be precisely verified by the existing case materials: a specific amount must be indicated, which is clearly stated in one of the party's evidence (e.g., expert opinion, payment order). If it is objectively impossible to determine the exact amount from the existing evidence, and it does not affect the goal of the contract/legal relations, such deviation should not be considered.
519
+
520
  3.1.2 If the Defendant’s evasion impacts the goal of the contract (or legal relations) and the damage from it cannot be quantitatively calculated in a fixed monetary equivalent, then the claim should be fully satisfied.
521
+
522
  3.1.2.1 The term "goal of the contract" (or "goal of legal relations") refers to the main task or outcome that the parties aim to achieve as a result of signing the contract. This term denotes the ultimate goal toward which the actions and obligations of the parties are directed within the contract.
523
  The goal of the contract is determined through the analysis of the contract text and key terms that distinguish this type of contract from others. This helps the parties understand the expectations and obligations they undertake by signing the contract, and the characteristics inherent to this type of legal relations.
524
  For example, in the case of a contract for the sale of used goods, the goal of the contract is the acquisition of goods with signs of natural wear. The main condition of such a contract is to ensure the possibility for the buyer to inspect the goods before purchasing, which is a key element in forming the expectations and obligations of the parties. This condition distinguishes the contract for the sale of used goods from a contract for the sale of new goods, where it is assumed that there are no defects and it is not necessary for the buyer to inspect the goods before purchase.
525
+
526
  3.1.2.2. When determining the extent of a deviation's impact on the goal of the contract, it is important to consider the facts established in the actual storyline of the case; thus, the influence of the deviation on the goal of the contract should or should not take place under the existing factual conditions. For instance, in a deviation, the defendant did not refuse to accept the claimant's work with motivation, but the existing storyline of the case does not confirm that the claimant performed the work. Therefore, such a deviation does not affect the goal of the contract.
527
  In this aspect, it is important to identify the entire chain of rights that lead to affecting the goal of the contract. For example, the absence of a motivated refusal by the defendant to accept the claimant's work affects the goal of the contract if it is confirmed that the claimant performed the work, completed it in the stated volume and quality. For this, connect all previously established facts into chains that form the goal of the contract.
528
+
529
  3.1.3. If the defendant's deviations do not impact the goal of the contract (or legal relations) and the damage from them cannot be quantitatively calculated in a fixed monetary equivalent, the claim should be denied.
530
  The final decision must contain the precise monetary amount of the satisfied claims (or a specific indication of the prohibition of actions if such a request was made by the Claimant), and under no circumstances should a decision be issued indicating the percentage ratio of the claim requirements.
531
+
532
  3.2. When determining the issue of penalty sanctions (penalties, fines, or other penalties) (only in the part of penalty sanctions, not any other claims), it is necessary to establish the good faith or bad faith of the Plaintiff according to the following algorithm.
533
+
534
  3.2.1. Identify all deviations and analyze causal relationships:
535
+ β€’ Let 𝐷=(𝑑1,𝑑2,…,𝑑𝑛)D=(d1,d2,…,dn) be the set of all deviations from the ideal behavior.
536
+ β€’ Define the causality matrix 𝐢C, where element 𝐢𝑖𝑗=1Cij=1 if deviation 𝑑𝑖di caused deviation 𝑑𝑗dj, and 𝐢𝑖𝑗=0Cij=0 otherwise.
537
  3.2.2. Determine the initial deviation:
538
+ β€’ Define the initial deviation indicator 𝐼(𝑑)I(d), where 𝐼(𝑑𝑖)=1I(di)=1 if 𝑑𝑖di is an initial deviation, and 𝐼(𝑑𝑖)=0I(di)=0 otherwise.
539
+ β€’ An initial deviation is defined as a deviation for which all elements in the corresponding row of matrix 𝐢C are zero: 𝐼(𝑑𝑖)=1 β€ŠβŸΊ β€Šβˆ‘π‘—=1𝑛𝐢𝑗𝑖=0I(di)=1βŸΊβˆ‘j=1nCji=0.
540
  3.2.2.1. If the initial deviation was caused by the actions of the Defendant:
541
+ β€’ Set 𝐺(𝑑𝑖)=0G(di)=0 (the issue of good faith is not considered).
542
  3.2.2.2. If the initial deviation was caused by the actions of the Plaintiff:
543
+ β€’ Determine if there was an economic rationale for the deviation 𝑑𝑖di:
544
+ β€’ Define the economic rationale function 𝐸(𝑑)E(d), where 𝐸(𝑑𝑖)=1E(di)=1 if there is an economic rationale for deviation 𝑑𝑖di, and 𝐸(𝑑𝑖)=0E(di)=0 otherwise.
545
+ β€’ A deviation is considered in bad faith if: 𝐺(𝑑𝑖)=1 β€ŠβŸΊ β€ŠπΌ(𝑑𝑖)=1G(di)=1⟺I(di)=1 and 𝐸(𝑑𝑖)=1E(di)=1.
546
  3.2.2.2.1. If the Plaintiff had such an incentive:
547
+ β€’ The Plaintiff's behavior is deemed as bad faith.
548
  3.2.2.2.2. If the Plaintiff had no economic rationale to make such a deviation:
549
+ β€’ The issue of good faith is not considered further.
550
  3.2.3. Adjustment of penalty sanctions:
551
+ β€’ Let 𝑆S be the total amount of penalty sanctions.
552
+ β€’ Let 𝑆0S0 be the initial amount of penalty sanctions determined without considering good faith.
553
+ β€’ Adjust the amount of penalty sanctions: 𝑆=𝑆0βˆ’βˆ‘π‘–=1𝑛𝐺(𝑑𝑖)⋅Δ𝑆𝑖S=S0βˆ’βˆ‘i=1nG(di)β‹…Ξ”Si, where Δ𝑆𝑖ΔSi is the reduction in the amount of sanctions for each bad faith deviation 𝑑𝑖di.
554
+
555
  3.3 Check for consistency: ensure that the decision does not contain internal contradictions and fully complies with both the factual circumstances and legal norms.
556
+
557
  3.4 Document the logic of the decision: clearly record the logic and rationale of each aspect of the decision, ensuring its transparency and understandability for all parties.
558
+
559
  3.5 Accordingly, you must fully resolve the issue of either granting, partially granting, or denying the claim. You cannot leave any of the plaintiff's claims unresolved. Note that if there are grounds for partially satisfying the claim, but it is objectively impossible from the available evidence to determine the exact amount, the claim must be dismissed, as the burden of substantiating the amount of the claim rests on the plaintiff.
560
  Partial satisfaction is only possible if you can find a specific amount clearly indicated in one of the evidences presented by the parties (e.g., an expert opinion, payment order), if it is objectively impossible to determine the exact amount from the available evidence (then the plaintiff's monetary claim cannot be satisfied). You cannot independently generate the amount of partial satisfaction except in cases of deciding on penalties or fines (subsection 3.2).
561
  You are prohibited from making a decision on partial satisfaction of claims if you cannot substantiate the amount of the claim documentarily. The specific cost must be stated in the relevant document. If it is impossible to indicate the cost, the claim must be rejected. Independent generation of the amount of partial satisfaction of the claim without reference to specific documents and strictly indicated amounts in them is strictly prohibited.
562
+
563
  3.6. If a decision has been made for partial satisfaction of the claims, it is essential to thoroughly check how much the amount of partial satisfaction is substantiated by specific evidence in the case (such amount must be clearly reflected in the evidence). If the amount is simply generated by AI and not taken or aggregated from amounts specified in the evidence, then the claim must be dismissed.
564
+
565
  3.7 Prepare the final full decision according to the following structure.
566
 
567
+
568
  Output should not have any starting greeting or ending goodbyes.
569
  Prepare the final full decision according to the following structure.
570
  # Judgement
uae_law.py CHANGED
@@ -331,7 +331,7 @@ class Uae_law():
331
  '''
332
  judgement_date = date.today()
333
  gpt_prompt = uae_law_stage_prompts.stage_7_prompt.format(judgement_date=judgement_date)
334
- prompt = self.claimant_facts_and_evidence + self.claim_extracted_text + self.defendant_extracted_text + self.claimant_response_extracted_text + self.defendant_response_extracted_text + self.case_fable + self.stage_6_ideal_model + "\n\nPrompt:" + gpt_prompt
335
 
336
  response = llm.llm_function_call(prompt, "gpt-4-0125-preview")
337
  # response = uae_law_mock_constants.stage_7_final_judgement
 
331
  '''
332
  judgement_date = date.today()
333
  gpt_prompt = uae_law_stage_prompts.stage_7_prompt.format(judgement_date=judgement_date)
334
+ prompt = self.claimant_facts_and_evidence + self.claim_extracted_text + self.defendant_extracted_text + self.claimant_response_extracted_text + self.defendant_response_extracted_text + self.case_fable + self.stage_6_ideal_model + self.legal_norms + "\n\nPrompt:" + gpt_prompt
335
 
336
  response = llm.llm_function_call(prompt, "gpt-4-0125-preview")
337
  # response = uae_law_mock_constants.stage_7_final_judgement