parent(john, mary).parent(mary, susan).grandparent(X, Y) :- parent(X, Z), parent(Z, Y).
Standard input is empty
GNU Prolog 1.4.5 (64 bits) Compiled Feb 5 2017, 10:30:08 with gcc By Daniel Diaz Copyright (C) 1999-2016 Daniel Diaz | ?-
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!