Skip to content

Commit

Permalink
relaxer add structure
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanzwicknagl committed Apr 11, 2023
1 parent 4fea3f1 commit f7908fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/viasp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from .shared.defaults import STDIN_TMP_STORAGE_PATH
from .shared.io import clingo_symbols_to_stable_model
from .wrapper import ShowConnector
from .wrapper import ShowConnector, Control as viaspControl

__all__ = [
"load_program_file",
Expand Down Expand Up @@ -279,7 +279,7 @@ def get_relaxed_program(*args, **kwargs) -> str:
connector = _get_connector(**kwargs)
return connector.get_relaxed_program(head_name, collect_variables)

def relax_constraints(*args, **kwargs):
def relax_constraints(*args, **kwargs) -> viaspControl:
r"""
Relax constraints in the marked models. Returns
a new viaspControl object with the relaxed program loaded
Expand Down
2 changes: 2 additions & 0 deletions backend/src/viasp/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def get_relaxed_program(self, head_name:str = "unsat", collect_variables:bool =
:param collect_variables: ``bool``
default=True (collect variables from body as a tuple in the head literal)
"""
self._database.set_target_stable_model(self._marked)
self._database._reconstruct()
kwargs = {"head_name": head_name, "collect_variables": collect_variables}
return self._database.relax_constraints(**kwargs)

Expand Down

0 comments on commit f7908fe

Please sign in to comment.