Pith.

Artificial Intelligence · arXiv:2611.17235 v1 · submitted 12 Nov 2026 · 13 references

Al-Ghasali: A Computational Framework for Simulating Islamic Jurisprudential Rulings via Finite State Automata and Large Language Models

Elnaserledinellah Mahmoud Abdelwahab

The paper says

“This paper presents Al Ghasali, a computational framework designed to formalize and simulate Islamic jurisprudential (Fiqh) rulings.”

more of the abstract

Building upon recent set theoretic formalizations of al sabr wa al Taqsim that extract minimal operational rules as simple Horn clause logical programs, this work proves that the semantics of closed Fiqh chapters collapse completely to deterministic Finite State Automata (FSA). We establish a formal computational hierarchy, demonstrating that restricting formalization to finite propositional Horn theories guarantees decidability and constant time (O(1)) verdict extraction after offline compilation. The framework formally proves that hierarchical compositions of sub-chapter FSAs preserve this O(1) complexity, and that temporal juristic requirements, such as Tartib (order), are deterministically flattened into static ontological states, preserving the memoryless property of the automaton. To generate human-readable juristic summaries, Al Ghasali incorporates Large Language Models (LLMs) via an architecture where the deterministic FSA strictly controls the probabilistic LLM. Crucially, the paper formulates sufficient design safety conditions for this FSA LLM integration, ensuring strict adherence to the epistemological boundaries of Usul al Fiqh. To neutralize the risk of LLM hallucination, the system employs a Grammar Guided Constrained Decoding mechanism. We formally define the mapping function that dynamically constructs unambiguous right linear grammars from the FSA execution history. The paper mathematically proves that this architecture, augmented by a Bounded Neutral Lexicon and Valence Locking, guarantees the absolute absence of Decisional Hallucination, Juristic Factual Hallucination, and Semantic Inversion reducing the LLM to a pure linguistic transformer of deterministic juristic facts

from the abstract

Pith says

Machine review · deepseek-v4-flash · 13 Nov 2026 · what was read was not recorded · not checked by a person

It can be wrong. Challenge this review or reply to it.

No verdict was given on this paper.

4 major objections · 5 minor

How often objections from reviews like this one are right: not yet measured

Are you an author? What you can do.

Not checked: figures, code, what the 13 references say.

The paper says, at §2.2, Lemma 1

The review did not quote this passage.

Pith says: Objection 1 of 4 · major

The proof of Lemma 1 relies on the equivalence P |= H ⇔ q ∈ F. However, the Horn program P defined in §2.1 includes integrity constraints (Eq. 3) of the form ← H ∧ W_j^+. Under classical entailment, if a valuation satisfies both S ∧ I_i (deriving H) and W_j^+, the theory becomes inconsistent, making P |= H and P |= ¬H both true vacuously.

more of objection 1

This would place the state in F incorrectly. The paper does not specify a nonmonotonic semantics to handle preventers. The later system description (§5.2) sidesteps this by checking membership in M+ directly, but Lemma 1 as stated is not established for the program as defined. This is a load-bearing issue for the central claim of finite-state collapse.

The paper says, at §8.3, Theorem 1

The review did not quote this passage.

Pith says: Objection 2 of 4 · major

The proof of Theorem 1 relies on the grammar G_{Σ_h} being constructed such that terminal nodes representing Juristic Facts are strictly drawn from J(Σ_h). However, the mapping function f defined in §8.2 is described algorithmically but not formally verified. The claim that 'the LLM is physically incapable of outputting a false condition' depends on the correctness of the grammar generation and the constrained decoding mechanism.

more of objection 2

No empirical evaluation or formal verification of the implementation is provided. The theorem is a theoretical guarantee under idealized assumptions, not a proven property of any actual system.

The paper says, at §2.1, Eq. 3

The review did not quote this passage.

Pith says: Objection 3 of 4 · major

