Hostname: page-component-745bb68f8f-v2bm5 Total loading time: 0 Render date: 2025-01-16T05:57:49.748Z Has data issue: false hasContentIssue false

Reasoning About Study Regulations in Answer Set Programming

Published online by Cambridge University Press:  15 January 2025

SUSANA HAHN
Affiliation:
University of Potsdam, Germany Potassco Solutions, Germany (e-mail: torsten@cs.uni-potsdam.de)
TORSTEN SCHAUB
Affiliation:
University of Potsdam, Germany Potassco Solutions, Germany (e-mail: torsten@cs.uni-potsdam.de)
CEDRIC MARTENS
Affiliation:
University of Potsdam, Germany
AMADE NEMES
Affiliation:
University of Potsdam, Germany
HENRY OTUNUYA
Affiliation:
University of Potsdam, Germany
JAVIER ROMERO
Affiliation:
University of Potsdam, Germany
SEBASTIAN SCHELLHORN
Affiliation:
University of Potsdam, Germany
Rights & Permissions [Opens in a new window]

Abstract

We are interested in automating reasoning with and about study regulations, catering to various stakeholders, ranging from administrators, over faculty, to students at different stages. Our work builds on an extensive analysis of various study programs at the University of Potsdam. The conceptualization of the underlying principles provides us with a formal account of study regulations. In particular, the formalization reveals the properties of admissible study plans. With these at end, we propose an encoding of study regulations in Answer Set Programming that produces corresponding study plans. Finally, we show how this approach can be extended to a generic user interface for exploring study plans.

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press

1 Introduction

Study regulations govern our teaching at universities by specifying requirements to be met by students to earn a degree. Creating a study program involves different stakeholders: faculty members designing study programs, administrative and legal staff warranting criteria, like studyability, faculty members teaching the corresponding programs as well as supervising their execution on examination boards, study advisors consulting students, and of course, students studying accordingly.

Given this impressive spectrum of use-cases, it is quite remarkable that study regulations are usually rather sparse and leave many aspects to the commonsense of the respective users. This is needed to cope with their inherent incomplete, inconsistent, and evolving nature. For instance, often study regulations leave open minor dependencies among modules. Sometimes associated courses overlap and certain modules cannot be taken in the same semester. And finally, studying happens over time, students’ perspectives may change and faculty may rotate. Often these phenomena are compensated by changes, preferences, recommendations, defaults, etc. In fact, this richness in issues and notions from Knowledge Representation and Reasoning (KRR) makes study regulations a prime candidate for a comprehensive benchmark for KRR formalisms.

Our approach is adaptable, though not universally applicable. Its foundations lie in the principles of Europe’s Bologna Process, designed to harmonize higher education across the continent. European curricula, for example, are structured around credit points, often allocated to individual modules. The European Credit Transfer and Accumulation System provides guidance on program design and credit allocation. Similarly, our approach utilizes modules and credit points as fundamental building blocks. Our goal is to encompass all study regulations at the University of Potsdam, which share additional key principles. However, adaptation or even redesign may be necessary for other institutions with differing structures or requirements.

In fact, this work is part of a project conducted at the University of Potsdam to assist different users by automatizing study regulations. These users range from study administrators, over faculty in different functions, to prospective and advanced students. We started by analyzing more than a dozen different study regulations in order to identify their underlying principles. The conceptualization of the basic principles led us to a formal account of basic study regulations, presented in Section 2. For illustration, we provide the formalization of the master program Cognitive Systems. We refine this in Section 3 by showing how modules are passed by accomplishing their associated examination tasks. The formalization of study regulations reveals the properties of admissible study plans. To automatize reasoning about study regulations and their study plans, we capture their properties in Answer Set Programming (ASP; Lifschitz (Reference Lifschitz2002)), a declarative problem solving paradigm, tailored for knowledge representation and reasoning. The ASP-based encoding of basic study regulations is discussed in Section 4. Moreover, we show in Section 5 how this encoding can be used together with an ASP-driven user interface to browse through study plans of given study regulations. We conclude in Section 7.

2 Conceptualizing study regulations

The basic concept of our study regulations are modules. Accordingly, a semester is composed of a set of modules and a study plan is a finite sequence of semesters. More formally, given a set $M$ of modules, a study plan of $n$ semesters is a sequence $ (S_i)_{i=1}^n$ where $ S_i\subseteq M$ for $1\leq i\leq n$ . Study regulations specify legal study plans. To capture this, we propose an abstract characterization of study regulations and show how they induce legal study plans.

A basic study regulation is a tuple $ (M, G, c, s, l, u, R_g, R_t),$ where

  1. 1. $M$ is a set of modules,

  2. 2. $G\subseteq{2^{M}}$ distinguishes certain groups of modules,

  3. 3. $c: M \to \mathbb{N}$ gives the credits of each module,

  4. 4. $s: M \to \{w,s,e\}$ assigns a regular semester to a module,

  5. 5. $l: G \to \mathbb{N}$ returns the lower bound of the credits of a module group,

  6. 6. $u: G \to \mathbb{N}$ returns the upper bound of the credits of a module group,

  7. 7. $R_g \subseteq{2^{({2^{M}})^n}}$ is a set of global constraints expressing study regulations, and

  8. 8. $R_t \subseteq{2^{({2^{M}})^n}}$ is a set of temporal constraints expressing study regulations.

