Fuzzy Logic defines membership to each linguistic term in the universe. Here, in legal documents, we can have multiple linguistic terms such as “dowry”, “maintenance”, “term”, “crime”, “separation”, “separated,” and so on. Each entity can be partially associated with a linguistic term, and we can apply fuzzy rules for inference. For example, the following fuzzy rule takes the linguistic variable “separation,” and its membership on a scale of [0,1] is measured,
If “separation” in marriage is high, then divorce is imminent.
This fuzzy rule specifies that if separation in marriage is longer, then divorce can be granted immediately. The time frame can be computed as explained below.
Each linguistic term is associated with membership for the participating universe. For example, the maintenance in a divorce can take values “high”, “medium,” or “low”. On a 0–10 scale, if the judgment describes maintenance as medium, it corresponds to a membership of 5, and the exact amount is computed as 50% of the husband’s salary. Similarly, the fuzzy inference engine can assign lower maintenance, say low, with a score of 3, meaning 30% of the salary is given as maintenance to the wife after divorce.
There are several Fuzzy Inference Engines. The most popular are the Sugeno and Mamdani Fuzzy Inference Engines. To compute results with Fuzzy Expert Inference Engines, we need rules expressed as human-like linguistic variables. The inference engine then computes the results itself; in our case, the judgment. We can provide this to an AI Agent as a tool: a Fuzzy Inference Engine Toolkit that takes a Natural Language Toolkit. We can verify this against outputs generated by LLM-based agents to ensure AI produces the same results; this reduces hallucination in legal systems and adds transparency and explainability through Fuzzy Inference.
So the question in our case is how we determine the Fuzzy Rules? Once we know the fuzzy rules, we can feed inputs from real cases into Fuzzy Expert systems, and the inference mechanism can generate outputs. Fuzzy rules can be generated in the following ways:
i. For each legal article: Convert the article into rules with linguistic terms such as “crime is serious”, “punishment should be high,” and “fine to be moderate”. A legal expert can do this.
ii. Mine association rules with frequent itemset rules of the Apriori algorithm and use an LLM to convert them to if-then rules with linguistic terms.
iii. Use AI Agents to discover rules from law books and precedents, as is the case in a country’s law. Since we are presenting a generic solution for a transparent legal system, we do not solely rely on precedents. However, similar cases can help produce linguistic rules which can work in tandem with AI agents to provide transparency and efficiency.

There may be facts not expressed in the Fuzzy Inference Engine that the LLM can take care of. We can also train LLMs to understand rules that use fuzzy terms as English rules. This may require explicit commands to help the LLM understand linguistic, English-like rules. Also, if humans write the Fuzzy Rules, we can connect the tools in an AI Agent to read those rules. The inference engine can be explicit, based on defuzzification, or implemented via LLM inference; after all, these are English rules, and LLMs can be trained to perform inference instead of Sugeno- or Mamdani-style inference.
Figure 2 shows that once the rules are extracted by AI (or manually or via association rule algorithms), the LLM can run in a loop until a Judge is satisfied. The legal experts are also told which rules were applied and how the LLM and Fuzzy Systems work to determine the outcome of a legal case. In this way, the LLM learns to understand the Fuzzy Inference Engine, and this learning can later support fast-track assessments. LLMs are used in cases where certain parameters are not explicitly expressed with fuzzy linguistic rules, such as when the person involved in the case previously paid a fine. Such factors can’t be expressed by Fuzzy Rules or even by rules manually created by legal experts. Hence, we need an LLM in the loop, and a fuzzy system alone is not sufficient. When a judge approves a result, the new rules are added to the rulebooks if the LLM explores a new rule that was not there before (through either an association rule or a human expert). This continues until a Judge is satisfied. This produces transparency. Use of RAG ensures that all data is factual. This experienced AI Agent can be used to find other inferences, and its learning grows as it solves more cases. This works to compute crime sentencing years to an even amount of fine via defuzzification processes.
This can be illustrated with examples. For example, the term crime can be considered fuzzy when rules are generated by LLM. Its linguistic values can be low crime, average crime, or high crime, as shown in Figure 1. We can also have more refined values. A crime rating of 0.4 indicates low crime with a membership of 0.3 and medium crime with a membership of 0.2. Thus, two rules apply to a crime rating of 0.4: low and medium crime; and vice versa. If the LLM generates a rule with average crime, it can cover memberships from 0.3 through 1. These would be required once we convert the rules to the given punishment, again, a fuzzy linguistic term. These are illustrations and can be modeled with an LLM and/or legal experts.
Fuzzy rules, once extracted with LLM agents until legal professionals are satisfied, are fed into a toolkit such as the Python package “skfuzzy”. This is shown in Figure 2. AI Agents can interact with toolkits as part of their functioning.

In Figure 3, we illustrate a Fuzzy Inference Engine that can determine the amount of punishment, fine, or maintenance to be awarded in a divorce settlement. Here, wife_income and husband_income are the inputs, and the output is the maintenance amount in a divorce settlement. The outputs are computed with the help of the “ControlSystem” tool from the above Python package.

The output is converted from a fuzzy set to a real number so that the maintenance amount can be computed in dollars or the currency of the country.
Further, the outputs from Fuzzy Inference are not always sufficient. At times, such as in a crime case, a portion of the fine has already been paid and needs to be subtracted from the new amount generated by this hybrid LLM-Fuzzy model. The LLM Agent can compute this and loop again to provide a new ruling. A lawyer and judge can allow looping until they are satisfied with the results.
In this note, we present a Fuzzy System based on LLM Agents (LLM-Fuzzy model). In the first phase, the system derives rules using natural-language linguistic terms; in the second, it determines which rules apply to a user case. The LLM agent then runs in a loop until the Judge is satisfied. The LLM presents any new rules it generates to the Judge for addition to the rule book, and then presents the ruling, transparently, to the people involved. This works to compute crime sentencing years to an even amount of fine via defuzzification processes. Hence, the novelty of this note is a linguistic Fuzzy-LLM agent and its application to legal procedures.
Thank you for reading.
Subscribe for updates.