child(john, mary).
child(john, martinez).
child(john, maggie).
age(mary, 11).
age(martinez, 12).
age(maggie, 13).
What I would like to do is define a query that returns the Nth oldest child of a person, in this case John. E.G. 1st oldest, would be Maggie. 2nd oldest would be Martinez, and 3rd oldest would be Mary.
I'm new to prolog, and the tutorials provided on the website are written in some archaic flash-script that has long since been dead and unsupported so I'm kind of in the dark here. Thank you in advance for helping with this.