Hostname: page-component-77f85d65b8-pztms Total loading time: 0 Render date: 2026-03-28T08:51:18.582Z Has data issue: false hasContentIssue false

Reactive Answer Set Programming

Published online by Cambridge University Press:  25 March 2022

KRYSIA BRODA
Affiliation:
Imperial College London, UK (e-mails: k.broda@imperial.ac.uk, f.sadri@imperial.ac.uk)
FARIBA SADRI
Affiliation:
Imperial College London, UK (e-mails: k.broda@imperial.ac.uk, f.sadri@imperial.ac.uk)
STEPHEN BUTLER
Affiliation:
Independent Scholar (e-mail: stephenjbutler@virginmedia.com)
Rights & Permissions [Opens in a new window]

Abstract

Logic Production System (LPS) is a logic-based framework for modelling reactive behaviour. Based on abductive logic programming, it combines reactive rules with logic programs, a database and a causal theory that specifies transitions between the states of the database. This paper proposes a systematic mapping of the Kernel of this framework (called KELPS) into an answer set program (ASP). For this purpose a new variant of KELPS with finite models, called n-distance KELPS, is introduced. A formal definition of the mapping from this n-distance KELPS to ASP is given and proven sound and complete. The Answer Set Programming paradigm allows to capture additional behaviours to the basic reactivity of KELPS, in particular proactive, pre-emptive and prospective behaviours. These are all discussed and illustrated with examples. Then a hybrid framework is proposed that integrates KELPS and ASP, allowing to combine the strengths of both paradigms.

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), 2022. Published by Cambridge University Press
Figure 0

Fig. 1. KELPS operational semantics cycle.

Figure 1

Fig. 2. Simple KELPS framework.

Figure 2

Fig. 3. Reactive ASP mapping of example in Figure 2.

Figure 3

Table 1. Predicates used in mapping KELPS to Reactive ASP

Figure 4

Table 2. Mapping details of KELPS to Reactive ASP

Figure 5

Table 3. Strata in Reactive ASP

Figure 6

Fig. 4. Security guard proactive and pre-emptive behaviour.

Figure 7

Fig. 5. Example for prospection.

Figure 8

Fig. 6. HKA: a combined architecture for reactive and prospective control.

Figure 9

Fig. 7. First Example for HKA interaction ($a1 - a8$ are events and p and q are fluents).

Figure 10

Fig. 8. Second Example for HKA interaction (here a and $a1-a3$ are events).

Figure 11

Fig. 9. In the numbering notation x.y, x is the timestamp of the start of the time frame and y is an identifier for a reactive ASP rule. Thus rules with $x=0$ are the mapping of $KELPS(0;3)$ into Reactive ASP. Rules with $x>0$ are the mapping of $KELPS(x;x+3)$.

Figure 12

Fig. 10. Relationship between KELPS($T;T+k$) and ASP($T;T+k$).

Figure 13

Fig. A1. Prospective behaviour choosing a drink.

Figure 14

Fig. B1. KELPS Framework for exemplifying incremental simulation.

Figure 15

Fig. B2. Translation by $f_{inc}$ of example in Figure B1.

Figure 16

Fig. B3. Pseudocode procedural control.

Figure 17

Table B1. Results of Experiment 1a (left) and Experiment 1b (right)

Figure 18

Table B2. Results of Experiment 2