The representation of preventers as Horn integrity constraints (← H ∧ W_j^+) is problematic. In standard Horn-clause logic, such constraints are not clauses; they are denials. The paper cites [2,10,11] for 'Horn integrity constraints', but these references do not provide a semantics that makes the program well-behaved under classical entailment. The paper should clarify the logical framework used (e.g., logic programming with negation as failure, or a different nonmonotonic formalism) and how Lemma 1 is intended to apply.

The paper says, at §1, Closed Chapter Assumption

The review did not quote this passage.

Pith says: Objection 4 of 4 · major

The paper acknowledges the Closed Chapter Assumption as foundational. However, the claim that 'a significant portion of the Fiqh corpus operates within these permanently closed conceptual bounds' is not supported by empirical evidence or citation. The assumption is theological/epistemological, not mathematical.

more of objection 4

While the paper is upfront about this, the practical applicability of the framework depends on the extent to which real Fiqh chapters satisfy this assumption. The paper would benefit from a discussion of how to identify closed chapters and what the consequences are if a chapter is not closed.

5 minor objections

The paper says, at General

Pith says: minor objection 1 of 5

The paper contains several typographical errors and formatting issues (e.g., 'al sabr wa al Taqsim' vs 'al-sabr wa al-Taqsim', inconsistent use of italics). These should be corrected.

The paper says, at §2.2

Pith says: minor objection 2 of 5

The proof of Lemma 1 states that 'P |= H under valuations' but does not define what it means for a Horn program with integrity constraints to entail H. The notation should be clarified.

show 3 more

The paper says, at §8.2

Pith says: minor objection 3 of 5

The example grammar for Tayammum ruling uses non-terminals like 'Connector1', 'Connector2', but the Bounded Neutral Lexicon is not explicitly listed. The paper should provide the full set of allowed connectors.

The paper says, at References

Pith says: minor objection 4 of 5

Reference [1] is self-cited and described as 'to appear' or similar. The paper should clarify the status of this reference. If it is unpublished, the dependency on it should be noted.

The paper says, at §5.2

Pith says: minor objection 5 of 5

The extraction of rulings (FSA Logic) is described as checking the current state against M+ array. This is a lookup, not the entailment-based evaluation claimed in Lemma 1. The paper should reconcile this discrepancy.

What would settle it

Implement the Section 2.1 construction for the minimal preventer example with S=true, I=true, W=true and intended ruling H=false. In a standard first-order or Horn-logic prover, add the valuation facts and check whether P|=H under Lemma 1's definition. If the prover returns 'inconsistent' or 'entails H', then the F of Lemma 1 includes the invalid state and the claimed collapse fails. Alternatively, ask the authors to specify the intended nonmonotonic semantics and re-prove Lemma 1 under that semantics; if the only consistent reading is F=M+ direct lookup, then Equations 1-3 should be revised or the formal claim should be restated without the defective entailment relation.

from the skeptic's reading

How the review went

4 readings by deepseek-v4-flash · 13 Nov 2026

  1. Reader no verdict given confidence low
  2. Skeptic disagrees 2 min 20 s · 15,207 tokens read, 17,385 written
  3. Editor wrote the review in brief 57 s · 16,149 tokens read, 6,820 written
  4. Referee major revision: 4 major objections, 5 minor 12 s · 15,673 tokens read, 1,155 written

Not run on this paper: the simulated authors' defence.

Pith did not check this review's objections against the paper.

The review in full

The review in brief, machine-written

Read this one if you want a clear example of a domain-motivated architecture whose formal packaging overstates its actual content. The useful core is the design: compile truth-table rules into a deterministic automaton, flatten temporal requirements such as Tartib into boolean state variables, and then let the FSA constrain an LLM's text generation via a right-linear grammar and a whitelist of neutral connectors. The Tartib construction is the best part. It is simple, correct, and shows real understanding of how juristic order can be modeled as a condition or preventer rather than as memory. The hierarchical composition argument is fine as far as it goes. What is genuinely new is not the mathematics—finite propositional Horn theories are finite-state for standard reasons—but the domain mapping.

