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

Clingo args #174

Merged
merged 2 commits into from
May 2, 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
4 changes: 2 additions & 2 deletions angular_frontend/src/assets/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"serverUrl":"http://localhost",
"serverPort":"8000"
"serverUrl": "http://localhost",
"serverPort": "8000"
}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"serverPort": 8092, "serverUrl": "http://localhost"}
{
"serverPort": 8092,
"serverUrl": "http://localhost"
}
11 changes: 10 additions & 1 deletion clinguin/server/application/backends/clingo_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, args):
raise RuntimeError("UI files need to be provided under --ui-files")
self._ui_files = args.ui_files
self._constants = [f"-c {v}" for v in args.const] if args.const else []
self._clingo_ctl_arg = args.clingo_ctl_arg if args.clingo_ctl_arg else []

self._domain_state_constructors = []
self._backup_ds_cache = {}
Expand Down Expand Up @@ -90,6 +91,13 @@ def register_options(cls, parser):
help="Constant passed to clingo, <id>=<term> replaces term occurrences of <id> with <term>",
metavar="",
)
parser.add_argument(
"--clingo-ctl-arg",
action="append",
help="""Argument that will be passed to clingo control object for the domain.
Should have format <name>=<value>, for example parallel-mode=2 will become --parallel-mode=2.""",
metavar="",
)

# ---------------------------------------------
# Context
Expand Down Expand Up @@ -136,7 +144,8 @@ def _init_ctl(self):
Uses the provided constants and domain files.
It adds the atoms.
"""
self._ctl = Control(["0"] + self._constants)
args = ["0"] + self._constants + [f"--{o}" for o in self._clingo_ctl_arg]
self._ctl = Control(args)

for f in self._domain_files:
path = Path(f)
Expand Down
3 changes: 2 additions & 1 deletion clinguin/server/application/backends/clingodl_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def __init__(self, args):
# ---------------------------------------------

def _init_ctl(self):
self._ctl = Control(["0"] + self._constants)
args = ["0"] + self._constants + [f"--{o}" for o in self._clingo_ctl_arg]
self._ctl = Control(args)
self._theory = ClingoDLTheory()
self._theory.register(self._ctl)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def register_options(cls, parser):
"--assumption-signature",
help=textwrap.dedent(
"""\
Signatures that will be considered as assumtions. Must be have format name,arity"""
Signatures that will be considered as true assumptions. Must be have format name,arity"""
),
nargs="+",
metavar="",
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
author = "Susana Hahn, Alexander Beiser"

# The full version, including alpha/beta/rc tags
release = "1.0.7"
release = "1.0.8"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = clinguin
version = 1.0.7
version = 1.0.8
author = Alexander Beiser, Susana Hahn (Potassco)
author_email = alexl.id.at@gmail.com, hahnmartin@uni-potsdam.de
description = An interactive visualizer for clingo
Expand Down
2 changes: 1 addition & 1 deletion tests/reference_json_output/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Health:
def get_reference_json(cls):
json_dict = {
"name": "clinguin",
"version": "1.0.7",
"version": "1.0.8",
"description": "An interactive visualizer for clingo",
}

Expand Down
Loading