ClingoMultishotBackend#
Extends ClingoBackend with functionality for multi-shot solving. Adds options to access and store assumptions and externals.
- class ClingoMultishotBackend(args)[source]
Extends the basic clingo functionality for grounding and solving with the use of assumptions and externals.
It is selected as the default Backend
- add_assumption(predicate)[source]
Adds an assumption
- Parameters
predicate (str) – The clingo symbol to be added
- clear_assumptions()[source]
Removes all assumptions.
- remove_assumption(predicate)[source]
Removes an assumption
- Parameters
predicate (str) – The clingo symbol to be removed
- remove_assumption_signature(predicate)[source]
Removes predicates matching the predicate description.
- Parameters
predicate (str) – The predicate description as a symbol, where the reserver word any is used to state that anything can take part of that position. For instance, person(anna,any), will remove all assumptions of predicate person, where the first argument is anna.
- select()[source]
Select the current solution during browsing. All atoms in the solution are added as assumptions in the backend.
- set_external(predicate, value)[source]
Sets the value of an external.
- Parameters
predicate (str) – The clingo symbol to be set
value (str) – The value (release, true or false)
Domain state constructors
The domain state also inclues domain constructors from the parent class.
- ClingoMultishotBackend._ds_assume()#
Adds information about the assumptions
Includes predicate
_clinguin_assume/1
for every atom that was assumed.