The stress-test note is right. Lemma 1 does not prove what it claims. Equation 3 encodes preventers as constraints of the form <-H∧W+. Under the classical entailment P|=H used in the lemma, any valuation with an active preventer makes the theory inconsistent, and classical entailment from an inconsistent theory is vacuous. So the equivalence P|=H iff s is in F is not established; the proof would need a nonmonotonic semantics, and none is specified. Interpreting those constraints as external integrity checks rather than clauses does not fix it, because then they are not part of the entailment relation the lemma reasons about. The system in Section 5.2 sidesteps this by checking M+ directly, which is operationally sensible, but that makes the formal claim in Lemma 1 largely decorative. This is a load-bearing issue, not a stylistic slip.

Two other soft spots, in proportion. First, there is no implementation, data, or evaluation. Saying the LLM endpoint was tested with GLM-4.6 without showing a single run means the hallucination claims remain a design argument. Theorem 1's "absolute absence" is conditional on an idealized constrained decoder, and its own Remark 1 already carves out linguistic artifacts; the Bounded Neutral Lexicon is clever but is not an empirical safety guarantee. Second, the O(1) extraction is a finite-lookup result; the offline table grows exponentially in the number of variables, which the sub-chapter decomposition mitigates but does not remove.

The paper is honest about the Closed Chapter Assumption and about its dependence on [1], so I would not call those hidden flaws. The dependency is real and worth checking, but it is acknowledged. Who gets value from this: people working on computational Islamic jurisprudence, and perhaps researchers designing constrained-decoding guardrails for domain-specific LLM use. I would not cite it in its current form, and I would bring it to a reading group only as a case study in formal overreach. Still, I would send it to a serious referee rather than desk-reject: a competent reviewer could push the author to either replace Lemma 1 with a correct nonmonotonic formulation or drop the entailment framing and present the table-lookup construction directly. The domain application is unusual enough to deserve one careful round.

The strongest objection

The load-bearing flaw is in Lemma 1 (Section 2.2) as applied to the program defined in Section 2.1. Equation 3 encodes preventers as Horn integrity constraints of the form ←H∧W+. Under the classical entailment the lemma uses (P|=H), take a closed chapter with a valuation satisfying the condition S, the cause I, and a preventer W. The definite clause H←S∧I derives H, while the constraint requires ¬(H∧W); the theory is inconsistent. Classical entailment from an inconsistent theory is vacuous, so P|=H and P|=¬H both hold, and the state would be placed in F, exactly the wrong answer, since the truth table puts it in M−. Standard Horn-clause logic is monotonic and cannot express "W prevents H" by a negative clause. A nonmonotonic semantics, such as stable models, program completion, or default rules, is needed, but none is defined in the paper; the citations in [2,10,11] do not supply such a semantics. The later system description (Section 5.2) sidesteps this by checking membership in M+ directly, so the implemented lookup may be correct, but Lemma 1's claimed equivalence P|=H ⇔ q∈F is not established for the program as defined. This is independent of the Closed Chapter Assumption: even for a genuinely finite closed chapter, the lemma as stated does not prove what it claims.

The paper's central computational claim rests on Lemma 1: that the semantics of the defined Horn program collapse to a deterministic FSA with accepting set F={s | P|=H}. For that to be true, the preventer clauses of Equation 3 must have a semantics under which an active preventer makes H false rather than making the theory inconsistent. Classical Horn logic is monotonic and cannot deliver this. In the invalid state S∧I∧W, the definite clause derives H and the constraint forbids H∧W, so the theory has no classical model; consequently P|=H holds vacuously under the standard reading. Thus the accepting-set definition in Lemma 1 is not sound for the paper's own program. This is a more direct, internal objection than the Closed Chapter Assumption: it does not depend on whether any real Fiqh chapter is closed, and it cannot be resolved by more empirical evidence about jurisprudential ontology. The paper's Section 5.2 algorithm, which checks membership in M+, is a correct and simpler FSA construction, so the framework is likely repairable, but the formal theorem as stated is not. For this reason the appropriate adjustment is CONDITIONAL rather than unconditional rejection: the authors should either give an explicit nonmonotonic semantics for Equations 1-3 and reprove Lemma 1 under it, or drop the Horn-program characterization and define F directly as M+. Only after that repair, and ideally with a concrete instantiation of at least one closed chapter, can the O(1) and no-hallucination claims be evaluated as proven.

