Propagators¶
Propagators for Explanation.
DecisionLevel = list[int]
module-attribute
¶
DecisionLevelList = list[DecisionLevel]
module-attribute
¶
__all__ = ['SolverDecisionPropagator']
module-attribute
¶
SolverDecisionPropagator(signatures: set[tuple[str, int]] | None = None, callback_propagate: Callable[[list[Decision | list[Decision]]], None] | None = None, callback_undo: Callable[[], None] | None = None)
¶
Bases: Propagator
Propagator for showing the Solver Decisions of clingo.
Construct a SolverDecisionPropagator watching decisions for the given signatures with the provided callbacks.
| PARAMETER | DESCRIPTION |
|---|---|
signatures
|
The set of fact signatures to match. |
callback_propagate
|
The callback to invoke during propagation.
TYPE:
|
callback_undo
|
The callback to invoke during undo.
TYPE:
|
get_decisions(assignment: clingo.Assignment) -> tuple[list[int], dict[int, list[int]]]
staticmethod
¶
Extract a list of decisions and entailments from a clingo propagator assignment.
init(init: clingo.PropagateInit) -> None
¶
Initialize the Decision Order Propagator.
literal_to_decision(literal: int) -> Decision
¶
Convert a literal integer to a Decision object.
literal_to_decision_sequence(literal_sequence: list[int | list[int]]) -> list[Decision | list[Decision]]
¶
Convert a literal sequence into a decision sequence.
These sequences are made up of their respective types or lists of these types.
propagate(control: clingo.PropagateControl, changes: Sequence[int], use_diff: bool = True) -> None
¶
Propagate method the is called when one the registered literals is propagated by clasp.
Here useful information about the decision progress is recorded to be visualized later.
undo(thread_id: int, assignment: clingo.Assignment, changes: Sequence[int]) -> None
¶
Run when solvers decisions is undone.
constants
¶
Constant definitions for the propagators package.
propagator_solver_decisions
¶
Propagator for the decision order.
Decision(positive: bool, literal: int, symbol: clingo.Symbol | None)
dataclass
¶
A solver decision.
SolverDecisionPropagator(signatures: set[tuple[str, int]] | None = None, callback_propagate: Callable[[list[Decision | list[Decision]]], None] | None = None, callback_undo: Callable[[], None] | None = None)
¶
Bases: Propagator
Propagator for showing the Solver Decisions of clingo.
Construct a SolverDecisionPropagator watching decisions for the given signatures with the provided callbacks.
| PARAMETER | DESCRIPTION |
|---|---|
signatures
|
The set of fact signatures to match. |
callback_propagate
|
The callback to invoke during propagation.
TYPE:
|
callback_undo
|
The callback to invoke during undo.
TYPE:
|
get_decisions(assignment: clingo.Assignment) -> tuple[list[int], dict[int, list[int]]]
staticmethod
¶
Extract a list of decisions and entailments from a clingo propagator assignment.
init(init: clingo.PropagateInit) -> None
¶
Initialize the Decision Order Propagator.
literal_to_decision(literal: int) -> Decision
¶
Convert a literal integer to a Decision object.
literal_to_decision_sequence(literal_sequence: list[int | list[int]]) -> list[Decision | list[Decision]]
¶
Convert a literal sequence into a decision sequence.
These sequences are made up of their respective types or lists of these types.
propagate(control: clingo.PropagateControl, changes: Sequence[int], use_diff: bool = True) -> None
¶
Propagate method the is called when one the registered literals is propagated by clasp.
Here useful information about the decision progress is recorded to be visualized later.
undo(thread_id: int, assignment: clingo.Assignment, changes: Sequence[int]) -> None
¶
Run when solvers decisions is undone.