A generic higher-order behavior function