While modeling git objects, I came up with this model:
sig Object {}
sig Tree {
children: set (Object + Tree)
}
fact {
no t: Tree | t in t.*children
}
It produces instances, but none with any Tree
. Alloy (well, Electrum) says “Predicate is consistent, contrary to expectation.”
What I’m intending to do is say that a tree cannot be its own parent (which may itself be a bad assumption, but I couldn’t make that happen using git hash-object
and friends.)
Where have I gone sideways here? It’s been a while since I read Software Abstractions, so a lot of this is trying to get the memory of how to do this back in my fingers.