Hostname: page-component-74656f9884-7drmj Total loading time: 0 Render date: 2026-11-05T09:04:35.540Z Has data issue: false hasContentIssue false

Meta-Programming for Linear-Time Temporal Answer Set Programming

Published online by Cambridge University Press:  30 July 2026

SUSANA HAHN
Affiliation:
Institute of Computer Science, University of Potsdam, Germany (e-mails: hahnmartinlu@uni-potsdam.de, nemes@uni-potsdam.de, javier@cs.uni-potsdam.de, torsten@cs.uni-potsdam.de)
AMADÉ NEMES
Affiliation:
Institute of Computer Science, University of Potsdam, Germany (e-mails: hahnmartinlu@uni-potsdam.de, nemes@uni-potsdam.de, javier@cs.uni-potsdam.de, torsten@cs.uni-potsdam.de)
JAVIER ROMERO
Affiliation:
Institute of Computer Science, University of Potsdam, Germany (e-mails: hahnmartinlu@uni-potsdam.de, nemes@uni-potsdam.de, javier@cs.uni-potsdam.de, torsten@cs.uni-potsdam.de)
TORSTEN SCHAUB
Affiliation:
Institute of Computer Science, University of Potsdam, Germany (e-mails: hahnmartinlu@uni-potsdam.de, nemes@uni-potsdam.de, javier@cs.uni-potsdam.de, torsten@cs.uni-potsdam.de)
Rights & Permissions [Opens in a new window]

Abstract

The development of temporal extensions of Answer Set Programming (ASP) has led to the emergence of non-monotonic linear-time ($\textrm {TEL}$), dynamic ($\textrm {DEL}$), and metric ($\textrm {MEL}$) temporal equilibrium logics. However, the inherent rigidity of highly optimized ASP systems often hinders the rapid exploration and implementation of alternative logical designs. In this work, we propose a flexible meta-programming framework that operationalizes the semantics of varied temporal logics through a unified, declarative framework. Our approach extends standard ASP meta-programming by augmenting clingo’s theory grammar with formal type specifications and nesting capabilities. To ensure semantic correctness, we introduce a transformation pipeline that protects nested modalities from stable-model-based simplifications during grounding. We demonstrate the extensibility of our framework by implementing meta-encodings for $\textrm {TEL}$, $\textrm {MEL}$, and $\textrm {DEL}$. We provide a comprehensive account of $\textrm {TEL}$ and highlight the key features for managing the interval constraints of $\textrm {MEL}$ and the Fischer–Ladner closure in $\textrm {DEL}$. Finally, we introduce the metasp system, a versatile tool that encapsulates this workflow.

Information

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 (https://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), 2026. Published by Cambridge University Press
Figure 0

Listing 1. Timed meta-encoding (teta.lp)

Figure 1

Listing 2. Abridged linear-time temporal grammar (tel-grammar.lp).

Figure 2

Listing 3. Linear-time temporal example (telex.lp).

Figure 3

Listing 4. Result of (non-ground) transformation of Listing 3.

Figure 4

Listing 5. Reified temporal example.

Figure 5

Listing 6. Encoding of TEL$\textrm {TEL}$ semantics of I$\boldsymbol{\mathsf{I}}$, ∘${\huge \circ}$, and ◊$\Diamond$ (tel-semantics.lp).

Figure 6

Listing 7. Abridged metric temporal grammar.

Figure 7

Listing 8. Metric temporal example.

Figure 8

Listing 9. Encoding of the timing function τ$\tau$.

Figure 9

Listing 10. Encoding for MEL semantics of ∘[l..u)${\huge \circ} _{[l..u)}$.

Figure 10

Listing 11. Abridged dynamic temporal grammar.

Figure 11

Listing 12. Additional rules for the Fischer–Ladner closure of &eventually formulas.

Figure 12

Listing 13. System output showcasing the TEL$\textrm {TEL}$ setting.

Figure 13

Figure 1. Comparison of runtime and solving time of metasp vs telingo-λ$\lambda$ on TEL$\textrm {TEL}$ problems.