Prolog mechanisms combined in java library.