The referee's report

If the claims hold, the framework could provide a computationally efficient and formally grounded tool for Islamic jurisprudence. The theoretical contributions include the finite-state collapse lemma and the safety conditions for LLM integration.

Pith's reading of the paper (a machine's summary, not the authors')

The paper introduces Al-Ghasali, a system that converts Islamic jurisprudential rulings (Fiqh) into a computational model. It builds on prior work that extracts minimal logical rules from juristic truth tables using a method called al-sabr wa al-Taqsim. The key insight is that for certain closed chapters of Fiqh (like ritual worship), the set of legal concepts is finite and bounded. This allows the system to represent all possible legal states as a finite state automaton (FSA), a simple machine with a fixed number of states. Once compiled, extracting a verdict for any given set of conditions takes constant time (O(1)). The system also handles hierarchical rules by nesting sub-chapters, and it flattens temporal requirements like order (Tartib) into static state variables. To generate natural language explanations, the system uses a large language model (LLM), but strictly controls it: the FSA determines the legal facts, and the LLM is only allowed to generate text that matches a grammar built from those facts. This grammar is constructed dynamically from the FSA execution history, and it uses a bounded neutral lexicon and valence locking to prevent the LLM from contradicting the verdict. The paper mathematically proves that this architecture eliminates decisional hallucination (wrong verdict), juristic factual hallucination (invented legal facts), and semantic inversion (contradictory phrasing). The system is implemented as a web application with a dynamic UI, JSON rule files, and an OpenAI-compatible API for LLM integration.

Core claim. The paper claims that for closed Fiqh chapters (with finite binary variables), the semantics of the Horn-clause program collapse to a deterministic finite state automaton, enabling O(1) verdict extraction after offline compilation (Lemma 1, Section 2.2). It further claims that the FSA-LLM architecture, with grammar-guided constrained decoding, guarantees the absolute absence of Decisional Hallucination, Juristic Factual Hallucination, and Semantic Inversion (Theorem 1, Section 8.3).

The premise it rests on. The foundational premise is the 'Closed Chapter Assumption' (Section 1, paragraph 4): that the ontological concepts tree (OCT) for certain Fiqh chapters (like Ibadat) is permanently stable and finite, and that no future jurist can invent new concepts. This is a theological and epistemological claim, not a mathematical one. If this assumption fails for any chapter, the finite-state collapse and O(1) guarantee do not hold. The paper acknowledges this assumption but does not provide empirical evidence that all relevant chapters are indeed closed in practice.

Check this review

Pith stored no record of this review's passes and took no fingerprint of it. Reviews made by code from 13 Nov 2026 on carry both.

How often reviews like this one are right

Reviews like this one: written by deepseek-v4-flash, where what was read was not recorded.

How often objections from reviews like this one are right: not yet measured

Every value above, in the review's public record (JSON)

Reviews by people

This review was written by a machine. No person has reviewed this paper on Pith yet. A scientist listed on Pith can review it for a fee, and their review is published here whatever it concludes.

Request a human review

How Pith checks papers · The full audit of this paper

The paper

Abstract