The module groups in $G$ allow us to structure the modules and to express group-wise regulations. Functions $c$ and $s$ give the credit points of a module and its turnus,Footnote 1 viz. in winter, summer, or each semester (indicated by w, s, e), respectively. The elements $l$ and $u$ are partial functions delineating the number of credits obtained per module group; a specific number of credits is captured by an equal lower and upper bound. The regulation constraints in $R_g$ and $R_t$ are represented extensionally: each constraint $r$ in $R_g \cup R_t$ is represented by the sequences of sets of modules $r\subseteq ({2^{M}})^n$ satisfying it. While the sets of constraints $R_g$ and $R_t$ share the same mathematical structure, they differ in purpose and are therefore separated for clarity’s sake. $R_t$ expresses temporal constraints over the sequence of semesters, while $R_g$ does not make use of this sequential structure, and rather expresses global constraints over the entire set of modules.

A study plan for a basic study regulation is a finite sequence of sets of modules satisfying all regulation constraints. More precisely, a sequence $ (S_i)_{i=1}^n$ of modules of length $n$ such that $S_i\subseteq M$ for $1\leq i\leq n$ is a study plan for $(M, G, c, s, l, u, R_g, R_t)$ if $ (S_i)_{i=1}^n\in \bigcap _{r\in R_g \cup R_t} r$ .

Finally, we call modules exogenous if they are imposed by external means, for example by an examination board. The specific choice of these modules is determined case by case.

Example 1 (Cognitive systems). As an example, consider the study regulations of the international master program Cognitive Systems offered at the University of Potsdam.Footnote 2 This program offers a combination of modules in Natural language processing, Machine learning, and Knowledge representation and reasoning.

These subjects are reflected by the three mandatory base modules, joined in $B$ in equation (3). Since each module yields 9 credits, their obligation is achieved by requiring that the modules stemming from $B$ must account for 27 credits.Footnote 3 While the amount is specified in equations (12) and (13), the actual constraint is imposed in equation (15). The same constraint is used for choosing two among three possible project modules from $P$ . The optional modules in group $O$ are handled similarly, just that only 24 credits from 36 possible credits are admissible. That is, four out of nine modules must be taken. The freedom of which four the student may choose is restricted by the examination board by imposing the study of up to two foundational modules $E\subseteq F$ , which must be the only modules taken from module group $F$ , as formalized in constraint (14). The total number of credits over all modules must equal 120. Finally, an internship, im, and a thesis, msc, are imposed in equation (16). This brings us to the temporal regulation in equation (20) requiring that at least 90 credits are accumulated before conducting a thesis. The temporal regulations in equations (18) and (19) ensure that modules are taken in the right season. And finally equation (17) makes sure that modules are chosen at most once.

Let $E\subseteq F$ be some exogenous set of modules in the following example; and let $\overline{S}$ stand for $\bigcup _{i=1}^n S_i$ , and $M_w=\{m\in M\mid s(m)=w\}$ and $M_s=\{m\in M\mid s(m)=s\}$ . Then, the study regulations of the master program Cognitive Systems with respect to $E$ can be formalized as follows.

(1) \begin{align} M&=B \cup F \cup A \cup P \cup \{\mathit{im},\mathit{msc}\} \end{align}
(2) \begin{align} G&={\{B,F,A,O,P,M\}} \end{align}
(3) \begin{align} &\qquad{B}=\{\mathit{bm}_i\mid i=1..3\} \end{align}
(4) \begin{align} &\qquad{F}=\{\mathit{fm}_i \mid i=1..3\} \end{align}
(5) \begin{align} &\qquad{A}=\{\mathit{am}_{i,j}\mid i=1..3,j=1,2\} \end{align}
(6) \begin{align} &\qquad{O}=F \cup A \end{align}
(7) \begin{align} &\qquad{P}=\{\mathit{pm}_i\mid i=1..3\} \end{align}
(8) \begin{align} c&=\{\mathit{bm}_i\mapsto 9\mid i=1..3\} \cup{} \{\mathit{am}_{i,j}\mapsto 6\mid i=1..3,j=1,2\} \,\cup \end{align}
(9) \begin{align} &\quad \ \{\mathit{fm}_i \mapsto 6 \mid i=1..3 \} \cup{} \{\mathit{pm}_i\mapsto 12\mid i=1..3\} \cup{} \{\mathit{im}\mapsto 15,\mathit{msc}\mapsto 30\} \end{align}
(10) \begin{align} s&=\{\mathit{bm}_1\mapsto w, \mathit{bm}_2\mapsto s, \mathit{bm}_3\mapsto w\} \cup{} \{\mathit{am}_{i,j}\mapsto e\mid i=1..3,j=1,2\} \,\cup \end{align}
(11) \begin{align} &\quad \ \{\mathit{fm}_i\mapsto w\mid i=1..3 \} \cup{} \{\mathit{pm}_i\mapsto e\mid i=1..3\} \cup{} \{\mathit{im}\mapsto e,\mathit{msc}\mapsto e\} \end{align}
(12) \begin{align} l&=\{{B}\mapsto 27,{O}\mapsto 24,{P}\mapsto 24,{M}\mapsto 120 \} \end{align}
(13) \begin{align} u&=\{{B}\mapsto 27,{O}\mapsto 24,{P}\mapsto 24,{M}\mapsto 120 \} \end{align}
(14) \begin{align} R_g&=\{\, \{(S_i)_{i=1}^n\subseteq M^n\mid |E| \leq 2, \overline{S} \cap F = E\}, \end{align}
(15) \begin{align} &\qquad \{(S_i)_{i=1}^n\subseteq M^n\mid l(H) \leq \textstyle \sum _{m\in H\cap \overline{S}}c(m) \leq u(H) \} \textrm{ for all } H \in \{B,O,P,M\}, \end{align}
(16) \begin{align} &\qquad \{(S_i)_{i=1}^n\subseteq M^n\mid \{\mathit{im},\mathit{msc}\}\subseteq \overline{S}\} \,\} \end{align}
(17) \begin{align} R_t&=\{\, \{(S_i)_{i=1}^n\subseteq M^n\mid S_i\cap S_j =\emptyset, 1\leq i < j \leq n\} \end{align}
(18) \begin{align} &\qquad \{(S_i)_{i=1}^n\subseteq M^n\mid M_w\cap S_{2k} =\emptyset, 1\leq 2k \leq n,k\in \mathbb{N}\} \end{align}
(19) \begin{align} &\qquad \{(S_i)_{i=1}^n\subseteq M^n\mid M_s\cap S_{2k-1}=\emptyset, 1\leq 2k-1\leq n,k\in \mathbb{N}\} \end{align}
(20) \begin{align} &\qquad \{(S_i)_{i=1}^n\subseteq M^n\mid \mathit{msc}\in S_k, \textstyle \sum _{1\leq i < k}\sum _{m\in S_i}c(m)\geq 90,k\in \mathbb{N}\} \,\} \end{align}

