added documentation
added :predicate for mode selection if Prolog[Mercury]