The Algorithm of Islamic Jurisprudence (Fiqh) with Validation of an Entscheidungsproblem
Paper · 2016 · Elnaserledinellah Mahmood Abdelwahab, Karim Daghbouche and Nadra Ahmad Shannan
Summary
A ruling in Islamic jurisprudence can depend on what someone did, why they did it, what they used, and what happened afterwards. Finding that ruling in a work organized by subject can require knowing in advance which details matter. This paper asks whether a person could describe a case in a structured way and have a program identify a ruling and explain how it follows. The authors approach Islamic jurisprudence, or Fiqh, as a body of legal reasoning that can be examined with formal logic. They also ask a broader question. Under what conditions could a procedure settle whether a formalized body of law gives a ruling for every question it admits and supplies a reason for each ruling?
The approach begins by separating jobs that a jurist ordinarily does together. Someone has to identify and authenticate the relevant sources, interpret their language, and decide which features of a case are legally relevant. Once those choices have been encoded, a program can apply explicit rules of deduction. The authors use terminology trees to organize the possible descriptions of a case, then combine terms to generate questions. They inspect the resulting possibilities for recurring patterns and express those patterns as rules. Simple questions go to a rule engine. For compound questions, where the order of actions matters, a finite-state automaton updates the status of the case as each action is entered.
The practical work concerns the Shafi'i chapter on ritual purification. The trees give a potential question count of 15G for tayammum and 2000G for the whole Tahara book, where G denotes billions of questions. These are counts of possible combinations at different scopes. The authors use them to explain why they sought rules that could stand in for many individual entries. They report conceptual prototypes for simple and compound tayammum questions and for compound wudu questions. The simple tayammum prototype matches structured inputs to propositional rules, and the compound wudu prototype checks the progress of an ordered sequence. The paper describes what these systems do and gives examples of their rules and outputs.
The formal result is conditional. The authors argue that if the chosen logic is complete and decidable, and if it can express the legislation and its coverage requirements, then those requirements can be made into questions for a decision procedure. Their examples show how to expose an unstated premise, turn a practical exception into an explicit rule, and locate a secondary ruling whose general basis remains unidentified. Together, these demonstrations explain what formalization can make inspectable. The coverage of Islamic jurisprudence as a whole remains an objective, and the purification prototypes show what it takes to pursue it in a limited setting.
Deep dive: The Algorithm of Islamic Jurisprudence (Fiqh) with Validation of an Entscheidungsproblem
The paper turns Islamic jurisprudence into formal rules and tests the approach with prototypes for ritual purification questions. · about 38 minutes to read
The problem and its context
Why a question is harder to find than a chapter
A reader may know what happened and still have difficulty locating the relevant ruling. The paper describes traditional works of Fiqh as collections of detailed questions arranged by subject. For a specialist, an arrangement of this kind reflects established distinctions. For someone approaching a book with a practical problem, the decisive feature of a case may be the very thing they need the book to tell them. Looking in the right place can therefore require some of the knowledge that the lookup is supposed to provide.
The authors connect their proposal to Al-Zuhayli's call to reorganize Fiqh for contemporary readers. He envisages a presentation in articles and paragraphs that judges, lawyers, and ordinary readers can consult more readily. The paper takes that concern into Legal AI by asking what an organization around possible questions would involve. A question could be reached through its subject, the means used, the reason for the act, or the way the act was performed. Terms distributed across traditional headings could participate in a common description. Someone looking up a case could supply its features before learning which ones control the ruling.
Reorganization serves the research question as well as the reader. A book can give rulings for a large collection of examples while leaving the scope of each rule difficult to establish. If the same body of material is represented as a space of possible questions, a jurist can examine which questions have an applicable rule, where rules overlap, and which decisions still require a separate explanation. The authors view access and scrutiny as connected. A person who sees how an answer was reached can inspect the premises on which it depends. A specialist can check whether the premises and rules used for one case also work for others.
The paper places this ambition in a historical account of calculation in jurisprudence. It traces the word algorithm to Al-Khwarizmi and discusses his algebra in connection with practical problems of inheritance, transactions, and related matters. The authors emphasize the use of reproducible procedures in those examples. In their account, the legal examples can be reduced to linear equations even though the algebraic work also develops methods for quadratic problems. The present proposal changes the scope of the exercise. Its starting point is a claim about all Fiqh questions, with computational treatment of selected purification cases serving as an initial investigation of what such scope would require.
How the paper describes earlier legal reasoning
The historical account distinguishes an early period of practice from a later period of systematic study. The companions of the Prophet, as the paper describes them, could draw on familiarity with the circumstances of revelation and with his practice. As temporal distance grew and the community became more diverse, jurists developed more explicit ways to interpret sources and justify judgments. The authors discuss the Quran and the Sunnah, the latter covering the Prophet's example and guidance. They also discuss ijma', understood in the paper as communal unanimity, and ijtihad, the exercise of scholarly judgment in reaching a ruling.
The paper describes several ways scholarly discretion operated. Some rulings involved interpretation of the Quran or Sunnah. Others extended the reasoning of an established case by analogy. Still others involved judgment without a specific text for the question. The authors concentrate on analogy, or qiyas, because it offers a particularly revealing point of contact with deduction. A jurist takes a ruling established for a primary case, identifies its legally operative reason, and asks whether the reason also governs a secondary case.
The legitimacy of analogy was itself disputed in the account the paper gives. The authors describe jurists who saw no suitable role for the logical approaches associated with analogy and others who defended analogical reasoning by appealing to the sources. The paper discusses Al-Shafi'i's Al-Risalah and Al-Ghazali's Al-Mustasfa in this setting. It also notes the use of syllogistic forms by scholars of Fiqh. These forms made particular patterns of inference explicit and gave jurists a way to examine when the conclusion followed from the stated premises. The debate over which premises and forms should be admitted remained a jurisprudential one.
This matters for the computational proposal because the term analogy can conceal several decisions. The jurist has to establish the first ruling, identify what makes it apply, then determine whether the relevant feature occurs in the second case. The formal expression can make the last step inspectable once those decisions are available. The authors give the example of reasoning from a prohibition on speaking hurtfully to one's parents to a prohibition on striking them. The example relies on an assessment of the reason behind the first ruling and the significance of harm in the second case. An inference rule has something to operate on once those judgments have been expressed.
Where language, sources, and deduction enter
The authors distinguish a language question, a source question, and a logical question. A language question concerns what an expression means. A source question concerns the search for and authentication of a ruling or its evidential basis. A logical question concerns what follows from stated claims. An analysis can involve all of these. Words may establish what a source appears to require, jurisprudential work establishes the status and relevance of the source, and deduction checks the consequences of the resulting premises. The distinction gives the reader a way to tell where a disagreement enters the calculation.
Consider a source phrased as a command to pray regularly. One methodological issue is whether the imperative is to be treated as binding or as advice. Once the jurist adopts the general rule that an imperative signifies an obligation and classifies the expression as an imperative, an obligation to pray is the resulting ruling in the authors' example. The reasoning contains a general interpretive premise and an identification of what this particular text directs. Encoding the conclusion by itself would conceal both. Encoding the interpretive rule makes it possible to examine how the same premise affects other cases.
The authors also examine the relation between general language and a specially described case. In one example they discuss, passages about expiation for zihar and for manslaughter both refer to freeing an enslaved person, while the passage about manslaughter specifies a religious qualification. The paper recounts an argument for carrying the qualification over to the first case because the jurists concerned identified a shared reason. The argument makes scope a practical issue. A property can be present in the wording of one source and enter the ruling of another case through an additional premise about the relation between them.
Timing raises a different problem. The paper discusses an event that invalidates ablution. Before prayer it can prevent the person from beginning in the required state. During prayer it can bring an act already in progress to an end and invalidate it. The legally relevant event is recognizable in both cases, while the stage at which it occurs changes what follows. This is one reason a collection of individual facts has to be supplemented with a representation of sequence when the authors move from single acts to compound questions.
Rules for interpreting evidence and rules for deciding cases
The paper distinguishes usul al-Fiqh, the methodology of jurisprudence, from practical Fiqh rules. An usul rule can establish what counts as evidence, how evidence is to be interpreted or weighed, or who is qualified to exercise a particular kind of judgment. A practical rule applies to cases and their details. Some practical rules recur across chapters. Others describe conditions and exceptions within a specific subject. For computational purposes, the authors give the usul rules the role of axioms and use practical rules to work out how those axioms bear on particular cases.
The authors describe scholarship that proceeded from general principles toward individual rulings, as well as scholarship that studied the rulings of earlier jurists and worked back toward general principles. In the latter approach, a proposed rule could be revised if it conflicted with established cases. A particular case could also be recorded as an exception. The paper finds this history relevant because its own procedure likewise moves in both directions. It applies explicit rules to detailed questions, and it studies individual questions to see whether a recurring rule can be formulated.
The genres were frequently intermingled in the books the authors discuss. A maxim about customary practice, for example, might bear on the interpretation of evidence and also supply a basis for decisions about particular conduct. General rules could be listed with practical maxims and criteria, with their supporting evidence left unstated. The proposed distinction is a formal arrangement for making these dependencies visible. It gives someone investigating a ruling a place to ask whether the governing premise comes from an interpretive axiom, a practical rule, or a case-specific exception.
The computer science problem follows from that arrangement. If the task is to apply an existing rule to one specified case, the system can substitute the relevant terms and check the stated conditions. If the task is to establish that a set of rules can settle the questions of a whole chapter, the system needs a definition of the questions it admits, a way to represent the rulings and their reasons, and a procedure that can determine whether the formal coverage claims hold. The paper's title refers to this last problem as an Entscheidungsproblem, or decision problem.
The method, step by step
Begin with a description the procedure can use
A simple question in the authors' design has a subject, a tool, a reason, and a method. The subject is who or what performs the act. The tool is the means used, such as a kind of water. The reason is the circumstance that makes the act relevant. The method is how the act was performed. One example concerns a person performing wudu, or ablution, with water previously used to remove a lesser impurity. The earlier use of the water belongs in the description because the applicable rules may treat it as significant.
The top-level elements have their own vocabulary. A subject, for example, may be described by physical features, religious affiliation, relevant properties, and actions. Any such category can have more specific terms, and a term selected for one element can affect the significance of a term selected for another. The authors use trees to organize these refinements. Choosing a narrower branch adds detail that can differentiate cases for which a broader description would be insufficient. The paper illustrates the structure with terms for a Shafi'i subchapter on tayammum, a form of ritual purification discussed in relation to the availability of water.
The authors call the advance differentiation of terms pre-differentiation. In practical terms, it means deciding which distinctions will be available before a user submits the case. The terminology is constrained by the sources and the way the chapter is being formalized. A question assembled in this vocabulary can be compared with formal rules because subject, means, circumstance, and action already have defined roles. Judgments about which terms to offer, how to group them, and which source distinctions they express go into building the question space.
The paper depicts the sources and adopted rules on one side of the procedure and facts about specific cases and generated verdicts on the other. The source and rule side supplies relatively stable premises. The individual case supplies the features that vary. Selecting a term changes the facts submitted for a case while leaving the governing rule available for the next query. The vocabulary connects the two sides. It expresses the user's case in the same terms in which the rule states its conditions.
From terminology trees to rulings on purification questions
The steps in order.
Generate possibilities and look for recurring decisions
The first pass through the trees is combinatorial. Terms selected from different branches are brought together to produce possible questions. A deeper tree can express a more detailed case, and it can also increase the number of combinations that must be considered. A combination can be easy to produce and still give an unusable case. The paper gives examples such as a baby performing ablution and a tayammum description with no valid reason supplied. Such entries teach the system builder where an exclusion can remove a recurring kind of case.
The authors describe generation in terms of a truth table. Each candidate question is a case for which the applicable outcome can be inspected. The table gives the rule author somewhere to look for sets of entries that share a feature and an outcome. If many entries fail because they lack a required circumstance, one rule can represent that dependency. Entries that share the same accepted treatment can also be grouped. Thus the table describes cases at the level of individual combinations, and a rule describes the decision at the level of a feature that cuts across them.
The practical work of abstracting rules is manual. The authors discuss negative rules, which exclude a possibility or establish invalidity, and positive rules, which express when something is sufficient or can be accepted. In describing the algorithm, they propose excluding null cases and obtaining positive possibilities from complements as needed. In their examples, they also state positive rules with an explicit jurisprudential basis. A candidate that survives a particular exclusion has passed that check. A substantive positive ruling may still require a reason and may depend on other conditions in the chapter.
A recurring outcome then becomes an object of source investigation. The authors consult Al-Suyuti's work for applicable Fiqh rules and compare practical patterns with more general maxims. For example, they give the invalidation of tayammum when water becomes available as an instance of a wider principle about a concession ending when its basis ends. They also encounter practical rules for which they report finding no general source rule in their investigation. The exercise therefore produces both rules that can be used for answering and questions about how the rules themselves are justified.
This is the paper's data procedure. The cases are generated from terminology constructed for the chapter. Their grouping and interpretation depend on jurisprudential work, including the inspection of the combinations and a search for relevant rules. The method has a direction from vocabulary to cases and from cases back to abstractions. The direction matters because the abstract rule can then answer further structured questions, while the cases make it possible to inspect what the abstraction is meant to cover.
Put the language of the rule on paper
The authors introduce a formal language using a set of statement symbols, QLn, a set of connectives, Qc, a set of variables, Qv, and a set of rules, Qg. A grammar, Gmr, says which combinations make well-formed sentences. QLn was introduced earlier for language questions. In the formal discussion it serves as the inventory from which statement symbols are drawn. The authors also use Sm for the unrestricted space of strings obtainable from the component sets. Even a finite inventory can give endlessly many candidate strings if repetition and nesting are unrestricted.
An example of a grammatical pattern is:
QLn × Qc × QLn
QLn is the set of statement symbols, and Qc is the set of connectives. The symbol × denotes a Cartesian product, so a member of this pattern consists of a statement symbol, a connective, and a statement symbol in that order. The repeated QLn means that both statement positions draw from the same set. The pattern belongs to Gmr, the grammar describing accepted structures.
The authors also illustrate how a grammar might admit expressions built from components that already have this structure:
(QLn × Qc × QLn) × Qc × (QLn × Qc × QLn)
Each parenthesized component contains statement symbols from QLn joined by a connective from Qc. The central Qc supplies an additional connective between those components. The × signs again specify the ordered choice of elements from the indicated sets. The parentheses group the components. This description concerns the structure of an admissible expression. A further question is whether the expression follows from the premises or holds under a given interpretation.
The paper distinguishes axioms of the underlying logic from the axioms and practical rules of the legal theory being processed. It uses Qg for the latter in the subsequent illustrations. The distinction lets the authors ask which features belong to the general apparatus of inference and which come from the Fiqh theory. An inference procedure can stay fixed as rules from another chapter are supplied. The assumptions behind a ruling can then be examined as assumptions of that particular legal representation.
Work through the analogy about retreat, prayer, and fasting
The authors illustrate inverse analogy with I’tikaf, a religious retreat, and a dispute over whether fasting is a condition of its validity. Their account distinguishes fasting when it was pledged from fasting without a pledge. They report agreement over the requirement in the pledged case, and different conclusions from Abu Hanifa and Al-Shafi'i concerning fasting without a pledge. Prayer provides the primary case in the analogy they analyze. The aim is to make clear which claims about prayer and pledging would be needed to reach a conclusion about fasting.
The paper first gives an abstract pattern for inverse analogy. With grouping made explicit, its scheme reads:
(Fs_primary ↔ R_primary) ⇔ (Inverse(Fs_secondary) ↔ Inverse(R_secondary))
Fs_primary denotes the primary-case statement associated with the ruling, and R_primary denotes its reason. Fs_secondary and R_secondary are the corresponding statements for the secondary case. The underscores attach case labels to the symbols. The operator Inverse marks the reversal of the designated statement in the paper's analogy. The inner arrows ↔ express equivalence, with the reason serving as a necessary and sufficient condition for the ruling. The outer ⇔ connects the two equivalences in the proposed analogy scheme. The parentheses group the expressions and delimit the input to Inverse.
The authors consider an analogy direct when the ruling for the secondary case goes in the same direction as the primary ruling. In the inverse form, a reversal of the reason is associated with a reversal of the ruling. The use of an equivalence is important to their explanation. A condition that merely suffices to reach a ruling leaves open the possibility that the ruling can hold for another reason. Reversing such a condition would therefore leave a question about those other routes. The scheme explicitly asks for a stronger connection between the reason and the result.
In the retreat example the paper reuses Fs with a more specific meaning, the performance of I’tikaf. Pgv stands for a pledge made in advance, Fv for fasting during the retreat, and Prv for prayer maintained during it. The pledged-fasting premise can be set out on its own:
(Fs ∧ Pgv) → Fv
Fs denotes performance of I’tikaf, Pgv denotes the prior pledge, and Fv denotes observance of fasting during the retreat. The conjunction ∧ joins Fs and Pgv, and the parentheses mark their joint role as the antecedent. The arrow → expresses implication. In the legal reading of the example, fasting is required for the case described by performance of the retreat together with the pledge.
The disputed target is broader:
Fs → Fv
Fs again stands for performance of I’tikaf, Fv stands for fasting, and → presents fasting as a condition attached to the retreat. Pgv is absent from the antecedent, so the claim reaches the case without a pledge as well. The example shows why the author of a rule has to make its scope visible. The pledged premise states what happens under a designated condition. A conclusion about the act in general requires a basis that reaches the other case.
In their discussion of prayer, the authors call attention to the need to consider both pledge statuses. They express the intended paired negative claims as follows, using Pgv consistently for the pledge:
Inverse((Fs ∧ Pgv) → Prv) ∧ Inverse((Fs ∧ Inverse(Pgv)) → Prv)
Fs denotes I’tikaf, Pgv a pledge, and Prv prayer during the retreat. An inner ∧ joins the retreat with the relevant pledge status, and the central ∧ combines the claims about the two situations. Each → marks the proposed conditional requirement of prayer. Inverse on Pgv denotes the absence of the pledge. Applied to a whole arrow expression, Inverse is the authors' notation for reversing the claim that prayer is required in the indicated situation. The parentheses identify which expressions each connective or operator governs.
The paper then writes a general form that can be specialized to fasting or prayer:
(((Fs ∧ Pgv) → X) ∨ ((Fs ∧ Inverse(Pgv)) → X)) ↔ (Fs → X)
Fs stands for the retreat, and Pgv marks the pledge. Inverse(Pgv) refers to the opposite pledge status. X is a variable for the action being considered, with Fv and Prv as the intended substitutions in the example. The ∧ signs combine circumstances, each → marks a conditional association, and ∨ is the disjunction printed in the paper's positive form. The outer ↔ expresses the proposed equivalence between the left-hand conditions and the general statement on the right. Parentheses govern the grouping.
The disjunction needs care. The authors describe the verbal requirement in terms of the pledged and unpledged situations both being covered. With ordinary material implication, a conditional with a false antecedent is true. In a disjunction between the conditionals for opposite pledge statuses, one of those antecedents is false under either status. That disjunction cannot do the work of verifying both cases. The paper itself identifies the gap in moving from the pledged-fasting premise to the broader conclusion. Its discussion exposes the scope problem more clearly than the displayed positive equivalence resolves it.
The authors use a distinct notation for the outcome of a deduction:
♦Qg (Fs → Fv)
The diamond ♦ marks syntactic derivation, and Qg identifies the set of Fiqh rules under which the derivation is claimed. Fs denotes I’tikaf, Fv denotes fasting, and → is the implication expressing the disputed requirement. The parentheses enclose the conclusion. The notation records the authors' claim about its derivation under the chosen rules. It also gives the reader a precise place to ask whether those rules, including the interpretation of the inverse scheme, support the result.
Keep admissible substitutions and truth assignments separate
A detailed sentence, in the authors' vocabulary, is one whose placeholders have already been filled. A general sentence contains a variable such as X. In the retreat example the distinction has a practical consequence. The general expression is intended to admit prayer or fasting as substitutions. Applying it indiscriminately to every symbol in the vocabulary would also let the retreat itself fill the position for the action under consideration. The ensuing statement about I’tikaf being its own prerequisite illustrates what can happen when a grammatical substitution falls outside the rule's intended use.
The authors introduce SymG for the interpretation that gives the predicates truth values and VV for the assignment of admissible values to variables. The first can represent a case in which a person performed the retreat, made a pledge, prayed, and fasted. The second says which action may occupy X when the general expression is evaluated. Instantiating a variable and identifying whether the resulting predicates are true are distinct operations. One determines what the sentence is asking about, and the other determines its truth in a particular described situation.
The paper uses the following notation for an assignment under which a sentence holds:
(SymG, VV) ♥ Sen
SymG supplies the interpretation of the predicates. VV gives the admissible variable assignments being considered. The comma separates these parts of the pair, and the parentheses group them. Sen denotes the sentence under evaluation. The heart ♥ indicates that the pair makes Sen true. The paper calls a sentence valid when it holds for every permitted pair. One particular true instance establishes a narrower fact about the expression.
The paper also considers a sentence that ranges over supposedly true sentences and declares them false. Allowing the sentence to range over a collection that includes itself creates the circularity the authors want to avoid. They suggest a hierarchy under which statements can concern expressions at a preceding level. In the practical example, the immediate safeguard is the controlled assignment of terms to variables. In the broader discussion, the hierarchy shows why extending a query language to make statements about its own sentences would require additional care.
In its informal account of correctness and completeness, the paper sets syntactic derivation beside truth under an interpretation. Its displayed condition for correctness can be rendered as:
♦Qg M ⇒ ∃(SymG, VV) : (SymG, VV) ♥ M
Qg is the set of rules and M is the sentence being considered. The diamond ♦ marks derivability using those rules. The arrow ⇒ connects the two claims at the level of the discussion about the formal system. The quantifier ∃ means that a pair exists, and the colon introduces the property of that pair. SymG and VV are the predicate interpretation and variable assignment, grouped with parentheses and separated by a comma. The heart ♥ says that the pair makes M true.
The paper presents the other direction in this form:
(SymG, VV) ♥ M ⇒ ∃Qg : ♦Qg M
The paired SymG and VV again specify how to evaluate predicates and variables, ♥ says that M is true under the pair, and M denotes the sentence. The arrow ⇒ links that claim to the existence of a Qg, the set of sentences used as rules. The symbol ∃ expresses existence, the colon introduces the condition on Qg, and ♦ marks derivability. These displays preserve the paper's informal use of existence. In particular, the first asks for a satisfying pair, and the second allows the set of rules to be selected. Their quantification matters when assessing how much the formal result establishes.
Choose the logic and express the coverage questions
The authors relate the notation to traditional syllogistic logic, which they denote S. The forms discussed in the paper quantify over individuals described by predicates. In readable notation, the universal affirmative form is:
∀x (p(x) → q(x))
The symbol ∀ means for every, and x ranges over individuals. The expressions p(x) and q(x) say that x has property p and property q, respectively. The arrow → expresses implication and the parentheses give its scope under the quantifier. The sentence says that every individual with the first property also has the second.
The existential affirmative form has the following reading:
∃x (p(x) ∧ q(x))
The quantifier ∃ asserts the existence of an individual x. The predicates p and q each apply to that same x. The connective ∧ requires both predications, and the parentheses group what the individual has to satisfy. This expresses that the groups picked out by the predicates have a member in common.
The universal negative form reads:
∀x (p(x) → ¬q(x))
The quantifier ∀ again ranges over every individual x. The expressions p(x) and q(x) apply p and q to that individual. The arrow → connects the first predication to the second, and ¬ negates q(x). The parentheses delimit the expression within the quantifier. The rule excludes any individual with p from also having q.
The particular negative form reads:
∃x (p(x) ∧ ¬q(x))
Here ∃ says there exists an individual x, p(x) attributes the first property to that individual, and q(x) attributes the second. The symbol ¬ negates q(x). The conjunction ∧ requires both p(x) and the negated predication to hold of the same x, with parentheses grouping the scope of the quantifier. The sentence states that at least one member of the first group falls outside the second.
These forms use predicates of a single individual and illustrate the kind of quantified reasoning the authors associate with earlier practice. The paper mentions several possible restricted logics and calls for a study of their adequacy for Fiqh. For the practical and complexity discussion it adopts propositional logic. A proposition in this setting is a statement evaluated as true or false. A rule links such statements using connectives. The vocabulary and the way a case is structured handle much of the detail that a more expressive logic might represent within formulas.
For the legislation-level discussion, the authors use SF for the set of Fiqh questions, QR for the set of rulings, and QE for the set of reasons. Their statement vocabulary combines symbols from all these categories:
QLn ≡ QE ∪ SF ∪ QR
QLn is the statement vocabulary. QE supplies the reason predicates, SF supplies the question predicates, and QR supplies the ruling predicates. The union sign ∪ puts the inventories together, and ≡ identifies the combined inventory with QLn. SF has a broader role here than in the earlier classification of source questions. It stands for the cases whose coverage is being considered.
The legislative coverage claim can be written in restricted quantifier notation:
∀M ∈ SF, ∃R ∈ QR : (M → R)
The quantifier ∀ ranges over every question M, and the membership sign ∈ restricts M to SF, the set of questions. The existential quantifier ∃ calls for a ruling R from QR, the set of rulings. The comma separates the two quantified parts, and the colon introduces the required relation. The expression M → R is the authors' representation of the question leading to the ruling, with parentheses grouping the implication. The claim depends on the scope of SF and on how the implication is understood as expressing applicability.
The reason requirement is:
∀M ∈ SF, ∀R ∈ QR : ((M → R) → ∃E ∈ QE : (E → R))
M ranges over the questions in SF and R over the rulings in QR, as indicated by ∀ and the membership sign ∈. The comma separates the quantified variables. E is a reason from QE, and ∃ says that such a reason has to exist when the condition holds. The colons introduce the respective conditions, and the parentheses group the arrows. M → R represents the ruling for the case, the encompassing → makes that relation the premise of the reason requirement, and E → R expresses the connection between the reason and the ruling. The paper calls this requirement consistency of legislation. Here the term concerns the availability of a reason.
The authors' decision proposition is conditional on a choice of logic in which the coverage and reason requirements can be expressed and decided. A decision procedure must terminate with a yes or no for inputs of the kind it is designed to decide. The authors distinguish that property from completeness. When discussing legislation, they use completeness for coverage by rulings. When discussing logic, they use it for a relation between what the system can derive and what holds under its semantics. A program that stops on every query still needs an adequately defined legal theory and question space to make its answers meaningful.
Apply rules to a case or follow a sequence
The simple tayammum implementation uses a restricted compiler for the authors' propositional rule format, written in Visual Basic. A structured query is compared with the conditions encoded in the rules. The matching rule supplies a result that the interface can explain. The user enters a particular configuration of terms, so the work of generating that query and finding its outcome can use the already abstracted rules. The run-time process is the last step in a larger procedure that has already established the terminology and examined the candidate cases.
For a compound question, the paper uses the example of a person performing ablution, then urinating, then washing, then performing ablution again. The status after one action affects what the next action means for the case. A finite-state automaton represents this progression by storing a current state and using each new action to select a transition. An action may advance the procedure or change its validity. The state therefore summarizes what matters about the sequence for the next decision.
In the Shafi'i wudu example, the authors treat intention, the specified washing and wiping actions, and their order as obligatory features of a valid progression. The interface has buttons for the individual actions. As the user enters one, the automaton changes state and can advise the user when a required action has been skipped or placed out of order. The authors describe this automaton as deterministic, meaning that its encoded state and the next input determine the transition. They link the particular design to the place of order in the Shafi'i rules and discuss a different treatment of order in the Hanafi school.
Experiments and results
What was built and what was counted
The empirical material is the authors' practical formalization of parts of the Shafi'i Tahara book, which concerns ritual purification. The paper describes terminology trees, individual case descriptions, practical rules formed from recurring judgments, and prototypes that accept user inputs. It treats tayammum and wudu as the subchapters used for the prototype work. Both simple and compound tayammum procedures were realized in conceptual prototype form. For wudu the authors implemented the compound procedure. The detailed implementation discussion follows simple tayammum and compound wudu.
The most prominent quantitative results describe the size of the candidate space. For Shafi'i tayammum the authors report 15G possible questions, also expressed as 15 Billion questions. For the whole Tahara book they give 2000G potential questions. The metric is the number of combinations yielded by the terms at each scope. The tayammum figure belongs to the subchapter trees. The Tahara figure belongs to the broader book. These counts establish the scale of the representation before practical exclusions and rule compression are taken into account.
Potential question counts in the Shafi'i Tahara terminology trees
The focused tayammum setting has a smaller candidate space than the whole purification book.
The numbers
| System or setting | G potential questions |
|---|---|
| Whole Tahara book | 2000 |
| Tayammum subchapter prototype scope (this paper) | 15 |
The lower count represents a smaller candidate enumeration workload for the narrower scope. The chart compares the scope of the terms, so the difference reflects what is included in each setting. It gives no measure of how many valid user queries the compiler matched or how often an explanation was judged adequate. It also leaves open how many entries remain after the practical rules are applied. Those would be separate quantities from the unpruned potential counts.
What the rule analysis produced
The paper reports 12 applicable Fiqh rules from the practical exercise, divided into negative and positive groups. Some apply across chapter boundaries. The rules listed in the paper show several kinds of generalization. In one, the disappearance of a circumstance that justified tayammum brings the concession to an end. In another, the authors relate restrictions on ways of removing impurity to wider rules about what is allowed under necessity. They also describe a timing restriction for tayammum undertaken for an obligatory prayer and trace it through a rule discussed by Al-Suyuti.
Several negative examples have no primary rule identified in the authors' presentation. They include a restriction on using previously used water and the invalidation of an earlier ablution when a condition involving incontinence ends. These are reported as secondary rules in the analysis. Their entries reveal separate questions for the formal system and for the scholar. A practical rule can assign an outcome to a structured query. The provenance of that ruling still has to be examined if the goal is to know why the rule belongs in the theory.
The positive examples show how a rule can combine requirements. The paper describes circumstances in which ghusl, a full ablution, is sufficient for overlapping purification needs. The authors associate these cases with a wider rule about combining acts of a common kind when their purpose coincides. They also give an example in which the greater purification requirement takes precedence over a separate requirement for wudu. What has been encoded is a relationship between the conditions and the actions needed to satisfy them. A list of isolated verdicts would leave that relationship implicit.
This part of the result illustrates the point of inspecting generated cases. A repeated decision can be expressed once, with conditions that say where it applies. A secondary rule can be linked to a more general one, or entered as an exception where the paper finds that treatment appropriate. Those outcomes are qualitative. The authors do not report the proportion of candidate entries covered by the 12 rules, how many entries needed individual treatment, or the size of the rule set relative to a completed lookup representation for the whole book.
What the prototypes demonstrate
For the simple tayammum procedure, the paper reports a truth table intended to contain the questions generated for the subchapter and a manual reduction to rule sets used by its logical engine. The Visual Basic compiler processes propositional rules and matches them to a question. The reported output includes an explanation, making it possible in principle to inspect the rule that produced a decision. The demonstration concerns cases expressed through the chosen structure and vocabulary.
For the compound wudu procedure, the paper describes an interface with inputs for actions and an automaton that applies the ordering rules. The user advances the case by entering another action. Because the state tracks progress, the program can identify a missing stage or an action supplied at the wrong point. The authors also report that the compound tayammum implementation includes a treatment of invalidation after subsequent actions or events. Their discussion gives more implementation detail for the wudu progression than for the later invalidation component.
The user interface was implemented in Arabic. The authors explain their choice in terms of the need for agreement on translated jurisprudential terms. That is a material setting for the demonstration because the interface uses an intentionally controlled terminology. Changing the wording can involve deciding whether a translated expression preserves the distinctions on which the rules operate. The paper describes an Arabic prototype and treats wider translation as part of the future work.
There is no conventional benchmark with training and test splits, and the paper gives no competing system evaluated on the same questions. The comparison with a chapter arranged for conventional lookup motivates the change in representation. The truth table, in turn, is the conceptual representation the rule sets are meant to compress. Neither serves as a baseline with independently measured accuracy or execution time. The results available for comparison are the potential question counts, the practical rule extraction, and the differing functionality demonstrated by the prototypes.
What the complexity claims measure
The paper analyzes the cost of two tasks in the chosen propositional setting. Proposition 4 concerns substituting values into an existing general formula to get a detailed statement. It describes this task as polynomial in formula length and gives a linear traversal of the formula as the reason. The operation assumes that the existing rule and the admissible substitutions are already available. Its input size is the length of the formula being instantiated.
Proposition 5 concerns deriving general statements from a mix of general and detailed statements. The authors describe that task as NP-Complete by connecting it to Boolean satisfiability, the question of whether some assignment makes a propositional expression true. This is a theoretical classification as stated by the authors. The paper supplies neither timings for this task nor a measured comparison between a satisfiability procedure and the manual process of abstracting rules from purification cases.
This contrast between tasks explains the workflow the paper adopts. Applying a known rule requires filling and evaluating its conditions for the query at hand. Formulating a rule that captures a broad regularity raises a different search problem. The cases, the terminology, and the general jurisprudential principles supply information that a rule author uses to guide that search. The cost estimate for substitution describes one part of answering a query after that preparatory work has taken place.
What the ablations show
The paper reports no ablations or controlled performance comparisons and offers instead a scope analysis of the fasting analogy, an inspection of positive and negative purification rules, and a theoretical comparison of applying a rule with deriving a general one.
The fasting example makes the effect of a premise visible. The condition concerning a pledge appears in the premise and disappears from the general conclusion. Once the case with a pledge is isolated in the notation, the reader can ask what establishes the ruling for the case without one. The authors add a treatment of opposing pledge statuses on the prayer side of the analogy. The proposed positive formula then presents a further issue about how the two statuses are joined. This is a useful distinction within the analysis itself. Exposing a missing condition makes the problem easier to locate, and the final derivation still depends on what the added premise actually establishes.
The purification analysis moves between a decision for a case and the general justification claimed for it. In examples such as the return of water after tayammum, the authors are able to pair a practical rule with a more general principle that explains the decision. Other outcomes are listed without a primary rule identified. That difference shows what the method can surface for review. The authors interpret the gaps as possible omissions in the traditional account of the reasoning, subject to further investigation. The exercise establishes that the general basis was unidentified in their analysis.
The comparison of detailed and general deduction identifies where the inexpensive operation sits. Substitution presupposes that a suitable expression has already been chosen and its variables have admissible values. Candidate generation and abstraction are ways the authors investigate rules for which that preparatory work is still necessary. The paper's analysis therefore supports a distinction between the computational operation used to process a prepared rule and the larger effort of constructing a body of rules with meaningful coverage.
The wudu example adds a comparison at the level of legal requirements. In the sequence described for the Shafi'i school, order is part of the validity criterion. The paper observes that the Hanafi treatment does not impose that same ordering obligation. This difference changes what the automaton must check. The example shows why the choice of school enters the specification of the procedure, alongside the actions and the conditions used to describe the case.
Limitations
Limits the authors identify
The authors present their implementations as conceptual prototypes and call for a study of which logic best suits Fiqh. Traditional syllogistic forms and propositional calculus appear in the paper, and the practical development uses a restricted propositional rule format. The authors leave open whether a tailored formal system could preserve the relevant distinctions more effectively. They also identify refinement of usul and Fiqh rule definitions as future work. The question of which claims can be expressed adequately is therefore part of the research agenda.
The authors recognize that the rule abstractions may leave individual questions uncovered. A truth table supplies a way of enumerating candidate entries, and the abstraction aims to capture those entries in practical rules. The paper explicitly allows for cases that fit neither a positive nor a negative category of the abstraction. The terminology can therefore support coverage at the level of expressible combinations before the rulings have achieved coverage at the level of decisions. The authors include completion for chapters and subchapters among their objectives.
They also treat the absence of a known primary rule as a finding that needs confirmation. A reported gap may indicate that a source has left some reasoning implicit or that a wider investigation is needed to identify the reason. The authors propose revisiting the basis of such cases and examining the relation between specific rulings and the claimed principles behind them. They describe the extraction of rules as an aid to scholars engaged in this work.
The terminology restricts where the software can operate. The authors describe the legal expressions in the Arabic interface as requiring agreement before corresponding interfaces can be built in other languages. They place multilingual access, support across schools, and fuller automation of analogy among their future objectives. They also identify the study of current and future cases as work that remains. Each objective involves revisiting the content of the rules and terms as well as the mechanics of the interface.
The practical scope also matters to the wider aims the paper states. The authors connect explicit rules and premises with transparency, accountability, legal equality, and legal security. Their experiments illustrate how a system could make the basis for particular decisions more inspectable. Institution-wide legal consequences are aspirations in the paper. The prototype work concentrates on expressing selected decisions and exposing parts of their reasoning.
Limits visible in the formal setup
The decision proposition depends on the relation between two languages. A logic may offer a decision procedure for its own formulas. The legislative claim also quantifies over questions, rulings, and reasons. To use that procedure for the claim, a formalization has to specify how those collections and the relevant coverage relation are represented. The paper outlines a vocabulary and a grammar and states the condition on the logic. It leaves the full translation of the jurisprudential corpus and both legislative requirements into an executable decision problem for further work.
There is also a difference between material implication and an applicable ruling. In the paper's notation, a ruling is represented by an implication from a case to a result. Under material implication, the formula can hold whenever its antecedent is false. A coverage check that is intended to produce a ruling for a case needs a way to establish that the case is admitted and that a rule can be applied to it. The practical query procedure addresses this by starting with specific entered features and matching them against rule conditions. The legislation-level formulas require an explicit account of the corresponding relation.
The paper's definitions of correctness and completeness are informal, as it acknowledges. One display connects derivability with truth under an existing interpretation. A truth-preserving inference test would ask about interpretations satisfying the premises. The other display permits some set of rules to be found for a sentence true under an interpretation. A completeness claim for a particular theory would require a specified set of premises and a clearly stated relation of semantic consequence. The given formulas can introduce the distinction between syntax and semantics. Their quantifiers leave work to do before they can substantiate the claim that the two relations coincide for the proposed legal system.
Similar precision is needed for Proposition 5. A connection to satisfiability depends on the precise problem being decided. Checking whether a collection of statements has a satisfying assignment and checking whether a stated conclusion follows from a collection involve different questions. The paper gives a short appeal to satisfiability for its NP-Complete label and leaves the exact decision problem and reduction unstated. Its more immediately supported computational point is that instantiating a rule can be a simple operation even when establishing an adequate body of general rules is difficult.
The finding of a rule with no identified primary basis also needs a defined standard of evidence. The paper's reason requirement asks whether a reason supporting a ruling exists in the represented theory. It takes additional work to determine how that formal question corresponds to a search through classical treatments of the case. A reason may be absent from the encoded inventory, unidentified by the authors, or disputed as an adequate reason by a jurist. Each state has a different bearing on the conclusion. The recorded result in the paper is a gap in the authors' attribution of the secondary rule to a primary one.
Limits visible in the evaluation
The terminology trees delimit the candidate cases. Generation can be exhaustive relative to a set of terms and still leave out a feature of the real situation that the terms do not describe. The claim of generated coverage therefore depends on the construction of the trees. A particular chapter tree can be inspected for omissions, but the paper gives no independent assessment of its treatment of the full variety of cases users might bring. The potential counts measure combinatorial scale within the adopted vocabulary.
Coverage after abstraction is a separate matter. The paper gives examples of exclusion, positive treatment, and exceptions, along with some links between practical outcomes and primary maxims. It does not give a count of unresolved entries by subchapter or a check of whether all the rules together give a single answer wherever more than one applies. A conflict between practical rules, or a case that escapes them, would matter directly to the legislative questions. The examples show how to write down the relevant rules and inspect some of their sources.
The implementation demonstrates input handling and the production of decisions in its chosen cases. The paper gives no separate set of independently adjudicated queries against which to measure the decisions. It also reports no timings for the rule engine, no comparison with direct table lookup at the stated scales, and no evaluation of whether users understood the explanations or could choose the right terms for their cases. The counts of potential questions and the complexity of substitution do not answer those questions about a working system.
Finally, religious and legal authority enters before the computation and remains visible after it. The paper's examples depend on judgments about what a text means, why a rule applies, and which school supplies the governing view. In the retreat example, the way the premises are defined determines what the program would derive. In the wudu example, the ordering requirement determines how the automaton tracks progress. A procedure can make such dependencies available for inspection, and its conclusions remain conditional on the selection and adequacy of the encoded premises.
What came after
A later citing work is ADAPT–MTU HAI at QIAS2025. It takes Arabic Islamic inheritance reasoning as its task and names dual-expert fine-tuning and constrained decoding as its methods. This brings computational treatment to inheritance, the area the earlier authors discuss in their account of Al-Khwarizmi. The earlier paper uses inheritance to motivate the broader possibility of expressing jurisprudential reasoning as a procedure, while its own implemented examples concern purification. The later paper puts inheritance at the center of the computational task.
The two approaches place explicit controls at different points. In the purification prototypes, the question is assembled from a controlled terminology, and a rule engine or an automaton determines what follows. The inheritance work names a training intervention and a constraint applied during decoding, the process by which a system produces its answer. This gives a specific basis for relating the papers. Both bring computational constraints to a defined problem in Islamic jurisprudence, with the earlier work placing them in the case representation and inferential procedure and the later work describing them as part of answer generation.
The citation connects these investigations without establishing that the inheritance work adopted the purification trees, the positive and negative rules, or the decision procedure proposed for Fiqh. The substantive continuity is the effort to identify a bounded legal reasoning task and choose computational controls suited to it. Inheritance and purification supply different facts to represent and different relations to check, so that choice is part of what each investigation contributes.
Cite
Cite as Elnaserledinellah Mahmood Abdelwahab, Karim Daghbouche and Nadra Ahmad Shannan. 2016. The Algorithm of Islamic Jurisprudence (Fiqh) with Validation of an Entscheidungsproblem. arXiv:1604.00266 · J.Acad.(N.Y.)4,2:52-87 May 16 2014.
@misc{abdelwahab2016algorithm,
title = {{The Algorithm of Islamic Jurisprudence (Fiqh) with Validation of an Entscheidungsproblem}},
author = {Elnaserledinellah Mahmood Abdelwahab, Karim Daghbouche and Nadra Ahmad Shannan},
year = {2016},
doi = {10.48550/arxiv.1604.00266},
eprint = {1604.00266},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.1604.00266}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/abdelwahab-2016-algorithm-islamic-jurisprudence-fiqh-validation/