If the set of exogenous modules given by the examination board is, for example, $E=\{\mathit{fm}_{1}\}$ , one admissible study plan spanning four semesters is $S = (S_i)_{i=1}^4$ , where

(21) \begin{align} S_1&=\{\mathit{bm}_1,\mathit{bm}_3,\mathit{fm}_{1},\mathit{am}_{1,2}\} \end{align}
(22) \begin{align} S_2&=\{\mathit{bm}_2,\mathit{am}_{2,1},\mathit{pm}_1\} \end{align}
(23) \begin{align} S_3&=\{\mathit{im},\mathit{pm}_3,\mathit{am}_{3,1}\} \end{align}
(24) \begin{align} S_4&=\{\mathit{msc}\} \end{align}

This plan comprises 120 credits, although the load per semester varies.

For illustration, let us verify that our study plan belongs to the ones in equations (14) and (15) for $H = O$ . Indeed constraint (14) is satisfied as we have $F \cap \overline{S} = \{\mathit{fm}_{1}\} = E$ , and thus $S$ is an element of constraint (14). With regards to equation (15), we have

(25) \begin{align} O \cap \overline{S}&=\{\mathit{fm}_{1},\mathit{am}_{1,2},\mathit{am}_{2,1},\mathit{am}_{3,1}\} \end{align}

which makes us check whether our study plan satisfies

(26) \begin{align} l(O)=24\leq \textstyle \sum _{m\in \{\mathit{fm}_{1},\mathit{am}_{1,2},\mathit{am}_{2,1},\mathit{am}_{3,1}\} }c(m) \leq 24= u(O) \end{align}

This is indeed the case since $ c(\mathit{fm}_{1})+c(\mathit{am}_{1,2})+c(\mathit{am}_{2,1})+c(\mathit{am}_{3,1})=24$ . Hence, our study plan is an element of constraint (15).

Although the above specification reflects the legal study regulation, it leaves many ambiguities behind. For instance, the number of credits per semester is left open, as is the order of the modules. The guideline is usually to take around 30 credits per semesters but this is not enforced. Similarly, basic modules in $B$ should be taken before advanced ones in $A$ , again this is neither enforced nor always possible. Since these constraints are usually soft, they are left to the students and/or their study advisors.

Our previous preliminary work (Hahn et al., Reference Hahn, Martens, Nemes, Otunuya, Romero, Schaub and Schellhorn2023) outlined further extensions to basic study regulations (subarea specializations, module dependencies, blocking modules). The following section delves into a more novel aspect: how modules are passed by accomplishing their associated examination tasks.

3 Examination tasks

Modules have specific examination tasks that define the criteria for successful completion. Students typically complete these tasks within courses, where they are carefully designed to align with the requirements of specific modules.

Study regulations focus on modules and their associated examination tasks. It is the responsibility of each department to provide a course selection that enables students to complete the modules required by their study program. Therefore, we concentrate in what follows on modules and their associated examinations, rather than courses.

Each module has at least one examination taskFootnote 4 and these tasks are unique to each module. We distinguish between primary examinations (e.g. written or oral exams) and secondary examinations (e.g. weekly exercises), and denote them by $E_{p}$ and $E_{s}$ , respectively. In analogy to study plans, examination plans are sequences of form $ (E_i)_{i=1}^n \subseteq (E_p \cup E_s)^n$ .

Interestingly, a single module can offer flexibility through different combinations of primary and secondary examination tasks. Given a set of modules $M$ and sets $E_{p}$ and $E_{s}$ of primary and secondary examinations, we define the functions $e_p: M \rightarrow{2^{{2^{E_p}}}}$ and $e_s: M \rightarrow{2^{{2^{E_s}}}}$ to associate a module with different combinations of primary and secondary examination tasks, respectively.

For illustration, suppose module $\mathit{bm}_1$ requires as primary examination task either a written exam or a final project report, identified by $\mathit{ep}_{\mathit{bm}_1,1}$ and $\mathit{ep}_{\mathit{bm}_1,2}$ . Also, two secondary examination tasks, a lecture attendance of 50% and the successful completion of all weekly exercises, viz. $\mathit{es}_{\mathit{bm}_1,1}$ and $\mathit{es}_{\mathit{bm}_1,2}$ , are required by the module. This is captured as $e_p(\mathit{bm}_1) = \{\{\mathit{ep}_{\mathit{bm}_1,1}\}, \{\mathit{ep}_{\mathit{bm}_1,2}\}\}$ and $e_s(\mathit{bm}_1) = \{\{\mathit{es}_{\mathit{bm}_1,1}, \mathit{es}_{\mathit{bm}_1,2}\}\}$ .

Next, we define the completion of modules in terms of examinations.

To this end, we define a function a associating examination plans with sequences of modules as ${a}: (E_i)_{i=1}^{n} \mapsto (S_i)_{i=1}^n$ where for $1\leq i\leq n$ we have

\begin{equation*}\textstyle S_i = \{ m\in M \mid V\cup W \subseteq \bigcup _{j=1}^{i}E_j, V\cup W \not \subseteq \bigcup _{j=1}^{i-1}E_j \text { for some }V \in e_s(m), W \in e_p(m) \} \end{equation*}

The idea is to complete modules as early as possible. Once a module is completed for a specific $V$ and $W$ combination, it cannot be repeated for credit in later semesters. A module may appear multiple times in a module sequence if it offers several valid combinations of primary and secondary examination tasks, and these combinations are spread across different semesters within the examination plan. However, study plans become invalid if they include the same module in multiple semesters, as this violates a core regulation (see also (17)). Also, different examination plans may result in the same module sequence, especially if some examination tasks do not immediately contribute to completing a module.

For illustration, let us continue our example with $e_p(\mathit{bm}_1)$ and $e_s(\mathit{bm}_1)$ as above. Furthermore, suppose we have the primary examination tasks

\begin{equation*} e_p(\mathit {m})=\{\{ep_{\mathit {m},1}\}\} \text { for } m\in \{\mathit {bm}_3, \mathit {fm}_1, \mathit {am}_{1,2}, \mathit {bm}_2, \mathit {am}_{2,1}, \mathit {pm}_1, \mathit {im}, \mathit {pm}_3, \mathit {am}_{3,1}, \mathit {msc}\} \end{equation*}

along with the following secondary examination tasks $ e_s(\mathit{bm}_2)=\{\{es_{\mathit{bm}_2,1}\}\}$ , $ e_s(\mathit{bm}_3)=\{\{es_{\mathit{bm}_3,1}, es_{\mathit{bm}_3,2}\}\}$ , $ e_s(\mathit{fm}_1)=\{\{es_{\mathit{fm}_1,1}\}\}$ , and

\begin{equation*} e_s(\mathit {m})=\{\emptyset \} \text { for } m\in \{\mathit {am}_{1,2}, \mathit {am}_{2,1}, \mathit {pm}_1, \mathit {im}, \mathit {pm}_3, \mathit {am}_{3,1},\mathit {msc}\}. \end{equation*}

Now, consider the examination plan $(E_i)_{i=1}^{4}$ where

\begin{align*} E_1&=\{ ep_{\mathit{bm}_1,1}, es_{\mathit{bm}_1,1}, es_{\mathit{bm}_1,2}, ep_{\mathit{bm}_3,1}, es_{\mathit{bm}_3,1}, es_{\mathit{bm}_3,2}, ep_{\mathit{fm}_1,1}, es_{\mathit{fm}_1,1}, ep_{\mathit{am}_{1,2},1} \} \\ E_2&=\{ ep_{\mathit{bm}_2,1}, es_{\mathit{bm}_2,1}, ep_{\mathit{am}_{2,1},1}, ep_{\mathit{pm}_1,1} \} \\ E_3&=\{ ep_{\mathit{im},1}, ep_{\mathit{pm}_3,1}, ep_{\mathit{am}_{3,1},1} \} \\ E_4&=\{ep_{\mathit{msc}}\}. \end{align*}

In fact, this examination plan induces the study plan given in Section 2, that is, ${a}((E_i)_{i=1}^4)=(S_i)_{i=1}^4$ as given in equations (21)–(24).

Similarly, the examination plan $E'=(E_1, E_2\cup \{ep_{\mathit{bm}_1,2}\},E_3,E_4)$ induces ${a}(E')=(S_1,S_2\cup \{\mathit{bm}_1\},S_3,S_4)$ . Since $ep_{\mathit{bm}_1,1}\in E_1$ and $e_p(\mathit{bm}_1) = \{\{\mathit{ep}_{\mathit{bm}_1,1}\}, \{\mathit{ep}_{\mathit{bm}_1,2}\}\}$ indicates that only one primary examination tasks is needed to accomplish module $\mathit{bm}_1$ , the occurrence of $ep_{\mathit{bm}_1,2}$ in the second semester of $E'$ is redundant and reflected by the second occurrence of module $\mathit{bm}_1$ in ${a}(E')$ .

The relation between primary and secondary examinations tasks is even more intricate since secondary tasks may need to be accomplished before primary ones. We represent such dependencies by a relation $ D \subseteq{2^{{2^{\mathit{E_s}}}}} \times{2^{\mathit{E_p}}}$ between alternative sets of secondary examination tasks and sets of primary ones.Footnote 5 More precisely, any such dependency in $D$ expresses a temporal constraint requiring that one of the sets of secondary examination tasks must be accomplished before or in the same semester as the set of primary constraints.

For example, the dependencies $ (\{\{es_{\mathit{bm}_1,2}\}\}, \{ep_{\mathit{bm}_1,1}\} )$ and $ (\{\{es_{\mathit{bm}_1,2}\}\}, \{ ep_{\mathit{bm}_1,2}\})$ express that weekly exercises of module $\mathit{bm}_1$ (viz. $es_{\mathit{bm}_1,2}$ ) must be successfully completed before a student can take a written exam ( $ep_{\mathit{bm}_1,1}$ ) or hand in the final project report ( $ep_{\mathit{bm}_1,2}$ ). None of the primary examinations depend on secondary examination task $es_{\mathit{bm}_1,1}$ , which is only needed to accomplish the module itself.

We are now ready to formalize the concept of an admissible examination plan.

A basic study regulation problem with examination tasks is a pair $(\mathcal{B},\mathcal{E})$ , where $\mathcal{B}$ is a basic study regulation problem and $ \mathcal{E} = (E_p, E_s, e_p, e_s, D, R_{eg}, R_{et})$ where $E_p, E_s, e_p, e_s, D$ are as defined above, and $R_{eg} \subseteq{2^{({2^{E_p \cup E_s}})^n}}$ and $R_{et} \subseteq{2^{({2^{E_p \cup E_s}})^n}}$ are sets of global and temporal constraints on examination plans, respectively, as given next.

In doing so, we extend the above abbreviation of $\overline{(E_i)_{i=1}^n}$ by $\overline{E}$ to sets of sets, that is, $ \overline{X}=\bigcup _{x\in X} x$ for any set $X$ of sets. Now, given a set of modules $M$ along with primary and secondary examination tasks $E_p\cup E_s$ , we define the following constraints:

(27) \begin{align} R_{eg} &=\{ \{ (E_i)_{i=1}^n\subseteq (E_p \cup E_s)^n \mid \overline{E}\cap \overline{\mathit{e_p}(m)\cup \mathit{e_s}(m)}\neq \emptyset \text{ implies } \end{align}
(28) \begin{align} &\hspace{160pt} \overline{E}\cap \overline{\mathit{e_p}(m)}\in \mathit{e_p}(m) \text{ for all } m \in M \}, \end{align}
(29) \begin{align} & \phantom{\ =\{} \{ (E_i)_{i=1}^n\subseteq (E_p \cup E_s)^n \mid \overline{E}\cap \overline{\mathit{e_p}(m)\cup \mathit{e_s}(m)}\neq \emptyset \text{ implies } \end{align}
(30) \begin{align} &\hspace{160pt} \overline{E}\cap \overline{\mathit{e_s}(m)}\in \mathit{e_s}(m) \text{ for all } m \in M \} \} \end{align}
(31) \begin{align} R_{et} &=\{ \{ (E_i)_{i=1}^n\subseteq (E_p \cup E_s)^n \mid E_i \cap E_j = \emptyset, 1 \leq i < j \leq n \}, \end{align}
(32) \begin{align} & \phantom{\ =\{} \{(E_i)_{i=1}^n\subseteq (E_p \cup E_s)^n \mid \text{for all }(X,W) \in D, \end{align}
(33) \begin{align} & W \subseteq \overline{E} \text{ implies there is some }V \in X \text{ such that } \end{align}
(34) \begin{align} & V \subseteq \overline{E} \text{ and } \max (\{i\mid V \cap E_i \neq \emptyset \}) \leq \min (\{i \mid W \cap E_i \neq \emptyset \}) \} \} \end{align}

The two global constraints in $R_{eg}$ , ranging from equation (27) to (30), ensure that if an examination task associated with a module $m$ is part of an examination plan, then a valid combination of primary and secondary examination achieving module $m$ must also be a part of the examination plan, with no further unnecessary examination tasks associated with the module being taken. The first temporal constraint in $R_{et}$ , given in equation (31), forbids the same examination task from being completed in two distinct semesters. Finally, the second temporal constraint in equations (32)–(34), implements the meaning of dependencies as presented when introducing the concept.

Last but not least, an examination plan $(E_i)_{i=1}^n\subseteq (Ep \cup Es)^n$ for a basic study regulations problem with examination tasks $(\mathcal{B},\mathcal{E})$ is admissible if ${a}((E_i)_{i=1}^{n})$ is a study plan for $\mathcal{B}$ and $(E_i)_{i=1}^n \in \bigcap _{r\in R_{eg} \cup R_{et}} r$ .

For illustration, let us return to examination plan $(E_i)_{i=1}^4$ . We have already seen in Section 2 that ${a}((E_i)_{i=1}^4)$ constitutes a valid study plan for the Cognitive Systems program. Similarly, the actual examination plan $(E_i)_{i=1}^4$ satisfies all constraints in equation (27)–(34), which warrants its admissibility. Unlike this, the aforementioned modified examination plan $E'$ fails to be admissible. This is because, first, $R_t$ , or more specifically (17), forces modules to occur at most once in a study plan and, second, $R_{eg}$ forbids to have both $ep_{\mathit{bm}_1,1}$ and $ep_{\mathit{bm}_1,2}$ in $\overline{E'}$ . Hence, both ${a}(E')$ and $E'$ violate constraints on study and examination plans, respectively.

Although we focused so far on total study and examination plans, in practice, a common use-case consists in completing partial ones. The above formalization directly carries over to partial plans. Even though we do not formally elaborate this, we can show the relationships among partial and total study and examination plans given in Figure 1.

Fig. 1. Relations between partial and total study and examination plans.

4 Encoding study regulations

In this section, we present an ASP-based approach to represent study regulations and generate valid study plans. We explain in detail the representation of basic study regulations, and we discuss briefly its extension to examination tasks.Footnote 6 As usual, the representation is divided in two parts: a specific instance and a general encoding. The instance represents the elements of a specific study regulation by a set of facts, while the encoding provides the semantics associated with study regulations. Given an instance that represents one study regulation, the answer sets of the encoding together with the instance correspond to the study plans for that study regulation.

We try to keep the notation as close as possible to the formalizations of the previous sections. We use the same symbols as before for sets and functions, but always in lowercase, to adapt to the conventions of ASP. For example, the sets $\overline{S}$ , $S_i$ and $M_w$ are denoted by the terms s, s(i) and m(w), respectively. In what follows, we may use the logic programing notation to refer to those sets and functions.

Listing 1 shows the first part of the instance cogsys.lp for the Cognitive Systems master, that specifies the sets and functions of the study plan (without examination tasks). Sets are defined using atoms of the form in(e,a) that represent that the element e belongs to the set a. For example, the atom in(bm1,b) expresses that bm1 $\in$ b. Functions are defined similarly, using atoms of the form map(f,e,v) that represent that the value of the function f applied to the element e is v. For example, map(c,bm1,9) expresses that c $($ bm1 $) = $ 9). To define the facts more compactly, we make extensive use of pooling using the operator ‘;’. For example, the three facts in(bm1,b)., in(bm2,b)., and in(bm3,b). defining the set b are captured by the single rule in((bm1;bm2;bm3),b). in Line 2.

Listing 1. First part of the instance of the Cognitive Systems master in cogsys.lp.

The definitions of the constraints in equation (14)–(20) provide the conditions that every study plan $(S_i)_{i=1}^n\subseteq M^n$ must satisfy. These conditions usually refer to operations over sets, that we represent in ASP using prefix notation. For example, the condition of equation (14) refers to the intersection of the sets $\overline{S}$ and $F$ , that is denoted in the logic program by the term int(s,f). Other terms can be used to denote the union, substraction and complement of sets. The regulation constraints could in principle be very diverse, but in our investigation of various study regulations we have found that they can be captured by a few types of general constraints, that we represent in ASP by different predicates. The general encoding gives their semantics, while the specific instance of each study regulation provides facts over those predicates to represent the corresponding constraints. Listing 2 shows the second part of our example instance, that specifies the constraints of the Cognitive Systems master. It uses atoms of the following form, with the associated meaning (where A and B denote sets, F denotes a function, and L and U are integers):

  • empty(A) means that A $\ = \emptyset$ ,

  • equal(A,B) means that A $\ = \;$ B,

  • subseteq(A,B) means that A $\ \subseteq \;$ B,

  • card(A,leq,U) means that |A| $\ \leq \;$ U,

  • sum(A,F,bw,(L,U)) means that L $\leq \sum _{e \in \texttt{A}}$ F $(e) \leq$ U, and

  • sum(A,F,geq,L) means that L $\leq \sum _{e \in \texttt{A}}$ F $(e)$ .

Listing 2. Second part of the instance of the Cognitive Systems master in cogsys.lp.

The general encoding includes more predicates to represent other relations among sets, like proper subset or superset, and it also allows other types of comparisons within atoms of the predicates card/3 and sum/4. Using these predicates, the global constraints (14)–(16) are captured in Lines 23–25. The first constraint consists of two conditions, and this is accordingly represented by two facts. Line 24 uses pooling to refer to all the sets in $\{$ b, o, p, m $\}$ , and atoms over map/3 to capture the values L and U of the functions l and u applied to those sets. The last rule of the block defines a new set gc3 that consists of im and msc, and compares it via subseteq with s. Temporal constraints are represented in Lines 28 to 31. The first three use atoms of the predicate empty/1 that refer to m(w), m(s), and the specific sets of modules s(i) of each semester i. The last one defines the set tc4 that consists of msc, applies to it a new kind of temporal operator called before, and uses the resulting term in an atom of predicate sum/4. The term before(tc4) denotes the set of modules that occur in the study plan before some element of tc4; in this case, before the module msc. Using our previous mathematical notation, the set before(tc4) is $\{ m \in M \ | \ m \in S_i \text{ and there is some }m' \in \texttt{tc4}\cap S_k \text{ such that } i < k \}$ . The general encoding includes other similar operators like after or between.

Listing 3 shows the general encoding in encoding.lp. It takes as input the constant n that gives the length of the study plan. This constant is used by the choice rule in Line 2 to generate the possible study plans, represented by the sets s(i) for i between 1 and n. Then, Line 5 defines the set s as the union of all s(i)’s, and Line 8 defines the sets m(w) and m(s). After this, Lines 11–20 handle the additional sets that may occur in the constraints. The first block of rules identifies the sets that occur as arguments in the constraints. Then, the rules in Lines 16 and 17 recursively look for the sets occurring inside the operators int and before. The encoding contains other similar rules for the other operators, but we do not show them here. Once all the new sets have been identified, additional rules provide their definition. Line 19 defines the intersection of two sets, and Line 20 defines the modules occurring before some module of another set. The complete encoding includes further rules for the other operators. The next part of the encoding, in Lines 23-33, enforces the constraints. The first ones about empty/1, subseteq/2 and equal/2, use the predicate in/2 to eliminate the cases that are not consistent with the constraints, while those about card/3 and sum/4 rely on cardinality and aggregate atoms for that task. For example, the condition |A| $\ \leq \;$ U for card(A,leq,U) is captured by the cardinality atom in(E,A) U, and the condition L $\leq \sum _{e \in \texttt{A}}$ F $(e) \leq$ U for sum(A,F,bw,(L,U)) is captured by the aggregate atom L #sum{ V,E : in(E,A), map(F,E,V) } U. Finally, the last block of statements in Lines 36 and 37 displays the sets s(i).

Listing 3. Encoding for all study regulations in encoding.lp.

We can now run the ASP solver clingo with the instance for the Cognitive Systems master and the general encoding. For n = 4 we obtain, among others, an answer set that corresponds to the admissible study plan $S$ of Example1:

clingo -c n = 4 cogsys.lp encoding.lp

Answer: 1

(bm1,1) (bm3,1) (fm1,1) (am12,1) (bm2,2) (am21,2) (pm1,2)

(im,3) (am31,3) (pm3,3) (msc,4)

This problem is solved in less than a second, but we have not evaluated the scalability of our approach yet. Note also that our current encodings are designed for readability, but we foresee that they can be made more efficient.

The extension to handle examination tasks is not involved. The first part of the instance is extended by the specification of the sets $E_p$ , $E_s$ and $D$ using predicate in/2, and of the functions $e_p$ and $e_s$ using predicate map/3. The second part specifies the constraints in $R_{eg}$ and $R_{eg}$ . As an example, the first global constraint is represented by the rule

implies(

neg(empty(int(ee,expand(union(EP,ES))))),

in’(int(ee,expand(EP)),EP)

) :- in(M,m), map(ep,M,EP), map(es,M,ES).

Looking at the body, variable M represents a module, EP denotes $\mathit{e_p}(\texttt{M})$ , and ES denotes $\mathit{e_s}(\texttt{M})$ . In the second line, the term ee refers to the set $\overline{E}$ , defined in the extended general encoding, while the set operator expand takes one set of sets and returns the union of the elements of that set. In the third line, relation in’ is a version of in where the first argument is a set and the second is a set of sets. With this, the second line refers to the set $\overline{E}\cap \overline{\mathit{e_p}(\texttt{M})\cup \mathit{e_s}(\texttt{M})}$ and checks whether that set is not empty, and the third line checks if $\overline{E}\cap \overline{\mathit{e_p}(\texttt{M})}\in \mathit{e_p}(\texttt{M})$ . All together, the rule states that for every module M the condition of the second line implies the condition of the third one, just like the constraint (27)–(28).

The general encoding for examination tasks is extended accordingly to accomodate the new set operations, like expand, and the logical connectives, like implies or neg. The main change of the encoding takes place at the generation part, where the choice rule of Line 2 is replaced by another choice rule that generates possible examination plans together with a normal rule that implements function $a$ and defines the corresponding possible study plans.

5 ASP-driven user interface

In this section, we sketch our interactive prototypical User Interface (UI) for creating study plans in accordance with study regulations. Notably, the UI is generated and driven by ASP, more precisely the clinguin system.Footnote 7

A detailed description of the UI can be found in our preliminary publication, where tkinter is used for rendering. For a complement, we concentrate in what follows on the modern web-based front-end Angular.Footnote 8 $^{,}$ Footnote 9 To this end, clinguin uses a few dedicated predicates to define UIs and the treatment of user-triggered events. This simple design greatly facilitates the specification of continuous user interactions with an ASP system, in our case clingo (Kaminski et al., Reference Kaminski, Romero, Schaub and Wanko2023). More precisely, the UI is defined by predicates elem/3, attr/3 and when/4, for specifying the UI’s layout, style and functionality, respectively.

We show in Listing 4 the relevant sections of the encoding used to generate the UI snapshots in Figure 2.Footnote 10 This encoding is passed along with our study regulations encoding from Section 4 to clinguin, which allows for browsing and completing (partial) study plans.

Line 1 creates a window element. Line 3 creates a container for each semester, which is placed in the window. Lines 5 and 6 define the title container for each semester, assigning values to the attribute class to define the blue background, bold font, padding and margin. Lines 9 and 10 define a dropdown menu with the text “Assign module.”

Listing 4. An encoding for the prototype UI (ui.lp)

Fig. 2. User interaction via mouse actions in clinguin.

The possible modules to be assigned are defined in predicate possible_module/1 on Line 12, using the assignments that appear in any model (union) but are not in all models (intersection), via predicates _any/1 and _all/1, respectively. This predicate is used in Lines 13 to 15 for defining the items in the dropdown menu.

In the second snapshot of Figure 2, we notice that module $\mathit{bm}_2$ does not appear in the options since there is no model where this module is assigned to the third semester. When the module $\mathit{bm}_3$ is clicked, Line 15 adds the corresponding atom as an assumption (Andres et al., Reference Andres, Kaufmann, Matheis and Schaub2012; Alviano et al., Reference Alviano, Dodaro, Fiorentino, Previti and Ricca2023). Lines 18 and 19 define the modules that are assigned to a semester (gray boxes). These can be the ones appearing in all models (Line 18) due to a user selection or inference, or the ones in the current model when the user is browsing solutions, as indicated by atom _clinguin_browsing.

Predicate assigned_modules/2 is then used in Lines 20 and 21 to create the corresponding container, using the number of credits of the module to define the height in Line 21. The third snapshot shows module “bm3” assigned to the third semester after the previous click. Modules selected by the user include a button marked with “x” to remove the selection; unlike assignments forced by the encoding, such as module “msc” in the fourth semester. Upon clicking in the “Next” button, the last snapshot shows one full study plan consistent with the user’s selections.

6 Related work

ASP, event calculus and process mining techniques were already used in (Wagner et al., Reference Wagner, Helal, Roepke, Judel, Doveren, Goerzen, Soudmand, Lakemeyer, Schroeder and van der Aalst2023) for solving study regulation problems. However, (Wagner et al., Reference Wagner, Helal, Roepke, Judel, Doveren, Goerzen, Soudmand, Lakemeyer, Schroeder and van der Aalst2023) presents an overview of the AIStudyBuddy project, and contains neither a formalization of study regulations nor any implementation details. Unlike this, (Samaranayake et al., Reference Samaranayake, Gunawardena and Meyer2023) presents a web-based Decision Support System for a degree planning problem along with a mathematical formalization. Degree requirements are mentioned but not formalized. Also, (Baldazo et al. Reference Baldazo, Yasmín and Nigenda2023) considers educational planning problems. This includes stress and learning effects on students in a personalized study plan generation. It aims at reducing the duration of student plans and is implemented via integer linear programing. (Schneider et al., Reference Schneider, Leuschel and Witt2018) present a curriculum timetable validation tool by modeling constraints in language B. Finally, (Shen et al., Reference Shen, Li and Liao2022) present a data-driven approach for implementing a course recommendation algorithm. A traditional collaborative filtering algorithm is extended to consider additional course path data.

7 Summary

We have introduced a conceptualization of study regulations based on set-based constraints. This formalization is both simple and general to capture a wide range of study regulations. We indicated how the basic formulation easily extends to more complex constructions. This will be further elaborated in future work. The identification of basic principles in study regulations also allowed us to obtain a very general ASP encoding. The building blocks of each study regulation are captured in terms of facts so that the actual encoding is also applicable to a large range of study programs. Finally, we have described an ASP-driven user interface for interactive elaboration of study plans. Again, the interface is designed in a generic way and broadly applicable. Moreover, this case study serves as a nice illustration of clinguin and how it can be used for interactive ASP applications.

Finally, study regulations offer a very rich playground for applications of knowledge representation and reasoning techniques. Study plans have a light temporal flavor and resemble finite traces in linear temporal logic (De Giacomo and Vardi, Reference De Giacomo and Vardi2013). The creation of a study plans amounts to a configuration task, which also brings about interaction and explainability. Finally, we have so far only been concerned with the hard constraints emerging from study regulations but there is so much commonsense knowledge involved, like defaults, preferences, deontic laws, updates, etc.

Acknowledgments

This work was partly funded by DFG grant SCHA 550/15 and BMBF project CAVAS+ (16DHBKI024).

Footnotes

*

A preliminary version of this article appeared in Hahn et al. (2023).

1 Winter and summer semesters are associated with odd and even positions in a sequence, respectively (see below).

3 This is not our way of modeling mandatory courses but rather reflects the actual regulation.

4 All this follows the general regulations for study examinations for BSc and MSc degrees at http://www.uni-potsdam.de/am-up/2013/ambek-2013-03-035-055.pdf (last accessed on 30th of April 2024).

5 For simplicity, we refrain here from defining these relations in a module dependent way. Without loss of generality, we can thus assume that only examination tasks associated with the same module are put in correspondence.

6 The complete encoding for study regulations with examination tasks is available at https://github.com/potassco/study-regulations/tree/v1.0.0.

9 A detailed account of clinguin has also been submitted to ICLP’24.

10 The full encoding can be found in https://github.com/potassco/study-regulations/tree/v1.0.0.

References

Alviano, M., Dodaro, C., Fiorentino, S., Previti, A. and Ricca, F. 2023. ASP and subset minimality: Enumeration, cautious reasoning and MUSes. Artificial Intelligence 320, 103931.Google Scholar
Andres, B., Kaufmann, B., Matheis, O. and Schaub, T. 2012. Unsatisfiability-based optimization in clasp. In Technical Communications of the Twenty-eighth International Conference on Logic Programming (ICLP’12), A. Dovier and V., Santos Costa, Eds., vol. 17. Leibniz International Proceedings in Informatics (LIPIcs), 212–221.Google Scholar
Baldazo, J., Yasmín, R. and Nigenda, R. 2023. Scheduling personalized study plans considering the stress factor. Interactive Learning Environments, 1–20.Google Scholar
De Giacomo, G. and Vardi, M. 2013. Linear temporal logic and linear dynamic logic on finite traces. Proceedings of the Twenty-third International Joint Conference on Artificial Intelligence (IJCAI‘13), F. Rossi, Ed. IJCAI/AAAI Press, 854860.Google Scholar
Hahn, S., Martens, C., Nemes, A., Otunuya, H., Romero, J., Schaub, T. and Schellhorn, S. 2023. Reasoning about study regulations in answer set programming (preliminary report). In Proceedings of the International Conference on Logic Programming Workshops 2023, J. Arias, S. Batsakis, W. Faber, G. Gupta, F. Pacenza, E. Papadakis, L. Robaldo, K. Rückschloß, E. Salazar, Z. Saribatur, I. Tachmazidis, F. Weitkämper and A. Wyner, Eds. CEUR Workshop Proceedings, CEUR-WS.org. 3437.Google Scholar
Kaminski, R., Romero, J., Schaub, T. and Wanko, P. 2023. How to build your own ASP-based system?! Theory and Practice of Logic Programming 23, 1, 299361.Google Scholar
Lifschitz, V. 2002. Answer set programming and plan generation. Artificial Intelligence 138, 1-2, 12,39–54.Google Scholar
Samaranayake, S., Gunawardena, A. and Meyer, R. 2023. An interactive decision support system for college degree planning. Athens Journal of Education 10, 1, 101116.Google Scholar
Schneider, D., Leuschel, M. and Witt, T. 2018. Model-based problem solving for university timetable validation and improvement. Formal Aspects of Computing 30, 5, 545569.Google Scholar
Shen, Y., Li, H. and Liao, Z. 2022. Online education course recommendation algorithm based on path factors. In Proceedings of the Fifth International Conference on Information Systems and Computer Aided Education (ICISCAE’22). IEEE Computer Society Press, 257260.Google Scholar
Wagner, M., Helal, H., Roepke, R., Judel, S., Doveren, J., Goerzen, S., Soudmand, P., Lakemeyer, G., Schroeder, U. and van der Aalst, W. 2023. A combined approach of process mining and rule-based AI for study planning and monitoring in higher education. In Proceedings of the International Conference on Process Mining (ICPM’22): Process Mining Workshops, Springer-Verlag, 513525.Google Scholar
Figure 0

Fig. 1. Relations between partial and total study and examination plans.

Figure 1

Listing 1. First part of the instance of the Cognitive Systems master in cogsys.lp.

Figure 2

Listing 2. Second part of the instance of the Cognitive Systems master in cogsys.lp.

Figure 3

Listing 3. Encoding for all study regulations in encoding.lp.

Figure 4

Listing 4. An encoding for the prototype UI (ui.lp)

Figure 5

Fig. 2. User interaction via mouse actions in clinguin.