I would like to write a bijection between a set and a relation in Alloy.
For example in the following code I would like to define ref to be a bijection between QArrow and event. Therefore, I write the fact bij. But Alloy complains, since I think I quantify over the relations which makes both expressions in the bij fact a higher order logic expression:
sig State {event : set State}
sig QArrow {ref: univ ->univ}
fact bij {
all q:QArrow | one a: univ->univ | Q[a] and q.ref=a
all a: univ->univ | one q:QArrow | Q[a] and q.ref=a
}
pred Q (a: univ->univ){
a in event
}
How to convert these expression to be be first order logic expression?
Also, in general, is there any guideline when we can convert HOL expressions to FOL expression and when we can not do this?
Thanks