arXiv:2501.05765v1 [cs.AI] 10 Jan 2025 Deontic Temporal Logic for Formal Verification of AI Ethics Priya T.V., Shrisha Rao International Institute of Information Technology - Bangalore Email: priya.tv@iiitb.ac.in, shrao@ieee.org Abstract—Ensuring ethical behavior in Artificial Intelligence (AI) systems amidst their increasing ubiquity and influence is a major concern the world over. The use of formal methods in AI ethics is a possible crucial approach for specifying and verifying the ethical behavior of AI systems. This paper proposes a formalization based on deontic logic to define and evaluate the ethical behavior of AI systems, focusing on system-level specifications, contributing to this important goal. It introduces axioms and theorems to capture ethical requirements related to fairness and explainability. The formalization incorporates temporal operators to reason about the ethical behavior of AI systems over time. The authors evaluate the effectiveness of this formalization by assessing the ethics of the real-world COMPAS and loan prediction AI systems. Various ethical properties of the COMPAS and loan prediction systems are encoded using deontic logical formulas, allowing the use of an automated theorem prover to verify whether these systems satisfy the defined properties. The formal verification reveals that both systems fail to fulfill certain key ethical properties related to fairness and non- discrimination, demonstrating the effectiveness of the proposed formalization in identifying potential ethical issues in real-world AI applications. Index Terms—Artificial Intelligence, Ethics, Deontic Temporal Logic I. I NTRODUCTION Artificial Intelligence (AI) systems are becoming increas- ingly ubiquitous and influential in our lives, making decisions that can have significant ethical implications. As AI continues to advance and take on more complex tasks, it is crucial to ensure that these systems behave ethically [1]–[9]. However, defining and enforcing ethical behavior in AI is a challenging task, as ethics often involve abstract concepts and context- dependent judgments [10]–[12]. There are numerous principles generated by various organizations and regulation bodies. For instance, the Ethically Aligned Design (EAD) guidelines of IEEE recommend that AI design prioritize maximizing bene- fits to humanity [13]. Furthermore, The European Commission has released Ethics Guidelines for Trustworthy AI, stressing the importance of AI being human-centric [14]. The national plan for AI in the United Kingdom suggests the establishment of an AI Code [15]. Australia has also introduced its AI ethics framework [16], which adopts a case study approach to examine fundamental ethical principles for AI and offers a toolkit for integrating ethical considerations into AI devel- opment. Adding to this are Beijing’s AI principles, Amnesty International ACM code of ethics, and many more. In addition to governmental organizations, prominent companies such as Google [17] and SAP [18] have publicly released their AI principles and guidelines. Moreover, professional associations and non-profit organizations like the Association for Comput- ing Machinery (ACM) have issued their recommendations for ethical and responsible AI [19], [20]. Despite these efforts, a consensus on the ethics of AI remains challenging. They lack a unified framework of guide- lines that can be universally adopted by organizations, govern- ments, and regulatory bodies to formulate and assess the ethics of systems. It is not yet clear what common principles and values AI should adhere to. Establishing cohesive and widely accepted ethical principles for AI is crucial across different organizations and domains. Moreover, ethics is a philosophical question of what is right or wrong [21], [22]. Its qualitative nature makes it complex and hard to define precisely and hence needs a mathematically rigorous framework. To address this challenge, we are exploring the use of formal methods to express and prove the ethical correctness of AI systems. One promising approach is the use of deontic logic, a branch of modal logic that deals with concepts such as obli- gation, permission, and prohibition [23], [24]. Deontic logic provides a rigorous framework for reasoning about ethical norms and can be used to formalize ethical principles [25] and constraints. Several works have explored using deontic logic to formalize machine ethics mainly for robots [26], [27] and normative systems [28]. These studies have concentrated on Kantian ethics, integrating deontic and temporal logic to verify the ethical behavior of autonomous systems, such as unmanned aircraft, over time [29], [30]. While promising, these methods are often constrained by specific ethical frameworks and fail to scale with modern AI’s complexity, which increasingly mimics human tasks, leverages natural language processing, and operates on vast datasets. This leads to a proliferation of potentially subjective ethical rules influenced by personal biases. The dynamic, evolving nature of AI further complicates ethical formalizations [31]. Critically, many of these approaches remain theoretical, lack- ing practical integration with machine learning techniques, highlighting the need for more adaptive and implementable eth- ical frameworks in AI [32]. Our work represents a foundational effort to develop a unified framework that addresses ethical principles in AI systems, specifically focusing on granular levels of explainability and fairness. It builds upon existing approaches [26], [33] in specialized domains, extending them to tackle the unique challenges posed by modern AI ethics. In