:- use_module(library(chr)). :- chr_constraint rich/1, prof/1, has/2. happy(X):- rich(X). happy(X):- prof(X), has(X,nice_students).