I'm building a simple Alloy to generate simple Java Pojo objects and some fields of that pojo are Boolean values. I'm now using the following mechanism to achieve this function
one sig item {
autoPay: String,
Price: Int
}
fact boolean {
all n: item {
item.autoPay = "true" or
item.autoPay = "false"
}
}
This will work but everytime I introduced a new boolean field I have to modify the boolean fact to make sure the value to be either "true" or "false". Is there any best practice to do this? Like what we Alloy does for Integers?
enum Boolean { True, False }
– Zea