attempt to emulate of prolog in java