Is there a way to express that all objects of Sig2 are either related by a rel relation to elements of Sig1 or are subsigs? I want something like either_rel_or_subsig but the code might be extended and someone else might introduce SubSigC. Then, either_rel_or_subsig would forbid any SubSigC object.
module test
sig Sig1 {}
sig Sig2 {
rel: lone Sig1
}
sig SubSigA extends Sig2 {}
sig SubSigB extends Sig2 {}
fact either_rel_or_subsig{Sig2 in rel.Sig1 + SubSigA + SubSigB}
run {}
question from:https://stackoverflow.com/questions/66054570/alloy-term-to-get-all-subsig