Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed code unrelated to API #7

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 1 addition & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# clingexplaid

Tools to aid the development of explanation systems using clingo
API to aid the development of explanation systems using clingo

## Installation

Expand All @@ -19,97 +19,6 @@ pip install clingexplaid

Please refer to [DEVELOPEMENT](DEVELOPMENT.md)

## Usage

Run the following for basic usage information:

```bash
clingexplaid -h
```

### Interactive Mode

We provide an interactive terminal user interface (textual) where all modes are
accessible in an interactive format. You can start this mode by using the
command below.

```bash
clingexplaid <files> --interactive
```

#### Example: MUS Sudoku

Below is one Example call using our [Sudoku Example](examples/sudoku).

```bash
clingexplaid examples/sudoku/encoding.lp examples/sudoku/instance.lp --interactive
```

![](example_mus.png)

#### Example: Show Decisions

This Example shows the interactive Solver Decision Tree generated from
[`examples/misc/sat_simple.lp`](examples/misc/sat_simple.lp).

![](example_show_decisions.png)

### Clingo Application Class

The clingexplaid CLI (based on the `clingo.Application` class) extends clingo
with `<method>` and `<options>`.

```bash
clingexplaid <method> <options>
```

- `<method>`: specifies which Clingexplaid method is used (Required)
- Options:
- `--muc`:
- Computes the Minimal Unsatisfiable Cores (MUCs) of the provided
unsatisfiable program
- `--unsat-constraints`:
- Computes the Unsatisfiable Constraints of the unsatisfiable program
provided.
- `--show-decisions`:
- Visualizes the decision process of clasp
- `<options>`: Additional options for the different methods
- For `--muc`:
- `-a`, `--assumption-signature`: limits which facts of the current program
are converted to choices/assumptions for finding the MUCs (Default: all
facts are converted)
- For `--show-decisions`:
- `--decision-signature`: limits which decisions are shown in the
visualization (Default: all atom's decisions are shown)

### Examples

Given the simple program below [`simple.lp`](examples/misc/simple.lp) we want
to find the contained MUC (Minimal Unsatisfiable Core).

```
a(1..5).
b(5..10).

:- a(X), b(X).
```

For this we can call `clingexplaid` the following way:

```bash
clingexplaid examples/misc/simple.lp --muc 0
```

This converts all facts of the program to choices and assumptions and returns
the contained MUC from that.

```
MUC 1
b(5) a(5)
```

A selection of more examples can be found [here](examples)

## API

Here are two example for using `clingexplaid`'s API.
Expand Down
Binary file removed example_mus.png
Binary file not shown.
Binary file removed example_show_decisions.png
Binary file not shown.
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ readme = "README.md"
dependencies = [
"clingo>=5.7.1",
"autoflake",
"textual==0.65.1",
]
classifiers = [
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -51,9 +50,6 @@ test = [ "coverage[toml]" ]
doc = [ "sphinx", "furo", "nbsphinx", "sphinx_copybutton", "myst-parser" ]
dev = [ "clingexplaid[test,typecheck,lint_pylint]" ]

[project.scripts]
clingexplaid = "clingexplaid.__main__:main"

[tool.setuptools.packages.find]
where = ["src"]

Expand Down Expand Up @@ -97,8 +93,6 @@ good-names = ["_"]
[tool.coverage.run]
source = ["clingexplaid", "tests"]
omit = [
"*/clingexplaid/__main__.py",
"*/clingexplaid/cli/*",
"*/clingexplaid/propagators/*",
"*/clingexplaid/transformers/__init__.py",
"*/clingexplaid/muc/__init__.py",
Expand Down
27 changes: 0 additions & 27 deletions src/clingexplaid/__main__.py

This file was deleted.

Empty file removed src/clingexplaid/cli/__init__.py
Empty file.
Loading