Parallels Galore: Islam, Artificial Intelligence and Ramon Llull

Parallels tend to spill over into, and down over to funny directions.

Inevitable as it seems, we are easily tempted to project one’s own epistemological prejudice upon what’s out there. A natural act of building syllogisms, good or bad ones. Following a happy path of process design along the confirmation bias highway. Position the unknown within an already predictable, hence controllable, scheme of reasoning and knowing.

The temptation of this slippery slope needs a degree of curbing, however. At least if we would like to place an intellectual venture within the domain of the logically sustainable, and put a limit to its intended rhetorical, instrumental and illegitimate utilization.

In simple words, it seems tempting to compare terms across various frameworks without actual causal relationship among them. My favorite ones come from within my own field, with the more straight forward and easily recognized as anecdotal.

Starting with the allegedly sloppiest of them all, we hear that all day from everybody – all religions are equal, they preach similar values. Judaism is like Christianity, Christianity is the same as Islam, in other words, people from these religions that spent centuries long on the non-crossable borders of these religions, both in theory and practice, seem to not have grasped the essential impasse among them. Or let’s go further, and regretfully, not in a direction that remained unexplored, rather the contrary.

Sunnis in Islam can be likened to Catholics in Western Christianity. Hanbalis are often, however, likened to conservative Protestants (favorite among modern scholars that usually have nothing to do with any form of religious attitude whatsoever, or just harbor a personal resentment against any of those religious groups above). The Qur’an seems to be like the Bible [aren’t they all „scriptures“, after all?]. Madrasas are universities (think of a George Makdisi)1. The ‘ulama‘ are the priests of Islam. Isn’t it, then, valid that St. Augustine can be likened to a grand faqih? Or a Thomas Aquinas be an al-Ghazali, possibly, or an Augustine [yes, the first wrote a stunningly personal „Deliverer from Error“ (Al-Munqidh min al-dalal), bemoaning one’s personal spiritual travails just like the „Confessions“ of St. Augustine]? Or al-Farabi’s „Virtuous City“ being a Plato’s „Republic„, but rather with a turban upon it? Or the Sunna be likened to a Christian tradition, and to the Oral Torah and the Talmud in Judaism. Ever in grosser terms: sometimes we see an „Islamic Reformation“ in the 19th century, as we had one in Western Christianity in the 16th.

These seem easily detected, openly superficial, and even sometimes stepping into the domain of the entertaining.

Funny stuff, eh? – the tonsure of Aquinas matching the stern imagined portrait of al-Ghazali, as both features appear accidental and glossing over the essential sameness.

But what about the more subtle forms of indecent parallelisms and the train of logical fallacies produced thereof, ones that would make Aristotle feverishly shake with indignation, what have you done, besides the scandal of refuting his teacher Plato? Such as, for example, discoveries of a reformulated „public sphere“ within Islam (just as within the Western Habermasian paradigm2, „same-but-not-same“) with the purpose to harness it towards achieving political ends? Or attempts to force liberal democracy model into a social and political framework influenced by a proper Islamic theological approach, with the plurality on one side equaling the plurality on the other? Or allegedly trying to leverage mechanisms from within a religious tradition in order to manipulate it outside of its own orbit, or gloss it over beyond its inherent characteristics, as it would work withing a common secular public space? In case you wonder what I mean, yes, an example of it would be the perennial USA tango with the Muslim „moderates“ in hot points of the globe, only to discover how immoderately-moderate they subsequently appear. They all seem to rest on the assumption that the difference between the current-and-the-future state of affairs, the here-and-there, the one-and-the-other, is but a formal [in the common sense, not in the Aristotelian] and superficial one.

Ok, let’s not overtly get scandalized over our political preferences but rather grasp the nature of indecent parallels where,

In a nutshell, all-is-all.

Drawing parallels, however, can be so seducing.

And I can plainly understand it. I am not the vehement opponent against, do not get me wrong, if only intellectual decency and logical approach are adhered to. Parallels cannot be evaded if we’d like to proceed from what we know to what we don’t. Yes, one of the lead principles of Islamic law, for example [am I drawing an illegitimate logical path here?], is the one of analogy/parallelisms (qiyas) . We draw a parallel, say, between the prohibited use of fermented substances (khamr), loosely translated as „wine“, in order to declare an overall ban over all that is a spirit drink, be it gin, brandy or liquor thing. It is a logical mechanism – A is subject to regulation B. C has same or converging attributes as A, hence C falls under B as well. To what extent convergence can be proven and how, is a different story; and is formal convergence related to contents, or how these relations of proportions are built, always remain questionable.

Now on to the meat of this text. As we knew the other day,

Dubai launches ‘world’s first’ AI fatwa initiative

The first service ever using Artificial Intelligence (AI) to issue Islamic religious rulings. The AI-powered Virtual Ifta machine takes questions real time on a chat and replies back.

Been about time, I would say. We all know what fatwa is not, and what is. It is not an death penalty sentence issued by an ayatollah over a Bombay origin writer daring to offend the Prophet in a „Satanic Verses“ novel. The popular usage of the word seems to have drawn upon the unhappy occurrence around the Salman Rushdie book, but goes far beyond it. Another thing which fatwa is not can be seen in every manual of Muslim law: although issued by a Muslim authority, it is not binding to the requester, in other words, it differs form the sentence issued by a Muslim judge (qadi) in a court. A fatwa cannot settle your legal dispute with your brother around the family heritage, or get you a Muslim divorce (talaq).

But its a real answer, a religious rulings to a question raised by a Muslim believer, while its validity is only conditioned by the consensus existing among the requester of this consultancy, and the answering religious authority. Depending on the authority of the fatwa generating person (mufti), the effect of the fatwa might spread across locations and times and be used as further supportive arguments. That is why fatwas issued by prominent historical theologians are gathered in compendia, classified and read over and over again, e.g. the ones of Ibn Taymiyyah (d. 1328).

Thus, a fatwa life cycle is fairly straightforward:

  1. A problem has been identified, based on the context and the need to comply with requirements of the Shari’a establishing a regulation (hukm) on a certain issue [e.g ‘One is not sure whether he passed wind during the prayer, what shall he do?‘].
  2. In case religious knowledge (‘ilm) of the requester is not found sufficient to solve it,
  3. Identification of authority [a ‘mufti‘] is due.
  4. Inquiry is submitted [online, face-to-face, through mail, etc.].
  5. Then it is validated by authority [‘Is that a valid, legitimate question?’].
  6. The identified solution issued by the religious authority, is the fatwa itself.
  7. Implementation of solution remains outside of the scope of the fatwa authority and documentation.

By design, a fatwa does not address a common, known topic which is supposed to be known by every Muslim as an integral component of his faith. It focuses on the subtility of day-to-day casuistry where the answers are not self-evident. That is why a certain online fatwa portal (see. e.g. the IslamQA of the Saudi Salafi Muhammad Al-Munajjid) where believers submit their inquiries, tends to contain virtually hundreds of thousands of questions and answers. And, as one of my favorite researchers on the topic, Gary Bunt, has pointed out in an excellent and entertaining piece of a study3, the existence of „CIE“ (Cyber Islamic Environments, a term far more neutral that a „Muslim Public Sphere“ 4), is not only a way to amplify the quantitative aspect, but also contains the potential to transform religious authority in a far more dynamic way than before. In other words, if I need to profane the discourse, in order to perform the exemplary „travel in search of [religious] knowledge“ (rihla fi talab al-‘ilm), the only thing I need, is to sit down with my smart device in my hands.

