has(link, sword).isWeapon(sword).hasWeapon(A) :- has(A, B), isWeapon(B).
hasWeapon(X).
GNU Prolog 1.3.1 By Daniel Diaz Copyright (C) 1999-2009 Daniel Diaz X = link yes
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!