This paper presents Al Ghasali, a computational framework designed to formalize and simulate Islamic jurisprudential (Fiqh) rulings. Building upon recent set theoretic formalizations of al sabr wa al Taqsim that extract minimal operational rules as simple Horn clause logical programs, this work proves that the semantics of closed Fiqh chapters collapse completely to deterministic Finite State Automata (FSA). We establish a formal computational hierarchy, demonstrating that restricting formalization to finite propositional Horn theories guarantees decidability and constant time (O(1)) verdict extraction after offline compilation. The framework formally proves that hierarchical compositions of sub-chapter FSAs preserve this O(1) complexity, and that temporal juristic requirements, such as Tartib (order), are deterministically flattened into static ontological states, preserving the memoryless property of the automaton. To generate human-readable juristic summaries, Al Ghasali incorporates Large Language Models (LLMs) via an architecture where the deterministic FSA strictly controls the probabilistic LLM. Crucially, the paper formulates sufficient design safety conditions for this FSA LLM integration, ensuring strict adherence to the epistemological boundaries of Usul al Fiqh. To neutralize the risk of LLM hallucination, the system employs a Grammar Guided Constrained Decoding mechanism. We formally define the mapping function that dynamically constructs unambiguous right linear grammars from the FSA execution history. The paper mathematically proves that this architecture, augmented by a Bounded Neutral Lexicon and Valence Locking, guarantees the absolute absence of Decisional Hallucination, Juristic Factual Hallucination, and Semantic Inversion reducing the LLM to a pure linguistic transformer of deterministic juristic facts

The paper's own sentences, arranged, kept beside the review and separate from it. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. No sentence in this record was written by a model.

abstract compiled · 2026-11-14

The authors' main claim, as the classifier picked it out 0.45

“The paper mathematically proves that this architecture, augmented by a Bounded Neutral Lexicon and Valence Locking, guarantees the absolute absence of Decisional Hallucination, Juristic Factual Hallucination, and Semantic Inversion reducing the LLM to a pure linguistic transformer of deterministic juristic facts”

How the main claim is stated: asserted 1.00

What the abstract itself states, as probabilities: claims first 0.06 · states limitation 0.14 · human participants 0.04 · controlled comparison 0.02 · randomized assignment 0.01 · states quantitative result 0.91 · compares with prior results 0.24 · mentions code or data availability 0.03

The abstract, sentence by sentence

This table labels the abstract only (arXiv listing abstract v1). The number is the probability the classifier gave the label.

SentenceRoleThe authors' own workStates the main conclusionStrength
This paper presents Al Ghasali, a computational framework designed to formalize and simulate Islamic jurisprudential (Fiqh) rulings. contribution 1.00 0.87 0.12 asserted 1.00
Building upon recent set theoretic formalizations of al sabr wa al Taqsim that extract minimal operational rules as simple Horn clause logical programs, this work proves that the semantics of closed Fiqh chapters collapse completely to deterministic Finite State Automata (FSA). result 0.45 0.81 0.30 asserted 1.00
We establish a formal computational hierarchy, demonstrating that restricting formalization to finite propositional Horn theories guarantees decidability and constant time (O(1)) verdict extraction after offline compilation. result 0.85 0.91 0.20 asserted 1.00
The framework formally proves that hierarchical compositions of sub-chapter FSAs preserve this O(1) complexity, and that temporal juristic requirements, such as Tartib (order), are deterministically flattened into static ontological states, preserving the memoryless property of the automaton. result 0.86 0.90 0.12 asserted 1.00
To generate human-readable juristic summaries, Al Ghasali incorporates Large Language Models (LLMs) via an architecture where the deterministic FSA strictly controls the probabilistic LLM. method 0.95 0.87 0.07 asserted 1.00
Crucially, the paper formulates sufficient design safety conditions for this FSA LLM integration, ensuring strict adherence to the epistemological boundaries of Usul al Fiqh. contribution 0.78 0.89 0.07 asserted 1.00
To neutralize the risk of LLM hallucination, the system employs a Grammar Guided Constrained Decoding mechanism. method 0.98 0.86 0.04 asserted 1.00
We formally define the mapping function that dynamically constructs unambiguous right linear grammars from the FSA execution history. method 0.90 0.93 0.04 asserted 1.00
The paper mathematically proves that this architecture, augmented by a Bounded Neutral Lexicon and Valence Locking, guarantees the absolute absence of Decisional Hallucination, Juristic Factual Hallucination, and Semantic Inversion reducing the LLM to a pure linguistic transformer of deterministic juristic facts result 0.91 0.89 0.31 asserted 1.00

