Skip to main content

Documentation PyPI version License

metasp

A framework to ease the creation of Answer Set Programming (ASP) extensions using meta-programming.

Visit the documentation for more details on how to use metasp and its features.

Installation

To install the project you must have Python 3.12 or higher, and run

pip install .

Usage

Run the following for basic usage information:

metasp -h

This gives you three different modes of operation: Here are the available modes:

  • solve: Solve the processed and reified input files using the meta encoding for the semantics.
  • transform: Output the transformed first-order program and perform syntactic checks.
  • reify: Output the reification with extensions.
  • ui: Launch the user interface mode.

Solving

metasp solve <system> <input_files>

The first argument specifies the system to use for solving, which can be either clingo, clingcon or fclingo. In what follows we will use clingo as an example, but the same applies to the other systems.

Once this is provided you will get a normal clingo command line interface, where you can provide additional arguments to the solver. For example, you can specify the number of models to compute with -n 0. And directly add your input files.

You can see how to run different examples in the examples folder, each example contains a README.md file with instructions on how to run it

  • examples/tel example of how to use the tel (Temporal Equilibrium Logic) extension.
  • examples/del example of how to use the del (Dynamic Equilibrium Logic) extension.
  • examples/mel example of how to use the mel (Modal Equilibrium Logic) extension.

Notice all of them are under finite traces.

Metasp basic arguments

You can see the additional arguments for the metasp that indicate the extension.

metasp solve clingo -h

Additional Arguments

  • Logging Use --log to set the logging level. For detailed parsing information, set it to debug.

  • Extension Files

    • --syntax-encoding: Specify the path to syntax encoding files containing the grammar.
    • --semantics-encoding: Provide the path to semantics encoding files that define the semantic extension.

Output Configuration

  • Printer Function Choose the printing function for models with --printer.

    • Default: Normal clingo print.
    • Alternative: temporal_printer (prints each state on a separate line).
    • Custom: Add your own printing functions using the --python-scripts argument.
  • Python Scripts Use --python-scripts to load custom Python scripts before running the system. These scripts can contain custom printing functions. See the examples/mel folder for usage examples.

Command line tools

To avoid long command lines, you can use a YAML configuration file to set arguments for your extension. Here is an example structure:

syntax-encoding:
    - "./syntax.lp"
semantics-encoding:
    - "./semantics.lp"
printer: temporal_printer
required-constants:
    - "n"
  • syntax-encoding: List of syntax encoding files.
  • semantics-encoding: List of semantics encoding files.
  • printer: Printer function to use (e.g., temporal_printer).
  • required-constants: Constants required for the encoding.

The required-constants field helps ensure all necessary constants are provided, preventing unexpected results when running the system.

UI

To launch the user interface, provide your system configuration using the --meta-config config.yml argument. The configuration file can optionally include a ui-encoding field to add extra encodings for UI generation. The ui-encoding field is optional and can be used to enhance the UI generation with additional logic or features.

Metadata

Release files for metasp 1.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metasp 1.1.5
File Size Uploaded
metasp-1.1.5.tar.gz 6.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for metasp 1.1.5
File Interpreter ABI Platform
metasp-1.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 MB

Release files / metasp-1.1.5.tar.gz

Download URL metasp-1.1.5.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
3d8ab9c06e5755dbc898d147a20608b17723a5f9fddbefe75f101b0f9eddabb2
BLAKE2b-256 checksum
How to use checksums
f9b87df79af3dd3524b006cef5bdbb50d5044ef04918ad28e3ed7a4d7e4087c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / metasp-1.1.5-py3-none-any.whl

Download URL metasp-1.1.5-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fef35cd67ccca17b1b8ed8d09395487025f7b96d1be5d3eba4c7a75475a9057
BLAKE2b-256 checksum
How to use checksums
d969edf2f02e0eb4c69f7ea98532af9092c252659a2ddd1234b7bd937eccf6c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.5 This release

2 release files

1.0.4

2 release files

1.0.2

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page