Strange behaviour in the UserPropagate propagate
function
#7465
Unanswered
JoanEspasa
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am implementing a user propagator for a planning as SMT approach in Python.
Given an assignment on whether some actions are selected in a given timestep, I am able to infer whether other actions have to be assigned either True or False. I am attempting to propagate this information, to prevent them to semantically interfere with each other on the same step for the final plan. More concretely, I aim to implement a "lemmas on demand" approach for mutexes between actions that can happen in parallel.
For example, given 2 actions
A
andB
, when the solver fixesA
to True I can now tell thatB
must be false. My assumption is that in order to propagate this fact, I can callpropagate()
with the expressione = z3.Not(B)
, and the justificationids=[A]
(a parameter to thepropagate
call. This is my understanding according to ( https://link.springer.com/chapter/10.1007/978-3-031-24950-1_5 ), which states "A propagation claim is(E ∧ F) ⇒ G
whereE
is a subset of the reported equalities ofEq
,F
a subset of Fixed, andG
an arbitrary formula constructed by Z3’s API", meaning I understand callingpropagate(e=z3.Not(B), ids=[A])
should add the clauseA->Not(B)
, or(Not(A) \/ Not(B))
to the solver.However I have found when validating solutions, the number of steps increases significantly from an eager approach. This is incorrect as just giving a part of the formula on demand to the solver should not change the number of steps. The problem becomes overconstrained, so maybe the lemmas propagated are not forgot when a
pop
callback happens?This makes me think that I am not understanding how the solver uses the parameters for
ids
.Surprisingly, I have found that passing the same action for justification in twice (e.g.
ids=[A, A]
) actually causes the problem to be solved in the correct number of steps, and also makes a notable difference to the number of propagations/user propagations made by the solver. This implies my initial understanding is incorrect, as I thought thatA \/ A -> Not(B)
=Not(A) \/ Not(A) \/ Not(B)
=Not(A) \/ Not(B)
, which I did not think would make a difference.I just wanted to double check how to correctly use the propagate function and ask about the difference I am seeing.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions