-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: distributed knowledge #36
Conversation
Many thanks already for doing this!
I will try to look at the code more later, overall it seems pretty tidy to me already :-) |
Thanks for the review! For the As a side note, I was wondering what the benefit is of the |
Still concerning tests:
|
As a quick reply, see section 3.5 here: https://malv.in/phdthesis/gattinger-thesis.pdf#section.3.5 (page 98 middle onwards, mostly). |
No, I think there is nothing particular about distributed knowledge for these features. Once we merge this into
The CUDD tests are both memory-hungry and very non-deterministic, so please don't worry much about this. Also for
I doubt it. Are you running on M1 or M2 hardware? Then I would actually be surprised if anything works because so far #35 prevented us (well, mostly @yukiniu) from evaluating anything involving (Has)CacBDD. I don't use any 🍎 stuff myself, so I can/did not investigate it further. |
Hi all, I am aware of the side effect that having indexed agent knowledge within the same BDD as the statelaw works well with distributed knowledge in some sense. After discussing it we decided to leave it out of my thesis, which was getting lengthy. From the top of my hat, i think you can indeed set the index variables of all agents in a group to true: -- the DD representing the agent knowledge index has var i set to true, and other vars are set to dont-care.
p_agent_i = bddOf (PrpF (P i))
-- "adding" an agent's knowledge the state law would be like conjuction
new_statelaw = prev_statelaw `con` (p_agent_i `imp` omega_i)
-- for multiple agents
new_statelaw2 = prev_statelaw `con` (p_agent_i `imp` omega_i) `con` (p_agent_j `imp` omega_j)
-- then we also have that
new_statelaw2 `imp` ((p_agent_i `con` p_agent_j ) `imp` (omega_i `con` omega_j)) == top
-- where (omega_i `con` omega_j) is what i think you mean with their distributed knowledge? Although i would still test/check it, there might be some combinations (e.g. action model update on ZDDs? ) that currently do not conserve the distributed knowledge. Its hard to remember exactly, if i find some spare time i can look into it. I hope this clarifies a bit! Let me know if you have any more questions. |
I am actually on a Thinkpad. Segfaults would indicate a memory management/addressing bug in the underlying memory-unsafe code, so shouldn't they potentially bring about unexpected results on all machines? In my (limited) experience, Macintoshes are usually more prone to throwing segfaults in contrast to other unexpected behaviors, when compared to other platforms. @BasLaa is on M1, but I believe he hasn't tested this out. More importantly, I am glad to know there's no need for us to worry about these tests. Thanks!
Thanks for the detailed answer! We are actually not concerning ourselves with the state law itself, though. As for now, we would be just interested in retrieving the conjunction of a group of agent's observable laws. Hence, we would like to know if the general inequality @m4lvin depicted in the picture above is actually an equality for your specific implementation or not. If it is, even if it is probably an implementation detail, it could be turned into a feature by simply documenting it. If it doesn't, we could retrieve the observable laws one by one and then compute their disjunction. |
Ah, my apologies, i could have explained it better. I looked it up and the K operator is mainly defined by the line: result = forallSet ps' <$> (imp <$> cpBdd (M.size ags) lawbdd <*> (imp <$> omegai <*> cpBdd (M.size ags) (bddOf bls form)))
-- this reflects: Forall paths through statelaw: statelaw -> (p_agent_i -> omega_i)
-- although, confusingly, the naming in the code is:
-- p_agent_i = omegai
-- omega_i = form
-- lawbdd = statelaw So i am confident "getting" distributed knowledge is equal to setting the indexes of the agents in question to true. Testing it never hurts though. I set the index to true for an agent i with the line:
replacing restrict for restrictSet and i with [0..(M.size ags)] or something in that direction should be an implementation of distributed knowledge in Ki. |
Thanks you so much! The namings initally threw me off. |
Thanks for weighing in @dushiel! I tried to find an actual example in code of a Ki structure, and I think this is the only one we have atm: Lines 221 to 230 in 80fa7bf
And indeed here we can get the distributed knowledge relation for a group using What I think should be noted somewhere is that this only works if (here: because) the agent-indexed BDD does not give any restrictions on the variables used for indexing among each other. Concretely, if we would add something like "exactly one of {0,1,2,3,4,5} is true" to the All that said, there may even be an automated way that from a possibly (by internal dependencies between the agent-indexing variables) broken BDD we can compute a proper BDD for which the restrictSet method works 🤔 But this is getting outside the scope of this PR I guess ;-) I'll open separate issues for (i) the CUDD tests failing or OOMing and (ii) better testing of |
Here's a sample txt: |
Perhaps the |
Indeed it would suffice to include an example formula with D in the existing Overall, it looks good to me and ready to merge. Or did you still want to do other things? |
The three of us are satisfied. Let us know if you would rather have us merge |
Thank you!! |
Closes #24:
reduce
(symbolic) 8703f13src/SMCDEL/Examples/
7c92051tests/K.hs
0b76e2aBefore turning this draft into an actual pull request, Umberto, @BasLaa and I would like to ask:
Ki
module works overall; we see that all agents share an indexed BDD, for implementingbddOf
for distributed knowledge, should we be setting the variables for all agents in a group to True?cabal test
? How should we build knowledge structures with DD/CUDD to test with?).Thanks!
P.S. We are also sending you our theoretical results via email. :)