Framework for meta-programming in ASP
Project description
metasp
Installation
To install the project you must have Python 3.12 or higher, and run
pip install metasp
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/telexample of how to use thetel(Temporal Equilibrium Logic) extension.examples/delexample of how to use thedel(Dynamic Equilibrium Logic) extension.examples/melexample of how to use themel(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
--logto set the logging level. For detailed parsing information, set it todebug. -
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-scriptsargument.
-
Python Scripts Use
--python-scriptsto load custom Python scripts before running the system. These scripts can contain custom printing functions. See theexamples/melfolder 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metasp-0.1.1.tar.gz.
File metadata
- Download URL: metasp-0.1.1.tar.gz
- Upload date:
- Size: 96.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb1cdc194190ad6ffb64f95f71def17c2739c194e1c9fa13d27dcaf81563f271
|
|
| MD5 |
45e7fefe5162962d994197f5988ef907
|
|
| BLAKE2b-256 |
541cc8d42ea13294f3243c0db80d6047bd88ca8c577888d19390ee7b9768971c
|
Provenance
The following attestation bundles were made for metasp-0.1.1.tar.gz:
Publisher:
deploy.yml on potassco/metasp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metasp-0.1.1.tar.gz -
Subject digest:
eb1cdc194190ad6ffb64f95f71def17c2739c194e1c9fa13d27dcaf81563f271 - Sigstore transparency entry: 982847669
- Sigstore integration time:
-
Permalink:
potassco/metasp@a67031faa506f3b98fc6a8a1692ce5a31e71f525 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/potassco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@a67031faa506f3b98fc6a8a1692ce5a31e71f525 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metasp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: metasp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cb245f56f76ab600398b1cf8aeec799b2ae49f4d9d33d99dc5dce82d2eaa8f6
|
|
| MD5 |
81ab135b489c6c9b61a1a87af6dfa8bc
|
|
| BLAKE2b-256 |
ce269ccd417ae698192455dffbae9dc0c6e201c745c9adbb09a9f3d82af1d4c4
|
Provenance
The following attestation bundles were made for metasp-0.1.1-py3-none-any.whl:
Publisher:
deploy.yml on potassco/metasp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metasp-0.1.1-py3-none-any.whl -
Subject digest:
1cb245f56f76ab600398b1cf8aeec799b2ae49f4d9d33d99dc5dce82d2eaa8f6 - Sigstore transparency entry: 982847672
- Sigstore integration time:
-
Permalink:
potassco/metasp@a67031faa506f3b98fc6a8a1692ce5a31e71f525 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/potassco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@a67031faa506f3b98fc6a8a1692ce5a31e71f525 -
Trigger Event:
push
-
Statement type: