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
Here is the solution to this problem ( I posted the question in mathematical notation in the math satck exchange here and got the solution ) I am converting it to Alloy.
In above code the fact imposes ref to be a bijective function between QArrow and relation event.