How can I implement a switch statement equivalent to a nested set of if_
s?
Ideally something like (don't mind the syntax):
compatible(X, Y) :-
switch X
a1 -> dif(Y, b2),
a2 -> dif(Y, c2), dif(Y, c3),
_ -> true
working the same way as this one:
compatible(X, Y) :-
if_(X = a1,
dif(Y, b2),
if_(X = a2,
(dif(Y, c2), dif(Y, c3)),
true
)
).