Having the following definition:
biggerThan(a,b).
biggerThan(b,c).
biggerThan(c,d).
How to define a rule is_bigger(X,Y), such that is_bigger(a,c) and is_bigger(a,d) will return true.
Besides, I am very new to Prolog. Did the title properly addressed the problem, if not, how should I say is?
Simply define
is_biggeras the transitive closure of thebiggerThanrelation:The transitive closure of a relation
Rhappens to be the smallest relationXsuch thatRis contained inX(this is the first clause of the definition), and such thatX = R o X(this is the second part). So, the above is basically one possible definition written out.