Questions about the UserPropagator API #7087
Replies: 1 comment 6 replies
-
Q1: You should only consider fixed callbacks for Booleans. The implementation will not produce equality callbacks. If the implementation changes and you get equality callbacks for Booleans they are subsumed by fixed. |
Beta Was this translation helpful? Give feedback.
-
I have a few questions about the usage of user propagators and how their callbacks get invoked.
Q1: Suppose I have registered two literals
p
andq
in my user propagator and suppose the solver somehow figures out that the values ofp
andq
are equivalent.What are the possible callbacks that the user propagator can receive? Let me give a few scenarios:
(1) The solver first invokes the
equality
-callback with parametersp
andq
. Then the solver makes the decisionp=true
, triggering thefixed
-callback. Will afixed
-callback also get invoked forq
or is this not invoked due to the previously established equality? In other words, do I have to track equalities to get a correct picture of the current partial model or is it sufficient to track assignments alone? What about disequalities?(2) The solver first sets
p=true
, invoking thefixed
-callback. The solver then establishes thatp==q
and calls theequality
-callback. Again, will afixed
-callback get invoked forq
?(3) Assuming the setting of (2) and assuming that the
fixed
-callback forq
is not called (only equality). If the user propagator wants to enforceq==false
, is he allowed to propagate a conflict in theequality
-callback that establishesq==p==true
? The documentation suggests that conflicts should only be raised in thefixed
andfinal
callbacks.(4) Can the solver set
p=true
, thenq=true
, and only then invoke theequality
-callback? I assume the callback is only invoked if at least one of the literals was not assigned yet.Q2: The
propagate_consequence
call has essentially 3 parameters: a setfixed
of fixed literals (or even arbitrary expressions?), a seteqs
of equalities, and a consequencecons
.What exactly is the purpose of the
eqs
parameter? Are these equalities that are propagated by the user propagator or are these equalities that are a reason/premise for the consequence.Put more formally, does the propagation correspond to
And(fixed) /\ And(eqs) => cons
orAnd(fixed) => cons /\ And(eqs)
?Also, do the equalities have to be between literals or can they be between any arbitrary expressions that were registered?
Q3: Is it possible to call
propagate_consequence
with an empty set of fixed literals, effectively generating an arbitrary formula given bycons
? For example, suppose I find a partial assignmentm
to be inconsistent and raise a conflict.Due to some symmetry in the problem, I also know that a symmetric assignment
m'
is going to be inconsistent and that the solver is likely going to explore it in the future. Could I somehow preemptively excludem'
by propagating something liketrue => not(m')
?More generally speaking, is it possible to generate arbitrary clauses, possibly unrelated to the current partial assignment, from within the user propagator?
Thanks in advance. If I have any more questions, I will add them to this discussion thread.
Beta Was this translation helpful? Give feedback.
All reactions