I’m still learning English, please excuse my poor English.
I wrote two codes, one is
sig Key {}
sig Value {}
one sig Map {
entries: Key -> Value
}
fact {
all k: Key | one Map.entries[k]
}
run { some v: Value | v not in Map.entries[Key] }
another one is
sig Key {}
sig Value {}
one sig Map {
entries: Key one -> Value
}
run { some v: Value | v not in Map.entries[Key] }
These codes have different results.
First one has instance, but second one has no instance.
I expected instance for both codes.
What is the difference?
In the second example, the declaration constraint says that each value is mapped to my exactly one key. So there are no values that are not mapped to by any key. The run constraint asks for a value that is not mapped to by any key. So the two constraints are inconsistent and there is no instance.