Hostname: page-component-77c78cf97d-v4t4b Total loading time: 0 Render date: 2026-04-24T02:16:39.265Z Has data issue: false hasContentIssue false

Clingraph: A System for ASP-based Visualization

Published online by Cambridge University Press:  14 February 2024

SUSANA HAHN
Affiliation:
University of Potsdam, Potsdam, Germany Potassco Solutions, Potsdam, Germany (e-mail: susana.hahn.martin.lunas@uni-potsdam.de)
ORKUNT SABUNCU
Affiliation:
TED University, Ankara, Turkey Potassco Solutions, Potsdam, Germany (e-mail: orkunt.sabuncu@tedu.edu.tr)
TORSTEN SCHAUB
Affiliation:
University of Potsdam, Potsdam, Germany Potassco Solutions, Potsdam, Germany (e-mails: torsten.schaub@uni-potsdam.de, tobias.stolzmann@uni-potsdam.de)
TOBIAS STOLZMANN
Affiliation:
University of Potsdam, Potsdam, Germany Potassco Solutions, Potsdam, Germany (e-mails: torsten.schaub@uni-potsdam.de, tobias.stolzmann@uni-potsdam.de)
Rights & Permissions [Opens in a new window]

Abstract

We present the Answer Set Programming (ASP)-based visualization tool clingraph, which aims at visualizing various concepts of ASP by means of ASP itself. This idea traces back to the aspviz tool and clingraph redevelops and extends it in the context of modern ASP systems. More precisely, clingraph takes graph specifications in terms of ASP facts and hands them over to the graph visualization system graphviz. The use of ASP provides a great interface between logic programs and/or answer sets and their visualization. Also, clingraph offers a Python application programming interface (API) that extends this ease of interfacing to clingo’s API and in turn to connect and monitor various aspects of the solving process.

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

Listing 1. Graph coloring instance, encoding, and display (color.lp).

Figure 1

Fig. 1. Visualization of the (first) stable model of the logic program in Listing 1.

Figure 2

Listing 2. Queens puzzle (queens.lp)

Figure 3

Fig. 2. Visualization of (first) stable model of the logic program in Listing 2.

Figure 4

Listing 3. Visualization encoding for Queens puzzle (viz.lp)

Figure 5

Table 1. Selected lines from the visualization encoding for an asprilo scenario (viz-asprilo.lp).

Figure 6

Fig. 3. Individual graph representations making up an animated plan.

Figure 7

Listing 4. Specification of interaction on trees based on clingraph’s SVG capabilities (tree-viz.lp)

Figure 8

Listing 5. Facts representing a simple tree (mytree.lp)

Figure 9

Fig. 4. Example user interaction via mouse actions expanding the tree.

Figure 10

Listing 6. SVG interactive queens (svg-queens.lp)

Figure 11

Fig. 5. Three snapshots of the user hovering the mouse pointer over specific cells on the board.

Figure 12

Table 2. The propagator class for visualizing solving

Figure 13

Table 3. Selected lines from the encoding visualizing Sudoku solving (viz-sudoku-solving.lp)

Figure 14

Fig. 6. Visualizations of the stages while solving a Sudoku puzzle.

Figure 15

Listing 7. Partial translation of the program in Listing 1 into our intermediate fact format

Figure 16

Listing 8. Selected lines from the encoding visualizing the AST (viz-ast.lp)

Figure 17

Fig. 7. A partial visualization of the AST of the program in Listing 1.

Figure 18

Listing 9. Visualization encoding to exemplify the generation of strings via templates (template.lp).

Figure 19

Listing 10. Instance for the template example (people.lp).

Figure 20

Fig. 8. Example of HTML-like labels using attribute templates.