prolog like operation in erlang ?

HP Wei hp@REDACTED
Fri Apr 25 01:53:14 CEST 2003


Another newbie type question:

Suppose I define a relation through the following function:

rel(x1, m1, m2) -> true;
rel(x2, m1, m2) -> true;
rel(x3, m3, m6) -> true;
....

In prolog, if I am not mistaken,
something like rel(X, m1, m2) can give me X = [x1, x2].

In erlang, how do I in general get the corresponding X ??
Or should I encode the relation in a structure in this case ?

HP




More information about the erlang-questions mailing list