Skip to content

Commit

Permalink
Fixes for paper and const
Browse files Browse the repository at this point in the history
  • Loading branch information
susuhahnml committed Aug 12, 2024
1 parent 5b30d4c commit 69289fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
* added option to set false assumptions
* type parsing and defaults for user input in `_context_value`
* model selection now accepts show statements for filtering
* added operation to set a constant
* Domain constructors
* added optimization information into domain state
* added information about externals
* added automatic check to skip constructors based on `ui files`
* added information about the constants
* Examples
* New example with incremental solving
* New examples with optimization and false assumptions
Expand Down
3 changes: 2 additions & 1 deletion clinguin/server/application/backends/clingo_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def _init_ds_constructors(self):
self._domain_state_constructors = []
self._backup_ds_cache = {}
self._add_domain_state_constructor("_ds_context")
self._add_domain_state_constructor("_ds_constants")
self._add_domain_state_constructor("_ds_browsing")
self._add_domain_state_constructor("_ds_cautious_optimal")
self._add_domain_state_constructor("_ds_brave_optimal")
Expand Down Expand Up @@ -1062,7 +1063,7 @@ def clear_assumptions(self):
self._outdate()
self._assumptions = set()

def add_assumption(self, atom, value):
def add_assumption(self, atom, value="true"):
"""
Adds an atom `a` as an assumption.
If the value is True, the atom is assumed to be true.
Expand Down
15 changes: 2 additions & 13 deletions clinguin/server/application/backends/explanation_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@ def _assumption_list(self):
# Initialization
# ---------------------------------------------

@extends(ClingoBackend)
def _init_interactive(self):
"""
Adds the MUS property
Attributes:
_mus (str): The list of assumptions in the MUS property
"""
super()._init_interactive()
# pylint: disable= attribute-defined-outside-init
self._mus = None

@extends(ClingoBackend)
def _init_command_line(self):
"""
Expand All @@ -72,7 +60,8 @@ def _init_command_line(self):
self._assumption_sig = []
for a in self._args.assumption_signature or []:
try:
self._assumption_sig.append((a.split(",")[0], int(a.split(",")[1])))
name, arity = a.split(",")
self._assumption_sig.append((name, int(arity)))
except Exception as ex:
raise ValueError(
"Argument assumption_signature must have format name,arity"
Expand Down

0 comments on commit 69289fc

Please sign in to comment.