In the Alloy fragment below, a check like isTotal is problematic because of the “unbounded universal quantifier” problem described by Jackson in Software Abstractions (sec. 5.3).
pred op [a, b: X] {
...
}
check isTotal {
all a: X | some b: X | op[a, b]
}
But what about a construction like the following to see if a relation is total?
sig P {
pre: X,
post: lone X
}
check isTotal2 {
all p: P | op[p.pre, p.post] => some p.post
}
I suppose there must be some cases in which it fails, because I haven’t seen it suggested before. Can anyone help shed light on a check like this? It seems to be useful in some cases, if not (I suppose?) completely general in some sense.
Am I missing something?