KS prolog