Skip to main content

a visualization tool for clingo.

Project description

viASP

Test Status

viASP visualizes an interactive explanation of your ASP program and its stable models Example visualization

viASP allows you to explore the visualization in a variety of ways:

  • Toggle parts of the program
  • Show the added symbols or all of them
  • Inspect a single model
  • Add #show statements on the fly
  • Search models, signatures and rules.

To use viASP you don't have to change your ASP programs at all. You only have to execute them using the clingo python API.

Installation

pip install viasp will install all necessary dependencies.

Usage

Overview

viASP has two parts, its frontend Dash component and the backend server. To get everything running, do the following:

  1. viasp (or viasp & to run it in the background)
  2. Start your dash app, a basic version can be found at examples/minimal_dash.py
  3. Replace clingo.Control with viasp.Control in your python scripts and use viasp.mark(model) to select the models you want to show

Quick start

If you don't have any scripts handy that use the python API of clingo, you can use our quickstart script.

IMPORTANT You will still need to start viasp (viasp or viasp &)

Then run examples/quickstart.py. Modify the clingo program in there to your linking.

If you now run your ASP programs, you can inspect them using viASP at http://127.0.0.1:8050/ or what ever port you have set.

If you want to learn more about Dash, check out their documentation.

Limitations

viASP only works if you run your ASP programs using the python API, e.g.:

from viasp import Control

program = """
rain; sprinkler.
wet :- rain.
wet :- sprinkler.
"""
ctl = Control(["0"])
ctl.add("base", [], program)
ctl.ground([("base", [])])
with ctl.solve(yield_=True) as handle:
    for model in handle:
        ctl.viasp.mark(model)
ctl.viasp.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viasp-1.2.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viasp-1.2.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file viasp-1.2.0.tar.gz.

File metadata

  • Download URL: viasp-1.2.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for viasp-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6ba0b211995c07ac5fac5f956e32cf958591539173d7186cbbaa0a3a9736dc71
MD5 7aa0817e785679768f496182837d4b54
BLAKE2b-256 ac5d36e2081fad52196a727570afef782f41935cf2c3342042026dd7ee3665ae

See more details on using hashes here.

File details

Details for the file viasp-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: viasp-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for viasp-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10186451055aa7f567593c024e05c2932429fe28162051aec91b97e81a2e3603
MD5 7bad5fae3e5c649cb588e4caad1f1c67
BLAKE2b-256 5a3e17591860ebe7bc5f866146ba37307ba44671adff34b685af5c005a74b503

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page