Islamic law is traditionally conceived to rest on four sources: the Scripture (Qur’an), the prophetic tradition (Sunna), analogy (the aforementioned qiyas), and last, and as if most obscure, the consensus of the learned men (ijma’). They relate to each other in a defined hierarchical manner (at least since al-Shafi’i (d. 820) and his „Treatise“ (Risala). The true task of a mufti thus appears simple on a conceptual level: stepping on the axiomatic contents defined in the Qur’an and the Sunna, through the use of the formal logic mechanisms (that is why Aristotle is so important), the technique of analogy, and supported by the range of previous authorities, arrive at a feasible (from Muslim standpoint) solution to an answer. Supposedly, each of these 4 can be broken into a database with a finite, albeit great, number of entries and attributes. The Qur’an contains 114 chapters, 6236 verses, 77,797 words and 330,709 letters. Same would stand for the Sunna, which is similarly defined as text (at least the contents of the Sihah corpus), although much larger as volume. The qiyas would depend on the ability to build automated algorithms of relations, while capturing a record of the ijma‘ would be the most problematic one – what theological opinions we would like to operationalize? This is not the Delphic oracle or an automated soothsaying machine (as both of them seeming a kind of glorified data randomizers), but rather the attempt to write a universal script to meet every possible inquiry within the scope of the valid religious problems. A religious syllogism device.

The only limits with regards to the quality of answers would be the quality of input, the logical relations defined among its various components (from lexicographical standpoint, syntactically , textually and within the background of tradition (naql)), and the processing power one is able to harness.

So close to a concept of employing AI for the task, right?

Kudos to the Dubai authorities then, whose effort seems to bring the idea of a fatwa to climax. If a fatwa is but a logical equation resting on complex, yet known premises, why not? Like the chat bot of my electronic banking provider, or the customer service to computer hardware offered currently by my employer, or the AI self-learning algorithm of Google translate engine. Or AI for finance and market analysis. Avio simulators. Education. Deepfake. Or plainly,

Religious contents tamed by formal logic, reigning supreme.

And that drives me to the second component of my parallel. While reading the news of the AI fatwa, had an impression that I had already seen something similar as a design in the religious domain. Took me around 5 minutes to recall, probably because it stands closer to my favorite times of history, the 13th century. Anyway, beyond my fav 11-12th centuries, but still closer than modernity.

Ramon Llull.jpg

Ramon Llull (d. 1316) seems to be one of those guys who serve as a measure of your basic knowledge on Western intellectual history. In my field he’s one of the towering giants to press down the pedal of interest into the „Orient“, urge into the studies of Arabic language for missionary purposes, and travel to Tunis in the 90s of the 13th centuries, setting foot into the domain of theological and philosophical debates with what was known as the ‘Saracens’ at the time. But I love the guy’s master lobbyist’s impact, advocating for education in Semitic languages, until ultimately the  Council of Vienne ordered the creation of chairs of Hebrew, Arabic and Aramaic at a couple of key Western centers of learning, such as Bologna, Oxford, Paris, or Salamanca.

O, and yes, in 1314 he was stoned by a crowd of angry Muslims in Tunis, and died later on in Mallorca. Turbulent times. we’d say, strange practices, as well, not knowing where they came from.

But the formal relation to the AI usage within the fatwas domain is not this. It might be, but it’s not. It is contained in his Ars generalis ultima or Ars magna („The Ultimate General Art“ or „The Great Art“, that went published in 1305. Not to be confused with the much later on 16th century work on algebra by Girolamo Cardano, bearing the same title. Take a look at the whole book below:

The concept, as explained in a good summary article by the late Umberto Eco5, is as follows [explanations follow closely the text of Eco, in case interested, take a look at the whole text of his article].

Llull was keen on coming up with a universal language to convince anyone of the truth of the Christian religion. That was supposed to be effected through rigorous mathematical calculation. To understand the Lullian project we must bear in mind the concept of “permutation”. Of the 24 possible permutations of the sequence ROME, for example, we use only the one that has a sense in our language, i.e., MORE, and discard those that we do not recognize as existing terms in the lexicon such as EOMR, OEMR, MREO and EROM.  In theory, however, all possible permutations could be considered as new words.

There is not only the permutation but also the “arrangement” of the elements. For example, given four people, A, B, C, D, how can I arrange them in pairs, as done on an airplane that has seats two by two, but in a way that takes into account also the order? Our people could be arranged in twelve ways: AB AC AD BA BC BD CD CB CA DA DB DC.

Llull was therefore implementing a combinatorial tool. The Ars considers an alphabet of nine letters, from B to K, representing nine absolute Principles (or Divine dignities), to which Llull attributes nine relative Principles that are predicates of his absolute Principles: nine types of Questions, nine Subjects and nine Vices and Virtues.

First Figure (on p. 4 of the edition embedded above, not the ones used by Eco).

Having assigned to the letters the nine absolute Principles, they combine to produce 72 propositions of the kind “Goodness is great,” or reading it in the opposite direction, “greatness is glorious”.

In the Third Figure below Llull seems to consider all possible pairings between the letters. The result is 36 pairs, but the virtually possible pairs amount to 72, because each letter can be either subject or predicate. The system allows questions such as “if goodness were great” or “what is great goodness?” It allows, at least in theory, 432 propositions and 864 questions.

And there comes the Fourth Figure below.

Eco defines it as the most complex one, “the one that will be the most successful in setting tradition”.

The scheme is mobile, with 3 concentric circles of decreasing sizes, applied one on top of the other. 9 elements in groups of three allow 84 possible combinations (of the kind BCD, BCE, CDE). Each triplet generates a column of 20 combinations (84 columns!) as Llull transforms the triplets into quadruples through inserting the letter T. When a sequence such as BCTC is obtained, the letters preceding T should be read as absolute Principles, and those that follow it as relative Principles. Thus BCTC will be read as: “If B, the goodness, being C great, as it contains C in itself, then things are consistent.” Following this, it is possible to obtain 1680 combinations.

Now, doesn’t this sound like an attempt to rationalize theological discourse?

Building a logical device to substantiate religious postulates, as AI would do for a fatwa inquiry?

„Yes, and no“ – just like the „Adventure Time“ squirrel.

– So does that mean I’m a prisoner forever?
– Well yes. And no. Are you a prisoner? Yes. Will you ever be free? No. In the tree, part of the tree. It’s very simple.

I’d leave to you the details of delving into the possible similarities and divergences of the two approaches, as to the role of logical reasoning into the two traditions, the place of „clergy“, the mechanism of ensuring of preservation of religious knowledge across time from creation to the Judgement Day, and its communal dimensions; or to what extent indeed the logical approach would come post factum only to instrumentally affirm a certain religious truth (as it is within Lull’s scheme), as opposed to providing a solution to an religious problem (as targeted by the fatwa mechanism, regardless of media and means). The ethical issues thereof can also be a subject of a separate scholarly endeavor – can the human element be eliminated whatsoever or human agency is indispensable, similar to the Ottoman Empire discussions whether the Qur’anic text of the revelation can be reproduced by a human scribe only, or through lithographic or typographical means. Aren’t both in fact subject to externally imposed premises, and thus limiting the possible logical permutations. And what if a generated solution contradicts an experimental learning or a long time established tradition.

Still, you can’t say blame me that I did not entertain a seducing parallel, right?


  1. Makdisi, George. The Rise of Colleges: Institutions of Learning in Islam and the West, Edinburgh University Press, 1981.
  2. Habermas, Jürgen. The Structural Transformation of the Public Sphere: An Inquiry into a category of Bourgeois Society, Polity, Cambridge, 1962 trans 1989, see also Calhoun, Craig, ed., Habermas and the Public Sphere, MIT Press, 1993.
  3. Bunt, Gary R. Hashtag Islam: How Cyber-Islamic Environments Are Transforming Religious Authority (Islamic Civilization and Muslim Networks), The University of North Carolina Press, 2018.
  4. The Public Sphere in Muslim Societies, ed. by Miriam Hoexter, Shmuel N. Eisenstadt and Nehemia Levtzion, SUNY Press, 2002.
  5. Eco, Umberto. „The Ars Magna by Ramon Llull“, Contributions to Science, Institut d’Estudis Catalans, Barcelona, Catalonia, 2016 [transl. of Chapter 4 of Storia della Filosofia. Vol 1 Dall’Antichità al Medioevo, ed. by Umberto Eco (1932–2016) and Riccardo Fedriga, Editore Laterza, Roma-Bari, 2014], pp. 47-50.