What kind of paper the classifier reports this is: method or tool 0.89 · evidence from proof or derivation 1.00

What was examined, and what was not

Sources read

  • arXiv listing abstract v1

Not examined

  • full text
  • figures and tables
  • references and citing sentences
  • relations to other papers

Levels run

  • P abstract

Not run

  • S sections
  • T body sentences
  • C citations
  • R cross-paper relations

How the labels were made

Compiled by classifier-1.13.0 via TypeSafe API, question bank abstract-p1-20260923, 2026-11-14: 1 request, 7,254 input tokens.

Every quoted sentence on this record is the authors'. Every label is from Pith's closed vocabulary, with the probability shown beside it. This record as JSON

Figures (1)
Figure 1 of the paper
Figure 1. System Architecture of Al-Ghasali utilizing a Hub-and-Spoke model to demon

Figures are the authors', reproduced from the paper.

References (13)
  1. [1] E. Abdelwahab, “Computational Extraction of Legal Causes via al-sabr wa al-Taqsim: A Set-Theoretic Formalization for Closed Fiqh Chapters,”Journal Academica, vol. 15, no. 1, pp. 1–16, 2026 on Pith
  2. [2] J. W. Lloyd,Foundations of Logic Programming, 2nd ed. Berlin, Germany: Springer- Verlag, 1987 on Pith
  3. [3] J. E. Hopcroft, R. Motwani, and J. D. Ullman,Introduction to Automata Theory, Languages, and Computation, 3rd ed. Boston, MA, USA: Addison-Wesley, 2006 on Pith
  4. [4] M. Sipser,Introduction to the Theory of Computation, 3rd ed. Boston, MA, USA: Cengage Learning, 2013 on Pith
  5. [5] S. Ceri, G. Gottlob, and L. Tanca,Logic Programming and Databases. Berlin, Ger- many: Springer-Verlag, 1990 on Pith
  6. [6] Z. Ji, N. Lee, R. Frieske, T. Yu, D. Su, Y. Xu, E. Ishii, Y. J. Bang, A. Madotto, and P. Fung, “Survey of Hallucination in Natural Language Generation,”ACM Computing Surveys, vol. 55, no. 12, pp. 1–38, 2023 on Pith
  7. [7] B. T. Willard and A. Vetta, “Efficient Guided Generation for Large Language Models,” arXiv preprint arXiv:2307.09702, 2023 on PithPith's reviewarXiv
  8. [8] I. M. Al-Shatibi,Al-Muwafaqat fi Usul al-Shari’a, vol. 1. Riyadh, Saudi Arabia: Dar Ibn Affan, 1997 on Pith
  9. [9] M. H. Kamali,Principles of Islamic Jurisprudence, 3rd rev. ed. Cambridge, UK: Islamic Texts Society, 2003 on Pith
  10. [10] S. Al-Amidi,Al-Ihkam fi Usul al-Ahkam, vols. 1–4. Beirut, Lebanon: Dar al-Kutub al-Ilmiyya, 2000 on Pith
  11. [11] M. Al-Shawkani,Irshad al-Fuhul ila Tahqiq al-Haqq min Ilm al-Usul. Beirut, Lebanon: Dar al-Kutub al-Ilmiyyah, 1999 on Pith
  12. [12] M. Al-Nawawi,Al-Majmu’ Sharh al-Muhadhdhab, vol. 2. Beirut, Lebanon: Dar al-Kutub al-Ilmiyyah, 2002 on Pith
  13. [13] B. Al-Marghinani,Al-Hidayah: The Guidance, translated by C. Hamilton. Leiden, Netherlands: Brill, 2004. 18 on Pith

Challenges and discussion

Disagree with the review, or know something it missed? Leave a comment, or challenge this review formally: a challenge becomes a permanent entry in this paper's record, and its decision is published here.

No comments yet.

Sign in to comment